/* MT portal. Same structure as the WMR FluentOS portal, in Mechanical Technologies' colors. */
:root {
  --red: #D52A28;
  --red-bright: #E92024;
  --red-dark: #A81F1D;
  --blue: #1E8FCF;
  --blue-dark: #16709F;
  --ink: #1A1F27;
  --ink-2: #3E4C63;
  --muted: #6B7A90;
  --muted-2: #9AA6B6;
  --line: #DCE2EA;
  --line-2: #EEF1F5;
  --surface: #F0F4F8;
  --surface-2: #F7F9FC;
  --white: #FFFFFF;
  --ok: #2F7D5B;
  --ok-bg: #E6F2EB;
  --warn: #C98A0B;
  --warn-bg: #FBF1D8;
  --bad: #C8322F;
  --bad-bg: #FBE8E6;
  --gold: #E0A51E;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 6px -1px rgba(26, 31, 39, .08), 0 2px 4px -2px rgba(26, 31, 39, .08);
  --shadow-lg: 0 12px 30px rgba(26, 31, 39, .16);

  --font-heading: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --font-label: 'Barlow Condensed', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; color: var(--ink); letter-spacing: -.01em; }
a { color: var(--blue-dark); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }

/* ── Header ─────────────────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; gap: 18px; padding: 10px 24px;
  background: var(--white); border-bottom: 3px solid var(--red); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
header.top .logo { height: 34px; width: auto; display: block; }
header.top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
header.top .who { font-size: 13px; color: var(--muted); }
header.top .who b { color: var(--ink); font-weight: 600; }

.btn {
  font-family: var(--font-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; font-size: 14px;
  cursor: pointer; border-radius: var(--radius); padding: 8px 14px; border: 1px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.hamburger { display: none; }

/* Segmented control (entity switch, filters) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg a, .seg button {
  border: 0; background: #fff; padding: 7px 12px; font: 500 13px var(--font-body); cursor: pointer;
  border-left: 1px solid var(--line); color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.seg a:first-child, .seg button:first-child { border-left: 0; }
.seg a.on, .seg button.on { background: var(--ink); color: #fff; }

/* ── Shell: icon rail + content ─────────────────────────────────── */
.shell { display: grid; grid-template-columns: 104px 1fr; min-height: calc(100vh - 57px); }
nav.rail {
  background: #F7F8FC; border-right: 1px solid var(--line); padding: 20px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
nav.rail a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
  color: var(--muted); font: 500 13px var(--font-heading); text-align: center; width: 100%;
}
nav.rail a .ic { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
nav.rail a .ic svg { width: 24px; height: 24px; }
nav.rail a:hover { color: var(--ink); }
nav.rail a:hover .ic { background: #E9EDF4; color: var(--ink); }
nav.rail a.active { color: var(--ink); font-weight: 700; }
nav.rail a.active .ic { background: var(--ink); color: #fff; }
nav.rail .rail-sep { width: 40px; border-top: 1px solid var(--line); margin: 2px 0; }
nav.rail .drawer-only { display: none; }

main { width: 100%; padding: 24px clamp(20px, 3vw, 44px) 48px; max-width: 1760px; margin: 0 auto; overflow-x: hidden; }
.foot-note { margin-top: 28px; font-size: 12px; color: var(--muted); }

.panel-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h1 { font-size: 24px; }
.panel-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 80ch; line-height: 1.5; }
.panel-head .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* data-as-of chip */
.asof { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); background: #fff;
        border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.asof .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.asof.stale .dot { background: var(--warn); }
.asof.stale b { color: var(--warn); font-weight: 600; }
.asof.missing .dot { background: var(--muted-2); }

/* Tabs */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 10px 16px; font: 600 15px var(--font-heading); color: var(--muted);
       border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab.on { color: var(--ink); border-bottom-color: var(--red); }
.tabs .asof { margin-left: auto; margin-bottom: 6px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 14px; box-shadow: var(--shadow);
       position: relative; overflow: hidden; min-width: 0; text-decoration: none; color: inherit; display: block; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ink); }
.kpi.accent::before { background: var(--red); }
.kpi.gold::before { background: var(--gold); }
.kpi.ok::before { background: var(--ok); }
.kpi.blue::before { background: var(--blue); }
a.kpi:hover { border-color: var(--ink-2); }
.kpi .l { color: var(--muted); font: 600 13px var(--font-label); text-transform: uppercase; letter-spacing: .06em; }
.kpi .n { font: 800 28px var(--font-heading); color: var(--ink); line-height: 1.15; margin-top: 4px; }
.kpi .d { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.kpi .asof { margin-top: 10px; white-space: normal; align-items: flex-start; line-height: 1.35; border-radius: 10px; }
.kpi .asof .dot { margin-top: 4px; flex: none; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h3 { font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.card > h3 .count { font: 700 12px var(--font-body); color: var(--muted); }
.card .cardsub { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .grid-2, .grid-even { grid-template-columns: 1fr; } }

/* Overview list rows */
.orow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0;
        border-top: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.orow:first-child { border-top: 0; }
a.orow:hover .otitle { text-decoration: underline; }
.otitle { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oval { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.oval small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.orow.no-ring { grid-template-columns: minmax(0, 1fr) auto; }
.empty-line { color: var(--muted); font-size: 13px; padding: 14px 0; }

/* Category bars */
.cats { display: flex; flex-direction: column; gap: 12px; }
.cat { display: grid; grid-template-columns: 150px minmax(0, 1fr) 96px 44px; gap: 12px; align-items: center; font-size: 14px; }
.cat .nm { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat .bar { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.cat .bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #1A1F2766, var(--ink)); }
.cat.red .bar span { background: linear-gradient(90deg, #D52A2866, var(--red)); }
.cat.blue .bar span { background: linear-gradient(90deg, #1E8FCF66, var(--blue)); }
.cat .v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cat .p { text-align: right; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .cat { grid-template-columns: 110px minmax(0, 1fr) 80px; } .cat .p { display: none; } }

/* Pills */
.pill { display: inline-flex; align-items: center; font: 600 12px var(--font-label); letter-spacing: .06em; text-transform: uppercase;
        padding: 3px 10px; border-radius: 999px; white-space: nowrap;
        background: color-mix(in srgb, var(--c, #6B7A90) 14%, #fff); color: var(--c, #6B7A90); }

/* Margin ring */
.ring { position: relative; width: 48px; height: 48px; }
.ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 12px var(--font-body); color: var(--ink); }

/* Strip of summary tiles (WMR job costs) */
.strip { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .strip { grid-template-columns: 1fr; } }
.stile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; align-items: center; gap: 22px; box-shadow: var(--shadow); min-width: 0; }
.stile .big { font: 800 26px var(--font-heading); color: var(--ink); }
.stile .lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }
.eyebrow { font: 600 13px var(--font-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.legend { display: grid; grid-template-columns: auto auto; gap: 6px 18px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.donut { position: relative; flex: none; }
.donut svg { transform: rotate(-90deg); display: block; }
.donut .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .mid b { font: 800 22px var(--font-heading); color: var(--ink); line-height: 1; }
.donut .mid b.long { font-size: 16px; }
.donut .mid small { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; background: #fff; border: 1px solid var(--line);
           border-radius: var(--radius-lg); padding: 12px 14px; }
.filters input[type=search], .filters select { font: 14px var(--font-body); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); }
.filters input[type=search] { width: 230px; }
.filters .count { margin-left: auto; color: var(--muted); font-size: 13px; }
.settings { position: relative; }
.settings summary { list-style: none; cursor: pointer; font: 500 13px var(--font-body); color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; }
.settings summary::-webkit-details-marker { display: none; }
.settings .pop { position: absolute; right: 0; top: 44px; z-index: 5; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
                 padding: 14px 16px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.45; }
.settings .pop p { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* Job / item list (grid rows, like WMR job costs) */
.list { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.list-scroll { overflow-x: auto; }
.lhead, .lrow { display: grid; gap: 14px; align-items: center; padding: 12px 18px; min-width: 980px; }
.lhead { font: 600 13px var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: #FAFBFD; }
.lrow { border-top: 1px solid var(--line-2); }
.lrow:first-child { border-top: 0; }
.lrow.click { cursor: pointer; }
.lrow.click:hover, .lrow.click:focus-visible { background: #F8FAFC; outline: none; }
.lrow[hidden] { display: none; }
.jobs .lhead, .jobs .lrow { grid-template-columns: 56px minmax(220px, 1.6fr) repeat(6, 40px) minmax(170px, 1fr) 96px 96px 120px; }
.coll .lhead, .coll .lrow { grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 1fr) 110px 150px 70px 120px 110px; }
.vend .lhead, .vend .lrow { grid-template-columns: minmax(200px, 1.4fr) 70px minmax(220px, 1.4fr) 110px 110px 110px; }
.c { text-align: center; }
.r { text-align: right; }
.tt { min-width: 0; }
.tt b { font-size: 15px; display: block; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt span { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot-cat { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 11px var(--font-body); }
.dot-cat.y { background: var(--ok); color: #fff; }
.dot-cat.n { background: var(--line-2); color: var(--muted-2); }
.usebar { height: 8px; border-radius: 4px; background: var(--line-2); position: relative; overflow: visible; }
.usebar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--ok); }
.usebar.warn span { background: var(--warn); }
.usebar.bad span { background: var(--bad); }
.usebar.blue span { background: var(--blue); }
.usebar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.uselbl { font-size: 12px; color: var(--muted); margin-top: 6px; }
.empty-list { padding: 40px; text-align: center; color: var(--muted); }
.list-note { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 120ch; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(26, 31, 39, .30); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 92vw); background: var(--surface-2); z-index: 41; overflow-y: auto;
          padding: 24px 28px 40px; box-shadow: -8px 0 28px rgba(26, 31, 39, .18); transform: translateX(100%); visibility: hidden;
          transition: transform .22s ease, visibility .22s; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; visibility: visible; }
.dhead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.dhead h2 { font: 800 22px var(--font-heading); }
.dmeta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dx { margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 20px; cursor: pointer; color: var(--ink-2); }
.dkpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dkpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.dkpi .v { font: 800 20px var(--font-heading); color: var(--ink); }
.dkpi .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dpanel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.dpanel h3 { font: 700 15px var(--font-heading); margin-bottom: 8px; }
@media (max-width: 640px) { .dkpis { grid-template-columns: 1fr 1fr; } }

/* Tables */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 600 12px var(--font-label); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
table.t th.num, table.t td.num { text-align: right; }
table.t tr.total td { font-weight: 700; color: var(--ink); border-bottom: 0; border-top: 2px solid var(--line); }
table.t td.neg { color: var(--bad); }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px; color: var(--muted); }
.empty-state .es-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.empty-state .es-icon svg { width: 26px; height: 26px; }
.empty-state .es-title { font: 700 16px var(--font-heading); color: var(--ink); }
.empty-state .es-line { font-size: 14px; line-height: 1.55; max-width: 56ch; }
.empty-state .es-src { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--font-label); text-transform: uppercase; letter-spacing: .06em;
                       color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.empty-state .es-src .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.chatbox { display: flex; gap: 10px; max-width: 720px; width: 100%; margin-top: 8px; }
.chatbox input { flex: 1; font: 15px var(--font-body); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.chat-answer { max-width: 720px; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--ink-2); }

/* ── Mobile: rail becomes a drawer ─────────────────────────────── */
@media (max-width: 860px) {
  header.top { padding: 10px 14px; gap: 10px; }
  header.top .logo { height: 26px; }
  header.top .who, header.top .right .btn { display: none; }
  header.top .seg { display: none; }
  .hamburger { display: inline-flex; margin-left: auto; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); padding: 7px 10px; font-size: 18px; line-height: 1; cursor: pointer; }
  .shell { grid-template-columns: 1fr; }
  nav.rail { flex-direction: column; align-items: stretch; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line);
             max-height: 0; overflow: hidden; padding: 0 12px; transition: max-height .25s ease; background: #fff; }
  nav.rail.open { max-height: 820px; padding: 10px 12px 14px; }
  nav.rail a { flex-direction: row; gap: 12px; font-size: 15px; padding: 4px 6px; }
  nav.rail a .ic { width: 40px; height: 40px; border-radius: 12px; }
  nav.rail .rail-sep { width: 100%; }
  nav.rail .drawer-only { display: flex; flex-direction: column; gap: 10px; padding: 10px 6px 0; }
  main { padding: 16px 14px 40px; }
  .panel-head h1 { font-size: 21px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 12px 10px; }
  .kpi .n { font-size: 22px; }
  .kpi .asof { font-size: 11px; padding: 3px 8px; }
  .orow { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .filters input[type=search] { width: 100%; }
  .filters .seg { max-width: 100%; overflow-x: auto; }
  .tabs { flex-wrap: wrap; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }

/* ── Login ─────────────────────────────────────────────────────── */
body.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #07090C; overflow: hidden; position: relative; }
.login-bg { position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(38% 46% at 18% 26%, rgba(30, 143, 207, .55), transparent 70%),
    radial-gradient(34% 40% at 82% 70%, rgba(213, 42, 40, .50), transparent 70%),
    radial-gradient(60% 60% at 50% 110%, rgba(30, 143, 207, .18), transparent 70%),
    linear-gradient(160deg, #10141B 0%, #07090C 60%, #0B0E13 100%);
  filter: blur(2px); }
.login-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 70% at 50% 50%, transparent 40%, rgba(0, 0, 0, .55) 100%); }
.login-grain { position: fixed; inset: 0; z-index: 1; opacity: .08; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.login-card { position: relative; z-index: 2; width: min(460px, 100%); border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 36, 46, .72), rgba(14, 17, 23, .78));
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.login-card .cap { background: #fff; padding: 22px 30px; display: flex; justify-content: center; border-bottom: 3px solid var(--red); }
.login-card .cap img { width: 100%; max-width: 360px; height: auto; display: block; }
.login-card .body { padding: 28px 40px 26px; }
.login-card h2 { color: #fff; text-align: center; font: 700 26px var(--font-heading); }
.login-card .tagline { text-align: center; color: #8FCBEE; font: 600 14px var(--font-label); letter-spacing: .1em; text-transform: uppercase; margin: 6px 0 22px; }
.login-card label { display: block; color: rgba(255, 255, 255, .78); font: 600 13px var(--font-label); letter-spacing: .08em; text-transform: uppercase; margin: 14px 0 7px; }
.login-card input { width: 100%; font: 16px var(--font-body); color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px; padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.login-card input::placeholder { color: rgba(255, 255, 255, .45); }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 143, 207, .35); }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 24px; padding: 13px 16px; font-size: 16px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(213, 42, 40, .40); }
.login-card .foot { text-align: center; color: rgba(255, 255, 255, .55); font-size: 12px; margin-top: 16px; }
.login-err { background: rgba(213, 42, 40, .16); border: 1px solid rgba(233, 32, 36, .55); color: #FFD7D5; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 4px; }
@media (max-width: 480px) { .login-card .body { padding: 22px 22px 20px; } .login-card .cap { padding: 18px 20px; } }

/* ── Readability pass (Jude 11/10): darker secondary text, bigger Job P&L hero, colored money ── */
:root { --muted: #4A5568; --muted-2: #718096; }
.inc { color: var(--ok) !important; }
.cst { color: var(--bad) !important; }
.lbl.strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1080px) { .hero { grid-template-columns: 1fr; } }
.hero .stile { padding: 22px 26px; }
.hero-donut { gap: 32px; }
.hero-donut .donut .mid b { font-size: 46px; }
.hero-donut .donut .mid small { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.hero-legend { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-legend .eyebrow { margin-bottom: 2px; }
.hl { display: grid; grid-template-columns: 12px 34px 1fr; column-gap: 10px; align-items: baseline; }
.hl .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); align-self: center; }
.hl b { font: 800 18px var(--font-heading); color: var(--ink); text-align: left; }
.hl .hn { font-weight: 700; color: var(--ink); font-size: 14px; }
.hl .hm { grid-column: 3; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.hero-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero-side .stile { flex-direction: column; align-items: flex-start; gap: 6px; flex: 1; justify-content: center; }
.hero-side .stile.money { flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: flex-end; justify-content: flex-start; }
.hero-side .big { font-size: 32px; }
.hero-side .big .of { font-size: 18px; font-weight: 600; color: var(--muted); }
.dpanel.explain { border-left: 4px solid var(--blue); }
.dpanel.explain p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 6px 0 0; }
.dpanel.explain .verdict { padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--c) 10%, #fff); }
.dpanel.explain .verdict b { color: var(--c); }
.dpanel.explain .missing { font-size: 13px; color: var(--muted); }

/* ── Service Titan job lifecycle (11/10) ── */
.jobs-st .lhead, .jobs-st .lrow { grid-template-columns: 56px minmax(240px, 1.7fr) repeat(7, 38px) minmax(160px, 1fr) 96px 96px 96px 124px; }
a.hl { text-decoration: none; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
a.hl:hover { background: var(--surface-2); }
.hero-side .stile.money > div { min-width: 150px; }
.filters .chk { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.drawer.wide { width: min(1200px, 86vw); }
.dkpis.five { grid-template-columns: repeat(5, 1fr); }
.dkpi .v small { font-size: 14px; font-weight: 700; }
@media (max-width: 900px) { .dkpis.five { grid-template-columns: 1fr 1fr; } }
table.money-io tr.grp td { font: 700 12px var(--font-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--surface-2); padding-top: 10px; }
table.money-io td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.qblines { margin-top: 12px; }
.qblines summary { cursor: pointer; font-size: 13px; color: var(--blue-dark); font-weight: 600; }
.tl-head { display: flex; align-items: center; gap: 12px; }
.tl-head h3 { margin: 0; }
.tl-head .btn { margin-left: auto; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.tl { margin-top: 14px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.tl-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.tl-axis { position: relative; height: 104px; margin: 6px 22px 0; }
.tl-line { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: var(--line); }
.tl-dot { position: absolute; top: 13px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; border: 3px solid #fff;
          background: var(--c); box-shadow: 0 0 0 1px var(--c); cursor: pointer; padding: 0; }
.tl-dot:hover, .tl-dot.on { transform: scale(1.25); box-shadow: 0 0 0 2px var(--c); }
.tl-dot i { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font: 700 10px var(--font-body); font-style: normal; color: var(--ink); }
.tl-date { position: absolute; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.tl-date.r0 { top: 42px; } .tl-date.r1 { top: 60px; } .tl-date.r2 { top: 78px; }
.tl-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 4px; }
.tl-card-date { font: 700 13px var(--font-heading); color: var(--ink); margin-bottom: 6px; }
.tl-item { display: grid; grid-template-columns: 12px 130px 1fr; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 4px 0; color: var(--ink-2); }
.tl-item .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); align-self: center; }
.tl-item > b { color: var(--ink); }
.tl-table { margin-top: 14px; }
.kdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 7px; }
.drawer .loading { padding: 40px; text-align: center; color: var(--muted); }
.jobs-st .lhead, .jobs-st .lrow { grid-template-columns: 52px minmax(210px, 1.5fr) repeat(7, 34px) minmax(130px, .9fr) 86px 86px 86px 118px; gap: 12px; }
.hero-side .stile.money { align-items: center; align-content: center; }
.filters input[name=q] { width: 210px; }

/* ── Chat bubble (Jude 11/11): floating, not a tab ── */
.chat-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(15,25,35,.25); cursor: pointer; display: grid; place-items: center; z-index: 60; }
.chat-fab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.chat-fab:hover { transform: translateY(-1px); }
.chat-pop { position: fixed; right: 24px; bottom: 92px; width: min(380px, calc(100vw - 32px)); height: min(480px, calc(100vh - 140px)); background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(15,25,35,.2); display: flex; flex-direction: column; z-index: 60; overflow: hidden; }
.chat-pop[hidden] { display: none; }
.chat-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-log .msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.chat-log .msg.bot { background: var(--surface-2); color: var(--ink); align-self: flex-start; }
.chat-log .msg.me { background: var(--ink); color: #fff; align-self: flex-end; }
.chat-pop .chatbox { margin: 0; padding: 12px; border-top: 1px solid var(--line); max-width: none; }
.chat-pop .chatbox input { padding: 10px 12px; font-size: 14px; }
@media (max-width: 640px) { .chat-fab { right: 16px; bottom: 16px; } .chat-pop { right: 16px; bottom: 82px; } }

/* ── Calmer look (Jude 11/12): Field Ops OS palette and type ──
   Soft paper background, white panels with hairline borders, no drop shadows, one quiet teal accent,
   system font, sentence-case labels. MT's logo carries the brand; the UI stays out of its way. */
:root {
  --paper: #F5F6F8; --accent: #0F6E78; --accent-soft: #E3F0F1;
  --ink: #131A22; --ink-2: #38424E; --muted: #6A7684; --muted-2: #8A95A3;
  --line: #E2E5EA; --line-2: #EDEFF2; --surface: #F5F6F8; --surface-2: #FAFBFC;
  --ok: #1B7F4B; --ok-bg: #E6F2EB; --warn: #B4620A; --warn-bg: #F7ECDE; --bad: #B4351F; --bad-bg: #F7E6E2;
  --red: var(--accent); --red-bright: #14868F; --blue: var(--accent); --blue-dark: var(--accent);
  --shadow: none; --shadow-lg: 0 12px 32px rgba(19, 26, 34, .10);
  --radius-lg: 12px;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-heading); --font-label: var(--font-heading);
}
body { background: var(--paper); color: var(--ink-2); font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4 { letter-spacing: -.01em; font-weight: 650; }
a { color: var(--accent); }

header.top { border-bottom: 1px solid var(--line); box-shadow: none; padding: 10px 22px; }
header.top .logo { height: 30px; }
.btn { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.seg a, .seg button { font-size: 13px; }
.seg a.on, .seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Left tabs: the original icon tiles, active tile in the accent */
nav.rail a { font-family: var(--font-body); }
nav.rail a.active .ic { background: var(--accent); }
nav.rail a.active { color: var(--accent); }

.panel-head h1 { font-size: 22px; }
.panel-head .sub, .card .cardsub { color: var(--muted); }
.tab { font: 500 14px var(--font-body); border-bottom-width: 2px; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Cards and tiles: flat, hairline borders */
.card, .kpi, .stile, .list, .filters, .dkpi, .dpanel { box-shadow: none; border-color: var(--line); }
.kpi::before { display: none; }
.kpi .l, .eyebrow, .lhead, table.t th, .empty-state .es-src {
  font: 600 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.kpi .n { font: 700 26px var(--font-heading); }
.stile .big, .hero-side .big { font: 700 28px var(--font-heading); letter-spacing: -.01em; }
.donut .mid b, .hero-donut .donut .mid b { font-weight: 700; }
.hero-donut .donut .mid b { font-size: 40px; }
.hl b { font: 700 16px var(--font-heading); }
.hl .hn { font-weight: 500; color: var(--ink-2); }
.dhead h2, .dkpi .v { font-weight: 700; }
.dpanel h3 { font-weight: 650; }
.lhead { background: var(--surface-2); }
.lrow.click:hover { background: var(--surface-2); }
.tt b { font-weight: 600; }
.pill { font: 600 11.5px var(--font-body); letter-spacing: 0; text-transform: none; border-radius: 6px; padding: 2px 8px; }
.dot-cat.y { background: var(--ok-bg); color: var(--ok); }
.cat .bar span, .cat.red .bar span, .cat.blue .bar span { background: var(--accent); opacity: .85; }
.usebar i { background: var(--muted); }
.dpanel.explain { border-left: 3px solid var(--accent); }
.drawer { background: var(--paper); box-shadow: -8px 0 28px rgba(19, 26, 34, .10); }
.scrim { background: rgba(19, 26, 34, .18); }
table.money-io tr.grp td { font: 600 11px var(--font-body); letter-spacing: .06em; }
.tl-dot i, .tl-card-date { font-family: var(--font-body); }

.chat-fab { background: var(--accent); box-shadow: 0 6px 18px rgba(15, 110, 120, .28); }
.chat-pop { background: #fff; box-shadow: var(--shadow-lg); }
.chat-log .msg.bot { background: var(--line-2); }
.chat-log .msg.me { background: var(--accent); }

/* Login: light, plain, like Field Ops */
body.login-page { background: var(--paper); }
.login-bg, .login-grain { display: none; }
.login-card { background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(19, 26, 34, .08); backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 14px; }
.login-card .cap { border-bottom: 1px solid var(--line); }
.login-card h2 { color: var(--ink); font: 650 22px var(--font-heading); }
.login-card label { color: var(--ink-2); font: 500 13px var(--font-body); letter-spacing: 0; text-transform: none; }
.login-card input { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.login-card input::placeholder { color: var(--muted-2); }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn-primary { box-shadow: none; }
.login-card .foot { color: var(--muted); }
.login-err { background: var(--bad-bg); border-color: #EBC4BA; color: var(--bad); }

.jobs-st .lhead, .jobs-st .lrow { grid-template-columns: 52px minmax(170px, 1.2fr) repeat(7, 36px) minmax(120px, .8fr) 82px 82px 82px 110px; gap: 10px; }

/* ── Vibrant status colors (Jude 11/13): brighter green / red / amber / blue on the calm base ── */
:root { --ok: #059669; --ok-bg: #D1FAE5; --bad: #DC2626; --bad-bg: #FEE2E2; --warn: #D97706; --warn-bg: #FEF3C7; }
.usebar span { background: #3DB489; }
.usebar.warn span { background: #E5A93D; }
.usebar.bad span { background: #E0685E; }
.usebar.blue span { background: #4A90FF; }
.pill { background: color-mix(in srgb, var(--c, #94A3B8) 16%, #fff); color: color-mix(in srgb, var(--c, #94A3B8) 80%, #000); }

/* ── Categories + sub-pages (Jude 11/13) ── */
.subbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; min-height: 34px; }
.subnav { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.subnav a:hover { background: var(--line-2); color: var(--ink); }
.subnav a.on { background: var(--accent); color: #fff; font-weight: 600; }
.subnav .lock svg, .lock-ic svg { width: 13px; height: 13px; opacity: .7; }
.subbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Overview: one row per advisor */
.adv { margin-bottom: 22px; }
.adv-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.adv-head h2 { font-size: 17px; }
.adv-head span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.adv .kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 0; }
.adv-finance .kpi { border-top: 3px solid #4A90FF; }
.adv-operations .kpi { border-top: 3px solid #E5A93D; }
.adv-sales .kpi { border-top: 3px solid #3DB489; }
.kpi.warn .n { color: var(--bad); }
.kpi.ok .n { color: var(--ok); }
.kpi.locked { background: var(--surface-2); border-style: dashed; }
.kpi.locked .n { color: var(--muted-2); font-size: 20px; display: flex; align-items: center; gap: 6px; }
.kpi .n { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trend { font: 600 12.5px var(--font-body); padding: 2px 7px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.trend.good { background: var(--ok-bg); color: var(--ok); }
.trend.bad { background: var(--bad-bg); color: var(--bad); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns: 1fr; } }
.oval.cst { color: var(--bad); }

/* Lists and tables on the new pages */
.dept-grid { grid-template-columns: minmax(220px, 1.6fr) 70px 60px 110px 100px minmax(160px, 1fr) 110px 110px !important; min-width: 960px; }
.unpaid-grid { grid-template-columns: minmax(260px, 2fr) 170px 110px 100px 100px 110px !important; min-width: 880px; text-decoration: none; color: inherit; }
.strip.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
@media (max-width: 1080px) { .strip.four { grid-template-columns: 1fr 1fr; } }
.filters.flat { border: 0; padding: 0; margin: 4px 0 10px; }
.filters.flat input { width: 100%; }
.muted { color: var(--muted); }
details.price { border-top: 1px solid var(--line-2); }
details.price summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto 100px; gap: 12px; align-items: center; padding: 10px 2px; }
details.price summary::-webkit-details-marker { display: none; }
details.price summary:hover { background: var(--surface-2); }
details.price table { margin: 0 0 12px; }
.wbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 8px; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.wb-col { flex: 1; width: 100%; max-width: 42px; position: relative; display: flex; align-items: flex-end; }
.wb-col span { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 5px 5px 0 0; background: #CBD5E1; }
.wb-col span:first-child:last-child { background: #4A90FF; }
.wb-col span.sold { background: #3DB489; left: 18%; right: 18%; }
.wb small { font-size: 11px; color: var(--muted); }
.will-show { text-align: left; max-width: 60ch; color: var(--ink-2); line-height: 1.7; font-size: 14px; }
.locked-card .es-icon { color: var(--muted); }

/* Reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report-card { display: flex; gap: 14px; text-decoration: none; color: inherit; }
.report-card:hover { border-color: var(--accent); }
.rc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.rc-ic svg { width: 22px; height: 22px; }
.rc-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 34px 40px; max-width: 1040px; }
.rep-head h1 { font-size: 28px; margin: 4px 0 6px; }
.rep-head { border-bottom: 2px solid var(--accent); padding-bottom: 16px; margin-bottom: 8px; }
.rep-sec { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.rep-sec h2 { font-size: 17px; margin-bottom: 12px; color: var(--accent); }
.rep-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.rep-kpis > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.rep-kpis .n { font: 700 22px var(--font-heading); color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.rep-kpis .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rep-sug ol { margin: 0; padding-left: 20px; line-height: 1.6; color: var(--ink); }
.rep-sug li { margin-bottom: 8px; }
.rep-blind ul { margin: 0; padding-left: 20px; color: var(--ink-2); line-height: 1.6; font-size: 14px; }
@media print {
  header.top, nav.rail, .subbar, .chat-fab, .chat-pop, .foot-note { display: none !important; }
  .shell { display: block; } main { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; }
  body { background: #fff; }
}

/* Chat answers keep their line breaks; suggestion chips */
.chat-log .msg { white-space: pre-line; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font: 500 12.5px var(--font-body); color: var(--accent); cursor: pointer; }
.chips button:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-pop { width: min(440px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px)); }
@media (max-width: 860px) { .subnav { width: 100%; overflow-x: auto; flex-wrap: nowrap; } }
.tt .kdot { display: inline-block; vertical-align: 1px; }

/* ── v3 (Jude 11/13): needs-you strip, actions, new pages ── */
.needs { margin-bottom: 22px; }
.needs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.need { position: relative; display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-left: 4px solid #E5A93D; border-radius: 12px; padding: 14px 16px 30px; }
.need.bad { border-left-color: #E0685E; }
.need:hover { border-color: var(--accent); border-left-color: inherit; }
.need .nk { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.need .nt { font: 650 16px var(--font-heading); color: var(--ink); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.need .nl { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.need .go { position: absolute; right: 14px; bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.adv .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .adv .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi.bucket { border-top: 3px solid var(--c); cursor: pointer; }
.kpi.bucket.sel { background: color-mix(in srgb, var(--c) 8%, #fff); border-color: var(--c); }
.kpi .n.cst, .n.cst { color: var(--bad); }
.chip-muted { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 999px; padding: 5px 12px; }
.chip-muted svg { width: 13px; height: 13px; }
.small { font-size: 12px; }
.h1-sub { font-size: 15px; font-weight: 500; }
form.inline { display: inline-flex; }
.filters form.inline input { width: 260px; }
.btn svg { width: 15px; height: 15px; }
a.ext { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); color: var(--accent); background: #fff; }
a.ext:hover { border-color: var(--accent); background: var(--accent-soft); }
a.ext svg { width: 15px; height: 15px; }
.tt a { color: var(--ink); text-decoration: none; } .tt a:hover { color: var(--accent); text-decoration: underline; }

/* Top line chart with a real axis */
.chart { display: grid; grid-template-columns: 56px 1fr; gap: 8px; height: 300px; margin-top: 10px; }
.yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11.5px; color: var(--muted); padding-bottom: 38px; transform: translateY(6px); }
.plot { position: relative; padding-bottom: 38px; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); transform: translateY(-38px); margin-bottom: 38px; }
.plot .gridline { bottom: 0; }
.cols { position: absolute; inset: 0 0 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; padding: 0 10px; }
.col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.col .stack { width: 64%; max-width: 90px; height: calc(100% - 38px); display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.col .stack span { display: block; width: 100%; }
.col .stack span:last-child { border-radius: 6px 6px 0 0; }
.col .coltotal { position: absolute; font-size: 12px; color: var(--ink); }
.col small { height: 38px; display: flex; align-items: center; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tl-grid { grid-template-columns: minmax(200px, 1.4fr) 150px 70px 80px 100px minmax(180px, 1fr) 110px !important; min-width: 900px; }
.mbar { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }

/* Purchases, prices, collections, stuck */
.buy-grid { grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) 70px 100px 100px 100px 150px 40px !important; min-width: 1000px; }
.pc-grid { grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr) 110px 90px 90px 60px 100px 80px !important; min-width: 980px; }
.vs-grid { grid-template-columns: minmax(240px, 2fr) 140px 140px 120px !important; min-width: 640px; }
.stuck-grid { grid-template-columns: minmax(260px, 2fr) 170px 120px 110px 100px 110px 40px !important; min-width: 960px; }
.col-grid { grid-template-columns: minmax(240px, 2fr) 110px 80px 100px 190px 190px 80px !important; min-width: 1000px; }
table.plist td, table.plist th { white-space: nowrap; }
table.plist td:first-child { white-space: normal; min-width: 220px; }
.cmp { padding: 16px 18px; }
.cmp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cmp-row { display: grid; grid-template-columns: 200px 1fr 80px 190px; gap: 12px; align-items: center; padding: 5px 0; font-size: 14px; }
.cmp-row .bar { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.cmp-row .bar span { display: block; height: 100%; border-radius: 6px; }
.cmp-row .v { font-weight: 700; text-align: right; }
.cmp-row .p { font-size: 12px; color: var(--muted); }
.coll2 { overflow-x: auto; }
details.crow > summary { list-style: none; }
details.crow > summary::-webkit-details-marker { display: none; }
details.crow[open] > summary { background: var(--accent-soft); }
.cbody { padding: 14px 18px 18px; background: var(--surface-2); border-top: 1px solid var(--line-2); min-width: 1000px; }
form.cnote { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; }
form.cnote input[type=text] { flex: 1; min-width: 240px; font: 14px var(--font-body); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
form.cnote input[type=date] { font: 13px var(--font-body); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.cbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rb input { display: none; }
.rb span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
.rb input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.money-eq { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.money-eq .me { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 170px; flex: 1; }
.money-eq .me.net { border: 2px solid var(--accent); }
.money-eq .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.money-eq .n { font: 700 24px var(--font-heading); color: var(--ink); margin-top: 4px; }
.money-eq .op { display: grid; place-items: center; font-size: 22px; color: var(--muted); font-weight: 300; }
details.card summary { cursor: pointer; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-kpis .n { font: 700 24px var(--font-heading); color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.mini-kpis .l { font-size: 12.5px; color: var(--muted); }

/* Locked pages */
.locked-card2 { padding: 22px 24px; border-style: dashed; }
.lk-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.lk-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--line-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.lk-ic svg { width: 20px; height: 20px; }
.lk-head h3 { font-size: 18px; margin-top: 2px; }
.lk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lk-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.lk-item b { display: block; color: var(--ink); margin-bottom: 4px; }
.lk-item span { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 760px) { .lk-grid { grid-template-columns: 1fr; } }

/* Settings */
.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid #A7F3D0; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 500; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stack-form input, .stack-form select, .stack-form textarea { font: 14px var(--font-body); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-weight: 400; }
.inline-form { display: inline-flex; gap: 6px; }
.src-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* Settings > Connections: status board, one row per source, one bar per night */
.status-board { padding: 0; overflow: visible; }
.status-board > :first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.sb-summary { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sb-summary > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sb-summary > div span { color: var(--muted); font-size: 13px; }
.sb-summary .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #3DB489; }
.sb-summary.stale .dot { background: #E5A93D; } .sb-summary.down .dot { background: #E0685E; } .sb-summary.waiting .dot { background: #A0AEC0; }
.sb-summary.down { background: var(--bad-bg); } .sb-summary.stale { background: var(--warn-bg); }
.sb-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sb-row { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.sb-head h3 { margin: 0; font-size: 15px; }
.sb-state { font-size: 13px; font-weight: 600; text-align: right; color: var(--muted); }
.sb-state.ok { color: #2F7D5B; } .sb-state.down { color: var(--bad); } .sb-state.stale { color: var(--warn); } .sb-state.info { color: var(--blue-dark); }
.sb-bars { display: flex; gap: 2px; height: 34px; }
.sb-bars i, .sb-legend i { flex: 1; border-radius: 1.5px; background: #EDEFF2; min-width: 0; }
.sb-bars i { position: relative; cursor: default; outline: none; }
.sb-bars i:hover, .sb-bars i:focus-visible { opacity: .65; }
.sb-bars .tip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--ink); color: #fff; font: 400 12px/1.35 var(--font-body); padding: 7px 10px; border-radius: 6px; white-space: nowrap;
  box-shadow: var(--shadow-lg); pointer-events: none; }
.sb-bars .tip b { display: block; font-weight: 600; }
.sb-bars i.tip-l .tip { left: 0; transform: none; } .sb-bars i.tip-r .tip { left: auto; right: 0; transform: none; }
.sb-bars i:hover .tip, .sb-bars i:focus .tip { display: block; }
.phone-only { display: none; }
i.ok { background: #3DB489; } i.failed { background: #E0685E; } i.missed { background: #E5A93D; } i.waiting { background: #CBD3DD; }
.sb-axis { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sb-line { flex: 1; height: 1px; background: var(--line); }
.sb-more { margin-top: 8px; font-size: 13px; }
.sb-more summary { cursor: pointer; color: var(--muted); }
.sb-detail { display: grid; gap: 6px; padding: 8px 0 2px; }
.sb-detail > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; }
.sb-detail span:first-child { color: var(--muted); }
.sb-detail .bad b, .sb-action .bad { color: var(--bad); }
.sb-action { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.sb-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 20px; font-size: 12px; color: var(--muted); }
.sb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sb-legend i { display: inline-block; flex: none; width: 10px; height: 14px; }
@media (max-width: 640px) {
  .sb-bars { gap: 3px; height: 28px; }
  .sb-bars i.old { display: none; }
  .wide-only { display: none; } .phone-only { display: inline; }
  .sb-row, .sb-summary { padding-left: 14px; padding-right: 14px; }
  .sb-note { display: none; }
  .sb-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sb-state { text-align: left; }
  .sb-axis { gap: 6px; }
  .sb-detail > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 1080px) { .src-grid { grid-template-columns: 1fr; } }
.src-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.src-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--line-2); align-items: center; }
.src-row span { color: var(--muted); }
.src-row.bad b { color: var(--bad); }
.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1080px) { .rule-grid { grid-template-columns: 1fr 1fr; } }
.rule-grid div { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.rule-grid b { display: block; color: var(--ink); margin-bottom: 4px; }
.rule-grid span { font-size: 13px; color: var(--ink-2); }

/* Phone: the web app on a phone browser */
@media (max-width: 640px) {
  .needs-row, .adv .kpis { grid-template-columns: 1fr; }
  .money-eq .op { display: none; }
  .chart { height: 240px; }
  .cols { gap: 6px; padding: 0; }
  .col .coltotal { font-size: 10px; }
  .cmp-row { grid-template-columns: 110px 1fr 70px; } .cmp-row .p { display: none; }
  .panel-head .actions { margin-left: 0; width: 100%; }
}

.chart2 { display: grid; grid-template-columns: 60px 1fr; grid-template-rows: 280px auto; column-gap: 10px; margin: 18px 0 6px; }
.yax { position: relative; }
.yax span { position: absolute; right: 0; transform: translateY(50%); font-size: 11.5px; color: var(--muted); }
.area { position: relative; border-left: 1px solid var(--line); border-bottom: 1px solid var(--ink-2); }
.gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bars { position: absolute; inset: 0; display: grid; gap: 22px; padding: 0 18px; align-items: end; }
.bcol { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bstack { position: relative; width: 70%; max-width: 96px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: visible; }
.bstack span { display: block; min-height: 2px; }
.bstack span:last-of-type { border-radius: 6px 6px 0 0; }
.bstack b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--ink); white-space: nowrap; }
.xax { display: grid; gap: 22px; padding: 8px 18px 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) { .bars, .xax { gap: 6px; padding-left: 4px; padding-right: 4px; } .bstack b { font-size: 10px; } }

/* ── v4 (Jude 11/14): the NextEra portal look with calmer highlights, a new Overview, three companies,
   and a real phone layout. White page, soft off-white cards, navy text, one blue accent, Jost.
   Status colors are muted on purpose: they flag, they don't shout. ── */
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/jost-latin.woff2) format('woff2'); }
:root {
  --paper: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F9FC; --card: #F7F9FC;
  --ink: #1A1A2E; --ink-2: #3B4A60; --muted: #6B8299; --muted-2: #9BA8B9;
  --line: #E2E8F0; --line-2: #EDF1F6;
  --accent: #2F6FE0; --accent-bright: #4A90FF; --accent-soft: #EAF2FF; --red-bright: #3D7DFF;
  --ok: #1F8F63; --ok-bg: #E6F5EE; --bad: #C4554B; --bad-bg: #FBECEA; --warn: #A8741A; --warn-bg: #FAF1DE;
  --sample: #6B58C9; --sample-bg: #F3F0FD; --sample-line: #CFC6F4;
  --radius-lg: 16px;
  --font-heading: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-heading); --font-label: var(--font-heading);
}
body { background: var(--paper); color: var(--ink-2); font-size: 15.5px; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.012em; }
.num, .n, .big, .oval, table.t td.num { font-variant-numeric: tabular-nums; }

header.top { background: #fff; border-bottom: 1px solid var(--line); }
nav.rail { background: #fff; }
nav.rail a { font-weight: 500; }
nav.rail a:hover .ic { background: var(--surface-2); }
nav.rail a.active { color: var(--ink); font-weight: 600; }
nav.rail a.active .ic { background: var(--accent-soft); color: var(--accent); }
.seg { border-radius: 10px; }
.seg a.on, .seg button.on { background: var(--ink); color: #fff; font-weight: 500; }
.subnav { background: var(--card); border-radius: 12px; }
.subnav a { border-radius: 9px; }
.subnav a:hover { background: #fff; }
.subnav a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(26, 26, 46, .10), 0 0 0 1px var(--line); }
.btn { border-radius: 10px; }
.btn-primary { background: var(--accent); }
.chat-fab { background: var(--ink); box-shadow: 0 8px 22px rgba(26, 26, 46, .22); }
.chat-log .msg.me { background: var(--ink); }

/* Surfaces: cards sit off-white on a white page; tables stay white so rows read cleanly */
.card, .kpi, .stile, .dkpi, .dpanel, .money-eq .me, .filters, .report { background: var(--card); border-color: var(--line); border-radius: var(--radius-lg); }
.list { background: #fff; border-radius: var(--radius-lg); }
.lhead { background: var(--card); }
.filters input[type=search], .filters select { border-radius: 10px; }
.kpi .l, .eyebrow, .lhead, table.t th, .empty-state .es-src, .money-eq .l {
  font: 500 12.5px var(--font-body); letter-spacing: .02em; text-transform: none; color: var(--muted);
}
.kpi .n { font: 600 27px var(--font-heading); letter-spacing: -.015em; }
.kpi.bucket { border-top-width: 1px; border-left: 3px solid var(--c); }
.kpi.warn .n, .kpi .n.cst, .n.cst { color: var(--bad); }
.stile .big, .hero-side .big, .money-eq .n, .dkpi .v, .rep-kpis .n, .mini-kpis .n { font-weight: 600; }
.tt b { font-weight: 600; }
.trend { border-radius: 999px; font-weight: 500; }
.pill { border-radius: 999px; font-weight: 500; }
.asof { background: transparent; }
.need:hover, a.kpi:hover, .report-card:hover { border-color: var(--accent-bright); }
.money-eq .me.net { border: 1px solid var(--accent-bright); background: var(--accent-soft); }
.rep-head { border-bottom: 1px solid var(--line); }
.rep-sec h2 { color: var(--ink); }

/* Sample data: always visibly tagged */
.sample-tag { display: inline-block; font: 600 10.5px var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--sample);
              background: var(--sample-bg); border: 1px dashed var(--sample-line); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.sample-banner { background: var(--sample-bg); border: 1px dashed var(--sample-line); color: var(--ink-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.sample-banner b { color: var(--sample); margin-right: 6px; }

/* Overview */
.ov-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ov-head h1 { font-size: 28px; }
.ov-date { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.src-chip { font-size: 12px; color: var(--muted); font-weight: 500; }
.subbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }
.sec { margin-bottom: 26px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; min-height: 34px; }
.sec-head h2 { font-size: 19px; }
.sec-sub { color: var(--muted); font-size: 13.5px; }
.sec-right { margin-left: auto; }
.sec-link { font-size: 13.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.sec-link::after { content: " →"; }
.count-pill { font: 600 12px var(--font-body); background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; }
.score { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.score.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.queues { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
        padding: 16px 18px 14px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--accent-bright); box-shadow: 0 4px 14px rgba(47, 111, 224, .08); }
.stat .l { font-size: 13.5px; font-weight: 500; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat .n { font: 600 30px/1.15 var(--font-heading); letter-spacing: -.02em; color: var(--ink); margin-top: 6px; display: flex; align-items: center; gap: 6px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .d { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 22px; }
.stat.small .n { font-size: 24px; }
.stat.small { padding: 14px 16px 12px; }
.stat.bad .n, .stat.flag .n, .neg { color: var(--bad) !important; }
.stat.locked { background: #fff; border-style: dashed; }
.stat.locked .n { color: var(--muted-2); font-size: 19px; }
.lock-ic svg { width: 15px; height: 15px; }

.needs-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.need { background: #fff; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 40px; }
.need::before { content: ""; position: absolute; left: 18px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: #E5A93D; }
.need.bad::before { background: #E0685E; }
.need.bad { border-left-color: var(--line); }
.need .nk { padding-left: 16px; font: 500 12.5px var(--font-body); letter-spacing: .02em; text-transform: none; color: var(--muted); }
.need .nt { font: 600 17px var(--font-heading); margin-top: 8px; }
.need .nl { font-size: 14px; line-height: 1.45; margin-top: 4px; color: var(--ink-2); }
.need .go { right: 18px; bottom: 14px; font-size: 13px; font-weight: 500; }
.need .go::after { content: " →"; }

.cos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.co-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; overflow: hidden; }
.co-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; text-decoration: none; color: inherit; }
.co-top:hover .co-name { color: var(--accent); }
.co-name { font: 600 17px var(--font-heading); color: var(--ink); display: flex; align-items: center; }
.co-billed { font: 600 24px var(--font-heading); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.co-margin { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 0 18px 14px; font-size: 13px; color: var(--muted); }
.co-margin b { font-size: 15px; color: var(--ink); font-weight: 600; }
.floorbar { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.floorbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: #3DB489; }
.floorbar.bad span { background: #E0685E; }
.floorbar i { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink); }
.co-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.co-facts a { padding: 10px 18px; text-decoration: none; color: inherit; border-left: 1px solid var(--line-2); min-width: 0; }
.co-facts a:first-child { border-left: 0; }
.co-facts a:hover { background: var(--accent-soft); }
.co-facts b { display: block; font: 600 17px var(--font-heading); color: var(--ink); font-variant-numeric: tabular-nums; }
.co-facts span { font-size: 12.5px; color: var(--muted); }
.co-depts { padding: 8px 8px 10px; }
.co-dept { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(40px, 1fr) 58px 44px; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px;
           font-size: 13.5px; text-decoration: none; color: var(--ink-2); }
.co-dept:hover { background: #fff; }
.co-dept .dn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-dept .db { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.co-dept .db i { display: block; height: 100%; border-radius: 3px; opacity: .85; }
.co-dept .dv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.co-dept .dm { text-align: right; font-weight: 600; color: var(--ok); font-variant-numeric: tabular-nums; }
.co-none { padding: 4px 18px 20px; color: var(--muted); font-size: 14px; }
.co-card.empty { background: #fff; border-style: dashed; }

/* Company by department matrix (Top line) and itemized vendor spend (Prices) */
.matrix td, .matrix th { white-space: nowrap; }
.matrix td.cell { text-align: right; }
.matrix td.cell small { display: block; font-size: 12px; font-weight: 600; color: var(--ok); }
.matrix td.cell small.neg { color: var(--bad); }
.matrix td.cell a { color: var(--ink); text-decoration: none; font-weight: 500; }
.matrix td.cell a:hover { color: var(--accent); text-decoration: underline; }
.matrix td.na { color: var(--muted-2); text-align: right; }
details.vendor { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 10px; overflow: hidden; }
details.vendor > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 90px 110px; gap: 14px; align-items: center; padding: 14px 18px; }
details.vendor > summary::-webkit-details-marker { display: none; }
details.vendor > summary:hover, details.vendor[open] > summary { background: var(--card); }
details.vendor .vb { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
details.vendor .vb i { display: block; height: 100%; background: var(--accent-bright); opacity: .8; border-radius: 4px; }
details.vendor .vt { text-align: right; font: 600 16px var(--font-heading); color: var(--ink); font-variant-numeric: tabular-nums; }
details.vendor .vc { text-align: right; font-size: 13px; color: var(--muted); }
details.vendor .vitems { padding: 0 8px 8px; overflow-x: auto; }

/* Leads, Crew, Lowe's & Home Depot */
.hero-row { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.2fr); gap: 12px; margin-bottom: 16px; }
.big-count { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; }
.big-count .n { font: 600 64px/1 var(--font-heading); letter-spacing: -.03em; color: var(--bad); font-variant-numeric: tabular-nums; }
.big-count .l { font: 600 17px var(--font-heading); color: var(--ink); margin-top: 8px; }
.big-count .d { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }
.wait { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wait.bad { color: var(--bad); } .wait.warn { color: var(--warn); } .wait.ok { color: var(--ok); }
.hbar { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.hbar .track { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 5px; background: var(--accent-bright); opacity: .85; }
.hbar .v { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.hbar .v small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.funnel-step { display: grid; grid-template-columns: 120px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.funnel-step .track { height: 22px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.funnel-step .track i { display: block; height: 100%; border-radius: 6px; opacity: .85; }
.funnel-step .v { text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel-step .v small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.goal-line { font-size: 13px; color: var(--muted); }
.wbars.stacked .wb-col span { background: #4A90FF; opacity: .85; }
.wbars.stacked .wb-col span.b2 { background: #EB8A4A; }
.wb-col span:first-child:last-child { background: var(--accent-bright); opacity: .85; }
.lead-grid { grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) 130px 120px 190px 120px !important; min-width: 900px; }
.crew-grid { grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1fr) minmax(160px, 1.2fr) 80px 80px 90px 90px 90px !important; min-width: 940px; }
.store-grid { grid-template-columns: minmax(180px, 1.4fr) 70px 80px 90px 70px 100px 130px 100px !important; min-width: 880px; }

@media (max-width: 1280px) { .queues { grid-template-columns: repeat(3, minmax(0, 1fr)); } .score { grid-template-columns: repeat(3, minmax(0, 1fr)); } .score.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .cos, .needs-row { grid-template-columns: 1fr; } .hero-row { grid-template-columns: 1fr; } }

/* ── Phone: bottom tab bar like an app, company switch under the logo, one column ── */
.shell { grid-template-columns: 104px minmax(0, 1fr); }
main { min-width: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  header.top { flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
  header.top .right { display: flex; order: 3; width: 100%; margin-left: 0; }
  header.top .co-switch { display: flex; width: 100%; }
  header.top .co-switch a { flex: 1; text-align: center; padding: 6px 4px; font-size: 13px; }
  nav.rail, nav.rail.open { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; align-items: stretch; justify-content: space-around; gap: 0;
             max-height: none; overflow: visible; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #fff;
             border-top: 1px solid var(--line); border-bottom: 0; border-right: 0; }
  nav.rail a { flex: 1; flex-direction: column; gap: 1px; font-size: 10.5px; padding: 0; width: auto; }
  nav.rail a .ic { width: 44px; height: 30px; border-radius: 10px; }
  nav.rail a .ic svg { width: 21px; height: 21px; }
  nav.rail .rail-sep { display: none; }
  nav.rail .drawer-only { display: none; }
  nav.rail.open .drawer-only { display: flex; position: fixed; top: 100px; right: 10px; left: auto; background: #fff; border: 1px solid var(--line);
                               border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg); z-index: 31; }
  nav.rail .drawer-only .seg { display: none; }
  main { padding: 14px 12px 104px; }
  .subbar { margin-bottom: 12px; }
  .subbar-right { margin-left: 0; justify-content: flex-start; }
  .ov-head h1 { font-size: 23px; }
  .sec { margin-bottom: 22px; }
  .score, .score.four, .queues { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .score > .stat:first-child { grid-column: 1 / -1; }
  .stat { padding: 13px 14px 11px; }
  .stat .n { font-size: 25px; }
  .stat.small .n { font-size: 21px; }
  .stat .d { font-size: 12.5px; }
  .sec-head .seg.sec-right { margin-left: 0; width: 100%; display: flex; }
  .sec-head .seg.sec-right a { flex: 1; text-align: center; }
  .co-facts a { padding: 10px 12px; }
  .chat-fab { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .chat-pop { right: 10px; bottom: calc(136px + env(safe-area-inset-bottom)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  details.vendor > summary { grid-template-columns: minmax(0, 1fr) 100px; }
  details.vendor .vb, details.vendor .vc { display: none; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; }
  .big-count .n { font-size: 52px; }
}

/* ── v5 (Jude 11/14, review round 1): today's list as plain lines with Done, cost types written out, bar hover ── */
.nlist { border-top: 1px solid var(--line); }
.nrow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; column-gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.nrow .ndot, .came-for .ndot { width: 8px; height: 8px; border-radius: 50%; background: #E5A93D; }
.nrow.bad .ndot, .came-for.bad .ndot { background: #E0685E; }
.nrow.clear .ndot { background: #3DB489; }
.nrow.was .ndot { background: var(--line); }
.nrow .nk, .came-for .nk { font-size: 12.5px; color: var(--muted); }
.nrow .nl, .came-for .nl { font-size: 15px; line-height: 1.45; color: var(--ink-2); margin-top: 1px; }
.nrow .nl b, .came-for .nl b { color: var(--ink); font-weight: 600; }
.nrow.was .nl { color: var(--muted); }
.nrow form, .came-for form { margin: 0; }
.nact { font-size: 13.5px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; }
.nact::after { content: " →"; }
.nact:hover { text-decoration: underline; }
.ndone { font: 500 13px var(--font-body); color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.ndone:hover { border-color: #3DB489; color: #2C8F6B; }
.ndone-list { margin-top: 10px; }
.ndone-list > summary { font-size: 13px; color: var(--muted); cursor: pointer; width: fit-content; }
.ndone-list .nrow { grid-template-columns: 10px minmax(0, 1fr) auto; padding: 9px 4px; }
.came-for { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; column-gap: 14px; background: var(--card, #F7F9FC);
            border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); padding: 12px 16px; margin-bottom: 16px; }
@media (max-width: 860px) {
  .nrow, .came-for { grid-template-columns: 10px minmax(0, 1fr) auto; row-gap: 8px; }
  .nrow .nact, .came-for form { grid-column: 2; }
  .nrow form, .came-for > a { grid-column: 3; }
  .nrow .nact { grid-row: 2; } .nrow form { grid-row: 2; }
}

.jobs-st .lhead, .jobs-st .lrow { grid-template-columns: 52px minmax(200px, 1.4fr) minmax(190px, 1.1fr) minmax(130px, .8fr) 86px 86px 86px 118px; gap: 12px; }
.jobs .lhead, .jobs .lrow { grid-template-columns: 56px minmax(220px, 1.5fr) minmax(190px, 1.1fr) minmax(170px, 1fr) 96px 96px 120px; }
.costs { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.costs b { color: var(--ink); font-weight: 600; margin-left: 4px; }

.bcol { position: relative; outline: none; cursor: default; }
.bcol:hover .bstack, .bcol:focus .bstack { filter: brightness(.94); }
.btip { display: none; position: absolute; z-index: 5; bottom: 12px; left: 50%; transform: translateX(-50%); width: max-content; min-width: 250px; background: #fff;
        border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(26, 26, 46, .14); padding: 12px 14px; pointer-events: none; }
.bcol.edge-l .btip { left: 0; transform: none; }
.bcol.edge-r .btip { left: auto; right: 0; transform: none; }
.bcol:hover .btip, .bcol:focus .btip { display: block; }
.bt-h { font: 600 14px var(--font-heading); color: var(--ink); margin-bottom: 8px; }
.bt-r { display: grid; grid-template-columns: 12px 1fr auto 38px; align-items: center; column-gap: 10px; font-size: 13px; color: var(--ink-2); padding: 3px 0; white-space: nowrap; }
.bt-r .kdot { margin: 0; }
.bt-r b { color: var(--ink); font-weight: 600; text-align: right; }
.bt-r i { font-style: normal; color: var(--muted); text-align: right; }
.bt-t { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 7px; font-weight: 600; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
