/* ============================================================
   Top Notch  -  Operations CRM (visual mockup)
   Design system: graphite "cockpit", brand-green accent locked.
   Brand source: Top Notch logo mark #20A050 (live site).
   Type: Geist + Geist Mono.  Icons: Phosphor.
   Locks: one accent (green), one neutral temperature (cool graphite),
          one radius rule (panel 14 / control 9 / chip pill),
          one theme family per mode (dark default, light variant).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --brand: #2fbe63;          /* logo green, lifted for dark legibility (fills/icons) */
  --brand-text: #43d178;     /* green used AS text/links (AA on dark surfaces) */
  --brand-strong: #1f9e4d;   /* hover / pressed depth */
  --brand-deep: #14723a;     /* lines on brand fills */
  --brand-soft: rgba(47, 190, 99, 0.12);
  --brand-softer: rgba(47, 190, 99, 0.07);
  --on-brand: #05210f;       /* text on green fills (AA on green) */

  /* graphite neutrals (cool) */
  --bg: #0e1217;
  --bg-grad-1: #11161d;
  --bg-grad-2: #0c1015;
  --surface: #151b23;        /* panels */
  --surface-2: #1a212b;      /* raised / hover */
  --surface-3: #202935;      /* input wells, headers */
  --line: #262f3b;           /* hairlines */
  --line-soft: #1e2630;

  --text: #e9edf2;
  --text-dim: #9aa6b4;
  --text-faint: #8b95a2;     /* AA >=4.5:1 on panels for real metadata copy */
  --text-ghost: #7c8694;     /* nav-group labels / faint affordances, still legible */

  /* semantic (used sparingly, muted) */
  --ok: #2fbe63;
  --ok-soft: rgba(47, 190, 99, 0.14);
  --warn: #e2a73f;
  --warn-soft: rgba(226, 167, 63, 0.14);
  --warn-text: #f0c073;
  --danger: #e8654c;
  --danger-soft: rgba(232, 101, 76, 0.15);
  --danger-text: #f49a86;
  --info: #5aa9e6;
  --info-soft: rgba(90, 169, 230, 0.14);
  --info-text: #8fc6f0;

  /* radius rule (locked): panels / controls / chips, plus two inset tiers */
  --r-panel: 14px;
  --r-control: 9px;
  --r-chip: 999px;
  --r-inset: 7px;
  --r-icon: 10px;   /* icon tiles */
  --r-tile: 8px;    /* small cards, thumbnails, job blocks */

  /* elevation (tinted, never pure black) */
  --shadow-sm: 0 1px 2px rgba(4, 7, 11, 0.5);
  --shadow-md: 0 8px 24px -10px rgba(4, 7, 11, 0.7);
  --shadow-lg: 0 24px 60px -22px rgba(3, 6, 10, 0.85);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);   /* solid, >=3:1 focus indicator */

  /* layout */
  --sidebar-w: 248px;
  --topbar-h: 62px;
  --maxw: 1480px;

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="light"] {
  --brand: #15823d;          /* darkened so white button text clears AA (4.9:1) */
  --brand-text: #117336;     /* green links/numbers: AA 4.5:1 on white */
  --brand-strong: #0f6f33;
  --brand-deep: #0c5b2a;
  --brand-soft: rgba(21, 130, 61, 0.10);
  --brand-softer: rgba(21, 130, 61, 0.06);
  --on-brand: #ffffff;

  --bg: #eef1f5;
  --bg-grad-1: #f3f5f8;
  --bg-grad-2: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef1f5;
  --line: #dde2e9;
  --line-soft: #e7ebf0;

  --text: #15202b;
  --text-dim: #5a6675;
  --text-faint: #69757f;     /* AA >=4.5:1 on white */
  --text-ghost: #6f7a89;

  --ok-soft: rgba(21, 130, 61, 0.12);
  --warn: #b5740f;
  --warn-soft: rgba(181, 116, 15, 0.12);
  --warn-text: #855508;
  --danger: #d24b30;
  --danger-soft: rgba(210, 75, 48, 0.10);
  --danger-text: #b53a22;
  --info: #2f7fc0;
  --info-soft: rgba(47, 127, 192, 0.10);
  --info-text: #236199;

  --shadow-sm: 0 1px 2px rgba(20, 30, 45, 0.06);
  --shadow-md: 0 10px 26px -14px rgba(20, 30, 45, 0.22);
  --shadow-lg: 0 26px 60px -24px rgba(20, 30, 45, 0.28);
  --ring: 0 0 0 2px #ffffff, 0 0 0 4px var(--brand);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "ss01";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select { font: inherit; color: inherit; }
ul { list-style: none; }
i.ph, i[class^="ph"], i[class*=" ph"] { display: inline-flex; line-height: 1; }
.num { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); background-clip: content-box; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background:
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.brand__mark {
  width: 36px; height: 36px;
  border-radius: var(--r-icon);
  background: var(--brand-soft);
  display: grid; place-items: center;
  border: 1px solid var(--brand-deep);
  flex: 0 0 auto;
}
.brand__mark img { width: 26px; height: 26px; display: block; }
.brand__name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.15; }
.brand__name span { display: block; font-size: 11px; font-weight: 500; color: var(--text-faint); letter-spacing: 0.01em; }

