/* Kaalinta — owner dashboard
   Warm ground, white rounded cards, Poppins with large light numerals.
   Colour follows meaning everywhere (charts and pills alike):
     blue  = paid at the pump   orange = deyn   aqua = repayments            */

:root {
  --bg: #f2f1ee;
  --card: #ffffff;
  --card-2: #f7f6f3;
  --ink: #232728;
  --ink-2: #55565c;
  --ink-3: #6b6b72;
  --line: #e8e7e2;
  --line-2: #f0efeb;
  --focus: #23272866;

  --paid: #2a78d6;
  --paid-bg: #e8f0fb;
  --paid-ink: #1c5cab;
  --deyn: #eb6834;
  --deyn-bg: #fdede5;
  --deyn-ink: #b23f12;
  --repay: #1baf7a;
  --repay-bg: #e2f5ed;
  --repay-ink: #0e6e4c;
  --partly-bg: #f8efe3;
  --partly-ink: #7a4a12;

  --good: #1b7348;
  --good-bg: #e5f2ea;
  --bad: #b4372b;
  --bad-bg: #fbe9e6;

  --watch: #fbf4ef;
  --watch-line: #f1dfd3;

  --sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 22px;
  --sidebar: 244px;
  --drawer: 440px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.dash { color: #c4c3bd; }
.owe { color: var(--deyn-ink); }
.neg { color: var(--repay-ink); }
.lbl { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 22px 16px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav a svg, .tabbar a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.nav a:hover { background: #e9e8e3; color: var(--ink); }
.nav a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px #23272814, 0 4px 14px -6px #2327281f; }
.nav a.active svg { color: var(--deyn); }
.sidebar-foot { margin-top: auto; }
.sample-note { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px dashed #cdc9bf; border-radius: 16px; font-size: 12px; color: var(--ink-2); }
.sample-note strong { font-size: 12px; color: var(--ink); font-weight: 600; }
.link-btn { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; font-size: 12px; margin-top: 4px; }

.main { min-width: 0; padding: 0 28px 64px 4px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 4px 18px; }
.topbar-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.crumb { font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 34px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.15; }
.page-sub { font-size: 14.5px; color: var(--ink-2); max-width: 720px; }
.page-sub b { font-weight: 600; color: var(--ink); }
.sample-pill { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 99px; background: var(--card); border: 1px dashed #bdb7ab; color: var(--ink-2); text-transform: uppercase; }
.view { display: flex; flex-direction: column; gap: 18px; }

/* ---------- period control ---------- */
.period { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 4px; background: #e6e5e0; border-radius: 99px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; }
.date-input { border: 0; background: var(--card); border-radius: 99px; padding: 8px 14px; font-size: 13px; height: 38px; }
.date-input.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.period .period-select { display: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.card-head a, .more { font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.card-head a:hover, .more:hover { text-decoration: underline; }
.row-grid { display: grid; gap: 18px; align-items: stretch; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); background: var(--card); border-radius: var(--r); }
.kpi { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 18px; border-left: 1px solid var(--line-2); min-width: 0; position: relative; }
.kpi:first-child { border-left: 0; }
.kpi:hover { background: #fbfaf8; }
.kpi:first-child:hover { border-radius: var(--r) 0 0 var(--r); }
.kpi:last-child:hover { border-radius: 0 var(--r) var(--r) 0; }
.kpi .top { display: flex; align-items: center; gap: 8px; }
.kpi .key { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kpi .val { font-size: 30px; font-weight: 300; letter-spacing: -0.035em; line-height: 1.05; white-space: nowrap; }
.kpi.hero .val { font-size: 48px; }
.kpi .val .cents { font-size: 0.55em; color: var(--ink-3); letter-spacing: -0.01em; }
.kpi .val .unit { font-size: 0.5em; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi .note { font-size: 12px; color: var(--ink-3); }
.kpi.owed .val { color: var(--deyn-ink); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.delta.good { color: var(--good); background: var(--good-bg); }
.delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--line-2); }

/* ---------- legends & chart frame ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; min-height: 40px; }
.chart svg { display: block; overflow: visible; }
.chart-pad { padding: 4px 18px 16px; }
.ax { font-family: var(--sans); font-size: 10.5px; fill: var(--ink-3); }
.ax-on { fill: var(--ink); font-weight: 500; }
.ax-sm { font-size: 9.5px; }
.end-lbl { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--ink); }
.hit { fill: transparent; cursor: pointer; outline: none; }
rect.hit:hover, rect.hit:focus { fill: #23272809; }
.xh line, .xh circle:not(.hit) { opacity: 0; transition: opacity 0.1s; pointer-events: none; }
.xh:hover line, .xh:hover circle:not(.hit), .xh:focus-within line, .xh:focus-within circle:not(.hit) { opacity: 1; }
.xh rect.hit:hover, .xh rect.hit:focus { fill: transparent; }
.cell { cursor: default; outline: none; }
.cell:hover, .cell:focus { stroke: var(--ink); stroke-width: 1.5; }
.dot-hit .hit { fill: transparent; cursor: pointer; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 0.08s; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 12px; min-width: 170px; box-shadow: 0 12px 30px -10px #00000066; }
.viz-tip.on { opacity: 1; }
.viz-tip b { display: block; font-weight: 600; margin-bottom: 6px; font-size: 12.5px; }
.viz-tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 1px 0; }
.viz-tip .r span:first-child { display: inline-flex; align-items: center; gap: 7px; color: #d7d6d0; }
.viz-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.viz-tip .r span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
.viz-tip .tot { border-top: 1px solid #ffffff2b; margin-top: 5px; padding-top: 5px; }
.viz-tip .hint { color: #a9a8a2; font-size: 11px; margin-top: 6px; }
.toggle-view { display: inline-flex; background: var(--line-2); border-radius: 99px; padding: 3px; }
.toggle-view button { border: 0; background: transparent; border-radius: 99px; padding: 4px 11px; font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; }
.toggle-view button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px #2327281a; }
.heat-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--ink-3); }
.heat-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.insight { font-size: 13px; color: var(--ink-2); padding: 0 22px 18px; }
.insight b { color: var(--ink); font-weight: 600; }

/* ---------- deyn watch ---------- */
.watch { background: var(--watch); border: 1px solid var(--watch-line); border-radius: var(--r); padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.watch-head { display: flex; align-items: center; gap: 12px; }
.watch-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; flex: none; }
.watch-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.watch-head .crumb { color: var(--deyn-ink); font-size: 10.5px; }
.watch .story { margin: 0; font-size: 19px; line-height: 1.32; letter-spacing: -0.02em; }
.watch .story b { font-weight: 600; }
.age-rows { display: grid; grid-template-columns: auto 1fr auto; gap: 9px 12px; align-items: center; font-size: 13px; }
.age-rows .amt { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.meter { height: 8px; border-radius: 99px; background: #f6dccd; overflow: hidden; display: block; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--deyn); }
.meter.ink { background: var(--line-2); }
.meter.ink > span { background: var(--ink); }
.meter.blue { background: var(--paid-bg); }
.meter.blue > span { background: var(--paid); }
.acts { display: flex; flex-direction: column; gap: 7px; }
.act { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--card); border-radius: 14px; font-size: 13px; }
.act:hover { box-shadow: 0 0 0 1.5px var(--ink); }
.act .t { font-weight: 500; }
.act .n { font-size: 12px; color: var(--ink-3); }
.act .go { margin-left: auto; }

/* ---------- payment split ---------- */
.split { display: flex; gap: 2px; height: 28px; }
.split > span { display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 600; color: #fff; min-width: 0; white-space: nowrap; border-radius: 4px; overflow: visible; }
.split .p { background: var(--paid); }
.split .d { background: var(--deyn); color: #2b1206; }
.pay-rows { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 12px; align-items: center; font-size: 13px; }
.pay-rows .amt { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.dotk { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 7px; }

/* ---------- bar lists ---------- */
.barlist { list-style: none; margin: 0; padding: 0 0 8px; }
.barlist li { border-top: 1px solid var(--line-2); }
.barlist button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 22px; align-items: center; }
.barlist button:hover { background: #fbfaf8; }
.barlist .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.barlist .amt { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.barlist .meter { grid-column: 1 / -1; height: 6px; }
.age { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.age.warn { background: var(--partly-bg); color: var(--partly-ink); }
.age.old { background: var(--bad-bg); color: var(--bad); }
.card-foot { padding: 12px 22px 18px; font-size: 13px; }
.empty { padding: 30px 22px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- fuel mix ---------- */
.fuel-rows { display: flex; flex-direction: column; gap: 16px; padding: 0 22px 20px; }
.fuel-row .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fuel-row .big { font-size: 24px; font-weight: 300; letter-spacing: -0.03em; }
.fuel-row .big small { font-size: 12px; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.fuel-row .meter { margin: 8px 0 6px; height: 8px; }
.fuel-row .note { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th.num { text-align: right; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t th:first-child, table.t td:first-child { padding-left: 22px; }
table.t th:last-child, table.t td:last-child { padding-right: 22px; }
table.t tbody tr.rec { cursor: pointer; scroll-margin-top: 24px; scroll-margin-bottom: 24px; }
table.t tbody tr.rec:hover td { background: #fbfaf8; }
table.t tbody tr.rec.selected td { background: #f4f3ef; }
table.t tbody tr.rec.selected td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
table.t tr.day td { background: var(--card-2); font-size: 12px; color: var(--ink-2); font-weight: 500; padding-top: 8px; padding-bottom: 8px; }
table.t tr.day td.num { color: var(--ink); }
.cust-cell .name { font-weight: 500; }
.cust-cell .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.c-m { display: none; }
.bal-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bal-cell .meter { width: 90px; height: 5px; }

/* ---------- status pills (same colours as the charts) ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; flex: none; }
.status.paid { color: var(--paid-ink); background: var(--paid-bg); }
.status.paid::before { background: var(--paid); }
.status.partly { color: var(--partly-ink); background: var(--partly-bg); }
.status.partly::before { background: linear-gradient(90deg, var(--paid) 50%, var(--deyn) 50%); }
.status.deyn { color: var(--deyn-ink); background: var(--deyn-bg); }
.status.deyn::before { border: 2px solid var(--deyn); }
.status.repayment { color: var(--repay-ink); background: var(--repay-bg); }
.status.repayment::before { content: '↩'; width: auto; height: auto; font-size: 11px; line-height: 1; }
.tag { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); vertical-align: 2px; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { position: relative; flex: 1 1 300px; max-width: 440px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); stroke: var(--ink-3); fill: none; stroke-width: 1.7; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 0; border-radius: 99px; background: var(--card); }
.search input:focus { outline: none; box-shadow: 0 0 0 1.5px var(--ink); }
.chip { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 14px; height: 40px; border-radius: 99px; background: var(--card); font-size: 13px; color: var(--ink-3); }
.chip select { border: 0; background: transparent; font-weight: 500; color: var(--ink); padding: 0 18px 0 0; cursor: pointer; appearance: none; -webkit-appearance: none; max-width: 170px; text-overflow: ellipsis; }
.chip::after { content: ''; position: absolute; right: 13px; top: 50%; width: 5px; height: 5px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.chip.set { box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip select:focus { outline: none; }
.chip:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.toggle { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 99px; background: var(--card); font-size: 13px; cursor: pointer; }
.toggle input { accent-color: var(--ink); margin: 0; }
.clear { all: unset; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 0 6px; }
.spacer { flex: 1; }

.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; border-bottom: 1px solid var(--line); }
.summary > div { padding: 16px 22px; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.summary > div:first-child { border-left: 0; }
.summary .k { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.summary .k i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.summary .v { font-size: 21px; font-weight: 300; letter-spacing: -0.03em; white-space: nowrap; }
.summary .v.owe { color: var(--deyn-ink); }
.summary .usd { justify-content: flex-end; font-size: 11.5px; color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 18px; border-radius: 99px; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #3a3f41; }
.btn.small { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- drawer ---------- */
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 20; width: var(--drawer); max-width: calc(100vw - 20px); background: var(--card); border-radius: var(--r); transform: translateX(calc(100% + 20px)); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; display: flex; flex-direction: column; overflow: hidden; }
.drawer.open { transform: none; visibility: visible; transition: transform 0.22s ease; box-shadow: 0 24px 60px -18px #23272859; }
body.drawer-open .main { padding-right: calc(var(--drawer) + 28px); }
.scrim { position: fixed; inset: 0; background: #23272866; z-index: 15; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.dr-head h3 { margin: 4px 0 0; font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.icon-btn { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; background: var(--line-2); }
.icon-btn:hover { background: var(--ink); color: #fff; }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: var(--line-2); color: var(--ink-2); }
.dr-tools { display: flex; gap: 6px; }
.dr-body { flex: 1; overflow-y: auto; padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.dr-amount { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dr-amount .big { font-size: 42px; font-weight: 300; letter-spacing: -0.035em; line-height: 1; }
.dr-amount .big .cents { font-size: 0.5em; color: var(--ink-3); }
.paybar { display: flex; gap: 2px; height: 10px; }
.paybar span { display: block; height: 100%; border-radius: 99px; }
.paybar .p { background: var(--paid); }
.paybar .d { background: var(--deyn); }
.paybar-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; margin: 0; }
dl.kv dt, dl.kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
dl.kv dt { color: var(--ink-3); padding-right: 16px; }
dl.kv dd { text-align: right; font-variant-numeric: tabular-nums; }
dl.kv dd small { display: block; font-size: 11.5px; color: var(--ink-3); }
dl.kv dd.strong { font-weight: 600; }
dl.kv dd.owe { color: var(--deyn-ink); font-weight: 600; }
.dr-section h4 { margin: 0 0 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.acct-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--card-2); border-radius: 16px; }
.acct-box .name { font-weight: 500; }
.acct-box .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.history li { padding-left: 14px; border-left: 2px solid var(--line); font-size: 13px; }
.history .who { font-size: 12px; color: var(--ink-3); }
.history .chg s { color: var(--ink-3); }
.history .why { color: var(--ink-2); font-style: italic; }
.dr-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.kbd-hint { font-size: 11.5px; color: var(--ink-3); }
kbd { font-family: var(--mono); font-size: 11px; padding: 0 5px; border-radius: 5px; background: var(--line-2); }
.plate { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--line-2); white-space: nowrap; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .lbl2 { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.field input:disabled { background: var(--card-2); color: var(--ink-3); }
.field .help { font-size: 12px; color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { font-size: 12.5px; color: var(--bad); background: var(--bad-bg); padding: 9px 12px; border-radius: 12px; }
.form-preview { font-size: 12.5px; color: var(--ink-2); background: var(--card-2); padding: 10px 12px; border-radius: 12px; }
.radio-row { display: flex; gap: 8px; }
.radio-row label { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; cursor: pointer; font-size: 13px; }
.radio-row label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.radio-row input { accent-color: var(--ink); margin: 0; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.money-input input { padding-left: 24px !important; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: #23272866; z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 460px; background: var(--card); border-radius: var(--r); box-shadow: 0 24px 60px -20px #00000059; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 500; }
.modal-body { padding: 16px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- customers ---------- */
.back { all: unset; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.back:hover { text-decoration: underline; }
.acct-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; padding: 24px; }
.acct-head h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.03em; font-weight: 400; }
.acct-head .meta { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.acct-bal { text-align: right; }
.acct-bal .big { font-size: 52px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; margin-top: 4px; }
.acct-bal .big.owe { color: var(--deyn-ink); }
.acct-bal .big .cents { font-size: 0.5em; opacity: 0.7; }
.acct-bal .sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.acct-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.acct-facts > div { display: flex; flex-direction: column; gap: 3px; }
.acct-facts .v { font-size: 18px; font-weight: 400; letter-spacing: -0.02em; }
.plates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 22px 12px; }
.plate-btn { border: 0; background: var(--line-2); border-radius: 99px; padding: 5px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
.plate-btn.on { background: var(--ink); color: #fff; }

/* ---------- staff page ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #e6e5e0; border-radius: 99px; align-self: flex-start; }
.tabs button { all: unset; cursor: pointer; padding: 8px 16px; font-weight: 500; font-size: 13px; color: var(--ink-2); border-radius: 99px; }
.tabs button.on { background: var(--ink); color: #fff; }
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.price-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.price-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price-now .big { font-size: 44px; font-weight: 300; letter-spacing: -0.04em; }
.price-form { display: flex; gap: 8px; align-items: flex-end; }
.price-form .field { flex: 1; }
.shift-cell select { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 99px; padding: 7px 12px; background: var(--card); font-size: 13px; width: 100%; max-width: 210px; }
.shift-cell .who { font-weight: 500; }
.shift-cell .act2 { font-size: 12px; color: var(--ink-3); }
.shift-cell button.act2 { all: unset; cursor: pointer; font-size: 12px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.unassigned { color: var(--bad); font-size: 12px; font-weight: 500; }
tr.today td { background: #fbfaf6; }
.note-line { font-size: 12.5px; color: var(--ink-3); padding: 12px 22px 18px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-size: 13px; transition: 0.2s; z-index: 40; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1360px) {
  .g-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 1280px) {
  body.drawer-open .main { padding-right: 28px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi { border-top: 1px solid var(--line-2); }
  .kpi:nth-child(-n+3) { border-top: 0; }
  .kpi:nth-child(4) { border-left: 0; }
}
@media (max-width: 1100px) {
  .g-2-1, .g-1-1, .g-3-2, .g-2-3 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary .usd { display: none; }
  .acct-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 0 12px 100px; }
  .topbar { padding: 18px 4px 12px; gap: 12px; }
  .topbar h1 { font-size: 26px; }
  .page-sub { font-size: 13.5px; }
  .period .seg { display: none; }
  .period .period-select { display: inline-flex; }
  .date-input { width: 140px; }
  .view { gap: 12px; }
  .row-grid { gap: 12px; }
  .g-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 16px; border-top: 1px solid var(--line-2) !important; border-left: 1px solid var(--line-2) !important; }
  .kpi.hero { grid-column: 1 / -1; border-left: 0 !important; border-top: 0 !important; }
  .kpi:nth-child(2n) { border-left: 0 !important; }
  .kpi.hero .val { font-size: 42px; }
  .kpi .val { font-size: 24px; }
  .kpi .spark { display: none; }
  .card-head { padding: 16px 16px 10px; }
  .chart-pad { padding: 4px 10px 12px; }
  .insight { padding: 0 16px 14px; }
  .watch { padding: 18px 16px; }
  .watch .story { font-size: 17px; }
  .barlist button { padding: 12px 16px; }
  .fuel-rows { padding: 0 16px 16px; }

  table.t thead { display: none; }
  table.t tr.rec td { display: none; }
  table.t tr.rec td.c-m { display: block; padding: 12px 16px; }
  table.t tr.day td { display: none; }
  table.t tr.day td.c-m { display: block; padding: 8px 16px; }
  .m-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
  .m-row .m-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-row .m-amt { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
  .m-row .m-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-row .m-right { text-align: right; font-size: 12px; }
  .m-day { display: flex; justify-content: space-between; font-size: 12px; }

  .toolbar { gap: 6px; }
  .search { flex-basis: 100%; max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 24px); margin: 0 -12px; padding: 0 12px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip, .clear { flex: none; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div { padding: 12px 16px; border-top: 1px solid var(--line-2); }
  .summary > div:nth-child(odd) { border-left: 0; }
  .summary > div:first-child { grid-column: 1 / -1; border-top: 0; }
  .summary .v { font-size: 18px; }

  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; border-radius: 0; }
  .dr-body { padding: 16px; }
  .kbd-hint { display: none; }

  .acct-head { grid-template-columns: 1fr; padding: 18px; }
  .acct-bal { text-align: left; }
  .acct-bal .big { font-size: 42px; }
  .acct-facts { grid-template-columns: 1fr 1fr; }
  .prices { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .tabs button { white-space: nowrap; padding: 8px 12px; }
  .field-row { grid-template-columns: 1fr; }

  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 4px 0; text-decoration: none; }
  .tabbar a.active { color: var(--ink); font-weight: 600; }
  .tabbar a.active svg { color: var(--deyn); }
  .tabbar a svg { width: 21px; height: 21px; }
}

/* recon line under the sales chart */
.recon .t { all: unset; cursor: pointer; }
.recon .t b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.recon .t:hover b { text-decoration: underline; text-underline-offset: 3px; }
dl.kv dd small { font-weight: 400; }

/* ================= tech team console additions ================= */
.brand-sub.console { color: var(--paid-ink); font-weight: 500; }
.nav a.active svg { color: var(--paid); }
.tabbar a.active svg { color: var(--paid); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.active { color: var(--good); background: var(--good-bg); }
.pill.suspended { color: var(--bad); background: var(--bad-bg); }
.pill.pending { color: var(--partly-ink); background: var(--partly-bg); }
.pill.pending::before { background: transparent; border: 1.5px solid currentColor; box-sizing: border-box; }
.pill.quiet { color: var(--ink-2); background: var(--line-2); }
.pill.off { color: var(--ink-3); background: var(--line-2); }
.watch.info { background: #f2f6fc; border-color: #dbe6f6; }
.watch.info .crumb { color: var(--paid-ink); }
.att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.att-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 11px 14px; font-size: 13px; }
.att-list .t { font-weight: 500; }
.att-list .n { font-size: 12px; color: var(--ink-3); grid-column: 1; }
.att-list .btn { grid-row: 1 / 3; grid-column: 2; }
.log { list-style: none; margin: 0; padding: 0 22px 18px; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.log li:first-child { border-top: 0; }
.log .when { color: var(--ink-3); font-size: 12px; }
.log .who { color: var(--ink-3); font-size: 12px; display: block; }
.privacy { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); background: var(--card); border-radius: 16px; padding: 14px 16px; }
.privacy svg { flex: none; margin-top: 1px; }
.biz-head { display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; padding: 24px; }
.biz-head h2 { margin: 0 0 6px; font-size: 28px; font-weight: 400; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.biz-head .meta { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.biz-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { box-shadow: inset 0 0 0 1.5px var(--bad); }
.join-cell { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.join-cell .meter { height: 5px; width: 90px; }
.form-note { font-size: 12.5px; color: var(--ink-2); background: var(--card-2); padding: 10px 12px; border-radius: 12px; display: flex; gap: 8px; align-items: flex-start; }
@media (max-width: 760px) {
  .biz-head { grid-template-columns: 1fr; padding: 18px; }
  .biz-actions { justify-content: flex-start; }
  .log { padding: 0 16px 14px; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 760px) {
  table.t tr.m td { display: none; }
  table.t tr.m td.c-m { display: block; padding: 12px 16px; }
}
