:root {
  --color-brand: hsl(258, 90%, 66%);
  --color-brand-light: hsl(258, 60%, 18%);
  --color-brand-dark: hsl(258, 90%, 76%);
  --color-canvas: hsl(240, 22%, 6%);
  --color-surface: hsl(240, 18%, 9%);
  --color-surface-2: hsl(240, 16%, 11%);
  --color-overlay: hsl(240, 16%, 13%);
  --color-overlay-hover: hsl(240, 14%, 16%);
  --color-text-primary: hsl(0, 0%, 98%);
  --color-text-secondary: hsl(240, 8%, 68%);
  --color-text-muted: hsl(240, 6%, 46%);
  --color-border: hsla(240, 20%, 100%, 0.07);
  --color-border-strong: hsla(240, 20%, 100%, 0.14);
  --color-success: hsl(150, 65%, 50%);
  --color-success-bg: hsl(150, 55%, 13%);
  --color-danger: hsl(4, 82%, 62%);
  --color-danger-bg: hsl(4, 55%, 15%);
  --color-warning: hsl(38, 92%, 58%);
  --color-warning-bg: hsl(38, 55%, 14%);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition-fast: 120ms cubic-bezier(.4,0,.2,1);
  --transition-base: 220ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 380ms cubic-bezier(.4,0,.2,1);
  --text-xs: 11.5px;
  --text-sm: 13.5px;
  --text-base: 15.5px;
  --text-md: 17px;
  --text-lg: 21px;
  --text-xl: 26px;
  --text-2xl: 34px;
  --text-3xl: 44px;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Inter", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--color-canvas);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
}
#particlesCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
}
.app-shell, .login-wrap { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; font-family: 'Poppins', var(--font-sans); }
button, input, select, textarea { font-family: inherit; font-size: var(--text-base); }

button, a, [role="button"] {
  transition: color var(--transition-base), background-color var(--transition-base),
    border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base), opacity var(--transition-base);
}

@keyframes ghostFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes ghostBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  92% { transform: scaleY(0.15); }
}
@keyframes handWave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}
.spin-ghost { animation: ghostFloat 3.2s ease-in-out infinite; transform-origin: center; }
.eye { animation: ghostBlink 4.6s ease-in-out infinite; transform-origin: center; }
.hand-left { animation: handWave 2.4s ease-in-out infinite; transform-origin: 7px 24px; }
.hand-right { animation: handWave 2.4s ease-in-out infinite reverse; transform-origin: 41px 24px; }

.sidebar-toggle-input { display: none; }

