/* Frigus 3.1 — design tokens lifted from the Command Center prototype */
:root {
  --bg: #F1F4F9;
  --surface: #FFFFFF;             /* solid, crisp surfaces — minimalist, no glass haze */
  --surface2: #F7F9FC;
  --surface3: rgba(120, 145, 175, 0.11);
  --line: rgba(18, 40, 72, 0.07);
  --line2: rgba(18, 40, 72, 0.15);
  --ink: #0E2135;
  --dim: #55657B;
  --faint: #8A99AD;
  --accent: #0AA2C0;
  --accent-deep: #07788F;
  --profit: #15803D;       /* CASH-IN health scale: deep green (collected) */
  --profit-mid: #22C55E;   /* CASH-IN health scale: mid green */
  --profit-soft: #86EFAC;  /* CASH-IN health scale: light green (early) */
  --teal: #0891B2;         /* CASH-OUT health scale: mid teal */
  --teal-deep: #075E6B;    /* CASH-OUT health scale: deep teal */
  --teal-soft: #7DD3E8;    /* CASH-OUT health scale: light teal */
  --alert: #E11D48;
  --amber: #C2710C;
  --amber-soft: #FFF6E9;
  --alert-soft: #FCE9ED;
  --accent-line: rgba(10, 162, 192, 0.28);
  --accent-soft: rgba(10, 162, 192, 0.13);
  --blue: #2563EB;
  --violet: #7C3AED;
  --shadow: 0 1px 2px rgba(13, 35, 66, 0.04), 0 6px 20px -12px rgba(13, 35, 66, 0.16);
  --shadow-hover: 0 2px 6px rgba(13, 35, 66, 0.06), 0 18px 44px -18px rgba(13, 35, 66, 0.26);
  --ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --pad-card: 18px;          /* main cards */
  --pad-card-sm: 12px 14px;  /* compact cards: hero, invoice-doc, group */
}
/* Text-color utilities — extracted from repeated inline styles */
.t-profit { color: var(--profit); }
.t-alert { color: var(--alert); }
.t-amber { color: var(--amber); }
.t-violet { color: var(--violet); }
.t-dim { color: var(--dim); }

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;     /* figures line up in columns — financial-grade */
  letter-spacing: -0.011em;               /* subtle Inter tracking for a refined, premium look */
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  color: var(--ink);
  background:
    radial-gradient(1100px 540px at 88% -12%, rgba(10, 162, 192, 0.05), transparent 60%),
    radial-gradient(820px 460px at -8% 108%, rgba(124, 58, 237, 0.04), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid var(--line); background: var(--surface2);
  backdrop-filter: blur(8px); position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 21px;
  background: linear-gradient(140deg, #22C55E, var(--profit));
  box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; letter-spacing: -0.01em; }
.brand-text span { font-size: 10px; color: var(--faint); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: var(--dim); cursor: pointer; text-align: left; transition: all 0.15s ease;
}
.nav-item .nav-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.nav-item .nav-txt strong { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.nav-item .nav-txt .sub { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.nav-item:hover { background: var(--surface); }
.nav-item.is-active {
  background: color-mix(in srgb, var(--hub) 12%, transparent);
  border-color: color-mix(in srgb, var(--hub) 38%, transparent);
  box-shadow: 0 6px 18px -12px color-mix(in srgb, var(--hub) 70%, transparent);
}
.nav-item.is-active .nav-txt strong { color: color-mix(in srgb, var(--hub) 75%, var(--ink)); }
.badge {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: none; place-items: center; color: #fff;
  background: color-mix(in srgb, var(--hub) 78%, transparent);
}
.nav-item:not(.is-active) .badge { background: var(--alert); }
.badge.show { display: grid; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.db-status { font-weight: 700; }
.db-status.ok { color: var(--profit); }
.db-status.bad { color: var(--alert); }
.muted { color: var(--faint); }

/* ---- Main ---- */
.main { padding: 26px 30px 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px;
  position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar h1 { font-size: 24px; letter-spacing: -0.02em; }
.topbar p { font-size: 13px; margin-top: 2px; }
.btn-ai {
  border: 1px solid var(--accent); border-radius: 12px; padding: 10px 16px;
  background: linear-gradient(140deg, var(--accent), var(--violet)); color: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: var(--shadow);
}

/* ---- Cards & grid ---- */
.view { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
/* compact cash tiles — 4 across, smaller, so they don't eat the page */
.grid.tiles-compact.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tiles-compact .tile { padding: 11px 14px; }
.tiles-compact .tile .tile-label { font-size: 11px; }
.tiles-compact .tile .tile-value { font-size: 19px; margin-top: 2px; }
.tiles-compact .tile .tile-sub { font-size: 10.5px; margin-top: 2px; }
@media (max-width: 680px) { .grid.tiles-compact.cols-4 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--pad-card); box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.card h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); margin-bottom: 14px; }
.card h2 .right { float: right; text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 600; }

.tile .tile-label { font-size: 12px; color: var(--dim); font-weight: 600; }
.tile .tile-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.tile .tile-sub { font-size: 12px; color: var(--faint); margin-top: 4px; }
.tile.accent { border-top: 3px solid var(--accent); }
.tile.profit .tile-value { color: var(--profit); }
.tile.alert .tile-value { color: var(--alert); }
/* Premium cash tiles — health rail: green=cash-in good · teal=cash-out good · red=attention · grey=neutral */
.tiles-compact .tile { position: relative; overflow: hidden; padding-left: 18px; background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 96%, var(--faint)) 100%); }
.tiles-compact .tile::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--faint); opacity: .85; transition: width .12s ease, opacity .12s ease; }
.tiles-compact .tile.profit { background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 93%, var(--profit)) 100%); }
.tiles-compact .tile.profit::before { background: var(--profit); }
.tiles-compact .tile.teal { background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 93%, var(--teal)) 100%); }
.tiles-compact .tile.teal::before { background: var(--teal); }
.tiles-compact .tile.alert  { background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 93%, var(--alert)) 100%); }
.tiles-compact .tile.profit::before { background: var(--profit); }
.tiles-compact .tile.alert::before  { background: var(--alert); }
.tiles-compact .tile .tile-label { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--dim); }
.tiles-compact .tile:hover::before { width: 5px; opacity: 1; }

/* gauge / lifecycle bar */
.bar { height: 14px; border-radius: 999px; overflow: hidden; display: flex; background: var(--surface3); }
.bar > span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }
/* Committed-vs-budget hero bar (Expenses tab): scaled to spent+requested, with a budget marker. */
.cbar-wrap { position: relative; margin: 15px 0 9px; }
.cbar-mark { position: absolute; top: -4px; height: 18px; width: 2px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); z-index: 2; box-shadow: 0 0 0 1.5px var(--surface); }
.cbar-lbl { position: absolute; top: -16px; transform: translateX(-50%); font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--dim); white-space: nowrap; }
.cbar-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--dim); font-weight: 600; }
.cbar-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.cbar-legend .cbar-foot { margin-left: auto; font-weight: 700; text-align: right; }

