/* =====================================================================
   Peppermint Bot design system
   Minimal surfaces in light grey, with purple used as an accent.
   ===================================================================== */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2');
}

:root {
  /* Brand scale */
  --brand-25: #FBFAFF; --brand-50: #F5F3FF; --brand-100: #EDE9FE; --brand-200: #DDD6FE; --brand-300: #C4B5FD;
  --brand-400: #A78BFA; --brand-500: #8B5CF6; --brand-600: #7C3AED; --brand-700: #6D28D9; --brand-800: #5B21B6; --brand-900: #4C1D95;
  /* Neutrals — light grey as the second colour, purple kept for accents */
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #F4F5F7; --surface-3: #EEF0F3; --sidebar: #FFFFFF;
  --line: #E6E8EC; --line-soft: #F0F1F3; --line-strong: #D5D8DE;
  --ink: #1A1C20; --ink-2: #3F4450; --muted: #6B7280; --faint: #9CA3AF;
  /* Semantic */
  --primary: var(--brand-600); --primary-hover: var(--brand-700); --primary-ink: #fff;
  --accent: var(--brand-400); --accent-soft: var(--brand-100); --accent-ink: var(--brand-700);
  --red: #DC2626; --red-ink: #B91C1C; --red-soft: #FEF2F2; --red-line: #FECACA;
  --amber: #B45309; --amber-soft: #FFFBEB; --amber-line: #FDE68A;
  --green: #047857; --green-soft: #ECFDF5;
  --sel: #F4F5F7;
  /* Legacy aliases used by inline styles in JS */
  --mint: var(--brand-600); --mint-dark: var(--brand-700); --mint-soft: var(--brand-100);
  /* Spacing (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  /* Radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-md: 0 2px 8px rgba(17, 24, 39, .05);
  --shadow-lg: 0 4px 16px rgba(17, 24, 39, .06);
  --shadow: var(--shadow-sm);
  --ring: 0 0 0 3px rgba(167, 139, 250, .28);
  --ring-inset: inset 0 0 0 2px var(--brand-400);
  /* Type scale */
  --fs-xs: 11px; --fs-sm: 12.5px; --fs-base: 13.5px; --fs-md: 14.5px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* Layout */
  --sidebar-w: 252px; --rail-w: 60px; --topbar-h: 60px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23625E77' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E");

  font-family: var(--font); font-size: var(--fs-base); color: var(--ink);
  font-feature-settings: 'cv11', 'ss01', 'ss03'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110F1A; --surface: #18151F; --surface-2: #1D1A26; --surface-3: #24202F; --sidebar: #14121C;
    --line: #2B2738; --line-soft: #221F2D; --line-strong: #3A3549;
    --ink: #ECEAF4; --ink-2: #CFCBDD; --muted: #A29EB5; --faint: #6F6A83;
    --primary: var(--brand-600); --primary-hover: var(--brand-500);
    --accent-soft: rgba(167, 139, 250, .16); --accent-ink: var(--brand-300);
    --mint-dark: var(--brand-300); --mint-soft: rgba(167, 139, 250, .16);
    --red: #F87171; --red-ink: #FCA5A5; --red-soft: rgba(248, 113, 113, .12); --red-line: rgba(248, 113, 113, .35);
    --amber: #FBBF24; --amber-soft: rgba(251, 191, 36, .12); --amber-line: rgba(251, 191, 36, .35);
    --green: #34D399; --green-soft: rgba(52, 211, 153, .12); --sel: rgba(167, 139, 250, .14);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 6px 16px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A29EB5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: var(--fs-base); line-height: 1.5; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: var(--brand-200); color: var(--brand-900); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-600); width: 15px; height: 15px; cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.011em; font-weight: 550; }
h2 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--s3); display: flex; align-items: center; gap: var(--s2); }
h3 { font-size: var(--fs-md); font-weight: 600; margin: var(--s5) 0 var(--s2); }
h4 { font-size: var(--fs-xs); font-weight: 600; margin: var(--s4) 0 var(--s2); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); } .small-text { font-size: var(--fs-sm); } .pad { padding: 0 var(--s6); }
.error { color: var(--red-ink); min-height: 1em; margin: 0; font-size: var(--fs-sm); }
.error:empty { display: none; }
.warn-text { color: var(--amber); font-weight: 600; }
code, pre { font-family: var(--mono); background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 6px; font-size: 12px; word-break: break-all; }
pre { padding: var(--s3); overflow: auto; white-space: pre; word-break: normal; }
kbd { font: 500 10.5px/1 var(--font); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-xs);
  padding: 3px 5px; color: var(--muted); background: var(--surface); min-width: 18px; text-align: center; display: inline-block; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.ico { width: 16px; height: 16px; flex: none; display: inline-block; }
.ico svg { width: 100%; height: 100%; display: block; }

