/* ============================================================
   AssetTrack v2 — School Inventory Management System
   Enhanced CSS: transitions, confirm dialogs, tags, sorting,
   procurement cart, bill upload, dashboard quick-review panel
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy-900: #0C1633;
  --navy-800: #12204A;
  --navy-700: #182C5E;
  --navy-600: #22397A;
  --navy-500: #2E4A93;
  --navy-400: #3A5BAD;

  --brass: #5FA82E;
  --brass-light: #8CC63F;
  --brass-soft: #DCF0C4;
  --brass-tint: #EFF9E4;

  --ink: #101526;
  --ink-soft: #29304A;
  --muted: #666F8C;
  --line: #DCE2F0;
  --line-soft: #EEF1F8;
  --canvas: #EEF2FA;
  --surface: #FFFFFF;
  --surface-soft: #F6F8FD;

  --success: #2F8F5B;  --success-tint: #E4F4EB;
  --danger:  #C0463A;  --danger-tint:  #FBEAE8;
  --late:    #C2841F;  --late-tint:    #FBF1DF;
  --info:    #2C6FA8;  --info-tint:    #E6F0F8;
  --purple:  #7B4FC0;  --purple-tint:  #F1ECFA;

  --display: 'Sora',    'Inter', sans-serif;
  --body:    'Inter',   -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(12,22,51,.06),  0 1px 1px  rgba(12,22,51,.04);
  --shadow:    0 8px 24px -8px rgba(12,22,51,.16), 0 2px 6px rgba(12,22,51,.06);
  --shadow-lg: 0 24px 60px -20px rgba(12,22,51,.35);
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; font-family:var(--body); background:var(--canvas); color:var(--ink); -webkit-font-smoothing:antialiased; }
.hidden { display:none !important; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; }
input, select, textarea { font-family:inherit; font-size:14px; }

/* ── Checkbox row ── */
.checkbox-row { display:flex; gap:10px; align-items:flex-start; margin:14px 0; cursor:pointer; }
.checkbox-row input { margin-top:3px; flex-shrink:0; width:16px; height:16px; accent-color:var(--brass); }
.checkbox-row span { font-size:12.5px; color:var(--muted); line-height:1.5; }