.gauge-wrap { display: flex; align-items: center; gap: 18px; }
.gauge { --pct: 0; --col: var(--profit); width: 120px; height: 120px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--col) calc(var(--pct) * 1%), var(--surface3) 0);
  display: grid; place-items: center; }
.gauge::after { content: ""; width: 88px; height: 88px; border-radius: 50%; background: var(--surface); position: absolute; box-shadow: var(--shadow); }
.gauge b { position: relative; font-size: 22px; }

/* tables / lists */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* premium typography polish — tighter tracking on headings & big figures */
h1, h2, h3, .tile-value, .big, .hm-val, .pf-prof, .modal-head h3 { letter-spacing: -0.022em; }
.tile-value, .big, .pay-pct { font-feature-settings: "tnum" 1, "cv05" 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; background: color-mix(in srgb, currentColor 12%, transparent); color: var(--dim); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.Inquiry { color: var(--faint); }
.pill.Quotation { color: var(--blue); }
.pill.Approved, .pill.Ongoing { color: var(--accent-deep); }
.pill.For\.Billing { color: var(--amber); }
.pill.Billed { color: var(--amber); }
.pill.Paid, .pill.Done { color: var(--profit); }
.pill.Cancelled { color: var(--alert); }
.flag { color: var(--alert); font-weight: 700; font-size: 11px; }

.kpi-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--dim); }
.chip b { color: var(--ink); font-weight: 800; margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.chip.is-active b { color: #fff; background: rgba(255, 255, 255, 0.22); }

.progress { height: 8px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--violet); }

.loading { color: var(--faint); padding: 40px; text-align: center; }
.empty { color: var(--faint); font-size: 13px; padding: 18px 2px; text-align: center; }
.err { color: var(--alert); padding: 12px; }

/* ---- buttons ---- */
.btn { border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.13s ease; }
.btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-primary { background: linear-gradient(140deg, var(--accent), var(--accent-deep)); color: #fff; border-color: transparent; }
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn-ghost:hover { background: var(--surface3); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- toolbar: search + chips + actions ---- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1; min-width: 180px; max-width: 460px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }
.search input { border: none; outline: none; background: transparent; font-size: 14px; width: 100%; color: var(--ink); }
.search input::placeholder { color: var(--faint); }
.search-clear { flex: none; border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 6px; border-radius: 999px; }
.search-clear:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.search-clear[hidden] { display: none; }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--accent); }
.chip.chip-empty { opacity: .4; }

/* ---- segmented toggle ---- */
.seg { display: inline-flex; gap: 2px; background: var(--surface3); border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
.seg button { border: none; background: transparent; padding: 7px 15px; border-radius: 9px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; color: var(--dim); cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex; align-items: center; gap: 5px; }
.seg button:hover:not(.is-active) { color: var(--ink); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.seg button.is-active { background: var(--surface); color: var(--accent-deep); box-shadow: 0 1px 3px rgba(13, 35, 66, 0.13); }
.seg button b { font-weight: 800; font-size: 11px; opacity: 0.7; background: color-mix(in srgb, currentColor 11%, transparent);
  padding: 1px 7px; border-radius: 999px; margin-left: 1px; }
.seg button.is-active b { opacity: 1; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.sheet-search { display: flex; align-items: center; gap: 10px; margin: -18px -22px 12px; padding: 16px 22px 12px;
  position: static; background: var(--bg); border-bottom: 1px solid var(--line); }
/* Sticky controls bar — group toggles + filter chips + search stay pinned while the list scrolls */
.sheet-controls { position: sticky; top: 0; z-index: 9; background: var(--bg); margin: -18px -22px 0; padding: 14px 22px 0; }
.sheet-controls .sheet-search { margin: 0 0 12px; padding: 0 0 12px; }
.sheet-controls .seg { margin-bottom: 10px !important; }
.list-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.sheet-search input { flex: 1; border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; background: var(--surface); color: var(--ink); }
.sheet-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, rgba(80,140,255,.12)); }
.sheet-search-count { font-size: 12px; color: var(--dim); white-space: nowrap; font-weight: 700; }
.chip.toggle::after { content: '▸'; margin-left: 6px; font-size: 9px; opacity: .55;
  display: inline-block; transition: transform .15s ease; }
.chip.toggle.is-active::after { transform: rotate(90deg); opacity: 1; }
/* ---- uniform metric explainers ---- */
.info-link { font-size: 11px; font-weight: 700; color: var(--accent); cursor: pointer; opacity: .85; vertical-align: middle; }
.info-link:hover { text-decoration: underline; opacity: 1; }
.info-dot { font-size: 11px; color: var(--accent); opacity: .55; margin-left: 4px; cursor: pointer; }
.card.tile.explainable, .explainable { cursor: pointer; }
.card.tile.explainable { transition: transform .12s ease, box-shadow .12s ease; }
.card.tile.explainable:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card.tile.explainable:hover .info-dot { opacity: 1; }
.explain-modal { max-width: 460px; }
.explain-body { padding: 2px 2px 0; }
.ex-lead { font-size: 14px; color: var(--ink); margin: 0 0 16px; line-height: 1.55; }
.ex-num { font-size: 36px; font-weight: 800; line-height: 1; margin: 4px 0 18px; }
.ex-num span { display: block; font-size: 12px; font-weight: 600; color: var(--dim); margin-top: 5px; }
.ex-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ex-row span { color: var(--dim); }
.ex-row b { font-weight: 800; text-align: right; }
.ex-note { font-size: 12.5px; color: var(--dim); line-height: 1.6; margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); }
.trust-banner { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 13px 16px;
  background: linear-gradient(90deg, rgba(255,176,32,.16), rgba(255,176,32,.06)), var(--surface);
  border: 1px solid rgba(255,176,32,.45); border-left: 4px solid var(--amber); border-radius: 12px;
  font-size: 13px; line-height: 1.5; color: var(--ink); }
/* sticky chip nav for Profit Pulse */
.pp-nav { position: sticky; top: var(--subnav-top, 60px); z-index: 8; display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; margin: -10px 0 4px; background: var(--bg); }
[id^="pp-"], [id^="sec-"] { scroll-margin-top: var(--sticky-stack, 120px); }