.nav-group { padding: 10px 8px 4px; font-size: 10.5px; font-weight: 600; color: var(--text-ghost); letter-spacing: 0.08em; text-transform: uppercase; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-control);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.nav-item i { font-size: 18px; color: var(--text-faint); transition: color .15s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover i { color: var(--text-dim); }
.nav-item.active { background: var(--brand-soft); color: var(--text); }
.nav-item.active i { color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  background: var(--surface-3); color: var(--text-dim);
  padding: 1px 7px; border-radius: 999px; min-width: 22px; text-align: center;
}
.nav-item.warn .count { background: var(--warn-soft); color: var(--warn-text); }

.sidebar__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.sync-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: var(--r-control);
  background: var(--surface); border: 1px solid var(--line);
}
.sync-card .hcp { width: 26px; height: 26px; border-radius: var(--r-inset); background: var(--surface-3); display: grid; place-items: center; color: var(--brand); font-size: 15px; }
.sync-card .meta { font-size: 11.5px; line-height: 1.3; }
.sync-card .meta b { font-weight: 600; font-size: 12px; }
.sync-card .meta span { color: var(--text-faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); flex: 0 0 auto; }
.dot.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--ok-soft); } 50% { box-shadow: 0 0 0 5px rgba(47,190,99,0.05); } }

/* ---------- Main column ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 25;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex; align-items: center; gap: 9px;
  width: 100%; max-width: 420px;
  padding: 8px 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  color: var(--text-faint);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--brand-strong); box-shadow: var(--ring); }
.search i { font-size: 16px; }
.search input { border: none; background: none; outline: none; width: 100%; color: var(--text); font-size: 13.5px; }
.search input::placeholder { color: var(--text-faint); }
.search kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.topbar__spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-control);
  display: grid; place-items: center; color: var(--text-dim);
  border: 1px solid transparent; position: relative;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn i { font-size: 19px; }
.icon-btn .nub { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.userchip {
  display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px;
  border-radius: var(--r-chip); border: 1px solid var(--line); background: var(--surface);
  transition: background .15s ease;
}
.userchip:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--on-brand); display: grid; place-items: center;
  font-weight: 600; font-size: 12px; letter-spacing: 0.02em;
}
.userchip .who { font-size: 12.5px; line-height: 1.2; }
.userchip .who span { display: block; color: var(--text-faint); font-size: 11px; }

/* ---------- Content / views ---------- */
.content { padding: 24px 22px 64px; max-width: var(--maxw); width: 100%; margin: 0 auto; }
.view { display: none; animation: viewin .32s cubic-bezier(.16,1,.3,1); }
.view.active { display: block; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.page-head .sub { color: var(--text-faint); font-size: 13px; margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: var(--r-control);
  font-size: 13px; font-weight: 550; line-height: 1;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn i { font-size: 16px; }
.btn:hover { background: var(--surface-3); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand-deep); font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 18px -10px var(--brand); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-deep); }
.btn--primary i { font-size: 16px; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 7px 11px; font-size: 12.5px; }