/* ── Footer ── */
.app-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:14px 28px; margin-top:auto; border-top:1px solid var(--line); font-size:12px; color:var(--muted); background:var(--surface); }
.app-footer-credit strong { color:var(--ink-soft); font-weight:700; }
.app-footer-auth { max-width:420px; width:100%; margin:14px auto 0; padding:12px 4px; border-top:none; background:transparent; color:#B9C2E6; justify-content:center; gap:18px; }
.app-footer-auth .app-footer-credit strong { color:#EAEEFB; }

/* ── Auth screen ── */
.auth-shell { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; background:#081026; padding:24px; }
.auth-split { width:100%; max-width:1040px; min-height:600px; display:flex; border-radius:20px; overflow:hidden; box-shadow:0 30px 80px rgba(4,8,24,.55); background:var(--surface); }
.auth-left { flex:1.1; position:relative; padding:40px 44px; display:flex; flex-direction:column; justify-content:space-between; background:radial-gradient(circle at 15% 8%,#1B2F63 0%,#101E45 45%,#081026 100%); color:#fff; overflow:hidden; min-width:0; }
.auth-left-noise { position:absolute; inset:0; opacity:.5; pointer-events:none; background-image:radial-gradient(rgba(255,255,255,.05) 1px,transparent 1px); background-size:16px 16px; }
.auth-left > * { position:relative; z-index:1; }
.auth-left-mid { max-width:440px; }
.auth-left .eyebrow { font-size:11.5px; font-weight:700; letter-spacing:.08em; color:#8CC63F; margin-bottom:14px; }
.auth-left h1 { font-family:var(--display); font-size:clamp(26px,3vw,34px); line-height:1.2; margin:0 0 16px; color:#fff; }
.auth-left-mid p { font-size:14px; line-height:1.65; color:#B9C2E6; margin:0; }
.auth-left-stats { display:flex; gap:36px; flex-wrap:wrap; }
.auth-left-stats .num { font-family:var(--display); font-size:26px; font-weight:700; color:#fff; }
.auth-left-stats .lbl { font-size:10.5px; letter-spacing:.06em; color:#8B96C2; margin-top:2px; }
.auth-right { flex:1; min-width:0; display:flex; align-items:center; justify-content:center; padding:44px 36px; background:var(--surface); }
.auth-card { width:100%; max-width:360px; }
.auth-brand { display:flex; align-items:center; gap:12px; }
.auth-brand > div:last-child { display:flex; flex-direction:column; justify-content:center; min-width:0; }
.auth-left .auth-brand .name { color:#fff; }
.auth-left .auth-brand .sub  { color:#9BA6D1; }
.mark {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,var(--navy-800),var(--navy-600));
  color: #fff; font-family: var(--display); font-weight: 700;
  overflow: hidden; flex-shrink: 0; text-align: center; line-height: 1;
}
.mark img { width:100%; height:100%; object-fit:cover; display:block; border-radius:inherit; }
/* Reference style: logo sits on a clean white rounded card, fully contained
   (never cropped) with a little breathing room — matches how the mark
   should look consistently across the sidebar, login screen and anywhere
   else it appears, regardless of the uploaded logo's own shape/colors.
   This class is only ever added once the image has actually finished
   loading (see applyBranding) — never pre-emptively — so a broken or
   still-loading logo never leaves a blank white box on screen. */
.mark.has-logo { background:#fff; box-shadow:0 1px 3px rgba(16,24,56,.12); border:1px solid var(--line-soft); }
/* The logo <img> itself (mark-logo-img) is only ever inserted by
   setBrandMarks() in common.js once fully loaded, and carries its own
   inline sizing/position/background so it can never be silently defeated
   by a stylesheet rule elsewhere — see that function for why. */
/* .sidebar .brand .mark / .auth-brand .mark are more specific (3 classes)
   than the plain .mark.has-logo rule above (2 classes), so without these
   they'd win and silently override the white has-logo background with the
   navy fallback gradient — restated here at matching specificity so the
   white card actually applies everywhere the mark appears. */
.sidebar .brand .mark.has-logo,
.auth-brand .mark.has-logo { background:#fff; box-shadow:0 1px 3px rgba(16,24,56,.12); }
.auth-brand .name { font-family:var(--display); font-weight:700; font-size:18px; color:var(--navy-900); line-height:1.25; margin:0; }
.auth-brand .sub  { font-size:11.5px; color:var(--muted); letter-spacing:.02em; line-height:1.3; margin-top:2px; }
.auth-card h2 { font-family:var(--display); font-size:24px; margin:22px 0 4px; color:var(--navy-900); }
.auth-card .sub { font-size:13.5px; color:var(--muted); margin-bottom:26px; }
.auth-card-foot { font-size:11.5px; color:var(--muted); text-align:center; margin:22px 0 0; }
.auth-error { display:none; background:var(--danger-tint); color:var(--danger); font-size:13px; padding:10px 14px; border-radius:var(--radius-sm); margin-bottom:16px; border:1px solid rgba(192,70,58,.2); }
.auth-error.show { display:block; animation:fadeIn var(--transition); }
.auth-success { display:none; background:var(--success-tint); color:var(--success); font-size:13px; padding:10px 14px; border-radius:var(--radius-sm); margin-bottom:16px; border:1px solid rgba(47,143,91,.2); }
.auth-success.show { display:block; }
/* OTP flow steps */
.auth-step { display:none; }
.auth-step.active { display:block; animation:fadeIn var(--transition); }
.otp-input-row { display:flex; gap:10px; margin:10px 0 20px; }
.otp-input-row input { flex:1; text-align:center; font-size:22px; font-weight:700; letter-spacing:4px; padding:12px 0; border-radius:10px; border:2px solid var(--line); }
.otp-input-row input:focus { border-color:var(--navy-600); outline:none; box-shadow:0 0 0 4px rgba(46,74,147,.1); }
.otp-resend { font-size:12.5px; color:var(--muted); margin-top:10px; text-align:center; }
.otp-resend a { color:var(--navy-600); cursor:pointer; font-weight:600; }
.auth-back-link { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); cursor:pointer; margin-bottom:18px; }
.auth-back-link:hover { color:var(--ink); }

/* ── Form fields ── */
.field { margin-bottom:18px; min-width:0; }
.field label { display:block; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:7px; letter-spacing:.01em; }
.field input, .field select, .field textarea { width:100%; padding:11px 13px; border-radius:10px; border:1.5px solid var(--line); background:var(--surface); color:var(--ink); transition:border-color var(--transition), box-shadow var(--transition); box-sizing:border-box; }
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color:var(--navy-600); box-shadow:0 0 0 4px rgba(46,74,147,.1); }
.field textarea { min-height:80px; resize:vertical; }
.field-row { display:flex; gap:12px; flex-wrap:wrap; }
.field-row .field { flex:1 1 160px; }
.field-hint { font-size:11.5px; color:var(--muted); margin-top:5px; }
.select { padding:10px 12px; border-radius:9px; border:1.5px solid var(--line); background:var(--surface); flex-shrink:0; }
.checkbox-list { display:flex; flex-direction:column; gap:2px; max-height:180px; overflow-y:auto; border:1.5px solid var(--line); border-radius:10px; padding:8px 10px; background:var(--surface); }
.checkbox-list label { display:flex; align-items:center; gap:9px; font-size:13.5px; font-weight:500; color:var(--ink); padding:6px 4px; margin:0; cursor:pointer; border-radius:6px; }
.checkbox-list label:hover { background:var(--surface-soft); }
.checkbox-list input[type="checkbox"] { width:auto; flex-shrink:0; accent-color:var(--navy-600); }
.checkbox-list .empty { font-size:13px; color:var(--muted); padding:6px 4px; }

/* Tags input */
.tags-input-wrap { border:1.5px solid var(--line); border-radius:10px; padding:6px 10px; background:var(--surface); display:flex; flex-wrap:wrap; gap:6px; align-items:center; min-height:44px; cursor:text; transition:border-color var(--transition), box-shadow var(--transition); }
.tags-input-wrap:focus-within { border-color:var(--navy-600); box-shadow:0 0 0 4px rgba(46,74,147,.1); }
.tag-chip { display:inline-flex; align-items:center; gap:5px; background:var(--info-tint); color:var(--info); border-radius:999px; padding:3px 10px 3px 12px; font-size:12px; font-weight:600; }
.tag-chip .tag-remove { background:none; border:none; padding:0; cursor:pointer; color:inherit; opacity:.7; display:flex; align-items:center; line-height:1; }
.tag-chip .tag-remove:hover { opacity:1; }
.tags-input-wrap input { border:none; outline:none; font-size:13px; padding:3px 4px; min-width:100px; flex:1; background:transparent; }
.tag-badge { display:inline-block; background:var(--info-tint); color:var(--info); padding:2px 9px; border-radius:999px; font-size:11px; font-weight:600; cursor:pointer; }
.tag-badge:hover { background:var(--info); color:#fff; }

/* Quantity stepper */
.qty-stepper { display:inline-flex; align-items:center; gap:0; border:1.5px solid var(--line); border-radius:10px; overflow:hidden; }
.qty-stepper button { border:none; background:var(--surface-soft); padding:8px 14px; font-size:16px; font-weight:600; color:var(--ink-soft); cursor:pointer; transition:background var(--transition); }
.qty-stepper button:hover { background:var(--line-soft); }
.qty-stepper input { border:none; border-left:1.5px solid var(--line); border-right:1.5px solid var(--line); width:72px; text-align:center; font-size:14px; font-weight:600; color:var(--ink); padding:8px 6px; }
.qty-stepper input:focus { outline:none; }

/* ── Buttons ── */
.btn { border:none; border-radius:10px; padding:11px 20px; font-size:14px; font-weight:600; transition:transform .1s, box-shadow var(--transition), background var(--transition), opacity var(--transition); }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn-primary  { background:var(--navy-800); color:#fff; }
.btn-primary:hover:not(:disabled)  { background:var(--navy-700); }
.btn-gold     { background:var(--brass);    color:#fff; }
.btn-gold:hover:not(:disabled)     { background:#54962A; }
.btn-ghost    { background:var(--surface-soft); color:var(--ink-soft); }
.btn-ghost:hover:not(:disabled)    { background:var(--line-soft); }
.btn-danger-ghost { background:var(--danger-tint); color:var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background:#F6D9D5; }
.btn-outline   { background:transparent; color:var(--navy-600); border:1.5px solid var(--navy-600); }
.btn-outline:hover:not(:disabled)  { background:var(--navy-600); color:#fff; }
.btn-sm   { padding:7px 14px; font-size:12.5px; border-radius:8px; }
.btn-xs   { padding:4px 10px; font-size:11.5px; border-radius:7px; }
.btn:disabled { opacity:.55; cursor:not-allowed; }
.btn-spinner { display:inline-block; width:12px; height:12px; margin-right:7px; vertical-align:-1.5px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:btn-spin .6s linear infinite; opacity:.85; }
@keyframes btn-spin { to { transform:rotate(360deg); } }
.btn-icon { padding:8px 10px; display:inline-flex; align-items:center; justify-content:center; line-height:1; flex-shrink:0; }
.btn-icon svg { width:15px; height:15px; }
.btn-block { width:100%; }

/* ── Confirm dialog (themed, replaces browser confirm()) ── */
.confirm-backdrop { position:fixed; inset:0; z-index:500; background:rgba(12,22,51,.5); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeIn .15s ease; }
.confirm-dialog { background:var(--surface); border-radius:var(--radius-lg); padding:28px 28px 24px; max-width:400px; width:100%; box-shadow:var(--shadow-lg); animation:modalIn .18s ease; }
.confirm-dialog .icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.confirm-dialog.danger .icon  { background:var(--danger-tint); color:var(--danger); }
.confirm-dialog.warning .icon { background:var(--late-tint);   color:var(--late);   }
.confirm-dialog.info .icon    { background:var(--info-tint);   color:var(--info);   }
.confirm-dialog h4 { font-family:var(--display); font-size:17px; margin:0 0 7px; color:var(--navy-900); }
.confirm-dialog p  { font-size:13.5px; color:var(--muted); margin:0 0 22px; line-height:1.55; }
.confirm-actions { display:flex; gap:10px; }
.confirm-actions .btn { flex:1; }

/* ── App shell ── */
.app-shell { display:flex; min-height:100vh; }
.sidebar { width:252px; flex-shrink:0; background:linear-gradient(180deg,var(--navy-900),#0F1B3D); color:#fff; display:flex; flex-direction:column; padding:22px 16px; position:sticky; top:0; height:100vh; overflow-y:auto; transition:left .2s; }
.sidebar .brand { display:flex; align-items:center; gap:11px; padding:6px 8px 22px; }
.sidebar .brand .mark { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--navy-800),var(--navy-600)); display:flex; align-items:center; justify-content:center; font-family:var(--display); font-weight:700; font-size:14px; overflow:hidden; flex-shrink:0; }
.sidebar .brand .name { font-family:var(--display); font-weight:700; font-size:15.5px; line-height:1.2; }
.sidebar .brand .sub  { font-size:10.5px; color:#9AA6CC; }
.nav-section-label { font-size:10.5px; letter-spacing:.08em; color:#7885B3; text-transform:uppercase; padding:16px 12px 6px; }
.nav-item { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px; font-size:13.5px; font-weight:500; color:#C6CEE8; cursor:pointer; margin-bottom:2px; position:relative; transition:background var(--transition), color var(--transition); }
.nav-item svg { width:17px; height:17px; flex-shrink:0; }
.nav-item:hover  { background:rgba(255,255,255,.06); color:#fff; }
.nav-item.active { background:rgba(95,168,46,.18); color:#fff; }
.nav-item.active svg { color:var(--brass-light); }
.nav-badge { margin-left:auto; background:var(--danger); color:#fff; font-size:10.5px; font-weight:700; padding:1.5px 7px; border-radius:999px; }
.sidebar .spacer { flex:1; }
.sidebar-foot { border-top:1px solid rgba(255,255,255,.1); padding-top:14px; margin-top:10px; }
.sidebar-user { display:flex; align-items:center; gap:10px; padding:8px; border-radius:10px; cursor:pointer; }
.sidebar-user:hover { background:rgba(255,255,255,.06); }
.sidebar-user .nm   { font-size:13px;   font-weight:600; color:#fff; }
.sidebar-user .role { font-size:10.5px; color:#9AA6CC; }
.logout-link { display:flex; align-items:center; gap:9px; padding:9px 10px; font-size:12.5px; color:#9AA6CC; cursor:pointer; border-radius:8px; }
.logout-link:hover { background:rgba(255,255,255,.06); color:#fff; }

.main { flex:1; min-width:0; display:flex; flex-direction:column; min-height:100vh; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:20px 32px; background:var(--surface); border-bottom:1px solid var(--line-soft); position:sticky; top:0; z-index:5; gap:16px; }
.topbar-left h1 { font-family:var(--display); font-size:20px; margin:0; color:var(--navy-900); }
.topbar-left .sub { font-size:12.5px; color:var(--muted); margin-top:2px; }
.topbar h1 { font-family:var(--display); font-size:20px; margin:0; color:var(--navy-900); }
.topbar .sub { font-size:12.5px; color:var(--muted); margin-top:2px; }
.menu-toggle { display:none; background:none; border:none; padding:6px; flex-shrink:0; }
.content { padding:28px 32px 60px; max-width:1400px; }

/* ── Sorting / filtering toolbar ── */
.filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:18px; padding:12px 16px; background:var(--surface); border-radius:var(--radius); border:1px solid var(--line-soft); box-shadow:var(--shadow-sm); }
.filter-bar .filter-group { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1; min-width:0; }
.filter-bar select, .filter-bar .search-input { font-size:13px; padding:8px 12px; border:1.5px solid var(--line); border-radius:9px; background:var(--surface); color:var(--ink); }
.filter-bar select:focus, .filter-bar .search-input:focus { outline:none; border-color:var(--navy-600); }
.filter-bar .search-input { min-width:190px; flex:1; }
.sort-select-wrap { display:flex; align-items:center; gap:6px; }
.sort-dir-btn { border:1.5px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink-soft); padding:7px 10px; font-size:14px; cursor:pointer; transition:background var(--transition); }
.sort-dir-btn:hover { background:var(--line-soft); }
.filter-tags { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.filter-tag-chip { display:inline-flex; align-items:center; gap:4px; background:var(--navy-800); color:#fff; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:600; }
.filter-tag-chip button { background:none; border:none; color:inherit; opacity:.7; cursor:pointer; padding:0 0 0 2px; line-height:1; }
.filter-tag-chip button:hover { opacity:1; }
.filter-results-count { font-size:12px; color:var(--muted); white-space:nowrap; }

/* ── Avatar ── */
.avatar { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13.5px; flex-shrink:0; overflow:hidden; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.avatar-lg { width:72px; height:72px; font-size:22px; border-radius:50%; }
.avatar-wrap { position:relative; display:inline-block; }
.avatar-wrap .avatar-remove-btn { position:absolute; bottom:-2px; right:-2px; background:var(--danger); border:none; border-radius:50%; width:20px; height:20px; display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0; transition:opacity var(--transition); }
.avatar-wrap:hover .avatar-remove-btn { opacity:1; }

/* ── Cards / grids ── */
.card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-sm); border:1px solid var(--line-soft); }
.card-pad { padding:24px; }
.grid-stats { display:grid; grid-template-columns:repeat(5,1fr); gap:16px; margin-bottom:24px; }
.stat-card { padding:20px; cursor:pointer; transition:box-shadow var(--transition), transform .12s; }
.stat-card:hover { box-shadow:var(--shadow); transform:translateY(-1px); }
.stat-card .ic { width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; margin-bottom:12px; }
.stat-card .num { font-family:var(--display); font-size:26px; font-weight:700; color:var(--navy-900); }
.stat-card .lbl { font-size:12px; color:var(--muted); margin-top:2px; }
.stat-card .stat-trend { font-size:11.5px; margin-top:6px; }
.grid-2 { display:grid; grid-template-columns:1.4fr 1fr; gap:20px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }

/* Dashboard quick review panel */
.quick-review-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:24px; }
.quick-review-card { background:var(--surface); border-radius:var(--radius); border:1px solid var(--line-soft); box-shadow:var(--shadow-sm); overflow:hidden; }
.quick-review-card .qr-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 12px; border-bottom:1px solid var(--line-soft); }
.quick-review-card .qr-title { font-size:13px; font-weight:700; color:var(--navy-900); }
.quick-review-card .qr-badge { font-size:11px; font-weight:700; background:var(--danger-tint); color:var(--danger); padding:2px 8px; border-radius:999px; }
.qr-item { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:10px 16px; border-bottom:1px solid var(--line-soft); transition:background var(--transition); cursor:pointer; }
.qr-item:last-child { border-bottom:none; }
.qr-item:hover { background:var(--surface-soft); }
.qr-item .qr-name { font-size:13px; font-weight:600; color:var(--ink); }
.qr-item .qr-sub  { font-size:11.5px; color:var(--muted); margin-top:1px; }
.qr-item .qr-actions { display:flex; gap:6px; flex-shrink:0; }
.qr-empty { padding:18px 16px; text-align:center; font-size:13px; color:var(--muted); }
.qr-view-all { display:block; text-align:center; padding:10px; font-size:12.5px; font-weight:600; color:var(--navy-600); cursor:pointer; border-top:1px solid var(--line-soft); }
.qr-view-all:hover { background:var(--surface-soft); }

/* ── Section headings ── */
.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; flex-wrap:wrap; }
.section-head h3 { font-family:var(--display); font-size:16.5px; margin:0 0 3px; color:var(--navy-900); }
.section-head .sub { font-size:12.5px; color:var(--muted); }

/* ── Tables ── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
thead th { text-align:left; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; user-select:none; }
thead th[data-sort-key] { cursor:pointer; }
thead th[data-sort-key]:hover { color:var(--ink-soft); }
thead th .sort-icon { margin-left:4px; opacity:.4; font-size:10px; }
thead th.sorted .sort-icon { opacity:1; color:var(--navy-600); }
tbody td { padding:12px; border-bottom:1px solid var(--line-soft); vertical-align:middle; color:var(--ink-soft); }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:var(--surface-soft); }
.mono  { font-family:var(--mono); font-size:12px; }
.muted { color:var(--muted); }
.row-person { display:flex; align-items:center; gap:10px; }
.row-person .nm  { font-weight:600; font-size:13px; color:var(--ink); }
.row-person .sub { font-size:11px; color:var(--muted); }
.item-thumb { width:34px; height:34px; border-radius:8px; object-fit:contain; object-position:center; padding:3px; box-sizing:border-box; background:var(--surface-soft); flex-shrink:0; }
.item-thumb-ph { width:34px; height:34px; border-radius:8px; background:var(--surface-soft); display:flex; align-items:center; justify-content:center; color:var(--muted); flex-shrink:0; }

/* ── Badges ── */
.badge { display:inline-block; padding:4px 11px; border-radius:999px; font-size:11.5px; font-weight:700; letter-spacing:.01em; white-space:nowrap; }
.badge-present,.badge-good,.badge-new,.badge-approved,.badge-completed,.badge-repaired,.badge-active { background:var(--success-tint); color:var(--success); }
.badge-late,.badge-fair,.badge-under_repair,.badge-in_repair,.badge-in_review { background:var(--late-tint); color:var(--late); }
.badge-absent,.badge-damaged,.badge-rejected,.badge-not_repairable { background:var(--danger-tint); color:var(--danger); }
.badge-pending,.badge-reported { background:var(--info-tint); color:var(--info); }
.badge-onleave,.badge-disposed,.badge-cancelled,.badge-neutral { background:var(--surface-soft); color:var(--muted); }
.badge-not_required { background:var(--surface-soft); color:var(--muted); }
.badge-asset  { background:#EEE7F8; color:#6B4FA0; }
.badge-stock  { background:var(--brass-tint); color:#4A7A22; }
.badge-low    { background:var(--late-tint); color:var(--late); }
.badge-urgent,.badge-high { background:var(--danger-tint); color:var(--danger); }
.badge-medium { background:var(--late-tint); color:var(--late); }
.badge-inactive { background:var(--surface-soft); color:var(--muted); }
.badge-tag { background:var(--info-tint); color:var(--info); font-size:11px; padding:2px 8px; }
.badge-code { background:var(--surface-soft); color:var(--navy-600,#22397A); font-family:var(--mono); font-size:10.5px; font-weight:700; padding:2px 8px; border:1px solid var(--line-soft); letter-spacing:.02em; }

/* Search summary — grouped totals so items with the same name across
   different locations show as one at-a-glance total (see inv-search-summary). */
.search-summary { background:var(--surface-soft); border:1px solid var(--line-soft); border-radius:var(--radius); padding:12px 14px; margin-bottom:14px; }
.search-summary .ss-totals { font-size:13px; font-weight:600; margin-bottom:6px; }
.search-summary .ss-group { display:flex; justify-content:space-between; gap:10px; font-size:12.5px; padding:4px 0; border-top:1px dashed var(--line-soft); }
.search-summary .ss-group:first-of-type { border-top:none; }
.search-summary .ss-group-name { font-weight:600; }
.search-summary .ss-group-meta { color:var(--muted); }

/* Scraps */
.scrap-value-input { width:110px; }

/* Reports — full-width responsive grid, preview sits below (never beside) */
.reports-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:16px; }
.report-card { cursor:pointer; display:flex; flex-direction:column; transition:border-color .15s, box-shadow .15s; }
.report-card:hover { border-color:var(--navy-300,#B7C2E6); box-shadow:0 2px 10px rgba(16,24,56,.08); }
.report-card.active { border-color:var(--navy-600); box-shadow:0 0 0 1px var(--navy-600) inset; }
.report-card-title { font-weight:700; margin-bottom:6px; }
.report-card-desc { font-size:12.5px; margin-bottom:14px; flex:1; }

/* ── Tabs ── */
.tab-row { display:flex; gap:4px; background:var(--surface-soft); padding:4px; border-radius:11px; width:fit-content; margin-bottom:22px; flex-wrap:wrap; }
.tab-row .tab { padding:9px 16px; border-radius:8px; font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; transition:background var(--transition), color var(--transition), box-shadow var(--transition); }
.tab-row .tab.active { background:var(--surface); color:var(--navy-900); box-shadow:var(--shadow-sm); }

/* ── Modals ── */
.modal-backdrop { position:fixed; inset:0; background:rgba(12,22,51,.5); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; backdrop-filter:blur(2px); animation:fadeIn .16s ease; }
.modal { background:var(--surface); border-radius:var(--radius-lg); width:100%; max-width:440px; padding:28px; box-shadow:var(--shadow-lg); animation:modalIn .18s ease; max-height:calc(100vh - 40px); overflow-y:auto; }
.modal-wide   { max-width:640px; }
.modal-narrow { max-width:380px; }
.modal h3  { font-size:19px; margin-bottom:6px; font-family:var(--display); color:var(--navy-900); }
.modal .sub { font-size:13px; color:var(--muted); margin-bottom:20px; }
.modal-close-row { display:flex; justify-content:flex-end; margin-bottom:14px; }
.modal-close-btn { border:none; background:var(--surface-soft); border-radius:50%; width:30px; height:30px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--muted); transition:background var(--transition), color var(--transition); }
.modal-close-btn:hover { background:var(--line); color:var(--ink); }
@keyframes modalIn { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
.modal-actions { display:flex; gap:10px; margin-top:20px; }
.modal-actions .btn { flex:1; }
.modal-section-sep { border:none; border-top:1px solid var(--line-soft); margin:20px 0; }

/* ── Procurement cart ── */
.cart-wrap { border:1.5px solid var(--line); border-radius:var(--radius); overflow:hidden; margin-bottom:18px; }
.cart-head { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--surface-soft); border-bottom:1px solid var(--line); }
.cart-head h4 { font-size:13px; font-weight:700; color:var(--navy-900); margin:0; }
.cart-item-row { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--line-soft); }
.cart-item-row:last-child { border-bottom:none; }
.cart-item-name { flex:1; font-size:13px; font-weight:600; color:var(--ink); }
.cart-item-meta { font-size:11.5px; color:var(--muted); }
.cart-item-qty  { display:flex; align-items:center; gap:6px; }
.cart-item-qty button { border:1.5px solid var(--line); border-radius:6px; background:var(--surface); color:var(--ink-soft); width:26px; height:26px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px; transition:background var(--transition); }
.cart-item-qty button:hover { background:var(--line-soft); }
.cart-item-qty .qty-val { font-size:13.5px; font-weight:700; min-width:28px; text-align:center; }
.cart-add-row { padding:10px 14px; display:flex; gap:8px; align-items:center; background:var(--surface-soft); }
.cart-empty { padding:18px; text-align:center; color:var(--muted); font-size:13px; }

/* ── Bill/receipt upload ── */
.bill-upload-area { border:2px dashed var(--line); border-radius:var(--radius); padding:20px; text-align:center; cursor:pointer; transition:border-color var(--transition), background var(--transition); }
.bill-upload-area:hover { border-color:var(--navy-600); background:var(--surface-soft); }
.bill-upload-area.has-file { border-color:var(--success); background:var(--success-tint); border-style:solid; }
.bill-upload-area .upload-icon { color:var(--muted); margin-bottom:8px; }
.bill-upload-area p { font-size:13px; color:var(--muted); margin:0 0 6px; }
.bill-upload-area small { font-size:11.5px; color:var(--muted); }
.bill-preview-row { display:flex; align-items:center; gap:12px; margin-top:12px; padding:10px 14px; background:var(--surface); border:1.5px solid var(--line); border-radius:10px; }
.bill-preview-thumb { width:44px; height:44px; border-radius:8px; object-fit:cover; border:1px solid var(--line); }
.bill-preview-info { flex:1; font-size:13px; font-weight:600; color:var(--ink); }
.bill-preview-info small { display:block; font-size:11.5px; color:var(--muted); font-weight:400; }

/* Photo upload in item form */
.photo-upload-box { border:2px dashed var(--line); border-radius:var(--radius); padding:24px; text-align:center; cursor:pointer; transition:border-color var(--transition), background var(--transition); position:relative; overflow:hidden; }
.photo-upload-box:hover { border-color:var(--navy-600); background:var(--surface-soft); }
.photo-upload-box img { width:100%; max-height:160px; object-fit:contain; border-radius:8px; }
.photo-upload-box .photo-overlay { position:absolute; inset:0; background:rgba(12,22,51,.55); display:none; align-items:center; justify-content:center; gap:10px; border-radius:var(--radius); }
.photo-upload-box:hover .photo-overlay { display:flex; }

/* ── Info list ── */
.info-list { display:flex; flex-direction:column; }
.info-row { display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--line-soft); font-size:13.5px; }
.info-row:last-child { border-bottom:none; }
.info-row .k { color:var(--muted); }
.info-row .v { font-weight:600; color:var(--ink); }

/* ── Misc ── */
.flex { display:flex; } .center { align-items:center; } .between { justify-content:space-between; }
.gap-8 { gap:8px; } .gap-12 { gap:12px; } .gap-16 { gap:16px; }
.empty-state { text-align:center; color:var(--muted); font-size:13.5px; padding:28px 0; }
.empty-state svg { opacity:.3; margin-bottom:10px; }
.search-input { padding:9px 13px; border-radius:9px; border:1.5px solid var(--line); background:var(--surface); font-size:13px; min-width:220px; }
.shift-pill { background:var(--surface-soft); color:var(--ink-soft); padding:4px 10px; border-radius:8px; font-size:12px; font-weight:600; }
.progress-bar { height:8px; border-radius:999px; background:var(--line-soft); overflow:hidden; }
.progress-bar .fill { height:100%; background:var(--brass); border-radius:999px; transition:width .4s ease; }
.chip { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:8px; font-size:12px; font-weight:600; background:var(--surface-soft); color:var(--ink-soft); }
.divider { border:none; border-top:1px solid var(--line-soft); margin:20px 0; }

/* Activity feed */
.activity-feed { display:flex; flex-direction:column; gap:0; }
.activity-item { display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-soft); cursor:pointer; transition:background var(--transition); border-radius:8px; padding:10px 8px; }
.activity-item:hover { background:var(--surface-soft); }
.activity-item:last-child { border-bottom:none; }
.activity-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:5px; }
.activity-dot.transfer   { background:var(--info); }
.activity-dot.procurement { background:var(--brass); }
.activity-dot.repair     { background:var(--late); }
.activity-text { flex:1; font-size:13px; color:var(--ink-soft); line-height:1.45; }
.activity-date { font-size:11.5px; color:var(--muted); white-space:nowrap; }

/* ── Toast ── */
.toast { position:fixed; bottom:24px; right:24px; background:var(--navy-900); color:#fff; padding:13px 20px; border-radius:11px; font-size:13.5px; box-shadow:var(--shadow-lg); z-index:200; animation:toastIn .2s ease; max-width:360px; }
.toast.error   { background:var(--danger); }
.toast.success { background:var(--success); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* Procurement source toggle */
.source-toggle { display:flex; gap:0; background:var(--surface-soft); border-radius:9px; overflow:hidden; border:1.5px solid var(--line); margin-bottom:18px; }
.source-toggle button { flex:1; border:none; background:none; padding:9px 14px; font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; transition:background var(--transition), color var(--transition); }
.source-toggle button.active { background:var(--navy-800); color:#fff; }

/* Low stock & warranty alert cards */
.alert-card { display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:10px; background:var(--late-tint); border:1px solid rgba(194,132,31,.2); cursor:pointer; transition:background var(--transition), transform .12s; }
.alert-card + .alert-card { margin-top:10px; }
.alert-card:hover { background:#F7EDCF; transform:translateX(2px); }
.alert-card.danger { background:var(--danger-tint); border-color:rgba(192,70,58,.2); }
.alert-card.danger:hover { background:#F8E0DC; }
.alert-card .alert-ic { flex-shrink:0; }
.alert-card .alert-name { font-size:13px; font-weight:600; color:var(--ink); line-height:1.4; }
.alert-card .alert-meta { font-size:11.5px; color:var(--muted); margin-top:3px; line-height:1.4; }

/* ── Responsive ── */
@media (max-width:1180px) {
  .grid-stats { grid-template-columns:repeat(3,1fr); }
  .grid-2     { grid-template-columns:1fr; }
  .grid-3     { grid-template-columns:repeat(2,1fr); }
  .quick-review-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:820px) {
  .auth-left { display:none; }
  .auth-split { box-shadow:none; background:transparent; }
  .auth-right { background:var(--surface); border-radius:20px; box-shadow:0 20px 60px rgba(4,8,24,.4); }
}
@media (max-width:900px) {
  .sidebar { position:fixed; left:-260px; top:0; z-index:50; box-shadow:var(--shadow-lg); height:100%; }
  .sidebar.open { left:0; }
  .menu-toggle { display:block; }
  .content  { padding:20px 16px 60px; }
  .topbar   { padding:16px; }
  .search-input { min-width:0; width:100%; }
  .quick-review-grid { grid-template-columns:1fr; }
}
@media (max-width:560px) {
  .grid-stats { grid-template-columns:repeat(2,1fr); }
  .grid-3     { grid-template-columns:1fr; }
  .filter-bar { gap:8px; }
  .filter-bar .search-input { min-width:0; }
}
@media (max-width:480px) {
  .field-row .field { flex-basis:100%; }
}
@media (max-height:820px) {
  .content  { padding-top:18px; padding-bottom:24px; }
  .grid-stats { gap:12px; margin-bottom:16px; }
  .stat-card  { padding:14px; }
  .card-pad   { padding:18px; }
}

/* ============================================================
   AssetTrack v3 — UI Fixes & New Components
   Logo, spacing, grid/list views, stocking plans, petty expenses,
   purchase history, FIFO/LIFO display, error/warning messages
   ============================================================ */

/* ── Logo — bigger, clearer in sidebar ── */
.sidebar .brand { padding: 8px 8px 26px; gap: 14px; align-items: center; }
.sidebar .brand .mark {
  width: 52px; height: 52px; border-radius: 14px; font-size: 19px;
  font-weight: 800; letter-spacing: -.5px; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.sidebar .brand .name { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.sidebar .brand .sub  { font-size: 10px; color: #8B96C2; margin-top: 2px; }
.auth-brand .mark { width: 52px; height: 52px; border-radius: 15px; font-size: 19px; }

/* ── Dashboard stat cards — better gaps & sizing ── */
.grid-stats { gap: 18px; margin-bottom: 22px; }
.stat-card { padding: 22px 20px; }
.stat-card .ic { width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px; }
.stat-card .num { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); }
.stat-card .stat-trend { font-size: 11.5px; margin-top: 8px; color: var(--muted); }

/* ── Quick review cards — internal spacing ── */
.quick-review-card .qr-head { padding: 14px 18px 12px; gap: 12px; }
.qr-item { padding: 11px 18px; gap: 14px; }
.qr-item .qr-name { font-size: 13.5px; font-weight: 600; }
.qr-item .qr-sub  { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Inventory view toggle ── */
.view-toggle { display: flex; gap: 4px; background: var(--surface-soft); border-radius: 10px; padding: 4px; border: 1.5px solid var(--line); }
.view-toggle-btn { border: none; background: none; border-radius: 7px; padding: 7px 11px; cursor: pointer; color: var(--muted); transition: background var(--transition), color var(--transition); display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.view-toggle-btn:hover { background: var(--line-soft); color: var(--ink); }
.view-toggle-btn.active { background: var(--surface); color: var(--navy-900); box-shadow: var(--shadow-sm); }
.view-toggle-btn svg { width: 15px; height: 15px; }

/* ── Grid view cards ── */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.inv-grid-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); overflow: hidden; cursor: pointer; transition: box-shadow var(--transition), transform .12s; }
.inv-grid-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.inv-grid-card .card-img { width: 100%; height: 148px; object-fit: contain; object-position: center; padding: 16px; box-sizing: border-box; display: block; background: var(--surface-soft); }
.inv-grid-card .card-img-ph { width: 100%; height: 148px; background: var(--surface-soft); display: flex; align-items: center; justify-content: center; color: var(--line); }
.inv-grid-card .card-body { padding: 13px 14px 14px; }
.inv-grid-card .card-name { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; line-height: 1.3; }
.inv-grid-card .card-sub  { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.inv-grid-card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.inv-grid-card .card-qty  { font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--surface-soft); padding: 3px 9px; border-radius: 7px; }

/* Compact list view */
.inv-compact-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background var(--transition); }
.inv-compact-row:hover { background: var(--surface-soft); }
.inv-compact-row:last-child { border-bottom: none; }
.inv-compact-row .cm-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex-shrink: 0; background: var(--surface-soft); }
.inv-compact-row .cm-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink); }
.inv-compact-row .cm-loc  { font-size: 11.5px; color: var(--muted); width: 130px; flex-shrink: 0; }
.inv-compact-row .cm-qty  { font-size: 12px; font-weight: 700; color: var(--ink-soft); width: 70px; flex-shrink: 0; text-align: right; }

/* ── Error & warning message styles ── */
.field-error { font-size: 12px; color: var(--danger); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.field-error::before { content: '⚠'; font-size: 11px; }
.field-warn  { font-size: 12px; color: var(--late); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.field-warn::before { content: '⚠'; font-size: 11px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(192,70,58,.12) !important; }
.field.has-warn input, .field.has-warn select { border-color: var(--late) !important; }

.alert-banner { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.alert-banner.danger  { background: var(--danger-tint); border: 1px solid rgba(192,70,58,.2); color: var(--danger); }
.alert-banner.warning { background: var(--late-tint);   border: 1px solid rgba(194,132,31,.2); color: var(--late); }
.alert-banner.success { background: var(--success-tint);border: 1px solid rgba(47,143,91,.2);  color: var(--success); }
.alert-banner.info    { background: var(--info-tint);   border: 1px solid rgba(44,111,168,.2); color: var(--info); }
.alert-banner .ab-icon { flex-shrink: 0; font-size: 16px; }
.alert-banner strong  { font-weight: 700; }

/* ── Purchase history / audit log ── */
.purchase-log-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.purchase-log-item:last-child { border-bottom: none; }
.pl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pl-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pl-amount { font-size: 14px; font-weight: 700; color: var(--navy-800); }
.pl-details { font-size: 12.5px; color: var(--muted); }
.pl-bill-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--info-tint); color: var(--info); padding: 4px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; cursor: pointer; border: none; margin-top: 8px; }
.pl-bill-btn:hover { background: var(--info); color: #fff; }

/* ── FIFO/LIFO batch display ── */
.batch-table { font-size: 12.5px; }
.batch-table th { font-size: 10.5px; }
.batch-bar { height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-top: 4px; }
.batch-bar .fill { height: 100%; background: var(--brass); border-radius: 999px; }
.fifo-badge { background: var(--info-tint); color: var(--info); padding: 2px 8px; border-radius: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.lifo-badge { background: #EEE7F8; color: #6B4FA0; padding: 2px 8px; border-radius: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }

/* ── Stocking plans ── */
.plan-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); padding: 18px 20px; transition: box-shadow var(--transition); }
.plan-card:hover { box-shadow: var(--shadow); }
.plan-card .plan-type-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.plan-type-annual  { background: var(--info-tint);   color: var(--info); }
.plan-type-weekly  { background: var(--brass-tint);  color: #3A7018; }
.plan-type-petty   { background: var(--late-tint);   color: var(--late); }
.plan-card .plan-title { font-size: 15px; font-weight: 700; color: var(--navy-900); margin-bottom: 5px; }
.plan-card .plan-sub   { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.budget-bar-wrap { margin: 12px 0 6px; }
.budget-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.budget-bar .fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.budget-bar .fill.safe     { background: var(--brass); }
.budget-bar .fill.warning  { background: var(--late); }
.budget-bar .fill.exceeded { background: var(--danger); }
.budget-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.budget-labels .spent { font-weight: 600; color: var(--ink-soft); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ── Petty expenses table ── */
.expense-amount { font-size: 15px; font-weight: 700; color: var(--navy-800); }
.expense-category { background: var(--surface-soft); color: var(--muted); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }

/* ── Section tabs (full-width style) ── */
.section-tabs { display: flex; border-bottom: 2px solid var(--line-soft); margin-bottom: 20px; gap: 0; }
.section-tabs .stab { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: color var(--transition), border-color var(--transition); }
.section-tabs .stab:hover { color: var(--ink); }
.section-tabs .stab.active { color: var(--navy-800); border-bottom-color: var(--navy-800); }

/* ── Spacing fixes across views ── */
.content { padding: 26px 28px 80px; }
.card-pad { padding: 22px 24px; }
.topbar { padding: 16px 28px; }
.filter-bar { gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
.filter-bar select, .filter-bar .search-input { font-size: 13px; padding: 8px 11px; }
.section-head { margin-bottom: 16px; }
.section-head h3 { font-size: 16px; margin: 0 0 3px; }

/* ── Table spacing ── */
thead th { padding: 10px 14px; }
tbody td  { padding: 11px 14px; }

/* ── Modal improvements ── */
.modal { padding: 26px 28px; }
.modal h3 { font-size: 18px; }
.modal .sub { font-size: 13px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { font-size: 12.5px; margin-bottom: 6px; }
.field-row { gap: 14px; }

/* ── Nav item spacing ── */
.nav-item { padding: 10px 13px; margin-bottom: 1px; font-size: 13px; }
.nav-section-label { padding: 18px 13px 5px; font-size: 10px; }

/* ── Responsive tweaks ── */
@media (max-width: 1280px) { .grid-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .content { padding: 16px 14px 60px; } .topbar { padding: 14px 14px; } .card-pad { padding: 16px; } }
@media (max-width: 640px)  { .grid-stats { grid-template-columns: repeat(2, 1fr); } .inv-grid { grid-template-columns: repeat(2, 1fr); } .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px)  { .grid-stats { grid-template-columns: 1fr 1fr; } .stat-card .num { font-size: 22px; } }