.app-shell { display: flex; min-height: 100vh; min-width: 0; max-width: 100vw; overflow-x: hidden; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
}
.sidebar-logo-wrap {
  width: 42px; height: 42px; border-radius: var(--radius-full);
  background: linear-gradient(145deg, hsl(258,70%,22%), hsl(258,60%,12%));
  border: 1px solid var(--color-border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo { width: 24px; height: 25px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-line-1 { font-size: var(--text-md); font-weight: 800; letter-spacing: 0.04em; }
.brand-line-2 { font-size: var(--text-xs); color: var(--color-text-muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding: 8px 14px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--color-overlay-hover); color: var(--color-text-primary); }
.sidebar-nav a.active { background: linear-gradient(135deg, hsl(258,70%,20%), hsl(258,60%,14%)); color: var(--color-brand-dark); box-shadow: inset 0 0 0 1px hsla(258,90%,66%,0.3); }

.sidebar-footer { border-top: 1px solid var(--color-border); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 11px; }
.sidebar-user-avatar {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  background: linear-gradient(145deg, var(--color-brand), hsl(258,80%,45%)); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--text-sm); flex-shrink: 0;
}
.sidebar-user-meta { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-user-name { font-size: var(--text-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: var(--text-xs); color: var(--color-text-muted); }
.sidebar-logout { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-secondary); padding: 9px 6px; border-radius: var(--radius-sm); }
.sidebar-logout:hover { color: var(--color-danger); background: var(--color-danger-bg); }
.sidebar-logout svg { width: 17px; height: 17px; }

.sidebar-overlay { display: none; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  padding-top: calc(16px + env(safe-area-inset-top));
  background: hsla(240, 18%, 9%, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--color-border);
}
.topbar-menu-btn { display: flex; padding: 8px; border-radius: var(--radius-sm); background: var(--color-overlay); cursor: pointer; }
.topbar-menu-btn svg { width: 20px; height: 20px; }
.topbar-title { font-size: var(--text-lg); }

.content { padding: 32px 36px 100px; max-width: 1400px; width: 100%; margin: 0 auto; min-width: 0; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header h1 { font-size: var(--text-2xl); }
.page-header p { color: var(--color-text-secondary); font-size: var(--text-sm); margin-top: 5px; }

.card {
  background: linear-gradient(180deg, hsla(240,16%,11%,0.4), hsla(240,18%,9%,0.4));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card:hover.card-hoverable { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.progress-track {
  width: 100%; height: 8px; border-radius: var(--radius-full);
  background: var(--color-overlay); overflow: hidden; margin: 14px 0;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-brand), var(--color-brand-dark));
  transition: width var(--transition-slow);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 26px; min-width: 0; }
.stat-grid > * { min-width: 0; }
.stat-card {
  background: linear-gradient(180deg, hsla(240,16%,11%,0.4), hsla(240,18%,9%,0.4));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card-label { display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.stat-card-label svg { width: 15px; height: 15px; }
.stat-card-value { font-size: var(--text-2xl); font-weight: 900; margin-top: 12px; letter-spacing: -0.02em; }
.stat-card-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 7px; }
.stat-card.accent-brand { border-color: hsla(258,90%,66%,0.28); }
.stat-card.accent-brand .stat-card-value { color: var(--color-brand-dark); }
.stat-card.accent-success .stat-card-value { color: var(--color-success); }
.stat-card.accent-danger .stat-card-value { color: var(--color-danger); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; min-width: 0; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.stack-vertical { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack-vertical > * { min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-size: var(--text-sm); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary { background: transparent; color: var(--color-brand-dark); border-color: var(--color-brand); }
.btn-primary:hover { background: hsla(258,90%,66%,0.1); }
.btn-secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-overlay-hover); border-color: var(--color-text-muted); }
.btn-success { background: transparent; color: var(--color-success); border-color: var(--color-success); }
.btn-success:hover { background: hsla(150,65%,50%,0.1); }
.btn-danger { background: transparent; color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger:hover { background: hsla(4,82%,62%,0.1); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); border-radius: var(--radius-sm); border-color: transparent; }
.btn-ghost:hover { color: var(--color-text-primary); background: var(--color-overlay); }
.btn-sm { padding: 7px 14px; font-size: var(--text-xs); border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-group { margin-bottom: 17px; }
.form-label { display: block; font-size: var(--text-sm); font-weight: 700; margin-bottom: 7px; color: var(--color-text-secondary); }
.form-control {
  width: 100%; padding: 12px 15px; background: var(--color-overlay);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  color: var(--color-text-primary); outline: none;
}
.form-control:focus { border-color: var(--color-brand); box-shadow: 0 0 0 4px hsla(258,90%,66%,0.18); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.file-drop {
  border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-md);
  padding: 28px; text-align: center; color: var(--color-text-muted); cursor: pointer; background: var(--color-overlay);
  display: block;
}
.file-drop:hover { border-color: var(--color-brand); color: var(--color-text-secondary); }
.file-drop svg { width: 24px; height: 24px; margin-bottom: 8px; }
.file-preview { margin-top: 14px; max-width: 260px; border-radius: var(--radius-md); border: 1px solid var(--color-border); overflow: hidden; display: none; }
.file-preview img { display: block; width: 100%; }

.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: hsla(240,18%,9%,0.4); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th {
  text-align: left; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); padding: 14px 18px; border-bottom: 1px solid var(--color-border); font-weight: 700;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-overlay); }

.badge {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 700; border: 1px solid transparent;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); border-color: hsl(150,55%,26%); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); border-color: hsl(4,55%,32%); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: hsl(38,55%,30%); }
.badge-pending { background: var(--color-overlay); color: var(--color-text-secondary); border-color: var(--color-border-strong); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; flex: 1; }
input[type="date"] { width: 100%; min-width: 0; -webkit-min-logical-width: 0; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: var(--radius-full); border: 1px solid var(--color-border-strong);
  font-size: var(--text-sm); color: var(--color-text-secondary);
}
.pagination a:hover { border-color: var(--color-brand); color: var(--color-text-primary); }
.pagination .current { background: var(--color-brand); color: white; border-color: var(--color-brand); }

.flash { padding: 13px 17px; border-radius: var(--radius-md); font-size: var(--text-sm); margin-bottom: 18px; border: 1px solid; }
.flash-success { background: var(--color-success-bg); color: var(--color-success); border-color: hsl(150,55%,26%); }
.flash-error { background: var(--color-danger-bg); color: var(--color-danger); border-color: hsl(4,55%,32%); }
.flash-info { background: var(--color-brand-light); color: var(--color-brand-dark); border-color: var(--color-brand); }
.flash-credential { background: var(--color-brand-light); color: var(--color-text-primary); border-color: var(--color-brand); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--text-sm); word-break: break-word; }

.toast-container {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  padding-top: env(safe-area-inset-top); pointer-events: none; width: 100%; max-width: 420px;
}
.toast {
  background: hsla(240, 20%, 10%, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid hsla(240, 20%, 100%, 0.12); border-radius: var(--radius-full);
  padding: 11px 20px; display: flex; align-items: center; gap: 9px;
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary);
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-12px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { display: flex; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-danger); }

.empty-state { text-align: center; padding: 54px 20px; color: var(--color-text-muted); }
.empty-state svg { width: 42px; height: 42px; margin-bottom: 14px; opacity: 0.5; }

.section-title { font-size: var(--text-lg); font-weight: 800; margin-bottom: 15px; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(circle at top, hsla(258,55%,14%,0.55) 0%, hsla(240,22%,6%,0.85) 55%), url('/assets/img/login-bg.png');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 390px;
  background: linear-gradient(180deg, hsla(240,16%,11%,0.55), hsla(240,18%,9%,0.55));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-xl); padding: 40px 32px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand .sidebar-logo-wrap { width: 64px; height: 64px; }
.login-brand .sidebar-logo { width: 36px; height: 37px; }
.login-brand h1 { font-size: var(--text-lg); letter-spacing: 0.06em; }
.login-brand p { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.12em; }

.modal-backdrop { position: fixed; inset: 0; background: hsla(240,30%,4%,0.7); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.modal-open { display: flex; }
.modal-box { background: linear-gradient(180deg, hsla(240,16%,11%,0.88), hsla(240,18%,9%,0.88)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { font-size: var(--text-md); margin-bottom: 11px; }
.modal-box p { color: var(--color-text-secondary); font-size: var(--text-sm); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 120px; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: var(--radius-full); background: var(--color-overlay); border: 1px solid var(--color-border-strong); font-size: var(--text-xs); color: var(--color-text-secondary); font-weight: 600; }

img.proof-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }

.toggle-pill {
  width: 46px; height: 26px; border-radius: var(--radius-full); position: relative;
  border: 1px solid var(--color-border-strong); background: var(--color-overlay);
  cursor: pointer; flex-shrink: 0; padding: 0; display: inline-block;
}
.toggle-pill.on { background: linear-gradient(135deg, var(--color-brand), hsl(258,80%,50%)); border-color: transparent; }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform var(--transition-base); box-shadow: var(--shadow-xs);
}
.toggle-pill.on .toggle-knob { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }

.credential-box {
  background: var(--color-overlay); border: 1px solid var(--color-brand); border-radius: var(--radius-md);
  padding: 14px 16px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--text-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

.month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.month-tile {
  background: var(--color-overlay); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px 16px; display: block;
}
.month-tile-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.month-tile-value { font-size: var(--text-lg); font-weight: 800; margin-top: 6px; }
.month-tile.current { border-color: var(--color-brand); }
.month-tile:hover { border-color: var(--color-border-strong); transform: translateY(-1px); }

code {
  background: var(--color-overlay); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xs); padding: 2px 7px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
}

.bottom-tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  background: hsla(240, 18%, 9%, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
.bottom-tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--color-text-muted); font-size: 10px; font-weight: 700;
  padding: 6px 10px; border-radius: var(--radius-sm); flex: 1;
}
.bottom-tabbar a svg { width: 21px; height: 21px; }
.bottom-tabbar a.active { color: var(--color-brand-dark); }

@media (max-width: 760px) {
  .table-wrap { border: none; background: transparent; overflow: visible; }
  table { min-width: 0; width: 100%; border-collapse: separate; border-spacing: 0 10px; }
  thead { display: none; }
  tbody tr {
    display: block; background: linear-gradient(180deg, hsla(240,16%,11%,0.4), hsla(240,18%,9%,0.4));
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 6px 4px; box-shadow: var(--shadow-sm);
  }
  tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 14px; border-bottom: 1px solid var(--color-border); text-align: right;
  }
  tbody td:last-child { border-bottom: none; }
  tbody td::before {
    content: attr(data-label); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); font-weight: 700; text-align: left; flex-shrink: 0;
  }
  tbody td:empty::before { content: none; }
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform var(--transition-slow); width: 270px; z-index: 60;
    padding-top: env(safe-area-inset-top);
  }
  .sidebar-toggle-input:checked ~ .app-shell .sidebar { transform: translateX(0); }
  .sidebar-toggle-input:checked ~ .app-shell .sidebar-overlay { display: block; }
  .sidebar-overlay { position: fixed; inset: 0; background: hsla(240,30%,4%,0.6); backdrop-filter: blur(4px); z-index: 50; }
  .topbar { display: flex; }
  .bottom-tabbar { display: flex; }
  .content { padding: 20px 16px 96px; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 14px; }
  .filter-bar .form-group { min-width: 0; width: 100%; flex: none; }
  .filter-bar .btn { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .stat-card-value { font-size: var(--text-xl); }
  .modal-box { padding: 20px 18px; max-height: 85vh; overflow-y: auto; }
  .modal-box form + form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--color-border); }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { width: 100%; flex: none; }
}