/* ---------- Chips / badges / status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--r-chip);
  font-size: 11.5px; font-weight: 550; line-height: 1.4;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--line);
}
.chip i { font-size: 12px; }
.chip .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--ok { background: var(--ok-soft); color: var(--brand-text); border-color: transparent; }
.chip--warn { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.chip--danger { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.chip--info { background: var(--info-soft); color: var(--info-text); border-color: transparent; }
.chip--ghost { background: transparent; }
.statcard { display: flex; align-items: center; gap: 13px; padding: 15px 17px; }
.statcard__ic { width: 38px; height: 38px; border-radius: var(--r-icon); display: grid; place-items: center; font-size: 18px; background: var(--surface-3); color: var(--text-dim); flex: 0 0 auto; }
.statcard__ic.g { background: var(--brand-soft); color: var(--brand); }
.statcard__ic.a { background: var(--warn-soft); color: var(--warn-text); }
.statcard .n { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.statcard .l { font-size: 12px; color: var(--text-faint); }

/* job status pill */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: var(--r-chip); }
.status .led { width: 7px; height: 7px; border-radius: 50%; }
.status--scheduled { background: var(--info-soft); color: var(--info-text); }
.status--scheduled .led { background: var(--info); }
.status--enroute { background: var(--warn-soft); color: var(--warn-text); }
.status--enroute .led { background: var(--warn); }
.status--active { background: var(--brand-soft); color: var(--brand-text); }
.status--active .led { background: var(--brand); }
.status--done { background: var(--surface-3); color: var(--text-dim); }
.status--done .led { background: var(--text-faint); }
.status--unpaid { background: var(--danger-soft); color: var(--danger-text); }
.status--unpaid .led { background: var(--danger); }
.status--paid { background: var(--ok-soft); color: var(--brand-text); }
.status--paid .led { background: var(--brand); }