/* ---- Cash focus view (one screen: verdict + two flows + today) ---- */
.cf-toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
#cf-focus { display: none; flex-direction: column; gap: 16px; }
body.cash-focus #cf-focus { display: flex; }
body.cash-focus #cash-full { display: none; }
.cf-hero { order: 9; border-radius: 20px; padding: 26px 28px; color: #fff; box-shadow: 0 18px 40px -22px rgba(13, 35, 66, 0.6); }
.cf-hero.ok { background: linear-gradient(135deg, var(--profit) 0%, var(--profit-mid) 100%); }
.cf-hero.tight { background: linear-gradient(135deg, #9F1239 0%, var(--alert) 100%); }
.cf-verdict { font-size: 15px; font-weight: 700; opacity: 0.92; }
.cf-net { font-size: 46px; font-weight: 850; letter-spacing: -0.02em; margin: 3px 0 7px; line-height: 1; }
.cf-line { font-size: 13.5px; opacity: 0.93; }
.cf-line b { font-weight: 800; }
.cf-river { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.cf-rhead { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.cf-rhead span:last-child { color: var(--dim); }
.cf-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface3); }
.cf-bar > span { height: 100%; }
.cf-in-solid { background: var(--profit); }
.cf-in-fade { background: var(--profit-soft); }
.cf-out-solid { background: var(--teal-deep); }
.cf-out-mid { background: var(--amber); }
.cf-out-fade { background: var(--teal-soft); }
.cf-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cf-leg { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface2); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; color: var(--dim); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.cf-leg:hover { border-color: var(--line2); background: var(--surface); }
.cf-leg b { color: var(--ink); font-weight: 800; }
.cf-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.cf-today { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 6px; }
.cf-today-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); margin-bottom: 6px; }
.cf-act { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: none; border-top: 1px solid var(--line); background: transparent; padding: 14px 6px; cursor: pointer; border-radius: 10px; }
.cf-act:hover { background: var(--surface2); }
.cf-act-ic { font-size: 22px; flex: none; }
.cf-act-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cf-act-body b { font-size: 15px; color: var(--ink); font-weight: 800; }
.cf-act-sub { font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.cf-act-go { font-size: 24px; color: var(--faint); font-weight: 700; flex: none; }
.cf-clear { color: var(--dim); font-size: 14px; padding: 10px 4px 14px; }

/* ---- Summary / Full view toggle (owner minimalist mode) ---- */
.pp-vtoggle { order: -5; display: flex; align-items: center; gap: 12px; }
.vt-seg { display: inline-flex; gap: 3px; background: var(--surface3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.vt-seg button { border: none; background: transparent; padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--dim); cursor: pointer; }
.vt-seg button.on { background: var(--profit); color: #fff; }
.vt-hint { font-size: 12px; color: var(--faint); font-weight: 600; }
/* Summary mode: show only the priority — Where revenue sits (top), What's left, Needs attention. Hide the detail. */
body.pulse-summary #pp-margin,
body.pulse-summary #pp-hero,
body.pulse-summary #pp-collections,
body.pulse-summary #pp-kpis,
body.pulse-summary #sec-insights,
body.pulse-summary #pp-nav { display: none !important; }
body.pulse-summary #pp-top { display: block; }                 /* margin gone → attention spans full width */
body.pulse-summary #pp-revenue { order: -3; }                  /* Where your revenue sits = the headline, pinned on top */
body.pulse-summary #pp-split { order: -2; }                    /* What's left */
body.pulse-summary #pp-top { order: -1; }                      /* Needs attention */
.att-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.att-cash.chip { color: var(--alert); border-color: rgba(229,72,77,0.4); }
.att-cash.chip.is-active { background: var(--alert); border-color: var(--alert); color: #fff; }
.att-cash.chip.is-active b { color: #fff; }
.trust-banner .tb-ic { font-size: 18px; line-height: 1.2; }
.trust-banner .info-link { white-space: nowrap; }

/* ---- modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 34, 54, 0.45); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--bg); border: 1px solid var(--line2); border-radius: 18px; width: 100%;
  max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px -30px rgba(13, 35, 66, 0.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
/* Sheet modals: fixed head + scrolling body so the subtitle & column headers never get clipped */
.modal.sheet { display: flex; flex-direction: column; overflow: hidden; height: 84vh; }
.modal.sheet .modal-head { flex-shrink: 0; background: var(--bg); }
.modal.sheet .tabs { flex-shrink: 0; }
.modal.sheet #tabbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal.sheet .modal-foot { flex-shrink: 0; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
/* clean, minimal confirm modals */
.modal-body.confirm { display: block; padding: 22px; }
.cm-amount { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.cm-amount.zero { color: var(--amber); }
.cm-unit { font-size: 13px; font-weight: 600; color: var(--dim); margin-left: 8px; letter-spacing: 0; }
.cm-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.cm-chip { background: var(--surface3); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.cm-desc { font-size: 13.5px; color: var(--dim); line-height: 1.5; }
.cm-hint { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 11px 13px;
  background: var(--surface3); border-radius: 10px; font-size: 12.5px; color: var(--dim); }
.cm-hint b { color: var(--ink); }
.cm-hint.warn { background: rgba(255,176,32,0.12); color: var(--ink); }
/* expense proof-of-liquidation attachments */
.att-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.att-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.att-link { flex: 1; color: var(--accent-deep); font-weight: 700; font-size: 13px; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-link:hover { text-decoration: underline; }
.cashrow-label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin: 4px 2px 8px; }
.cashrow-label:not(:first-of-type) { margin-top: 16px; }
/* Today — decision rows */
.today-action { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.12s; }
.today-action:last-child { border-bottom: none; }
.today-action:hover { background: var(--surface3); }
.ta-ic { font-size: 19px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface3); border-radius: 50%; flex-shrink: 0; }
.ta-ic.alert { background: var(--alert-soft); }
.ta-main { flex: 1; min-width: 0; }
.ta-go { color: var(--accent-deep); font-weight: 700; font-size: 13px; white-space: nowrap; }
/* paid progress (receivables) */
.pay-wrap { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.pay-bar { flex: 1; height: 7px; background: var(--surface3); border-radius: 999px; overflow: hidden; min-width: 56px; }
.pay-bar span { display: block; height: 100%; background: var(--profit); border-radius: 999px; }
.pay-pct { font-size: 11px; font-weight: 800; color: var(--dim); white-space: nowrap; }
.linkbtn { border: none; background: none; cursor: pointer; color: var(--accent-deep); font-size: 12px; opacity: 0.55; padding: 0 3px; }
.linkbtn:hover { opacity: 1; }
/* expense request detail — compact, decision-focused */
.exp-top { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.exp-ask { flex: 1 1 280px; }
.exp-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; margin-top: 2px; }
.exp-meta { flex: 1 1 190px; display: grid; gap: 12px; align-content: start; }
.exp-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 16px 0; padding: 12px 14px; background: var(--surface3); border-radius: 12px; }
.flow-step { display: flex; align-items: center; gap: 9px; opacity: 0.4; }
.flow-step.done { opacity: 1; }
.flow-step b { font-size: 13px; }
.flow-dot { font-size: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 50%; flex-shrink: 0; }
.flow-step.done .flow-dot { background: color-mix(in srgb, var(--profit) 16%, transparent); }
.flow-arrow { color: var(--faint); font-weight: 700; font-size: 15px; }
/* Invoice monitor — fixed-height scroll so the list size stays constant across filters */
.inv-scroll { max-height: 58vh; overflow-y: auto; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.inv-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line); }
.cash-tabs { display: flex; gap: 4px; margin: 14px 0 0; border-bottom: 2px solid var(--line);
  position: sticky; top: var(--subnav-top, 60px); z-index: 9; background: var(--bg); }
.cash-tabs button { border: none; background: transparent; padding: 11px 20px; font-size: 14px; font-weight: 700;
  color: var(--dim); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.cash-tabs button:hover { color: var(--ink); }
.cash-tabs button.is-active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.cash-pane { display: flex; flex-direction: column; gap: 18px; }
/* per-tab chips — sticky just below the tab bar so nothing gets covered */
.pane-chips { position: sticky; top: calc(var(--subnav-top, 60px) + var(--cash-tabs-h, 46px)); z-index: 8; background: var(--bg);
  display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0 6px; margin: 0; }
/* total row at the foot of a list */
td.tot { border-top: 2px solid var(--line2); background: var(--surface3); padding-top: 11px; padding-bottom: 11px; }
/* "What's left" card (Profit Pulse #pp-split) — four forward-looking numbers, premium layout */
.wl-cardhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.wl-cardhead h2 { margin: 0; }
.wl-hint { font-size: 11.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.wl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.wl-col { padding: 2px 28px; }
.wl-col:first-child { padding-left: 2px; }
.wl-col + .wl-col { border-left: 1px solid var(--line); }
.wl-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); margin-bottom: 18px; }
.wl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.wl-metric { margin-bottom: 18px; border-radius: 9px; }
.wl-metric:last-child { margin-bottom: 0; }
.wl-metric.pf-link { cursor: pointer; transition: background 0.15s var(--ease, ease); margin: -5px -8px 13px; padding: 5px 8px; }
.wl-metric.pf-link:last-child { margin-bottom: -5px; }
.wl-metric.pf-link:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.wl-val { font-size: 29px; font-weight: 800; line-height: 1; letter-spacing: -0.9px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.wl-arrow { font-size: 17px; color: var(--faint); font-weight: 600; transition: transform 0.15s var(--ease, ease); }
.wl-metric.pf-link:hover .wl-arrow { transform: translateX(3px); }
.wl-lbl { font-size: 12.5px; color: var(--faint); font-weight: 600; margin-top: 5px; line-height: 1.4; }
.wl-lbl b { color: var(--ink); font-weight: 700; }
.wl-bar { height: 7px; margin-top: 11px; border-radius: 6px; overflow: hidden; }
.wl-bar span { border-radius: 6px; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; font-size: 11px; color: var(--faint); font-weight: 600; }
.wl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wl-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.wl-legend i.track { background: var(--line2); }
@media (max-width: 640px) { .wl-grid { grid-template-columns: 1fr; gap: 12px; } }

/* Past vs Future profit table (Profit Pulse) */
.pf-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.pf-table th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.pf-table th:first-child { text-align: left; }
.pf-table td { text-align: right; padding: 11px 10px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pf-table td:first-child { text-align: left; font-weight: 600; }
.pf-table .tile-sub { font-weight: 600; }
.pf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.pf-prof { font-size: 16px; }
.pf-table tr.explainable { cursor: pointer; }
.pf-table tr.explainable:hover { background: var(--surface3); }
.pf-table tr.pf-total td { border-bottom: none; border-top: 2px solid var(--line2); background: var(--surface3); font-size: 16px; }
.pf-table td.pf-link { cursor: pointer; }
.pf-table td.pf-link:hover { color: var(--accent-deep); }
.pf-table td.pf-link:hover .tile-sub { color: var(--accent-deep); }
/* Allowance bar */
.pf-allow { margin-top: 14px; padding: 12px 14px; background: var(--surface3); border-radius: 12px; }
.pf-allow-top { font-size: 14px; }
.pf-allow-bar { height: 12px; margin: 9px 0; }
.pf-allow-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; font-weight: 600; color: var(--dim); }
.pf-allow-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.pf-allow-left { margin-left: auto; color: var(--ink); }
.pf-allow-left b { color: var(--profit); font-size: 14px; }
/* Login gate */
.login-ov { position: fixed; inset: 0; background: var(--bg, #f4f6fb); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-card { background: var(--surface, #fff); border: 1px solid var(--line2, #dfe4ee); border-radius: 16px; padding: 28px; width: 320px; max-width: 92vw; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 14px 44px rgba(13, 35, 66, 0.18); }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.login-card h2 { margin: 4px 0 10px; font-size: 20px; }
.login-card label { font-size: 12px; font-weight: 700; color: var(--dim); margin-top: 6px; }
.login-card input { padding: 11px 12px; border: 1px solid var(--line2, #dfe4ee); border-radius: 9px; font-size: 16px; }
.login-card .btn { margin-top: 14px; padding: 11px; font-size: 15px; }
.login-err { display: none; background: var(--alert-soft, #fde8e8); color: var(--alert, #c0392b); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
/* Top-right account menu */
.usermenu { position: relative; }
.userchip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); cursor: pointer; color: var(--ink); }
.userchip:hover { background: var(--surface3); }
.uavatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-deep); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.uname { font-size: 13px; font-weight: 700; }
.ucaret { font-size: 10px; color: var(--dim); }
.umenu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px -10px rgba(13, 35, 66, 0.35); padding: 6px; min-width: 210px; z-index: 200; }
.umenu-head { padding: 8px 10px; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.umenu-head span { font-size: 10px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; }
.umenu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.umenu-item:hover { background: var(--surface3); }
/* Highlight the SR row you drilled in from */
tr.sr-hit > td { background: color-mix(in srgb, var(--amber) 20%, transparent); animation: sr-flash 0.85s ease-in-out 2; }
tr.sr-hit > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
@keyframes sr-flash { 0%, 100% { background: color-mix(in srgb, var(--amber) 20%, transparent); } 50% { background: color-mix(in srgb, var(--amber) 48%, transparent); } }
/* Value-first hero blocks on the Overview / Collection tabs */
.hero-card { box-shadow: none; padding: var(--pad-card-sm); margin-bottom: 10px; }
.hero-card .hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-num { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; margin: 1px 0; line-height: 1.05; }
.hero-pct { font-size: 16px; font-weight: 700; color: var(--dim); }
.hero-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.ov-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--dim); margin-bottom: 16px; }
.ov-meta b, .ov-meta .q { color: var(--ink); }
.hero-card .ov-meta { margin-top: 5px; margin-bottom: 0; }
.ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.ov-stat { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.ov-stat.hi { background: color-mix(in srgb, var(--profit) 8%, var(--surface)); border-color: color-mix(in srgb, var(--profit) 28%, var(--line)); }
.ov-stat-v { font-size: 18px; font-weight: 800; margin: 1px 0; }
.ov-budgetbar { margin-bottom: 4px; }
@media (max-width: 560px) { .ov-stats { grid-template-columns: repeat(2, 1fr); } }
/* Insights hub — owner report cards */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ins-card { display: flex; flex-direction: column; gap: 3px; min-height: 120px; }
.ins-title { font-weight: 700; font-size: 14px; }
.ins-big { font-size: 22px; font-weight: 800; margin: 2px 0; line-height: 1.15; }
.ins-foot { margin-top: auto; padding-top: 8px; font-size: 12px; font-weight: 600; color: var(--accent-deep); }
/* Invoice cards — made to read like an invoice document */
.inv-doc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--pad-card-sm); margin-bottom: 8px; box-shadow: 0 1px 3px rgba(13, 35, 66, 0.05); }
.inv-doc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px dashed var(--line2); }
.inv-doc-seq { font-size: 11px; font-weight: 800; color: var(--accent-deep); text-transform: uppercase; letter-spacing: 0.05em; }
.inv-doc-no { font-weight: 700; margin-top: 3px; }
.pay-card.clickable { cursor: pointer; transition: box-shadow 0.12s, border-color 0.12s; }
.pay-card.clickable:hover { box-shadow: 0 6px 16px -9px rgba(13, 35, 66, 0.3); border-color: var(--line2); }
.grp-item.clickable { cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.grp-item.clickable:hover { background: var(--surface2); }
.grp-q { color: var(--dim); font-weight: 600; }
/* Record-payment modal summary */
.pay-sum { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pay-sum-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pay-sum-row { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.pay-sum-row b { display: block; color: var(--ink); font-size: 15px; font-weight: 800; margin-top: 1px; }
/* Profit-by-service rows (clickable) */
.svc-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.12s; }
.svc-row:last-child { border-bottom: none; }
.svc-row:hover { background: var(--surface3); }
.svc-arrow { opacity: 0.4; font-size: 18px; font-weight: 700; }
/* Activity Log — chronological feed */
.act-month { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 4px 8px; }
.act-month-name { font-size: 13px; font-weight: 800; color: var(--ink); }
/* Each report is its own spaced card so rows never feel crammed together. */
.act-feed { padding: 0; background: transparent; border: none; box-shadow: none; backdrop-filter: none; display: flex; flex-direction: column; gap: 10px; }
.act-item { display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px; min-height: 100px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.act-item:hover { background: var(--surface2); border-color: var(--line2); }
.act-dot { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 2px solid var(--accent); }
.act-dot.done { color: var(--profit); background: color-mix(in srgb, var(--profit) 14%, transparent); border-color: var(--profit); }
.act-main { flex: 1; min-width: 0; }
.act-line1 { font-size: 13.5px; }
.act-line1 .q { font-weight: 800; }
.act-client { font-weight: 700; color: var(--ink); }
.act-cat { font-size: 11px; color: var(--dim); background: var(--surface3); padding: 2px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.act-notes { font-size: 12.5px; color: var(--dim); margin-top: 4px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act-loc { font-size: 12px; color: var(--dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-loc { font-size: 12px; color: var(--dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.act-meta { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 130px; }
.act-techs { font-size: 12px; font-weight: 700; color: var(--ink); }
.act-srbadge { font: 700 12px ui-monospace, "SF Mono", monospace; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 11%, transparent); border-radius: 7px; padding: 2px 8px; letter-spacing: -0.02em; }
.act-date { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.act-sticky { position: sticky; top: var(--subnav-top, 60px); z-index: 7; }
.inv-controls { position: sticky; top: calc(var(--subnav-top, 60px) + var(--cash-tabs-h, 46px)); z-index: 7; background: var(--surface); }
/* Activity Log — "By job" grouped view */
.act-job { padding: 0; overflow: hidden; margin-bottom: 14px; }
.act-job-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; transition: background 0.12s; }
.act-job-head:hover { background: var(--surface3); }
.act-job-srs { border-top: 1px solid var(--line); }
.act-sr { display: grid; grid-template-columns: 86px 130px 1fr auto; gap: 12px; align-items: center; padding: 9px 16px 9px 70px; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-sr:last-child { border-bottom: none; }
.act-sr-date { color: var(--dim); font-weight: 600; white-space: nowrap; }
.act-sr-tech { font-weight: 700; color: var(--ink); }
.act-sr-notes { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.more-wrap { position: relative; margin-right: auto; }
.more-menu { position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 180px; background: var(--bg);
  border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(13,35,66,0.55);
  padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 20; }
.more-menu.show { display: flex; }
.more-item { border: none; background: transparent; text-align: left; padding: 9px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; }
.more-item:hover { background: var(--surface3); }
/* Custom Q# picker — light, app-styled, capped height so it never covers the modal */
.qcombo { position: relative; }
.qmenu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 232px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line2); border-radius: 11px; padding: 4px;
  box-shadow: 0 18px 44px -10px rgba(13, 35, 66, 0.45), 0 2px 8px rgba(13, 35, 66, 0.12); }
.qopt { display: flex; align-items: baseline; gap: 9px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.qopt[hidden] { display: none; }   /* type-to-filter: actually hide non-matches (display:flex was overriding [hidden]) */
.qopt.active { background: var(--surface3); }
.qopt-add b { color: var(--accent-deep); }
.qopt:hover { background: var(--surface3); }
.qopt b { color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.qopt-sub { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Release modal — capture "who's receiving the cash" when it wasn't set */
.cm-person { margin-top: 14px; text-align: left; }
.cm-plabel { display: block; font-size: 12px; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
.cm-person input { width: 100%; border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; font-size: 14px; background: var(--surface); }
.cm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cm-chips .chip { cursor: pointer; border: 1px solid var(--line2); background: var(--surface); }
.cm-chips .chip:hover { background: var(--surface3); }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: 1 / -1; }
.field.field-half { grid-column: span 1; }
@media (max-width: 560px) { .field.field-half { grid-column: 1 / -1; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* Grouped By-client / By-project cards — clean itemized list per group */
.grp-summary { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.grp-card { border: 1px solid var(--line2); border-radius: 13px; padding: var(--pad-card-sm); margin-bottom: 10px; background: var(--surface); box-shadow: 0 1px 3px rgba(16, 40, 70, 0.05); transition: box-shadow .12s ease, border-color .12s ease; }
.grp-card:hover { box-shadow: 0 6px 16px -8px rgba(16, 40, 70, 0.28); }
.grp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; position: sticky; top: var(--ctrl-h, 0px); z-index: 2; background: var(--surface); margin: -12px -14px 9px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.grp-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.grp-title > b, .grp-title .q b { font-size: 15px; }
.grp-titlerow { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.grp-pdesc { font-size: 12.5px; color: var(--dim); font-weight: 500; }
.grp-sub { font-size: 11.5px; color: var(--faint); font-weight: 500; }
.grp-amt { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grp-items { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.grp-item { display: flex; align-items: baseline; gap: 9px; font-size: 13px; padding: 3px 6px; border-radius: 6px; }
.grp-item:hover { background: var(--surface3); }
.grp-rfp { flex: none; }
.grp-q { flex: none; font-size: 11.5px; opacity: .85; }
.grp-desc { flex: 1; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-iamt { flex: none; font-weight: 600; color: var(--ink); }
.grp-rest { margin-top: 3px; }
.grp-rest > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--accent-deep); padding: 6px; list-style: none; user-select: none; border-radius: 6px; }
.grp-rest > summary::-webkit-details-marker { display: none; }
.grp-rest > summary:hover { background: var(--surface3); }
/* when expanded: reveal the rows first, drop the toggle to the BOTTOM and flip it to "Show less" */
.grp-rest[open] { display: flex; flex-direction: column; }
.grp-rest[open] > summary { order: 1; color: var(--faint); font-size: 0; margin-top: 2px; }
.grp-rest[open] > summary::after { content: 'Show less ↑'; font-size: 12px; }
/* Project History — color-coded timeline */
.timeline { padding-left: 2px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 0 0 3px var(--surface); z-index: 1; }
.tl-body { padding-top: 4px; min-width: 0; }
.tl-body b { font-size: 13.5px; }
/* Payroll cards — status rail (amber = to post, green = posted) */
.pay-card { display: flex; align-items: center; gap: 12px; position: relative; background: var(--surface); border: 1px solid var(--line2); border-radius: 13px; padding: 12px 16px; margin-bottom: 9px; box-shadow: 0 1px 3px rgba(16, 40, 70, 0.05); transition: box-shadow .12s ease; }
.pay-card:hover { box-shadow: 0 6px 16px -8px rgba(16, 40, 70, 0.28); }
.pay-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amber); }
.pay-card.is-posted::before { background: var(--profit); }
.pay-card.acct-blocked::before { background: var(--alert); }
/* Cash-blocked OpEx bar with a cap marker at 65% */
.cb-bar { position: relative; height: 9px; border-radius: 999px; background: var(--surface3); }
.cb-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--alert); max-width: 100%; }
.cb-cap { position: absolute; left: 65%; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .45; }
.pay-info { flex: 1; min-width: 0; }
.pay-info b { font-size: 14px; }
.pay-right { text-align: right; flex: none; }
.pay-gross { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--dim); }
.money-input { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); overflow: hidden; }
.money-input span { padding: 10px 4px 10px 12px; color: var(--dim); font-weight: 800; }
.money-input input { border: none !important; background: transparent; padding: 10px 12px 10px 4px; font-size: 14px; width: 100%; outline: none; color: var(--ink); font-family: inherit; }
.money-input:focus-within { border-color: var(--accent); }
.budget-panel { background: var(--surface3); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 14px;
  background: var(--surface); color: var(--ink); font-family: inherit; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--faint); }
.x { border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--dim); cursor: pointer; }

/* ---- toast ---- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 1100; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 16px 40px -16px rgba(13, 35, 66, 0.6); animation: toastIn 0.2s ease; max-width: 320px; }
.toast.ok { background: var(--profit); } .toast.bad { background: var(--alert); } .toast.warn { background: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- profit hero (Profit Pulse) ---- */
.hero { background: linear-gradient(135deg, #1E4366, #316593); color: #fff; border: none; position: relative; overflow: hidden; }
/* Top: Earned-margin + Needs-attention side by side, equal height (Net-profit hero lives after Revenue) */
#pp-top { align-items: stretch; }
/* Margin card fills its height — gauge up top, overhead pinned to the bottom, space in the middle */
#pp-top > .card:not(#pp-attention) { display: flex; flex-direction: column; justify-content: space-between; }
/* Compact Profit Pulse so margin · attention · past-vs-future fit one screen on load (other hubs unaffected) */
.view.hub-pulse { gap: 12px; }
.hub-pulse .card { padding: 14px 16px; }
.hub-pulse .card h2 { margin-bottom: 10px; }
.hub-pulse .att-row { padding: 4px 0; }
.hub-pulse .gauge-wrap { gap: 14px; }
.hub-pulse .gauge { width: 104px; height: 104px; }
.hub-pulse .gauge::after { width: 74px; height: 74px; }
.hub-pulse .gauge b { font-size: 20px; }
.hero .eyebrow { font: 700 10px/1 ui-monospace, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #7FE7C4; }
.hero .big { font-size: 50px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 2px; }
.hero .marginpill { display: inline-block; background: rgba(22,163,74,0.25); color: #7FE7C4; border: 1px solid rgba(127,231,196,0.4);
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.hero .hero-pills { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.hero .hero-target { font-size: 12px; font-weight: 700; }
/* Sales − Expenses = Profit, as crisp chips */
.hero .hero-math { display: flex; align-items: stretch; gap: 8px; margin: 16px 0 14px; flex-wrap: wrap; }
.hero .hm-item { flex: 1 1 90px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.hero .hm-item.hm-profit { background: rgba(127,231,196,0.14); border-color: rgba(127,231,196,0.32); }
.hero .hm-lbl { font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.hero .hm-val { font-size: 16px; font-weight: 800; color: #fff; }
.hero .hm-profit .hm-val { color: #7FE7C4; }
.hero .hm-op { align-self: center; font-size: 17px; font-weight: 700; color: rgba(255,255,255,0.45); }
.hero .hero-exp-break { font-size: 11px; color: rgba(255,255,255,0.42); margin-top: 7px; }
.hero .hero-projected { margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,0.13); }
.hero .hp-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,0.82); }
.hero .hp-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #A9E0FF;
  background: rgba(90,160,255,0.18); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.hero .hp-sub { font-size: 12.5px; color: rgba(255,255,255,0.66); margin-top: 6px; }
.splitbar { height: 8px; border-radius: 999px; overflow: hidden; display: flex; margin: 8px 0 0; background: var(--line2); }
.splitbar > span { height: 100%; }
.splitbar .s-profit { background: var(--profit); }
.splitbar .s-cost { background: #8b97ad; }
.splitbar .s-cost.planned { background: repeating-linear-gradient(45deg, #8b97ad 0 5px, #aeb8c8 5px 10px); }
.split-legend { display: flex; justify-content: space-between; gap: 12px; }
.split-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.6; }
.evp-col { }
.evp-head { font-size: 12px; font-weight: 700; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.evp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.evp-sub { font-weight: 600; opacity: 0.7; }
.evp-profit { font-size: 22px; font-weight: 800; margin: 6px 0 1px; letter-spacing: -0.01em; }
.hero .hero-eq { margin: 14px 0 4px; font-size: 13.5px; color: rgba(255,255,255,0.82); }
.hero .hero-eq b { color: #fff; }
.hero .pnl-cap { font: 700 10px/1 ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin: 16px 0 6px; }
.hero .pnl { height: 16px; border-radius: 999px; overflow: hidden; display: flex; margin: 0 0 10px; background: rgba(255,255,255,0.12); }
.hero .pnl > span { height: 100%; }
.hero .pnl-legend { display: flex; gap: 18px; font-size: 12px; color: rgba(255,255,255,0.85); flex-wrap: wrap; }
.hero .pnl-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---- small progress ring ---- */
.ring { --pct: 0; --col: var(--accent-deep); width: 42px; height: 42px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--col) calc(var(--pct) * 1%), var(--surface3) 0); display: grid; place-items: center; }
.ring::after { content: ""; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 11px; font-weight: 700; }

/* ---- revenue stage cards ---- */
.stage { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.stage:hover { transform: translateY(-3px); }
.stage .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.stage .lbl i { width: 9px; height: 9px; border-radius: 50%; }
.stage .v { font-size: 23px; font-weight: 800; margin: 7px 0 2px; }

/* ---- card-style group partitions ---- */
.group { --gc: var(--faint); border: 1px solid var(--line); border-radius: 20px; padding: 16px 16px 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 7%, var(--surface2)), var(--surface2));
  box-shadow: var(--shadow); margin-bottom: 16px; }
.group > .group-head { margin-bottom: 14px; }
.rowcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px;
  box-shadow: 0 4px 14px -11px rgba(13, 35, 66, 0.35); display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.rowcard:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -16px rgba(13, 35, 66, 0.5); }
.rowcard .who { flex: 1; min-width: 0; }
.rowcard .amt-wrap { text-align: right; }
.rowcard .amt-lbl { font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; }
.rowcard .amt { font-weight: 800; font-size: 17px; }
.rowcard .cl { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.rowcard .rc-open { font-size: 12px; font-weight: 700; color: var(--accent-deep); opacity: 0.5; white-space: nowrap; }
.rowcard.clickable:hover .rc-open { opacity: 1; }
.rowcard .rc-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.rowcard .amt-wrap { min-width: 96px; }
.rc-total { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; margin-top: 4px;
  border-top: 2px solid var(--line2); font-size: 13px; color: var(--dim); font-weight: 700; }
.rc-total b { font-size: 18px; color: var(--ink); }
.btn-call { border: 1px solid color-mix(in srgb, var(--alert) 55%, transparent); color: var(--alert); background: var(--alert-soft); }
.btn-call:hover { background: color-mix(in srgb, var(--alert) 16%, transparent); color: var(--alert); }
.ff-ok { color: var(--profit); font-size: 11px; font-weight: 700; }

/* ---- status group (Sales Brain) ---- */
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.group-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.group-head h3 { font-size: 15px; }
.group-head .ct { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface3); color: var(--dim); }
.group-head .sum { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.group-head h3 { font-weight: 800; }
/* Status-colored rail down each pipeline group (ties the group to its stage color) */
.group { position: relative; }
.group::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gc); opacity: .92; }
.jobrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.jobrow:last-child { border-bottom: none; }
.jobrow .who { flex: 1; min-width: 0; }
.jobrow .q { font: 700 11.5px ui-monospace, monospace; color: var(--accent-deep); cursor: pointer; }
.jobrow .q:hover { text-decoration: underline; }
.jobrow .cl { font-weight: 700; font-size: 14.5px; }
.jobrow .cat { font-size: 12.5px; color: var(--dim); }
.jobrow .amt { font-weight: 800; font-size: 15px; text-align: right; }

/* ---- 7-day liquidation clock ---- */
.clock { display: inline-flex; gap: 3px; }
.clock i { width: 9px; height: 14px; border-radius: 2px; background: var(--surface3); }
.clock i.ok { background: var(--profit); }
.clock i.warn { background: var(--amber); }
.clock i.late { background: var(--alert); }

/* ---- inline classify (pending RFP) ---- */
.classify { display: flex; gap: 6px; align-items: center; }
.classify select { border: 1px solid var(--line2); border-radius: 8px; padding: 5px 8px; font-size: 12px; background: var(--surface); }

/* ---- status + next-step hero (Q# overview) ---- */
.status-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface));
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.sh-now { display: flex; align-items: center; gap: 10px; }
.sh-step { font: 800 11px ui-monospace, monospace; color: var(--faint); letter-spacing: 0.04em; }
.sh-next { margin-top: 7px; font-size: 14px; color: var(--ink); }
.sh-next b { color: var(--accent-deep); }
.stepper { display: flex; gap: 5px; align-items: center; }
.stepdot { width: 16px; height: 8px; border-radius: 999px; background: var(--surface3); display: inline-block; transition: all 0.15s ease; }
.stepdot.done { background: var(--profit); }
.stepdot.now { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.stepdot.cancel { background: var(--alert); width: 10px; height: 10px; border-radius: 50%; }

/* ---- drill sheet (wider modal) + tabs ---- */
.modal.sheet { max-width: min(1240px, 96vw); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 22px; }
.tabs button { border: none; background: transparent; padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--dim); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.is-active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.tabpane { padding: 18px 22px; }
/* keep drill-sheet tables within the modal — no sideways scroll */
.tabpane table { width: 100%; }
/* let descriptions breathe: text wraps & columns size to content; only numbers / IDs stay on one line */
.tabpane th, .tabpane td { white-space: normal; overflow-wrap: break-word; word-break: normal; vertical-align: middle; }
.tabpane td:not(.num), .tabpane th:not(.num) { min-width: 56px; }
/* shrink the leading ID column (RFP / Inv No. / Q#) to its content so text columns get the room */
.tabpane td:first-child, .tabpane th:first-child { width: 1%; white-space: nowrap; vertical-align: top; padding-top: 13px; }
.tabpane td.num, .tabpane th.num { white-space: nowrap; }
.tabpane .q { white-space: nowrap; }
/* sticky column headers — stay visible below the sticky title + search while scrolling */
.tabpane thead th { position: sticky; top: var(--ctrl-h, 0px); z-index: 6; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line); }
/* …but short summary/detail tables inside a card must NOT stick — their header would float over their own rows */
.tabpane .card thead th { position: static; }
.tabpane tbody tr.row-click { cursor: pointer; transition: background 0.1s; }
.tabpane tbody tr.row-click:hover { background: var(--surface3); }
.tabpane td.row-actions { overflow: visible; white-space: nowrap; text-align: right; }
/* fixed body height so switching tabs doesn't resize the modal */
#tabbody.tabbody-fixed { height: 52vh; min-height: 320px; max-height: 560px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kv .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.kv .v { font-size: 15px; font-weight: 700; }
.alert-soft-row { background: var(--alert-soft); border: 1px solid rgba(225,29,72,0.25); border-radius: 12px; padding: 12px 14px; }

/* ---- collapsible sections ---- */
.sec .sec-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; position: sticky; top: var(--pane-top, 106px); z-index: 4; background: var(--surface); border-radius: 14px; }
.sec .sec-head .ic { font-size: 17px; line-height: 1; }
.sec .sec-head h2 { margin: 0; }
.sec .sec-head .chev { margin-left: auto; color: var(--faint); font-size: 13px; transition: transform 0.15s ease; }
.sec.collapsed .sec-head .chev { transform: rotate(-90deg); }
.sec .sec-body { margin-top: 14px; }
.sec.collapsed .sec-body { display: none; }

/* ---- sticky section nav (Cash Flow) + sticky toolbar (Sales Brain) ---- */
.hubnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; margin: -8px 0 2px; }
.hubnav .search { flex: 1 1 200px; }
.sticky-bar { position: sticky; top: var(--subnav-top, 60px); z-index: 6; background: var(--bg);
  box-shadow: 0 6px 14px -10px rgba(13, 35, 66, 0.35); }
.role-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.role-strip b { display: block; font-size: 14px; }
.role-strip span { display: block; color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.role-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.role-actions .btn b { margin-left: 4px; font-size: 11px; opacity: .72; }
.sec { scroll-margin-top: var(--sticky-stack, 120px); }   /* chip-jumps clear the full sticky stack (topbar + tabs + chips) */

/* ---- range slider ---- */
input[type=range].rng { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--surface3); outline: none; }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: var(--shadow); }

/* ---- multi-select chips (e.g. technicians) ---- */
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 1px solid var(--line2); background: var(--surface); border-radius: 999px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 700; color: var(--dim); cursor: pointer; transition: all 0.12s ease; }
.pick button.on { background: var(--accent); color: #fff; border-color: transparent; }

/* ---- clickable rows ---- */
.jobrow.clickable { cursor: pointer; border-radius: 10px; transition: background 0.12s ease, transform 0.12s ease; }
.jobrow.clickable:hover { background: var(--surface3); }
.jobrow.clickable:hover .amt { transform: scale(1.02); }

/* ---- avatar (payroll / techs) ---- */
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff; text-transform: uppercase;
  background: linear-gradient(140deg, var(--accent), var(--violet)); box-shadow: var(--shadow); }

/* ---- smooth list reveal + section/modal transitions ("swabe") ---- */
.view > *, #col-list table, #pay-list .jobrow, .sec-body table tbody tr { animation: fadeUp 0.22s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sec-body { transition: opacity 0.18s ease; }
.modal { animation: pop 0.18s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface3); }

/* ---- clickable affordance (uniform across every clickable link) ---- */
[data-drillq], [data-drillexp], [data-drillsr], [data-person], [data-client], [data-cl], [data-clientedit], [data-stage], [data-att], .clickable { cursor: pointer; }
.q[data-drillq], .q[data-drillexp], .q[data-drillsr], .q[data-person], .q[data-clientedit] {
  text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent-deep) 55%, transparent); }
/* codes (SR#, Q#, RFP#) and dates must never break across lines at their hyphens */
.q { white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
.q[data-drillq]:hover, .q[data-drillexp]:hover, .q[data-drillsr]:hover, .q[data-person]:hover, .q[data-clientedit]:hover {
  color: var(--accent); text-decoration-style: solid; }
td .q[data-drillq], td .q[data-drillexp], td .q[data-drillsr] { font-weight: 700; }
/* budget breakdown (Q# detail) */
.budget-split { height: 10px; border-radius: 999px; overflow: hidden; display: flex; background: var(--surface3); margin: 8px 0; }
.budget-split > span { height: 100%; }
.budget-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); }
.budget-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* =========================================================================
   2026 minimalist refresh — interaction polish layered on top (logic unchanged)
   ========================================================================= */
/* smooth, consistent motion on interactive elements */
.btn, .nav-item, .chip, .seg button, .card.clickable, .ins-card, .pill, .userchip, .tile.explainable, .info-link, .info-dot, .q, .grp-item { transition: all var(--ease); }

/* buttons — crisper depth + a tactile press */
.btn:active { transform: translateY(0.5px); }
.btn-primary { box-shadow: 0 2px 8px -3px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-primary:hover { transform: translateY(-1px); filter: none; box-shadow: 0 7px 18px -5px color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent-deep)); }
.btn-primary:active { transform: translateY(0); }

/* clickable cards lift gently on hover */
.card.clickable, .clickable { cursor: pointer; }
.card.clickable:hover, .ins-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line2); }
.card.clickable:active { transform: translateY(-1px); }

/* refined modal + overlay */
.modal-overlay { background: rgba(14, 33, 53, 0.40); backdrop-filter: blur(5px); }
.modal { border-radius: 20px; box-shadow: 0 1px 3px rgba(13, 35, 66, 0.08), 0 30px 80px -28px rgba(13, 35, 66, 0.5); }
.modal-head h3 { letter-spacing: -0.02em; }

/* table rows — subtle hover so the eye tracks across a row */
table tbody tr { transition: background var(--ease); }
table tbody tr:hover { background: var(--surface2); }

/* grouped list rows — clean hover */
.grp-item:hover { background: var(--surface2); }

/* Q# links — clear affordance */
.q:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* inputs & search — clean focus ring */
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* keyboard accessibility — visible focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .nav-item:focus-visible, .chip:focus-visible, .seg button:focus-visible { outline-offset: 3px; }

/* modern thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(18, 40, 72, 0.20) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(18, 40, 72, 0.18); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(18, 40, 72, 0.30); border: 3px solid transparent; background-clip: padding-box; }

/* respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Profit Pulse section order — Past vs Future + This month → Revenue → Earned margin + Attention (flex order) */
#pp-nav { order: -3; }
#pp-split { order: -2; }
#pp-revenue { order: -1; }
/* net profit hero sits BELOW the win-rate / active / pipeline KPI cards */
#pp-kpis { order: 1; }
#pp-hero { order: 2; }
#sec-insights { order: 3; }

/* ---- responsive ---- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .sidebar-foot { display: none; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
}
/* ---- Phone (<560px): compact nav bar, scrollable tables, stacked topbar, touch targets ---- */
@media (max-width: 560px) {
  /* Bigger tap targets for the tiny ✎ / ⓘ controls so a thumb hits them, not the row behind */
  .linkbtn, .info-dot, .info-link { min-width: 32px; min-height: 32px; padding: 6px; opacity: 0.85; display: inline-flex; align-items: center; justify-content: center; }
  /* Sidebar becomes one compact horizontal scroll bar; drop the brand + sub-labels to save space */
  .sidebar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 8px; padding: 8px 10px; }
  .sidebar .brand { display: none; }
  .sidebar .nav { flex-wrap: nowrap; gap: 6px; }
  .nav-item { flex: 0 0 auto; padding: 9px 13px; }
  .nav-item .sub { display: none; }
  /* Topbar stacks: title on top, actions below */
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .topbar-right { justify-content: flex-start; flex-wrap: wrap; }
  .topbar-actions { flex-wrap: wrap; }
  .main { padding: 14px 12px 70px; }
  /* Wide tables in drill sheets scroll sideways instead of squishing/breaking */
  .modal.sheet { height: 92vh; }
  .modal.sheet #tabbody { overflow-x: auto; }
  .tabpane table { min-width: 520px; }
  /* Touch-friendly inputs (16px font stops iOS auto-zoom) + full-width modal buttons */
  .field input, .field select, .field textarea, .money-input input { font-size: 16px; padding: 12px 14px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  /* Slightly tighter tiles */
  .tile { padding: 13px; }
  .tiles-compact .tile .tile-value { font-size: 18px; }
}