/* ---------- Buttons ---------- */
.btn { --h: 34px; height: var(--h); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  padding: 0 var(--s3); border-radius: var(--r-md); font: 500 var(--fs-base)/1 var(--font); cursor: pointer; text-decoration: none !important;
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn .ico { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(91, 33, 182, .25), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.on { background: var(--surface); border-color: var(--brand-400); color: var(--brand-700); font-weight: 600; }
.btn.on:hover { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-800); }
.btn.primary kbd { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; margin-left: 2px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.small { --h: 28px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.tiny { --h: 22px; padding: 0 7px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn.danger { color: var(--red-ink); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red-line); color: var(--red-ink); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.danger-solid:hover { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { box-shadow: var(--ring); }
.icon { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; width: 28px; height: 28px; padding: 0;
  border-radius: var(--r-sm); display: inline-grid; place-items: center; transition: background .12s, color .12s, opacity .12s; }
.icon:hover { background: var(--surface-3); color: var(--ink); }
/* Swap emoji glyphs for crisp line icons, keyed on the button title (no JS change needed). */
.icon[title="Delete lead"], .icon[title="Delete entry"], .icon[title="Open details"], .icon[title^="Close"], .modal-head .icon { font-size: 0; }
.icon[title="Delete lead"]::before, .icon[title="Delete entry"]::before, .icon[title="Open details"]::before, .icon[title^="Close"]::before, .modal-head .icon::before {
  content: ''; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.icon[title="Delete lead"] { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.icon[title="Delete lead"]:hover { color: var(--red-ink); background: var(--red-soft); }
.icon[title="Open details"] { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E"); }
.icon[title="Delete entry"], .icon[title^="Close"], .modal-head .icon { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }

/* ---------- Form controls ---------- */
.field, input, select, textarea { font: inherit; color: var(--ink); }
.field { width: 100%; height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background-color: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
textarea.field { height: auto; padding: var(--s2) var(--s3); resize: vertical; line-height: 1.5; }
select.field, .toolbar select, .bulkbar select { appearance: none; -webkit-appearance: none; background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }
.field::placeholder, input::placeholder, textarea::placeholder { color: var(--faint); }
.field:hover { border-color: var(--brand-300); }
.field:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.field:disabled { background-color: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.stack { display: grid; gap: 6px; }
.lbl { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); }
.row-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.row-btns.left { justify-content: flex-start; }
.check { display: flex; gap: var(--s2); align-items: center; cursor: pointer; }
details summary { cursor: pointer; color: var(--accent-ink); margin: var(--s2) 0; font-weight: 500; }

/* ---------- Chips, tags, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs);
  font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.chip.bad { background: var(--red-soft); color: var(--red-ink); } .chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.muted { color: var(--muted); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs);
  font-weight: 500; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tag { background: rgba(167, 139, 250, .12); color: var(--brand-300); border-color: rgba(167, 139, 250, .2); } }
.tag .x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .6; }
.tag .x:hover { opacity: 1; }
.tags.editable { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 6px 8px; background: var(--surface); min-height: 36px; box-shadow: var(--shadow-xs); }
.tags.editable:focus-within { border-color: var(--brand-400); box-shadow: var(--ring); }
.tag-input { border: 0; outline: 0; background: transparent; min-width: 80px; flex: 1; padding: 2px 4px; }
.value { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.count { font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--muted); border-radius: var(--r-full); padding: 2px 8px; }
.count.bad { background: var(--red-soft); color: var(--red-ink); } .count.warn { background: var(--amber-soft); color: var(--amber); }
.badge { background: var(--surface); color: var(--brand-700); border: 1px solid var(--brand-300); border-radius: var(--r-full); font-size: 10.5px; line-height: 16px; padding: 0 6px; margin-left: auto; font-weight: 600; min-width: 18px; text-align: center; }
.badge-manual, .badge-missing, .badge-range { font-size: 10px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: var(--r-full); white-space: nowrap; display: inline-flex; align-items: center; }
.badge-manual { background: var(--amber-soft); color: var(--amber); }
.badge-missing { background: var(--red-soft); color: var(--red-ink); }
.badge-range { background: var(--brand-100); color: var(--brand-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
li.warn { color: var(--amber); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s6); margin: 0 var(--s6) var(--s4); box-shadow: var(--shadow-xs); }
#view > .card:first-child, #view > div > .card:first-child { margin-top: var(--s1); }
.card > h2:first-child { margin-top: 0; }

/* =====================================================================
   App shell: sidebar + main
   ===================================================================== */
.app { --sb-cur: var(--rail-w); padding-left: var(--rail-w); min-height: 100vh; transition: padding-left .22s cubic-bezier(.2, .8, .2, 1); }
body.sb-pinned .app { padding-left: var(--sidebar-w); }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 35; width: var(--rail-w); display: flex; flex-direction: column; gap: 1px; padding: var(--s3) 10px;
  background: var(--sidebar); border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
  transition: width .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, transform .24s cubic-bezier(.2, .8, .2, 1); }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.expanded { width: var(--sidebar-w); }
.sidebar.peek { box-shadow: var(--shadow-lg); border-right-color: var(--line-strong); }
.sidebar.no-anim, .app.no-anim { transition: none !important; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0 12px; min-width: 0; }
.brand { font-weight: 550; font-size: 15px; display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink) !important; text-decoration: none !important; letter-spacing: -.01em; }
.side-head .brand { padding: 4px 7px; min-width: 0; }
.sb-btn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--faint); cursor: pointer; transition: background .12s, color .12s, opacity .15s; }
.sb-btn:hover { background: var(--surface-3); color: var(--ink); }
.sb-btn.on { color: var(--brand-600); background: var(--brand-100); }
.sb-btn .ico { width: 15px; height: 15px; }
/* Collapsed rail: labels fade out, icons stay put (centred in the rail) */
.sidebar .side-label, .sidebar .nav-group, .sidebar .soon-pill, .sidebar .search-btn .lab, .sidebar .search-btn kbd, .sidebar #me, .sidebar .sb-btn,
.sidebar .brand > span, .sidebar .module-nav a > span:not(.ico), .sidebar .mod-subnav a > span:not(.ico):not(.badge), .sidebar .side-foot .btn .lab-t {
  transition: opacity .16s ease; }
.sidebar:not(.expanded) .side-label, .sidebar:not(.expanded) .nav-group, .sidebar:not(.expanded) .soon-pill, .sidebar:not(.expanded) .search-btn .lab,
.sidebar:not(.expanded) .search-btn kbd, .sidebar:not(.expanded) #me, .sidebar:not(.expanded) .sb-btn, .sidebar:not(.expanded) .brand > span,
.sidebar:not(.expanded) .module-nav a > span:not(.ico), .sidebar:not(.expanded) .mod-subnav a > span:not(.ico):not(.badge) { opacity: 0; pointer-events: none; }
.sidebar:not(.expanded) .sb-btn { visibility: hidden; }
.sidebar:not(.expanded) .side-label, .sidebar:not(.expanded) .nav-group { height: 14px; padding: 0; margin: 6px 8px; border-top: 1px solid var(--line); overflow: hidden; color: transparent; }
.sidebar:not(.expanded) .side-label { margin-top: 2px; }
.sidebar:not(.expanded) .search-btn { width: 40px; padding-left: 12px; border-color: transparent; background: transparent; box-shadow: none; overflow: hidden; }
.sidebar:not(.expanded) .search-btn:hover { background: var(--surface-3); }
.sidebar:not(.expanded) .search-btn .ico { color: var(--muted); }
.sidebar:not(.expanded) .side-foot .btn.ghost { font-size: 0; }
.sidebar:not(.expanded) .badge { position: absolute; left: 24px; top: 3px; font-size: 9px; line-height: 14px; min-width: 14px; padding: 0 4px; margin: 0; }
.module-nav a, .mod-subnav a { position: relative; }
.sb-toggle .ico { transition: transform .22s; }
.sidebar.expanded .sb-toggle .ico { transform: scaleX(-1); }
.sidebar:not(.expanded) .sb-toggle .lab { opacity: 0; }
.sb-menu { display: none; margin-left: -6px; }
.sb-backdrop { position: fixed; inset: 0; z-index: 34; background: rgba(27, 23, 48, .32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.logo { width: 26px; height: 26px; object-fit: contain; object-position: center; flex: none; display: block; border-radius: 0; overflow: visible; background: transparent; }
.logo.big { width: 44px; height: 44px; }
.search-btn { display: flex; align-items: center; gap: 8px; width: 100%; flex: none; white-space: nowrap; transition: width .22s, background .12s; height: 34px; padding: 0 6px 0 10px; margin-bottom: var(--s2);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--faint); font: inherit; cursor: pointer; box-shadow: var(--shadow-xs); text-align: left; }
.search-btn .lab { flex: 1; color: var(--muted); }
.search-btn:hover { border-color: var(--brand-300); }
.side-label { font-size: var(--fs-xs); font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.module-nav, .mod-subnav { display: grid; gap: 1px; }
.module-nav a, .mod-subnav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px 0 12px; flex: none; border-radius: var(--r-md); white-space: nowrap; min-width: 0;
  color: var(--ink-2); font-weight: 500; text-decoration: none !important; transition: background .1s, color .1s; }
.module-nav a .ico, .mod-subnav a .ico { color: var(--faint); }
.module-nav a > span:not(.ico):not(.soon-pill), .mod-subnav a > span:not(.ico):not(.badge) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.module-nav a:hover, .mod-subnav a:hover { background: var(--surface-3); color: var(--ink); }
.module-nav a.active, .mod-subnav a.active { background: var(--surface-2); color: var(--brand-700); box-shadow: inset 2px 0 0 var(--brand-500); }
.module-nav a.active .ico, .mod-subnav a.active .ico { color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .module-nav a.active, .mod-subnav a.active { background: rgba(167, 139, 250, .16); color: var(--brand-200); } }
.module-nav a.soon { color: var(--muted); }
.soon-pill { margin-left: auto; flex: none; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: var(--r-full); padding: 1px 7px; }
.mod-subnav .nav-group { font-size: var(--fs-xs); font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: var(--s3); display: grid; gap: 1px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 6px 5px 8px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--brand-700);
  background: var(--surface-2); border: 1px solid var(--line); letter-spacing: .02em; }
#me { display: grid; min-width: 0; line-height: 1.25; }
#me b { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me small { font-size: var(--fs-xs); color: var(--muted); }
.side-foot .btn.ghost { justify-content: flex-start; height: 32px; padding: 0 12px; overflow: hidden; color: var(--ink-2); font-weight: 500; width: 100%; gap: 10px; }
.side-foot .btn.ghost .ico { color: var(--faint); width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s6); background: var(--bg);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); position: sticky; top: 0; z-index: 21; }
.page-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.page-head h1 { font-size: var(--fs-xl); font-weight: 550; margin: 0; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); }
.page-head .muted { font-size: var(--fs-sm); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
body.desktop .topbar, body.desktop .sidebar .brand { -webkit-app-region: drag; }
body.mac .sidebar { padding-top: 36px; }
body.desktop .side-head .brand { -webkit-app-region: no-drag; }
body.desktop .topbar button, body.desktop .topbar a, body.desktop .topbar input { -webkit-app-region: no-drag; }

/* Save state indicator: Saving… → Saved → All changes saved, or error + Retry */
.save-state { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--fs-sm);
  color: var(--muted); font-weight: 500; transition: background .2s, color .2s; white-space: nowrap; border: 1px solid transparent; }
.save-state .ss-ico { width: 14px; height: 14px; display: inline-block; flex: none; }
.save-state.saving .ss-ico { border: 2px solid var(--brand-200); border-top-color: var(--brand-600); border-radius: 50%; animation: spin .7s linear infinite; }
.save-state.saved { color: var(--green); background: var(--green-soft); }
.save-state.saved .ss-ico, .save-state.idle .ss-ico { background: currentColor; -webkit-mask: var(--check) center/contain no-repeat; mask: var(--check) center/contain no-repeat; }
.save-state.idle { color: var(--faint); }
.save-state.error { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-line); padding-right: 4px; }
.save-state.error .ss-ico { background: currentColor; -webkit-mask: var(--alert) center/contain no-repeat; mask: var(--alert) center/contain no-repeat; }
.save-state .ss-retry { border: 0; background: var(--red); color: #fff; font: 600 var(--fs-xs)/1 var(--font); padding: 5px 10px; border-radius: var(--r-full); cursor: pointer; margin-left: 4px; }
.save-state .ss-retry:hover { background: var(--red-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: var(--s3); padding: 4px var(--s6) var(--s4); flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background-color: var(--surface);
  font-size: var(--fs-sm); color: var(--ink-2); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s, background-color .12s; }
.toolbar select { padding-right: 26px; background-position: right 8px center; max-width: 150px; }
.toolbar select:hover, .toolbar input:hover { border-color: var(--brand-300); }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.toolbar input[type=search] { min-width: 150px; flex: 1 1 200px; max-width: 280px; padding-left: 32px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%239C98AE' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center; }
.toolbar select.active-filter { border-color: var(--brand-300); background-color: var(--brand-50); color: var(--brand-800); font-weight: 600; }
@media (prefers-color-scheme: dark) { .toolbar select.active-filter { background-color: rgba(167, 139, 250, .12); color: var(--brand-200); } }
#save-view { display: none; }
@media (min-width: 1200px) { .toolbar { flex-wrap: nowrap; } .toolbar select { flex: 0 1 auto; min-width: 84px; } .toolbar .btn { flex: none; } }
#export-json { margin-left: -6px; }
.toolbar .divider { width: 1px; height: 20px; background: var(--line-strong); margin: 0 2px; }
.toolbar .btn.ghost { padding: 0 8px; }
.bulkbar { display: flex; gap: var(--s2); align-items: center; margin: 0 var(--s6) var(--s3); padding: 6px 8px 6px 14px; border-radius: var(--r-lg);
  background: #1F1B2E; color: #fff; flex-wrap: wrap; box-shadow: var(--shadow-md); }
.bulkbar strong { font-weight: 600; font-size: var(--fs-sm); margin-right: 6px; }
.bulkbar select, .bulkbar .btn { height: 28px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.bulkbar select { padding: 0 26px 0 10px; border: 1px solid rgba(255, 255, 255, .18); background-color: rgba(255, 255, 255, .08); color: #fff; }
.bulkbar select option { color: var(--ink); background: var(--surface); }
.bulkbar .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.bulkbar .btn.danger { color: #FCA5A5; } .bulkbar .btn.ghost { border-color: transparent; background: transparent; color: rgba(255, 255, 255, .7); }

/* =====================================================================
   Lead sheet
   ===================================================================== */
.sheet-wrap { margin: 0 var(--s4) var(--s4); overflow-x: hidden; overflow-y: auto; max-width: calc(100% - 2 * var(--s4)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  max-height: calc(100vh - var(--topbar-h) - 70px); box-shadow: var(--shadow-xs); }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; font-size: var(--fs-base); }
.sheet th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; font-size: var(--fs-xs); z-index: 2;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 12px; height: 38px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; transition: color .1s; }
.sheet th:hover { color: var(--ink); }
.sheet td { border-bottom: 1px solid var(--line-soft); padding: 0; height: 44px; background: var(--surface); transition: background .1s; vertical-align: middle; }
.sheet td input, .sheet td select { width: 100%; height: 43px; border: 0; padding: 0 8px; background-color: transparent; outline: none; color: var(--ink); text-overflow: ellipsis; min-width: 0; }
.sheet td select { appearance: none; -webkit-appearance: none; cursor: pointer; background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; }
.sheet tr:hover td select:not(.status) { background-image: var(--chevron); }
.sheet td input:hover, .sheet td select:not(.status):hover { background-color: var(--brand-25); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sheet td input:focus, .sheet td select:focus { box-shadow: var(--ring-inset); background-color: var(--surface); position: relative; z-index: 1; }
@media (prefers-color-scheme: dark) { .sheet td input:hover, .sheet td select:not(.status):hover { background-color: var(--surface-2); } }
.sheet td input[aria-label="Company"] { font-weight: 600; }
.sheet td input[aria-label="SPOC Email"], .sheet td input[aria-label="SPOC Phone"] { color: var(--ink-2); }
.sheet td input[type=date] { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sheet td.ro { color: var(--muted); font-size: var(--fs-sm); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .sel { width: 36px; min-width: 36px; max-width: 36px; text-align: center; position: sticky; left: 0; z-index: 1; padding: 0; }
.sheet th.sel { z-index: 3; cursor: default; }
.sheet .sel input { width: 15px; height: 15px; margin: 0; padding: 0; vertical-align: middle; opacity: .5; transition: opacity .1s; }
.sheet tr:hover .sel input, .sheet .sel input:checked { opacity: 1; }
.sheet td.actions, .sheet th.actions { width: 100px; min-width: 100px; max-width: 100px; text-align: center; cursor: default; white-space: nowrap; padding: 0 4px; overflow: hidden; }
.sheet td.actions .icon { opacity: 0; }
.sheet tr:hover td.actions .icon, .sheet td.actions .icon:focus-visible { opacity: 1; }
.sheet tbody tr:hover td { background: var(--surface-2); }
.sheet tr.selected td { background: var(--sel) !important; }
.sheet tr.overdue td.sel { box-shadow: inset 3px 0 0 var(--red); }
.sheet tr.due-today td.sel { box-shadow: inset 3px 0 0 #F59E0B; }
.sheet tr.overdue input[type=date] { color: var(--red-ink); font-weight: 600; }
.sheet tr.due-today input[type=date] { color: var(--amber); font-weight: 600; }
.sheet tfoot td { font-weight: 600; padding: 0 12px; height: 42px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; position: sticky; bottom: 0; z-index: 2;
  font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.sheet tfoot .total { color: var(--ink); font-variant-numeric: tabular-nums; white-space: normal; line-height: 1.35; text-align: right; }
.sheet th:nth-child(2), .sheet td:nth-child(2) { position: sticky; left: 36px; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.sheet thead th:nth-child(2) { z-index: 3; }
.sheet tfoot td:first-child, .sheet tfoot td:nth-child(2) { z-index: 3; }
/* Saved-cell flash + check */
.sheet td.flash { animation: cellflash 1.2s ease-out; position: relative; }
.sheet tr.flash td { animation: cellflash 1.2s ease-out; }
@keyframes cellflash { 0% { background-color: rgba(167, 139, 250, .38); } 100% { background-color: var(--surface); } }
.sheet td.flash::after { content: ''; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--green);
  -webkit-mask: var(--check) center/contain no-repeat; mask: var(--check) center/contain no-repeat; animation: checkfade 1.8s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes checkfade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.sheet td.save-failed, .sheet td.save-failed input, .sheet td.save-failed select { box-shadow: inset 0 0 0 2px var(--red) !important; background-color: var(--red-soft) !important; }

/* Status pill (tint follows the status colour set inline, so custom statuses work too) */
select.status { font-weight: 600; font-size: var(--fs-sm); }
.sheet td select.status { width: auto; max-width: calc(100% - 16px); height: 24px; margin: 0 10px; padding: 0 24px 0 10px; border-radius: var(--r-full);
  background-color: color-mix(in srgb, currentColor 11%, transparent); background-image: var(--chevron); background-position: right 7px center;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent); }
.sheet td select.status:hover { background-color: color-mix(in srgb, currentColor 17%, transparent); }
.sheet td select.status:focus { box-shadow: var(--ring); }
.s-new { color: #0369A1; } .s-qualified { color: #15803D; } .s-warm { color: #A16207; }
.s-hot { color: #C2410C; } .s-won { color: #047857; } .s-lost { color: #475569; } .s-dropped { color: #7C3AED; }
.s-contacted { color: #15803D; }

/* Deal value: computed from products; the cell is a button that opens the product + qty picker */
.deal-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; height: 43px; padding: 0 12px; }
.deal-cell input { flex: 1; min-width: 0; padding: 0 2px !important; }
.deal-cell.computed, td.computed, .deal-cell[role=button], button.deal-cell, .deal-btn {
  cursor: pointer; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); transition: background .1s, box-shadow .1s, color .1s; }
button.deal-cell, .deal-btn { width: 100%; border: 0; background: transparent; font: inherit; font-weight: 600; text-align: right; }
.deal-cell.computed:hover, td.computed:hover, .deal-cell[role=button]:hover, button.deal-cell:hover, .deal-btn:hover {
  background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-200); color: var(--brand-800); }
.deal-cell.computed:focus-visible, button.deal-cell:focus-visible, .deal-btn:focus-visible, .deal-cell[role=button]:focus-visible { box-shadow: var(--ring-inset); border-radius: 0; }
.deal-cell .deal-empty, .deal-cell .placeholder, .deal-btn .placeholder { color: var(--faint); font-weight: 500; }
@media (prefers-color-scheme: dark) { .deal-cell.computed:hover, td.computed:hover, button.deal-cell:hover, .deal-btn:hover { background: rgba(167, 139, 250, .1); color: var(--brand-200); } }

.deal-cell.deal-readonly { padding: 0; gap: 0; }
.deal-cell.deal-readonly > .badge-manual, .deal-cell.deal-readonly > .badge-missing, .deal-cell.deal-readonly > .btn { margin-right: 8px; flex: none; }
.sheet th.money-col, .sheet td.money-cell { text-align: right; }
.sheet td.money-cell { overflow: hidden; }
.deal-open { appearance: none; -webkit-appearance: none; flex: 1 1 auto; min-width: 0; height: 43px; margin: 0; padding: 0 12px; border: 0; background: transparent;
  font: inherit; font-weight: 600; color: var(--ink); text-align: right; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: clip; transition: background .1s, box-shadow .1s, color .1s; }
.deal-open:hover { background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-200); color: var(--brand-800); }
.deal-open:focus, .deal-open:focus-visible { outline: none; box-shadow: var(--ring-inset); background: var(--surface); border-radius: 0; }
.panel .deal-open { height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r-md); text-align: left; background: var(--surface-2); }
@media (prefers-color-scheme: dark) { .deal-open:hover { background: rgba(167, 139, 250, .1); color: var(--brand-200); } }
.prod-cell:focus, .prod-cell:focus-visible { outline: none; box-shadow: var(--ring-inset); background: var(--surface); border-radius: 0; }
.add-product-form { border-top: 1px solid var(--line-soft); padding-top: 12px; }

/* Products cell */
.prod-cell { display: flex; flex-wrap: nowrap; overflow: hidden; gap: 4px; align-items: center; padding: 0 12px; min-height: 43px; cursor: pointer; transition: background .1s; }
.prod-cell:hover { background: var(--brand-25); box-shadow: inset 0 0 0 1px var(--line-strong); }
.prod-cell > .muted { color: var(--faint); font-size: var(--fs-sm); }
.prod-cell .tag { cursor: pointer; }
.panel .prod-cell { flex-wrap: wrap; min-height: 36px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 6px 8px; }
.panel .prod-cell:hover { border-color: var(--brand-300); box-shadow: none; }
.prod-thumb { width: 18px; height: 18px; object-fit: cover; border-radius: 4px; background: var(--line-soft); }
.plain .prod-thumb { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 56px 20px; display: grid; justify-items: center; gap: 4px; }
.empty::before { content: ''; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 10px; background: var(--brand-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%237C3AED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6M22 11h-6'/%3E%3C/svg%3E") center no-repeat; }
.empty p { margin: 0; max-width: 440px; } .empty p:first-of-type { font-weight: 600; font-size: var(--fs-md); }

/* =====================================================================
   Pipeline
   ===================================================================== */
.board { display: grid; gap: var(--s3); padding: 0 var(--s6) var(--s6); overflow-x: auto; align-items: start; }
.col { background: var(--surface-3); border: 1px solid transparent; border-radius: var(--r-lg); padding: var(--s2); min-height: 280px; transition: background .15s, border-color .15s; }
@media (prefers-color-scheme: dark) { .col { background: var(--surface); } }
.col.drop { background: var(--brand-50); border-color: var(--brand-300); }
.col header { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 6px 6px 10px; }
.col header strong { font-size: var(--fs-sm); font-weight: 650; }
.col header .muted { grid-column: 1 / -1; font-size: var(--fs-xs); margin-top: 2px; padding-left: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards { display: grid; gap: var(--s2); min-height: 30px; }
.board .card { margin: 0; padding: 12px; cursor: grab; display: grid; gap: 6px; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  transition: box-shadow .15s, border-color .15s, transform .15s; }
.board .card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.board .card:focus-visible { box-shadow: var(--ring); }
.board .card.dragging { opacity: .5; transform: rotate(1.5deg); }
.board .card.overdue { box-shadow: inset 3px 0 0 var(--red), var(--shadow-xs); }
.board .card.selected { border-color: var(--brand-400); box-shadow: var(--ring); }
.card-title { font-weight: 600; font-size: var(--fs-base); color: var(--ink); }
.board .card > .muted { font-size: var(--fs-sm); margin-top: -4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.add-card { width: 100%; justify-content: center; margin-top: 6px; color: var(--muted); }
.add-card:hover { background: var(--surface) !important; }

/* Autocomplete + likely-duplicate warnings */
.suggest-menu { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 4px; max-height: 260px; overflow: auto; min-width: 220px; animation: pop .12s ease-out; }
.suggest-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink); font: inherit; padding: 7px 10px; border-radius: var(--r-md); cursor: pointer; }
.suggest-item .muted { font-size: var(--fs-xs); }
.suggest-item.active, .suggest-item:hover { background: var(--brand-50); color: var(--brand-800); }
@media (prefers-color-scheme: dark) { .suggest-item.active, .suggest-item:hover { background: rgba(167, 139, 250, .12); color: var(--brand-200); } }
.dup-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 6px 6px; padding: 6px 10px;
  background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; }
.dup-chip .dup-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.dup-chip .btn.tiny { background: var(--surface); }
.sheet td .dup-chip { margin: 0 4px 4px; }
.panel-body > .dup-chip { margin: 0; }
.sheet tr.dup-row td { height: auto; border-bottom: 1px solid var(--line); background: var(--amber-soft) !important; }
.sheet tr.dup-row .dup-chip { margin: 6px 12px; background: transparent; border: 0; padding: 0; }
.dup-chip.soft, .sheet tr.dup-row:has(.dup-chip.soft) td { background: var(--surface-2) !important; }
.dup-chip.soft { color: var(--muted); border-color: var(--line); background: var(--surface-2); font-weight: 500; }

/* Calendar actions + lead files */
.cal-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.cal-actions.compact { margin: 0 6px 0 0; flex: none; }
.cal-actions .ico { width: 14px; height: 14px; display: inline-flex; }
.cal-actions .btn .ico { margin-right: 2px; }
.follow-cell { display: flex; align-items: center; gap: 2px; min-width: 0; height: 100%; }
.follow-cell input { flex: 1; min-width: 0; }
.fu .cal-actions { margin: 0; }
.fu .cal-actions .btn { padding: 0 8px; }
.file-count { gap: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.file-count .ico { width: 14px; height: 14px; }
.icon.cal-google, .icon.cal-ics, .icon.file-count { display: inline-flex; align-items: center; justify-content: center; }
.icon.cal-google .ico, .icon.cal-ics .ico { width: 15px; height: 15px; }
.icon.file-count { width: auto; min-width: 28px; padding: 0 6px; }
.lead-files { display: grid; gap: var(--s2); }
.lead-files .panel-section { margin-top: 8px; }
.file-drop { display: grid; justify-items: center; gap: 4px; padding: 16px 12px; border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg); background: var(--surface-2); color: var(--muted); cursor: pointer; text-align: center; transition: border-color .12s, background .12s, color .12s; }
.file-drop .ico { width: 20px; height: 20px; color: var(--brand-600); }
.file-drop:hover, .file-drop.drag { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-800); }
.file-drop.disabled { cursor: default; opacity: .8; }
.file-drop.disabled:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .file-drop:hover, .file-drop.drag { background: rgba(167, 139, 250, .12); color: var(--brand-200); }
}
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-list li.muted { padding: 4px 0; }
.lead-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.lead-file .file-name { font-weight: 600; color: var(--ink); text-decoration: none; flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-file .file-name:hover { color: var(--brand-700); }
.lead-file .row-btns { margin-left: auto; }

/* =====================================================================
   Lead side panel
   ===================================================================== */
.overlay { position: fixed; inset: 0; background: rgba(27, 23, 48, .28); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 30; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.panel { position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(580px, calc(100vw - 16px)); background: var(--surface); z-index: 40; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); border-radius: var(--r-xl); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 16px 16px 24px; border-bottom: 1px solid var(--line); }
.panel-head > div:first-child { display: grid; gap: 2px; min-width: 0; }
.panel-head h2 { margin: 0; font-size: var(--fs-xl); font-weight: 550; letter-spacing: -.02em; }
.panel-head .muted { font-size: var(--fs-base); } .panel-head .muted.small-text { font-size: var(--fs-xs); color: var(--faint); margin-top: 4px; }
.panel-body { overflow: auto; padding: 16px 24px 48px; display: grid; gap: var(--s4); align-content: start; }
.panel-section { grid-column: 1 / -1; font-size: var(--fs-xs); font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em;
  margin: 6px 0 -4px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.panel-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.panel h3 { margin: 12px 0 0; font-size: var(--fs-md); }
.composer { display: grid; gap: var(--s2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); }
.composer .btn { justify-self: end; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; position: relative; }
.timeline > li.muted { padding: 8px 0; }
.act { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; position: relative; }
.act:not(:last-child)::before { content: ''; position: absolute; left: 13.5px; top: 40px; bottom: -6px; width: 1px; background: var(--line); }
.act-icon { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: 13px; }
.act-system .act-icon { background: var(--surface-3); border-color: var(--line); color: var(--faint); }
.act-main { flex: 1; min-width: 0; padding-top: 4px; } .act-body { white-space: pre-wrap; }
.act-system .act-body { color: var(--muted); font-size: var(--fs-sm); }
.act .icon { opacity: 0; } .act:hover .icon { opacity: 1; }

/* =====================================================================
   Modals, palette, pickers, toasts
   ===================================================================== */
.modal { position: fixed; inset: 0; display: grid; place-items: start center; padding: 10vh 16px 16px; z-index: 60; pointer-events: none; overflow: auto; }
.modal-card { pointer-events: auto; width: min(560px, 94vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); animation: pop .16s cubic-bezier(.2, .8, .2, 1); max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 0 24px; flex: none; }
.modal-head h2 { margin: 0; font-size: var(--fs-lg); }
.modal-body { padding: 16px 24px 20px; display: grid; gap: var(--s3); overflow: auto; }
.modal-body label.stack { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); padding: 12px 24px; background: var(--surface-2); border-top: 1px solid var(--line); flex: none; }
.palette { padding: 0; width: min(620px, 94vw); }
.palette-input { font-size: var(--fs-lg); height: 56px !important; padding: 0 20px 0 48px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239C98AE' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 18px center !important; }
.palette-input:focus { outline: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette-list li { display: flex; gap: 10px; align-items: center; height: 40px; padding: 0 12px; border-radius: var(--r-md); cursor: pointer; min-width: 0; }
.palette-list li.active { background: var(--brand-50); }
.palette-list li.active .pi-icon { color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .palette-list li.active { background: rgba(167, 139, 250, .12); } }
.pi-label { font-weight: 500; white-space: nowrap; } .palette-list kbd { margin-left: auto; }
.palette-list .small-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-icon { width: 18px; text-align: center; color: var(--faint); flex: none; }
.picker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px; width: min(420px, 92vw); max-height: 70vh; overflow: auto; }
.picker-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s2); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.picker-row strong { font-weight: 600; }
.picker-row .prod-thumb { vertical-align: middle; margin-right: 6px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px 10px 12px; border-radius: var(--r-lg); font-weight: 500; font-size: var(--fs-base);
  background: #1F1B2E; color: #fff; box-shadow: var(--shadow-lg); animation: toastin .2s cubic-bezier(.2, .8, .2, 1); }
.toast::before { content: ''; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--brand-400) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center no-repeat; }
.toast.bad { background: var(--surface); color: var(--ink); border: 1px solid var(--red-line); box-shadow: var(--shadow-lg); }
.toast.bad::before { background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18.5v.5'/%3E%3C/svg%3E") center no-repeat; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

/* =====================================================================
   Dashboard
   ===================================================================== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3); padding: 0 var(--s6); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 6px; align-content: start; box-shadow: var(--shadow-xs); }
.kpi .lbl { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi strong { font-size: 22px; font-weight: 550; letter-spacing: -.02em; line-height: 1.2; word-break: break-word; font-variant-numeric: tabular-nums; }
.kpi strong.long { font-size: 16px; letter-spacing: -.01em; }
.kpi.good strong { color: var(--green); } .kpi.bad strong { color: var(--red-ink); }
.kpi:first-child { background: linear-gradient(140deg, var(--brand-500), var(--brand-700)); border-color: transparent; color: #fff; }
.kpi:first-child .lbl, .kpi:first-child .muted { color: rgba(255, 255, 255, .82); } .kpi:first-child strong { color: #fff; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: var(--s3); padding: var(--s3) var(--s6) var(--s6); }
.charts .card { margin: 0 !important; padding: 18px 20px; } .chart.wide { grid-column: 1 / -1; }
.charts .card h2 { font-size: var(--fs-base); font-weight: 600; color: var(--ink-2); }
.chart-area { position: relative; height: 240px; }

/* Follow-ups */
.followups { max-width: 1040px; }
.followups .card h2 { font-size: var(--fs-md); }
.fu-list { list-style: none; margin: 0 -12px; padding: 0; }
.fu { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--r-md); flex-wrap: wrap; transition: background .1s; }
.fu + .fu { border-top: 1px solid var(--line-soft); }
.fu:hover { background: var(--surface-2); }
.fu-list .fu { flex-wrap: nowrap; color: var(--ink); }
.fu .row-btns { flex: none; flex-wrap: nowrap; }
.fu-main { flex: 1; flex-wrap: nowrap !important; overflow: hidden; }
.fu-main > * { flex: none; }
.fu-main > .muted { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-main { display: flex; gap: 10px; align-items: center; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; flex-wrap: wrap; padding: 4px 0; min-width: 0; }
.fu-main strong { font-weight: 600; } .fu-main:hover strong { color: var(--brand-700); }
.fu-main .muted { font-size: var(--fs-sm); }

/* =====================================================================
   Data, tables, users, permissions, products
   ===================================================================== */
.data-page { max-width: 1100px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.import-summary { margin: 14px 0 8px; }
.preview-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--s3); }
.plain { width: 100%; border-collapse: collapse; }
.plain th { text-align: left; padding: 0 12px; height: 36px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.plain tbody tr:hover td { background: var(--surface-2); }
.plain tbody tr:last-child td { border-bottom: 0; }
.plain td a { font-weight: 600; color: var(--ink); } .plain td a:hover { color: var(--brand-700); }
.card .plain { border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; margin-top: var(--s3); }
.plain.compact th, .plain.compact td { padding: 5px 8px; font-size: var(--fs-sm); height: auto; }
.plain tr.dup td { background: var(--amber-soft); }
.notice { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--ink-2); border-radius: var(--r-md); padding: 10px 14px; margin-top: 10px; }
.dupe-group { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); padding: 10px 0; flex-wrap: wrap; }
.dupe-group ul { margin: 0; padding-left: 18px; }
.field-list { list-style: none; padding: 0; margin: 0 0 12px; } .field-list li { display: flex; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.field-list .btn { margin-left: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; } .inline-form .field { width: auto; flex: 1 1 180px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: center; }
.form-grid h2 { grid-column: 1 / -1; margin: 0 0 4px; }

/* Org tree */
.org { list-style: none; padding-left: 32px; margin: 0; position: relative; }
.org > li { margin: 8px 0; position: relative; }
.org .org > li::before { content: ''; position: absolute; left: -20px; top: -8px; height: 36px; width: 16px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 8px; }
.org .org > li:not(:last-child)::after { content: ''; position: absolute; left: -20px; top: 26px; bottom: -10px; border-left: 1.5px solid var(--line-strong); }
.org-card { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
.org-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.org-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.org-who strong { font-weight: 600; }
.org-card .row-btns { opacity: .55; transition: opacity .12s; } .org-card:hover .row-btns { opacity: 1; }
.bu-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bu-chip { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); height: 20px; padding: 0 7px; }
@media (prefers-color-scheme: dark) { .bu-chip { background: rgba(167, 139, 250, .16); color: var(--brand-200); border-color: rgba(167, 139, 250, .28); } }
.bu-pick { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 4px 0 2px; }
.bu-pick .check { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.bu-pick .check:hover { border-color: var(--brand-300); background: var(--brand-50); }
@media (prefers-color-scheme: dark) { .bu-pick .check:hover { background: rgba(167, 139, 250, .12); } }
.mod-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mod-chip { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); height: 20px; padding: 0 7px; }
.mod-chip.soon { opacity: .8; }
.mod-chip.muted { background: var(--surface-3); color: var(--muted); border-color: var(--line); }
@media (prefers-color-scheme: dark) { .mod-chip { background: rgba(167, 139, 250, .16); color: var(--brand-200); border-color: rgba(167, 139, 250, .28); } }
.mod-pick { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.mod-pick .check { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.mod-pick .check:hover { border-color: var(--brand-300); background: var(--brand-50); }
.mod-pick .soon-pill { margin-left: auto; }
@media (prefers-color-scheme: dark) { .mod-pick .check:hover { background: rgba(167, 139, 250, .12); } }
.lvl { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-full); font-size: 10.5px; font-weight: 600; background: var(--brand-100); color: var(--brand-800); margin-left: 8px; vertical-align: 1px; }
.lvl.l2 { background: #E0F2FE; color: #075985; } .lvl.l3 { background: #DCFCE7; color: #166534; } .lvl.l4 { background: #FEF3C7; color: #92400E; }
.lvl.inactive { background: var(--surface-3); color: var(--muted); }
.lvl.l5 { background: #EDE9FE; color: #5B21B6; }
.qual-box { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.qual-box h3 { margin: 0; font-size: 15px; }
.qual-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.qual-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #E2E8F0; color: #334155; max-width: 100%; }
.qual-badge.unvetted { background: #FEE2E2; color: #991B1B; }
.qual-badge.partial { background: #FEF3C7; color: #92400E; }
.qual-badge.qualified { background: #DCFCE7; color: #166534; }
.qual-nudge { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FEF3C7; color: #92400E; font-size: 13px; line-height: 1.4; }
.qual-box .check { min-height: 44px; align-items: center; }
.panel-head .qual-badge { margin-top: 6px; }

/* Permission matrix */
.perm-table { border-collapse: separate; border-spacing: 0; width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: var(--s3); }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line-soft); padding: 10px 14px; text-align: left; }
.perm-table thead th { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: var(--topbar-h); z-index: 1; border-bottom-color: var(--line); }
.perm-table thead th:first-child { border-top-left-radius: var(--r-md); } .perm-table thead th:last-child { border-top-right-radius: var(--r-md); }
.perm-table th:not(:first-child), .perm-table td:not(:first-child) { text-align: center; width: 150px; }
.perm-table tbody tr:hover td { background: var(--surface-2); }
.perm-table tbody tr:last-child td { border-bottom: 0; }
.perm-table td strong { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.perm-table input:disabled { opacity: .4; cursor: not-allowed; }

/* Products */
.seg { margin-bottom: 16px; display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r-md); gap: 2px; }
.seg .btn { --h: 28px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }
.seg .btn:hover { color: var(--ink); background: transparent; }
.seg .btn.primary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); font-weight: 600; }
.price-grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.price-grid th, .price-grid td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 8px; vertical-align: top; min-width: 150px; }
.price-grid thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 2; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; height: 36px; vertical-align: middle; border-bottom-color: var(--line); }
.price-grid tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; font-weight: 600; min-width: 210px; vertical-align: middle; box-shadow: 1px 0 0 var(--line); }
.price-grid thead th:first-child { left: 0; z-index: 3; }
.price-grid td .field { height: 30px; font-size: var(--fs-sm); margin-bottom: 4px; padding: 0 8px; box-shadow: none; }
.price-grid td select.field { padding-right: 24px; background-position: right 7px center; }
.price-grid td .field:last-child { margin-bottom: 0; }
.price-grid td select.price-type { font-weight: 600; }
.price-grid tbody tr:hover td, .price-grid tbody tr:hover th { background: var(--surface-2); }
.price-type { font-size: var(--fs-xs); }
.product-hero { display: grid; grid-template-columns: 300px 1fr; gap: 28px; margin-top: 12px; }
.product-hero h2 { font-size: var(--fs-2xl); font-weight: 550; letter-spacing: -.02em; margin-bottom: 8px; }
@media (max-width: 800px) { .product-hero { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery img, .gallery .doc { width: 100%; height: 120px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.gallery .doc { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; padding: 10px; text-align: center; font-size: var(--fs-sm); height: auto; min-height: 90px; color: var(--ink-2); }
.specs { width: 100%; border-collapse: collapse; margin-bottom: 12px; } .specs th, .specs td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.specs th { color: var(--muted); font-weight: 500; width: 40%; }
.coming-soon { text-align: center; padding: 72px 20px !important; display: grid; justify-items: center; gap: 6px; }
.coming-soon h2 { justify-content: center; margin: 10px 0 0; font-size: var(--fs-xl); }

/* =====================================================================
   Login, setup, invite
   ===================================================================== */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 600px at 12% -10%, rgba(167, 139, 250, .38), transparent 60%),
              radial-gradient(900px 520px at 110% 110%, rgba(124, 58, 237, .18), transparent 60%), var(--bg); }
.login-card { width: min(400px, 92vw); display: grid; gap: var(--s5); padding: 40px !important; margin: 0 !important; border-radius: var(--r-xl) !important; box-shadow: none !important; border: 1px solid var(--line) !important; }
.login-card .brand { flex-direction: column; align-items: flex-start; gap: 18px; font-size: 22px; font-weight: 550; letter-spacing: -.02em; white-space: normal; }
.login-card .brand + p { margin: -10px 0 4px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }
.login-card .field { height: 40px; }
.login-card .btn.primary { --h: 40px; width: 100%; margin-top: 4px; font-size: var(--fs-md); }
.login-or { text-align: center; color: var(--muted); margin: 2px 0; font-size: var(--fs-sm); }
.btn.google { width: 100%; justify-content: center; background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 550; }
.btn.google:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--surface); }
.login-card .btn.google { --h: 40px; margin-top: 0; }

.login-foot { text-align: center; font-size: var(--fs-sm); color: var(--muted); margin: -4px 0 0; }
.login-page::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 36px; -webkit-app-region: drag; }

#export-csv[hidden], #export-json[hidden] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app, body.sb-pinned .app { padding-left: 0; }
  .sidebar { width: min(var(--sidebar-w), 86vw); transform: translateX(-102%); box-shadow: none; z-index: 45; }
  .sidebar.expanded { width: min(var(--sidebar-w), 86vw); transform: none; box-shadow: var(--shadow-lg); }
  .sidebar .sb-btn { display: none; }
  .sb-backdrop { z-index: 44; }
  .sb-menu { display: inline-grid; }
  .topbar { padding: 0 12px; } .card { margin: 0 12px 12px; } .toolbar { padding: 0 12px 12px; } .sheet-wrap { margin: 0 12px 12px; }
  .kpis, .charts, .board { padding-left: 12px; padding-right: 12px; }
  .toolbar input[type=search] { min-width: 0; flex: 1 1 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(7, 78vw) !important; }
  .page-head .muted, .save-state .ss-text, .btn.primary kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Soft “Needs BU” flag for leads missing a business unit (not blocking). */
.needs-bu-flag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: var(--r-full); background: var(--amber-soft); color: var(--amber);
  border: 1px solid var(--amber-line); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.sheet td.needs-bu { background: var(--amber-soft); }
.sheet td.needs-bu select { font-weight: 600; }
.bu-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bu-cell select { flex: 1; min-width: 0; }
.sheet tr.draft { box-shadow: inset 3px 0 0 var(--brand-400); }
.stack.needs-bu .field { border-color: var(--amber-line); background: var(--amber-soft); }


/* Compact SPOC cell, last-edited / latest-update, status updates, columns picker */
.sheet th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; }
.sheet td { overflow: hidden; }
.sheet-wrap.has-extra-cols { overflow-x: auto; }
.sheet td.spoc { height: 52px; vertical-align: middle; }
.sheet td.spoc .spoc-cell { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; height: 51px; padding: 4px 8px; box-sizing: border-box; }
.sheet td.spoc input { height: 20px; padding: 0; font-weight: 600; line-height: 20px; }
.sheet td.spoc input:hover, .sheet td.spoc input:focus { box-shadow: none; background-color: transparent; }
.sheet td.spoc:hover input, .sheet td.spoc input:focus { background-color: var(--brand-25); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sheet td.spoc input:focus { box-shadow: var(--ring-inset); background-color: var(--surface); }
.sheet td.spoc .spoc-sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sheet td.latest-update { color: var(--ink-2); font-size: var(--fs-sm); }
.sheet td.last-edited { color: var(--muted); font-size: var(--fs-sm); }
.sheet td.last-edited .last-edited-inner { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.sheet td.last-edited .last-edited-date { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sheet td.last-edited .file-count { flex: none; color: var(--brand-700); opacity: 1; }
.sheet td.last-edited .file-count.is-empty { color: var(--faint); font-weight: 500; }
.sheet td.actions .icon { width: 24px; height: 24px; }
.sheet td.actions .icon.add-update { opacity: 1; color: var(--brand-600); }
.sheet td.actions .icon.add-update:hover { color: var(--brand-700); background: var(--brand-50); }
.sheet td.actions .icon.add-update .ico, .sheet td.actions .icon.add-update svg { width: 14px; height: 14px; display: block; }

.updates-section { margin-top: 18px; padding-top: 8px; }
.updates-section h3 { margin: 0 0 10px; font-size: var(--fs-md); color: var(--ink); }
.update-form { display: grid; gap: 10px; padding: 12px; margin-bottom: 14px; background: var(--brand-25); border: 1px solid var(--brand-100); border-radius: var(--r-lg); }
.update-form #update-date { background: var(--surface-2); color: var(--muted); cursor: default; }
.update-form .btn { justify-self: start; }
.update-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.update-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.update-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.update-top strong { font-size: var(--fs-sm); }
.update-note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.update-change { margin-top: 4px; }
.status-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-full); font-size: 11px; font-weight: 600; background: color-mix(in srgb, currentColor 14%, transparent); }

.col-picker { display: grid; gap: 8px; }
.col-picker .check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-md); }
.col-picker .check:hover { background: var(--brand-25); }

.sheet tfoot td { overflow: visible; height: auto; }
.sheet tfoot .total { padding-top: 8px; padding-bottom: 8px; height: auto; min-height: 42px; overflow: visible; }
.total-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.total-line { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.total-amount { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; width: max-content; }
.total-words { font-weight: 500; font-size: var(--fs-xs); line-height: 1.4; white-space: pre-line; max-width: min(420px, 70vw); width: max-content; text-wrap: pretty; color: var(--muted); text-align: right; }
.sheet tfoot .total-stack, .sheet tfoot .total-line { position: relative; z-index: 1; }
.kpi .total-stack { align-items: flex-start; gap: 10px; }
.kpi .total-amount { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.kpi .total-words { margin-top: 0; max-width: 100%; }


/* Full-text tooltip and click-to-expand editors (portaled; cells clip overflow). */
.sheet-tip {
  position: fixed; z-index: 200; max-width: 360px; padding: 8px 10px;
  background: var(--ink); color: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: var(--fs-sm); line-height: 1.4;
  white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none;
  animation: pop .1s ease-out;
}
@media (prefers-color-scheme: dark) {
  .sheet-tip { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); }
}
.sheet-editor-overlay {
  position: fixed; z-index: 190; margin: 0; box-sizing: border-box;
  padding: 8px 10px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--brand-300);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  outline: none; resize: none; overflow: auto; line-height: 1.4;
  min-width: 160px; max-width: min(520px, calc(100vw - 16px));
}
.sheet-editor-overlay:focus { box-shadow: var(--shadow-lg), var(--ring-inset); }
.latest-update-pop {
  position: fixed; z-index: 200; width: min(360px, calc(100vw - 16px));
  background: var(--surface); background-color: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 12px 14px 12px; display: grid; gap: 8px; animation: pop .12s ease-out;
  isolation: isolate;
}
.latest-update-pop .update-note { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.latest-update-pop .update-top { margin: 0; }
.latest-update-pop .pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sheet td.latest-update { cursor: pointer; }
.sheet td.latest-update:focus, .sheet td.last-edited:focus { outline: none; box-shadow: var(--ring-inset); }


/* Sales Logs */
.sl-toolbar { padding: 0 var(--s6) var(--s3); flex-wrap: wrap; }
.sl-wrap { margin: 0 var(--s6) var(--s6); overflow-x: auto; }
table.sales-logs-sheet { table-layout: fixed; width: 100%; }
table.sales-logs-sheet td, table.sales-logs-sheet th { overflow: hidden; }
table.sales-logs-sheet .field { font-size: 12px; padding-left: 4px; padding-right: 4px; }
table.sales-logs-sheet .sl-month { text-overflow: clip; }
table.sales-logs-sheet td input, table.sales-logs-sheet td select { text-overflow: clip; }
table.sales-logs-sheet .sl-money { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
table.sales-logs-sheet .sl-money .field { min-width: 0; }
table.sales-logs-sheet .sl-ccy { width: 58px; flex: none; }
table.sales-logs-sheet td.deal-open, table.sales-logs-sheet .sl-money-show { text-overflow: clip; }
.sl-money-show { display: block; width: 100%; border: 0; background: none; padding: 0 2px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; cursor: text; color: inherit; }
.sl-money-show:disabled { cursor: default; }
.sl-chassis { display: block; width: 100%; min-width: 0; }
.sl-chips { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; width: 100%; min-width: 0; }
.sl-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 6px; font-size: 10px; line-height: 18px; height: 20px; white-space: nowrap; max-width: none; }
.sl-chip-num { white-space: nowrap; }
.sl-chip .chip-x { border: 0; background: none; cursor: pointer; padding: 0 1px; color: inherit; font-size: 11px; line-height: 1; }
.sl-batt { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; }
.sl-batt-btn { width: 16px; height: 16px; padding: 0; border: 0; background: none; color: #9ca3af; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.sl-batt-btn .ico { width: 12px; height: 12px; }
.sl-batt-btn.on, .sl-chip.has-batt .sl-batt-btn { color: #6d28d9; }
.sl-batt-btn:disabled { cursor: default; opacity: .7; }
.sl-chip-more { font-size: 10px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 0 6px; height: 20px; cursor: pointer; color: var(--brand-700); white-space: nowrap; font-weight: 600; }
.sl-chassis-tools { display: flex; gap: 4px; align-items: center; min-height: 20px; flex: 0 0 auto; }
.sl-all-batt { font-size: 10px; height: 20px; padding: 0 6px 0 4px; border-radius: 999px; border: 1px solid var(--brand-200); background: #fff; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; color: inherit; }
.sl-all-batt .ico { width: 12px; height: 12px; }
.sl-all-batt.on { background: var(--brand-50); color: #5b21b6; border-color: var(--brand-200); }
.sl-chip-input { min-width: 48px; flex: 1; height: 20px; font-size: 11px; }
.sl-flag { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
tr.sl-group td { background: var(--brand-50); font-weight: 600; }
tr.sl-subtotal td, tr.sl-total td { background: var(--surface-2, #faf9fc); overflow: visible; height: auto; }
.sl-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; width: 100%; }
.sl-summary-meta { display: flex; flex-direction: column; gap: 2px; flex: none; }
.sl-summary-qty { color: var(--muted); font-size: var(--fs-xs); }
.sl-summary-stack { margin-left: auto; text-align: right; min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sl-summary-line { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; width: 100%; }
.sl-summary-line .total-amount { width: auto; }
.sl-summary-line .total-words { max-width: 100%; width: 100%; white-space: normal; overflow-wrap: break-word; text-align: right; }
.sl-rate-warn { color: #92400e; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 4px 8px; font-size: 12px; margin-top: 4px; max-width: 28rem; text-align: right; }
tr.sl-warn { box-shadow: inset 3px 0 0 #f59e0b; }
.sl-actions-col { width: 36px; text-align: center; overflow: visible !important; }
.sl-kebab { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 8px; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.sl-kebab:hover { background: var(--brand-50); }
.sl-menu, .sl-chip-pop { position: fixed; z-index: 80; background: var(--surface, #fff); border: 1px solid var(--line, var(--brand-200)); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,16,30,.14); padding: 6px; min-width: 140px; }
.sl-chip-pop { min-width: 220px; max-width: 360px; max-height: 280px; overflow: auto; }
.sl-chip-pop-title { font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 4px 6px; }
.sl-chips-full { max-height: none; }
.sl-menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.sl-menu-item:hover { background: var(--brand-50); }
.sl-menu-item.danger { color: #b91c1c; }
.sl-preview { max-height: 360px; overflow: auto; }

/* Management — pastel purple */
.mgmt { padding: 4px var(--s6) var(--s8); display: flex; flex-direction: column; gap: 16px; }
.mgmt-year { width: 96px; max-width: 96px; flex: none; }
.mgmt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mgmt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: none; overflow: visible; min-width: 0; }
.mgmt-card h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 550; }
.mgmt-kpi { font-size: 28px; font-weight: 550; color: var(--ink); letter-spacing: -0.03em; }
.mgmt-card .total-stack { align-items: flex-start; max-width: 100%; }
.mgmt-card .total-line { max-width: 100%; align-items: flex-start; }
.mgmt-card .total-words { max-width: 100%; width: 100%; white-space: normal; overflow-wrap: break-word; text-align: left; }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.mgmt-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .mgmt-grid-2 { grid-template-columns: 1fr; } }
.mgmt-chart { height: 168px; }
.mgmt-table { width: 100%; table-layout: fixed; }
.mgmt-table th, .mgmt-table td { overflow: hidden; }
.mgmt-table .mgmt-name, .mgmt-table td.mgmt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgmt-table .mgmt-amount, .mgmt-table td.mgmt-amount { font-variant-numeric: tabular-nums; overflow: visible; white-space: normal; }
.mgmt-table th.num, .mgmt-table td.num { width: 30%; }
.mgmt-amount-line { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.mgmt-placeholder { border-style: dashed; background: var(--surface-2); min-height: 88px; }
@media (prefers-color-scheme: dark) {
  .mgmt-card { background: linear-gradient(180deg, rgba(139,92,246,.12), rgba(20,16,30,.6)); }
  .mgmt-kpi, .mgmt-card h3 { color: var(--brand-200); }
}

/* BU code + optional name */
.bu-stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; line-height: 1.2; pointer-events: none; }
.bu-code { font-weight: 600; white-space: nowrap; }
.bu-name { font-size: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-weight: 500; }
.bu-cell { position: relative; min-width: 0; width: 100%; min-height: 28px; display: flex; flex-direction: column; justify-content: center; }
.bu-cell-select, table.sales-logs-sheet .bu-cell-select, .sheet td .bu-cell-select,
table.sales-logs-sheet select.field.bu-cell-select, .sheet td select.bu-cell-select {
  position: absolute; inset: 0; width: 100%; height: 100% !important; opacity: 0 !important; cursor: pointer; margin: 0; padding: 0; background-image: none;
}
table.sales-logs-sheet .sl-chip-input.field,
table.sales-logs-sheet input.sl-chip-input,
table.sales-logs-sheet .sl-all-batt {
  height: 20px; min-height: 20px; padding-top: 0; padding-bottom: 0; font-size: 11px;
}
.bu-cell:focus-within { border-radius: 6px; box-shadow: var(--ring-inset); }
.sl-preview-bu { min-width: 72px; }
.sl-preview-bu .bu-stack { pointer-events: auto; }
.sl-preview-skip { background: #fff7ed; }
.sl-preview-pick { background: var(--surface-2); }
.sl-preview-summary { font-weight: 600; }
.sl-preview-table { width: 100%; }
.sl-preview-table td, .sl-preview-table th { overflow: hidden; }
.bu-editor-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.bu-editor-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 88px auto auto; gap: 8px; align-items: center; }
.bu-editor-head { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; padding: 0 2px; }
.bu-editor-row .btn { white-space: nowrap; }
.bu-settings { padding-bottom: 8px; border-bottom: 1px solid var(--line, #E6E8EC); margin-bottom: 8px; }
.bu-editor > .btn { align-self: start; width: auto; }
.bu-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.price-grid thead th .bu-stack { align-items: flex-start; }
table.sales-logs-sheet .sl-bu { text-overflow: clip; }
.mgmt-table td .bu-stack { max-width: 100%; }

.mgmt-banner, .mgmt-rate-warn { color: #92400e; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.mgmt-banner { margin: 0 0 12px; }
.mgmt-rate-warn { margin-top: 6px; padding: 4px 8px; }
.mgmt-kpi-aop { font-size: 22px; line-height: 1.25; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgmt-aop-kpi { min-width: 0; margin-bottom: 12px; }
.mgmt-aop .mgmt-aop-wrap { overflow-x: auto; }
.aop-table { min-width: 720px; }
.aop-table th.num, .aop-table td.num { width: 12%; }
.aop-table tr.aop-ahead td { }
.aop-table tr.aop-behind td.aop-pace { }
.aop-table tr.aop-total { font-weight: 600; background: var(--surface-2); }
.aop-table tr.aop-unplanned td { font-style: italic; }
.aop-pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; text-transform: capitalize; }
.aop-pill.ahead, .aop-table tr.aop-ahead .aop-pill { background: #dcfce7; color: #166534; }
.aop-pill.behind, .aop-table tr.aop-behind .aop-pill { background: #fee2e2; color: #991b1b; }
.aop-table tr.aop-ahead { background: #f0fdf4; }
.aop-table tr.aop-behind { background: #fef2f2; }
.mgmt-aop-chart { height: 200px; margin-top: 12px; }
.aop-group-ed { border: 1px solid var(--brand-200); border-radius: 12px; padding: 10px 12px; background: #faf8ff; }
.aop-groups { gap: 10px; }

.mod-subs { margin: 2px 0 6px 24px; display: flex; gap: 14px; flex-wrap: wrap; }
.mod-item { margin-bottom: 2px; }

.prod { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.prod-toolbar { flex-wrap: wrap; gap: 8px; }
.prod-month { width: 150px; max-width: 150px; flex: none; }
.prod-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.prod-filter { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.prod-filter.on { background: var(--surface); color: var(--brand-700); border-color: var(--brand-400); }
.prod-badge { min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.prod-filter.on .prod-badge { background: var(--brand-50); color: var(--brand-700); }
.prod-sticky { position: sticky; top: 0; z-index: 3; background: var(--bg, #f8f6ff); padding: 8px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.prod-util { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; background: var(--surface); }
.prod-util-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.prod-util-label strong { font-size: 22px; color: var(--ink); font-weight: 550; letter-spacing: -0.03em; }
.prod-util-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.prod-util-fill { height: 100%; border-radius: 999px; background: var(--brand-400); }
.prod-util.tone-amber .prod-util-fill { background: #d97706; }
.prod-util.tone-amber { border-color: #fcd34d; background: #fffbeb; }
.prod-util.tone-over .prod-util-fill { background: #dc2626; }
.prod-util.tone-over { border-color: #fecaca; background: #fef2f2; }
.prod-util.tone-over .prod-util-label strong { color: #991b1b; }
.prod-warn { margin-top: 6px; font-size: 12px; color: #991b1b; }
.prod-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.prod-strip-m { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 2px; font-size: 10px; text-align: center; cursor: pointer; color: var(--ink-2); min-width: 0; }
.prod-strip-m.on { border-color: var(--brand-400); box-shadow: inset 0 0 0 1px var(--brand-400); }
.prod-strip-lab { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.prod-strip-n { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-strip-m.tone-amber { background: #fffbeb; }
.prod-strip-m.tone-over { background: #fef2f2; color: #991b1b; }
.prod-sheet-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.prod-sheet { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
table.prod-sheet th, table.prod-sheet td { border-bottom: 1px solid var(--line); padding: 4px 6px; vertical-align: middle; }
table.prod-sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11px; font-weight: 550; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); height: 32px; }
.prod-col-slot { width: 78px; }
.prod-col-prod { width: 168px; }
.prod-col-ch { width: 150px; }
.prod-col-date { width: 132px; }
.prod-col-po { width: 110px; }
.prod-col-cust { width: 150px; }
.prod-col-qc { width: 92px; }
.prod-col-notes { width: auto; }
table.prod-sheet .field { font-size: 12px; padding: 3px 5px; width: 100%; min-width: 0; }
tr.is-open td { color: #64748b; }
tr.is-overdue { background: #fff1f2; }
tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 #e11d48; }
.prod-code { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.prod-open { display: block; font-size: 10px; color: #94a3b8; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.prod-ch-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.prod-ch-wrap .field { flex: 1; }
.prod-sold { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #dbeafe; color: #1d4ed8; border-radius: 999px; padding: 1px 6px; cursor: pointer; }
.prod-qc { border: 0; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: #f1f5f9; color: #475569; }
.prod-qc.qc-pending { background: #f1f5f9; color: #475569; }
.prod-qc.qc-in_qc { background: #ede9fe; color: #5b21b6; }
.prod-qc.qc-passed { background: #dcfce7; color: #166534; }
.prod-qc.qc-failed { background: #fee2e2; color: #991b1b; }
.prod-qc.overdue { box-shadow: 0 0 0 1px #e11d48; }
.prod-qc:disabled { opacity: 1; cursor: default; }
.prod-acc { margin-top: 14px; padding-top: 8px; }
.prod-acc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prod-acc h3 { margin: 0; font-size: 14px; color: var(--ink); font-weight: 550; }
.prod-acc-table { width: 100%; }
@media (max-width: 1280px) {
  .prod-util-label strong { font-size: 18px; }
}

/* Production tracker tabs and admin UI */
.prod-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.prod-tab { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.prod-tab:hover { background: var(--surface-2); color: var(--ink); }
.prod-tab.on { background: transparent; color: var(--brand-700); box-shadow: inset 0 -2px 0 var(--brand-500); border-radius: 0; }
.tracker-sheet .tr-row.on td { background: var(--sel); }
.tracker-sheet .linkish { background: none; border: 0; padding: 0; color: var(--brand-700); font: inherit; font-weight: 650; cursor: pointer; }
.tracker-sheet .linkish:hover { text-decoration: underline; }
table.tracker-sheet { table-layout: auto; }
.tr-mini { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.tr-mini-track { width: 64px; height: 8px; border-radius: 99px; background: var(--brand-100); flex: none; overflow: hidden; }
.tr-mini-fill { height: 100%; border-radius: 99px; background: var(--brand-500); }
.tr-mini span { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ord-tracker { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 9rem; max-width: 14rem; }
.ord-tracker .stage-lab { font-size: var(--fs-sm); color: var(--ink-2); }
.tr-order-meta, .tr-access-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.tr-access-prompt { padding: 8px 12px; background: var(--surface-2, #F4F5F7); border: 1px solid var(--line, #E6E8EC); border-radius: 8px; }
.tr-access-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--surface-2, #F4F5F7); border: 1px solid var(--line, #E6E8EC); border-radius: 8px; }
.tr-cust-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr-cust-chip { background: var(--surface); border: 1px solid var(--line, #E6E8EC); color: var(--ink-2); height: auto; min-height: 22px; padding: 2px 8px; }
.tr-cust-chip.muted { color: var(--muted); }

.tr-access-prompt .msg { color: var(--ink-2); font-size: var(--fs-sm); }
.tr-dispatch-hint { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

.tr-detail { margin-top: 16px; padding: 18px 20px 24px; border: 1px solid var(--brand-200); border-radius: 12px; background: #fff; }
.tr-detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.tr-detail-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.tr-meta { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 18px; }
.tr-meta label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 180px; }
.tr-meta label.tr-export { align-items: start; max-width: 420px; }
.tr-optional-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--muted); }
tr.tr-stage-optional td { opacity: 0.78; }
.tr-section { margin-top: 18px; }
.tr-section h3 { margin: 0 0 8px; font-size: 15px; color: var(--brand-800); }
table.tr-stages { table-layout: auto; }
table.tr-stages tr.st-done td { background: #f0fdf6; }
table.tr-stages tr.st-in_progress td { background: #f5f3ff; }
.tr-tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tr-tmpl { padding: 16px; }
.tr-tmpl-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tr-tmpl h3 { margin: 0 0 4px; font-size: 16px; }
.tr-tmpl-edit { min-width: 0; }
.tr-sec-edit { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.tr-st-edit { display: grid; grid-template-columns: 72px 1.2fr 1.6fr auto; gap: 6px; align-items: center; }
.modal-card.tr-tmpl-modal {
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  max-height: min(80vh, calc(100dvh - 24px));
  box-sizing: border-box;
}
.tr-tmpl-modal .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 8px;
}
.tr-tmpl-modal .tr-tmpl-edit {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: none;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.tr-tmpl-list {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tr-tmpl-tools {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.tr-stage-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tr-stage-row .field { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.tr-stage-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.tr-stage-btns { display: flex; gap: 2px; flex: none; }
.tr-stage-row.dragging { opacity: .55; }
.tr-tmpl-paste, .tr-tmpl-adv { display: none; gap: 8px; min-width: 0; }
.tr-tmpl-paste.on, .tr-tmpl-adv.on { display: grid; }
.tr-tmpl-paste-area { width: 100%; min-width: 0; min-height: 120px; height: auto; padding: 8px 10px; resize: vertical; box-sizing: border-box; }
.tr-tmpl-paste-preview { margin: 0; padding-left: 1.25rem; }
.tr-st-adv { display: grid; gap: 4px; min-width: 0; }
.tr-date-cell { min-width: 0; }
.tr-date-cell .tr-stage-value { margin-top: 6px; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Order Platform, queue, logistics, nav badges */
.nav-badge { margin-left: auto; background: var(--surface); color: var(--brand-700); border: 1px solid var(--brand-300); font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; }
.ord { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.ord > *:not(.toolbar):not(.sl-toolbar),
.prod > *:not(.toolbar):not(.sl-toolbar):not(.prod-tabs) {
  margin-left: var(--s6);
  margin-right: var(--s6);
}
.prod-tabs { padding-left: var(--s6); padding-right: var(--s6); }
.ord-line-edit { /* value column added in a later rule */ }
.ord-form-total, .ord-total { margin: 4px 0 0; }
.ord-line-value { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.ord h3 { margin: 8px 0 4px; font-size: 15px; color: var(--brand-800); }
.ord-sheet tr.ord-row { cursor: pointer; }
.ord-sheet tr.ord-row:hover td { background: var(--sel); }
.ord-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--brand-100); color: var(--brand-800); }
.ord-pill.st-draft { background: var(--surface-3); color: var(--muted); }
.ord-pill.st-submitted, .ord-pill.st-approved { background: var(--brand-100); color: var(--brand-800); }
.ord-pill.st-changes_requested { background: var(--amber-soft); color: var(--amber); }
.ord-pill.st-acknowledged, .ord-pill.st-queued { background: var(--brand-50); color: var(--brand-700); }
.ord-pill.st-slotted, .ord-pill.st-in_production { background: #eef2ff; color: #3730a3; }
.ord-pill.st-qc { background: var(--amber-soft); color: var(--amber); }
.ord-pill.st-dispatched { background: var(--green-soft); color: var(--green); }
.ord-tl { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0 16px; padding: 0; }
.ord-tl-step { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 24px 8px 0; position: relative; min-width: 110px; }
.ord-tl-step:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 10px; width: calc(100% - 10px); height: 2px; background: var(--brand-100); }
.ord-tl-dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--brand-200); background: #fff; z-index: 1; }
.ord-tl-step.is-done .ord-tl-dot { background: var(--green); border-color: var(--green); }
.ord-tl-step.is-current .ord-tl-dot { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(124, 58, 237, .18); background: var(--brand-600); }
.ord-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; }
.ord-meta label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ord-meta p { margin: 4px 0 0; }
.ord-address { white-space: pre-wrap; }
.ord-stamp { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ord-history { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ord-history li { display: grid; grid-template-columns: minmax(9rem, auto) minmax(7rem, auto) minmax(9rem, auto) 1fr; gap: 6px 16px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ord-history li .ord-stamp { margin: 0; }
@media (max-width: 640px) {
  .ord-history li { grid-template-columns: 1fr; gap: 2px; }
}
.ord-reason { background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 10px; padding: 10px 12px; }
.ord-line-edit { display: grid; grid-template-columns: 1fr 90px minmax(9rem, auto) auto; gap: 8px; align-items: center; }
.ord-lines { margin: 0; padding-left: 18px; }
.prod-from-q { font-size: 11px; }
.prod-queued-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-100); border-radius: 99px; padding: 1px 6px; }
input[type="date"].field, input.date-field[type="date"] {
  min-width: 10.5rem; max-width: 14rem; color-scheme: light;
}
.tr-date-range { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tr-date-range .to-lab { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.tr-date-cell { min-width: 0; }
.tr-date-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tr-saved { font-size: 12px; font-weight: 600; color: var(--green, #047857); opacity: 0; transition: opacity .15s; pointer-events: none; }
.tr-saved.on { opacity: 1; }
.tr-date-legacy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tr-date-legacy .legacy-text { color: var(--ink-2); font-size: var(--fs-sm); }




.modal-card.tr-copy-modal {
  width: min(640px, calc(100vw - 32px));
  max-width: 640px;
  max-height: min(80vh, calc(100dvh - 24px));
  box-sizing: border-box;
}
.tr-copy-modal .modal-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tr-copy-form { min-width: 0; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.tr-copy-preview { display: grid; gap: 12px; flex: 1 1 auto; min-height: 0; overflow: auto; }
.tr-copy-tgt { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.tr-copy-tgt h3 { margin: 0 0 8px; font-size: 14px; }
.tr-copy-diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-copy-diff th, .tr-copy-diff td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tr-copy-diff td.from { color: var(--muted); }
.tr-copy-diff td.to { font-weight: 600; }
.tr-copy-pick { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.tr-copy-dispatch { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 13px; }
.tr-copy-errors .error, .tr-copy-form .error { color: var(--red-ink, #B91C1C); margin: 0; }


.tr-share { margin-top: 16px; display: grid; gap: 10px; min-width: 0; }
.tr-share h3 { margin: 0; font-size: 16px; }
.tr-share-text { width: 100%; min-width: 0; min-height: 160px; height: auto; padding: 10px 12px; resize: vertical; box-sizing: border-box; line-height: 1.45; }

/* ---------- iPhone / small phones ---------- */
/* Desktop (≥641px) is unchanged. These rules only apply at phone widths. */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .app, #view, .main, .prod, .ord, .sl, .mgmt { min-width: 0; max-width: 100%; }
  .app, body.sb-pinned .app { padding-left: 0; }

  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    height: auto; min-height: calc(44px + env(safe-area-inset-top, 0px));
    flex-wrap: wrap; row-gap: 8px;
  }
  .sb-menu { width: 44px; height: 44px; min-width: 44px; min-height: 44px; place-items: center; }
  .page-head h1 { font-size: 18px; white-space: normal; }
  .top-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .top-right .btn { min-height: 44px; height: auto; }
  .top-right kbd, #quick-add { display: none; }
  #add { padding: 0 12px; }

  .btn, .btn.small, .btn.tiny, .icon, .prod-tab, .module-nav a, .mod-subnav a,
  .side-foot .btn.ghost, .search-btn {
    min-height: 44px; min-width: 44px; height: auto;
  }
  .module-nav a, .mod-subnav a { padding: 0 12px; }

  .field, input.field, select.field, textarea.field,
  .toolbar input, .toolbar select, .login-card .field,
  input[type="date"], input[type="email"], input[type="password"], input[type="search"],
  input[type="text"], input[type="number"], select, textarea,
  .sheet td input, .sheet td select, table.prod-sheet .field {
    font-size: 16px !important;
    min-height: 44px;
    height: auto;
  }
  textarea.field { min-height: 88px; }
  .qual-box { padding: 12px; }
  .qual-box .check { font-size: 16px; }
  .qual-nudge { font-size: 14px; }
  input[type="date"].field, input.date-field[type="date"] {
    min-width: 0; max-width: 100%; width: 100%;
  }
  .tr-date-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 100%; }
  .tr-meta label { min-width: 0; width: 100%; }
  .tr-st-edit { grid-template-columns: 1fr; }

  .toolbar { padding: 8px 12px 12px; gap: 8px; }
  .toolbar input, .toolbar select { max-width: none; min-width: 0; flex: 1 1 100%; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
  .card, .toolbar, .bulkbar, .kpis, .charts, .board, .sheet-wrap { margin-left: 12px; margin-right: 12px; }
  .pad { padding-left: 12px; padding-right: 12px; }

  .sheet-wrap, .sheet-wrap.has-extra-cols, .prod-sheet-wrap {
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100% - 24px);
    margin-left: 12px; margin-right: 12px;
  }
  table.sheet, table.prod-sheet, table.ord-sheet, table.sales-logs-sheet,
  table.tracker-sheet, table.tr-stages {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  table.prod-sheet th, table.prod-sheet td, table.ord-sheet th, table.ord-sheet td,
  table.tracker-sheet th, table.tracker-sheet td, table.tr-stages th, table.tr-stages td {
    white-space: nowrap;
  }
  .sheet th:first-child, .sheet td:first-child,
  .prod-sheet th:first-child, .prod-sheet td:first-child,
  .ord-sheet th:first-child, .ord-sheet td:first-child,
  table.tr-stages th:first-child, table.tr-stages td:first-child {
    position: sticky; left: 0; z-index: 3;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }
  .sheet th:first-child, .prod-sheet th:first-child, .ord-sheet th:first-child, table.tr-stages th:first-child {
    background: var(--surface-2); z-index: 4;
  }

  .modal { padding: 0; place-items: stretch; overflow: hidden; }
  .modal-card {
    width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;
    border-radius: 0 !important; margin: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; flex-direction: column;
  }
  .modal-card.tr-tmpl-modal, .modal-card.tr-copy-modal {
    width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;
  }
  .modal-body { flex: 1; }

  .login-page {
    padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  }
  .login-card { width: min(400px, 100%); padding: 28px 20px !important; }
  .login-card .field, .login-card .btn.primary, .login-card .btn.google { min-height: 44px; height: auto; font-size: 16px !important; }

  .board { grid-template-columns: repeat(7, 78vw) !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .grid2, .mgmt-grid-2, .product-hero { grid-template-columns: 1fr; }
  .ord-tl { flex-wrap: wrap; }
  .ord-meta { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ord > *:not(.toolbar):not(.sl-toolbar),
  .prod > *:not(.toolbar):not(.sl-toolbar):not(.prod-tabs) {
    margin-left: var(--s3);
    margin-right: var(--s3);
  }
  .prod-tabs { padding-left: var(--s3); padding-right: var(--s3); }
  .bu-editor-row { grid-template-columns: 1fr; }
  .tr-detail { padding: 14px 12px 20px; }
  .tr-detail-head h2 { font-size: 18px; }
  .prod-tabs { gap: 2px; }
  .prod-tab { min-height: 44px; padding: 10px 12px; }

  .sidebar {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  .panel {
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Keep the existing <900px drawer, but make the hamburger easy to tap on phones too. */
@media (max-width: 900px) {
  .sb-menu { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}

/* In-app notifications + Settings backups */
.sb-notif { position: relative; }
.sb-notif .nav-badge { margin-left: auto; }
.sidebar:not(.expanded) .sb-notif .lab { display: none; }
.sidebar:not(.expanded) .sb-notif .nav-badge {
  position: absolute; top: 0; right: 2px; margin-left: 0; min-width: 16px; height: 16px;
  font-size: 9px; padding: 0 4px;
}
.notif { display: flex; flex-direction: column; gap: 12px; padding: 8px var(--s6) 24px; min-height: 0; flex: 1; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notif-head p { margin: 0; }
.notif-list { display: grid; gap: 8px; }
.notif-item {
  display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
}
.notif-item:hover { border-color: var(--brand-300); }
.notif-item.unread { border-color: var(--brand-300); background: var(--brand-100, var(--sel)); }
.notif-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.notif-type { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-800); }
.notif-item-title { font-weight: 600; }
.notif-empty { padding: 24px; }
.backup-history { width: 100%; border-collapse: collapse; font-size: 13px; }
.backup-history th, .backup-history td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