/* intent-named aliases (quote + payment lifecycles) mapped to the shared palette */
.status--draft { background: var(--surface-3); color: var(--text-dim); }
.status--draft .led { background: var(--text-faint); }
.status--sent { background: var(--info-soft); color: var(--info-text); }
.status--sent .led { background: var(--info); }
.status--expiring { background: var(--warn-soft); color: var(--warn-text); }
.status--expiring .led { background: var(--warn); }
.status--accepted { background: var(--ok-soft); color: var(--brand-text); }
.status--accepted .led { background: var(--brand); }
.status--transit { background: var(--info-soft); color: var(--info-text); }
.status--transit .led { background: var(--info); }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel__head h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.panel__head .hint { color: var(--text-faint); font-size: 12px; }
.panel__head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel__body { padding: 16px 18px; }
.panel__foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 16px 17px; position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--brand), transparent 60%); opacity: .6; }
.kpi.warn::after { background: linear-gradient(90deg, var(--warn), transparent 60%); }
.kpi.danger::after { background: linear-gradient(90deg, var(--danger), transparent 60%); }
.kpi__top { display: flex; align-items: center; gap: 9px; color: var(--text-dim); font-size: 12.5px; font-weight: 500; margin-bottom: 12px; }
.kpi__ic { width: 30px; height: 30px; border-radius: var(--r-icon); display: grid; place-items: center; background: var(--surface-3); color: var(--text-dim); font-size: 16px; }
.kpi__ic.g { background: var(--brand-soft); color: var(--brand); }
.kpi__ic.a { background: var(--warn-soft); color: var(--warn-text); }
.kpi__ic.r { background: var(--danger-soft); color: var(--danger-text); }
.kpi__val { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.kpi__val small { font-size: 15px; color: var(--text-faint); font-weight: 500; }
.kpi__sub { margin-top: 9px; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; padding: 1px 6px; border-radius: 999px; }
.delta i { font-size: 12px; }
.delta.up { background: var(--ok-soft); color: var(--brand-text); }
.delta.down { background: var(--danger-soft); color: var(--danger-text); }

/* ---------- Triage list (needs attention) ---------- */
.triage { display: flex; flex-direction: column; }
.triage__row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  transition: background .14s ease;
}
.triage__row:last-child { border-bottom: none; }
.triage__row:hover { background: var(--surface-2); }
.triage__ic { width: 36px; height: 36px; border-radius: var(--r-icon); display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.triage__ic.a { background: var(--warn-soft); color: var(--warn-text); }
.triage__ic.r { background: var(--danger-soft); color: var(--danger-text); }
.triage__ic.i { background: var(--info-soft); color: var(--info-text); }
.triage__txt { min-width: 0; }
.triage__txt b { font-weight: 600; font-size: 13.5px; }
.triage__txt span { display: block; color: var(--text-faint); font-size: 12px; }
.triage__val { margin-left: auto; text-align: right; flex: 0 0 auto; }
.triage__val .n { font-family: var(--mono); font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.triage__val .l { font-size: 11px; color: var(--text-faint); }
.triage__row .go { color: var(--text-ghost); font-size: 17px; flex: 0 0 auto; transition: color .14s ease, transform .14s ease; }
.triage__row:hover .go { color: var(--brand); transform: translateX(2px); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-weight: 600; color: var(--text-faint); font-size: 11.5px;
  letter-spacing: 0.02em; padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
.tbl thead th.r, .tbl td.r { text-align: right; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .mono { font-family: var(--mono); letter-spacing: -0.01em; }
.tbl .muted { color: var(--text-faint); }
.tbl .strong { font-weight: 600; }
.cust { display: flex; align-items: center; gap: 11px; }
.cust .avatar { width: 32px; height: 32px; font-size: 12px; display: grid; place-items: center; }
.cust .avatar.n { background: var(--surface-3); color: var(--text-dim); }
.cust b { font-weight: 600; font-size: 13px; }
.cust div span { display: block; color: var(--text-faint); font-size: 11.5px; }
.rowlink { color: var(--brand-text); font-family: var(--mono); font-weight: 500; }

/* segmented filter tabs */
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-control); gap: 2px; }
.seg button {
  padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 550; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 7px; transition: background .14s ease, color .14s ease;
}
.seg button .c { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button.on .c { color: var(--brand); }

/* ---------- Activity feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.feed__item:last-child { border-bottom: none; }
.feed__rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.feed__ic { width: 30px; height: 30px; border-radius: var(--r-tile); display: grid; place-items: center; font-size: 15px; background: var(--surface-3); color: var(--text-dim); }
.feed__ic.g { background: var(--brand-soft); color: var(--brand); }
.feed__ic.a { background: var(--warn-soft); color: var(--warn-text); }
.feed__ic.i { background: var(--info-soft); color: var(--info-text); }
.feed__line { width: 1px; flex: 1; background: var(--line); margin-top: 4px; min-height: 8px; }
.feed__body { padding-top: 2px; font-size: 13px; }
.feed__body .t { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); }
.feed__body b { font-weight: 600; }

/* ---------- Schedule / dispatch board ---------- */
.board { display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.board__cell { background: var(--surface); min-height: 64px; position: relative; }
.board__corner { background: var(--surface-3); }
.board__tech { background: var(--surface-3); padding: 11px 12px; display: flex; align-items: center; gap: 9px; }
.board__tech .avatar { width: 28px; height: 28px; font-size: 11px; display: grid; place-items: center; }
.board__tech b { font-size: 12.5px; font-weight: 600; }
.board__tech div span { display: block; font-size: 10.5px; color: var(--text-faint); }
.board__time { background: var(--surface); color: var(--text-faint); font-family: var(--mono); font-size: 11px; padding: 8px 8px 0; text-align: right; }
.board__cell.slot { padding: 5px; }
.jobcard {
  border-radius: var(--r-tile); padding: 8px 9px; font-size: 11.5px; line-height: 1.3;
  border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--text);
  cursor: pointer; transition: transform .1s ease, box-shadow .15s ease;
  height: 100%;
}
.jobcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.jobcard b { font-weight: 600; display: block; }
.jobcard span { color: var(--text-dim); }
.jobcard.info { border-left-color: var(--info); background: var(--info-soft); }
.jobcard.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.jobcard.done { border-left-color: var(--text-faint); background: var(--surface-3); }
.jobcard .mini { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }

/* ---------- Job detail ---------- */
.pipeline { display: flex; align-items: center; gap: 0; padding: 4px 0; overflow-x: auto; }
.pstep { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.pstep__dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-faint); border: 1px solid var(--line); font-size: 14px;
}
.pstep.done .pstep__dot { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-deep); }
.pstep.current .pstep__dot { background: var(--brand); color: var(--on-brand); border-color: var(--brand-deep); box-shadow: var(--ring); }
.pstep__txt { font-size: 12px; line-height: 1.2; }
.pstep__txt b { font-weight: 600; }
.pstep__txt span { display: block; color: var(--text-faint); font-size: 10.5px; font-family: var(--mono); }
.pstep__txt.muted b { color: var(--text-faint); }
.pbar { width: 34px; height: 2px; background: var(--line); margin: 0 4px; align-self: center; border-radius: 2px; }
.pbar.fill { background: var(--brand); }

.linelist { width: 100%; border-collapse: collapse; font-size: 13px; }
.linelist th { text-align: left; font-size: 11px; color: var(--text-faint); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.linelist th.r, .linelist td.r { text-align: right; }
.linelist td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.linelist .tag { font-size: 10.5px; color: var(--text-faint); }
.linelist tfoot td { padding: 9px 12px; font-family: var(--mono); }
.linelist tfoot tr:last-child td { font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); }

.kv { display: flex; flex-direction: column; gap: 11px; }
.kv__row { display: flex; align-items: center; gap: 10px; }
.kv__row .k { color: var(--text-faint); font-size: 12.5px; width: 92px; flex: 0 0 auto; }
.kv__row .v { font-size: 13px; font-weight: 500; }

.margin-meter { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.margin-meter .bar { flex: 1; background: var(--surface-3); border-radius: 3px 3px 0 0; }
.margin-meter .bar.cost { background: var(--warn-soft); }
.margin-meter .bar.profit { background: var(--brand-soft); }

/* big stat block (job detail money) */
.moneyrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border-radius: var(--r-inset); overflow: hidden; border: 1px solid var(--line); }
.moneycell { background: var(--surface); padding: 13px 15px; }
.moneycell .l { font-size: 11.5px; color: var(--text-faint); margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.moneycell .n { font-family: var(--mono); font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.moneycell .n.g { color: var(--brand-text); }

/* ---------- Mobile field-app frame ---------- */
.field-wrap { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.phone {
  width: 320px; border-radius: 40px; padding: 12px;
  background: linear-gradient(160deg, #20262f, #11161d);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  position: relative;
}
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 96px; height: 24px; background: #0a0d12; border-radius: 999px; z-index: 5; }
.phone__screen { background: var(--bg); border-radius: 30px; overflow: hidden; height: 640px; display: flex; flex-direction: column; border: 1px solid var(--line-soft); }
.phone__status { padding: 30px 20px 8px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.phone__head { padding: 6px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.phone__head .h { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.phone__head .d { font-size: 12px; color: var(--text-faint); }
.phone__body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 11px; }
.mjob { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 13px; border-left: 3px solid var(--brand); }
.mjob.next { border-left-color: var(--info); }
.mjob__t { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mjob b { font-size: 13.5px; font-weight: 600; }
.mjob .addr { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.mjob .when { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.mjob__cta { margin-top: 11px; display: flex; gap: 7px; }
.mbtn { flex: 1; padding: 9px; border-radius: var(--r-control); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mbtn.g { background: var(--brand); color: var(--on-brand); }
.mbtn.s { background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }
.phone__tabs { display: flex; border-top: 1px solid var(--line); background: var(--surface); padding: 9px 0 14px; }
.phone__tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9.5px; color: var(--text-faint); }
.phone__tabs button i { font-size: 19px; }
.phone__tabs button.on { color: var(--brand); }

.field-notes { display: flex; flex-direction: column; gap: 14px; }
.feat-line { display: flex; gap: 13px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.feat-line__ic { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.feat-line b { font-weight: 600; font-size: 13.5px; }
.feat-line p { color: var(--text-faint); font-size: 12.5px; margin-top: 3px; }

/* ---------- P&L / reports ---------- */
.barchart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 4px 0; }
.barchart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 100%; }
.barchart .stack { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; flex: 1; }
.barchart .seg-b { border-radius: 4px 4px 0 0; }
.barchart .seg-b.rev { background: var(--brand); }
.barchart .seg-b.lab { background: var(--info-soft); border: 1px solid var(--info); }
.barchart .seg-b.mat { background: var(--warn-soft); border: 1px solid var(--warn); }
.barchart .lbl { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.sparkline .b { flex: 1; background: var(--brand-soft); border-radius: 2px; min-width: 3px; }
.sparkline .b.hi { background: var(--brand); }

.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- Empty / helper ---------- */
.hint-row { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 12px; }

.mock-flag {
  position: fixed; bottom: 14px; right: 16px; z-index: 50;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; font-size: 11.5px; color: var(--text-dim);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(8px); box-shadow: var(--shadow-md);
}
.mock-flag i { color: var(--warn-text); font-size: 13px; }

/* ---------- Search results (static demo) ---------- */
.search-wrap { position: relative; width: 100%; max-width: 460px; }
.search-results {
  position: absolute; top: calc(100% + 9px); left: 0; width: min(480px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow-lg); padding: 7px; z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.search-wrap:focus-within .search-results { opacity: 1; visibility: visible; transform: none; }
.search-results .grp { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-ghost); padding: 8px 10px 4px; }
.sr {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-control); text-align: left;
  transition: background .12s ease;
}
.sr:hover { background: var(--surface-2); }
.sr__ic { width: 30px; height: 30px; border-radius: var(--r-tile); display: grid; place-items: center; background: var(--surface-3); color: var(--text-dim); font-size: 15px; flex: 0 0 auto; }
.sr__t { min-width: 0; flex: 1; }
.sr__t b { font-size: 13px; font-weight: 600; }
.sr__t b .rowlink { font-weight: 600; }
.sr__t span { display: block; font-size: 11.5px; color: var(--text-faint); }
.sr__meta { font-family: var(--mono); font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }

/* ---------- Table polish: zebra + aligned figures ---------- */
.tbl.zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tbl.zebra tbody tr:nth-child(even):hover { background: var(--surface-2); }
.tbl td.r .num, .tbl td.r.mono, .linelist td.r { font-variant-numeric: tabular-nums; }

/* ---------- Board "now" marker (live-shift cue) ---------- */
.board__time.now { color: var(--brand-text); font-weight: 600; position: relative; }
.board__time.now::after { content: ""; position: absolute; right: 8px; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.board__cell.now-row { box-shadow: inset 0 1px 0 var(--brand); }
.nowtag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--brand-text); }

/* gradient sparkline / chart fills (data-ink, still single hue) */
.sparkline .b { background: linear-gradient(180deg, var(--brand-soft), var(--brand-softer)); }
.sparkline .b.hi { background: linear-gradient(180deg, var(--brand), var(--brand-strong)); }

/* two-device field layout */
.field-duo { display: flex; gap: 20px; flex-wrap: wrap; }
.field-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }

/* photo thumbnails (tokenized radius) */
.thumb { width: 100%; height: 78px; object-fit: cover; border-radius: var(--r-tile); border: 1px solid var(--line); display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .field-wrap { grid-template-columns: 1fr; justify-items: start; }
  .field-duo { flex-direction: column; align-items: center; }
}
@media (max-width: 880px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .app { grid-template-columns: 1fr; }
  /* dispatch board keeps all 4 techs and scrolls horizontally instead of cramming */
  .board { min-width: 680px; }
  .page-head { flex-wrap: wrap; }
  .page-head__actions { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .kpis, .cols-2, .cols-3, .moneyrow { grid-template-columns: 1fr; }
  .search-wrap { max-width: none; }
  .content { padding: 18px 14px 60px; }
  .topbar { gap: 8px; padding: 0 14px; }
  .userchip .who { display: none; }
  .search kbd { display: none; }
  .field-grid2 { grid-template-columns: 1fr; }
}
.board-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Motion / a11y ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .dot.pulse { animation: none; }
}
:focus-visible { outline: none; }
.nav-item:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible,
.userchip:focus-visible, .triage__row:focus-visible, .jobcard:focus-visible,
.mbtn:focus-visible, .phone__tabs button:focus-visible, .sr:focus-visible,
.statcard:focus-visible, .cmdk-item:focus-visible, .notif:focus-visible { box-shadow: var(--ring); position: relative; z-index: 1; }

/* ============================================================
   Interaction layer: toasts, modals, command palette, notifs
   ============================================================ */

/* Toasts */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--r-control); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; color: var(--text); opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; max-width: 92vw; }
.toast.in { opacity: 1; transform: none; }
.toast i { color: var(--brand); font-size: 17px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(6, 9, 13, .62); backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; animation: fadein .18s ease; }
.modal { width: 460px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalin .22s cubic-bezier(.16,1,.3,1); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalin { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.modal__head h3 { font-size: 15px; font-weight: 600; }
.modal__head span { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.modal__head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.modal__body { padding: 18px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); }

/* SMS preview */
.sms-preview { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-control); padding: 14px; }
.sms-bubble { background: var(--brand); color: var(--on-brand); padding: 11px 13px; border-radius: 16px 16px 4px 16px; font-size: 13px; line-height: 1.45; max-width: 90%; margin-left: auto; }
.sms-meta { margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); }

/* Payment modal */
.paybtns { display: flex; flex-direction: column; gap: 9px; }
.paybtns .btn { width: 100%; justify-content: center; padding: 12px; }
[data-step] { display: none; }
[data-step].active { display: block; }
.pay-success { text-align: center; padding: 16px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pay-success__ic { font-size: 50px; color: var(--brand); line-height: 1; }
.pay-success b { font-size: 15px; }
.pay-success .pay-method { font-size: 12px; color: var(--text-faint); }

/* Command palette */
.cmdk { position: fixed; inset: 0; z-index: 75; display: none; }
.cmdk.open { display: block; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(6, 9, 13, .55); backdrop-filter: blur(4px); animation: fadein .15s ease; }
.cmdk-box { position: relative; width: 560px; max-width: calc(100vw - 32px); margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalin .2s cubic-bezier(.16,1,.3,1); }
.cmdk-input-wrap { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.cmdk-input-wrap i { color: var(--text-faint); font-size: 18px; }
.cmdk-input-wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; }
.cmdk-input-wrap input::placeholder { color: var(--text-faint); }
.cmdk-input-wrap kbd { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 7px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-control); text-align: left; font-size: 13.5px; color: var(--text-dim); }
.cmdk-item i { font-size: 17px; color: var(--text-faint); }
.cmdk-item.on, .cmdk-item:hover { background: var(--brand-soft); color: var(--text); }
.cmdk-item.on i, .cmdk-item:hover i { color: var(--brand); }

/* Notifications panel */
.notif-panel { position: fixed; top: calc(var(--topbar-h) + 6px); right: 16px; width: 340px; max-width: calc(100vw - 24px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.notif-panel.open { opacity: 1; visibility: visible; transform: none; }
.notif-panel__head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.notif-panel__head b { font-size: 13.5px; }
.notif-panel__head .chip { margin-left: auto; }
.notif { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; transition: background .12s ease; }
.notif:hover { background: var(--surface-2); }
.notif__ic { width: 30px; height: 30px; border-radius: var(--r-tile); display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; background: var(--surface-3); color: var(--text-dim); }
.notif__ic.g { background: var(--brand-soft); color: var(--brand); }
.notif__ic.a { background: var(--warn-soft); color: var(--warn-text); }
.notif__ic.i { background: var(--info-soft); color: var(--info-text); }
.notif__t { min-width: 0; flex: 1; }
.notif__t b { font-size: 13px; font-weight: 600; }
.notif__t span { display: block; font-size: 11.5px; color: var(--text-faint); }
.notif__time { font-size: 11px; color: var(--text-faint); flex: 0 0 auto; }
.notif-panel__foot { padding: 10px 12px; }

/* Area chart (cash collected) */
.areachart { width: 100%; height: 96px; display: block; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; color: var(--text-faint); text-align: center; }
.empty-state i { font-size: 26px; color: var(--text-ghost); }
.empty-state b { font-size: 14px; color: var(--text-dim); }
.empty-state span { font-size: 12.5px; }
