/* Dashboard shell (dashboard.haldo.app). Builds on style.css tokens.
   Plain: neutral greys, 1px hairlines, lime only for the primary button, the active nav icon and money received. */
.dash {
  --side: #0e0e11; --panel: #131317; --hover: #18181d; --line2: #1d1d23;
  --ok: var(--lime); --warn: var(--amber); --bad: var(--pink); --info: var(--blue);
  background: var(--bg); font-size: 14px;
}

/* sidebar */
.side { position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 20; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px; background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; }
.side-brand svg { width: 22px; height: 22px; color: var(--lime); }
.side-new { width: 100%; justify-content: center; padding: 9px 12px; font-size: 14px; margin-bottom: 14px; }
.side-new:hover { transform: none; }
.side-nav { display: grid; gap: 1px; }
.side-nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
.side-nav a svg { flex: none; color: var(--off); }
.side-nav a:hover { background: var(--hover); color: var(--text); }
.side-nav a.on { background: var(--hover); color: var(--text); }
.side-nav a.on svg { color: var(--lime); }
.side-nav em { margin-left: auto; font: 500 11px var(--mono); font-style: normal; color: var(--muted); background: var(--line2); border-radius: 4px; padding: 1px 6px; }
.side-label { margin: 18px 10px 6px; font: 500 11px var(--mono); color: var(--off); letter-spacing: .04em; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side-foot a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font: 12px var(--mono); }
.side-foot a:hover { background: var(--hover); color: var(--text); }
.side-foot .site-link svg { width: 12px; height: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--off); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--info); } .dot.mute { background: var(--off); }

/* top bar + main */
.dwrap { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.dbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--text); }
.crumbs span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs i { font-style: normal; color: var(--off); }
.dbar-r { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--text); width: 34px; height: 34px; place-items: center; cursor: pointer; }
.dmain { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 32px 64px; }
/* top-level pages have no breadcrumb, so the bar is only needed for the phone menu button */
.dbar.bare { display: none; }

/* page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.ph-sub { margin: 6px 0 0; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-sub a { color: var(--muted); }
.ph-sub .sep { color: var(--off); }
.ph-r { display: flex; gap: 8px; }
.ph .btn svg, .dbar .btn svg, .panel .btn svg { width: 15px; height: 15px; }
.btn { font-size: 14px; padding: 9px 14px; }
.btn:hover { transform: none; }
.fine { margin: -10px 0 18px; font: 12px var(--mono); color: var(--muted); }

/* status: a dot and a word, no badges */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: var(--text); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.st-ok::before { background: var(--ok); } .st-warn::before { background: var(--warn); } .st-info::before { background: var(--info); }
.st-bad::before { background: var(--bad); } .st-mute { color: var(--muted); } .st-mute::before { background: transparent; border: 1.5px solid var(--off); width: 5px; height: 5px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-bottom: 18px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; margin: 6px 0 2px; font: 600 22px var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { font: 11.5px var(--mono); color: var(--off); }
.pos { color: var(--lime) !important; } .warn { color: var(--amber); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-h h2 { font-size: 15px; margin: 0; letter-spacing: 0; }
.panel-h .count { font: 12px var(--mono); color: var(--muted); }
.panel-h .more { font-size: 13px; color: var(--muted); text-decoration: none; } .panel-h .more:hover { color: var(--text); }
.pad { padding: 18px 20px; } .pad-h { padding: 16px 20px 0; margin-bottom: 8px; }
.quiet { color: var(--muted); margin: 0 0 4px; font-size: 13.5px; line-height: 1.55; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.cols > .panel { margin-bottom: 16px; }
.narrow { max-width: 760px; }
.narrow .card { background: var(--panel); border-radius: 8px; }
.narrow .card > h2 { display: none; }

/* attention + activity lists */
.attn, .feed { list-style: none; margin: 0; padding: 0; }
.attn li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line2); }
.attn li:first-child { border-top: 0; padding-top: 2px; }
.attn p { margin: 0; line-height: 1.5; } .attn a { color: var(--text); font-weight: 600; text-decoration: none; } .attn a:hover { text-decoration: underline; }
.attn time, .feed time { font: 11.5px var(--mono); color: var(--off); white-space: nowrap; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line2); }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed p { margin: 0; color: var(--text); line-height: 1.45; }
.feed a { font-size: 12.5px; color: var(--muted); text-decoration: none; } .feed a:hover { color: var(--text); }
.fd { width: 6px; height: 6px; border-radius: 50%; background: var(--off); transform: translateY(-1px); }
.fd-ok { background: var(--lime); } .fd-warn { background: var(--amber); } .fd-error { background: var(--pink); }

/* chart */
.bars { width: 100%; height: auto; display: block; }
.bars .bar { fill: #2a2a31; } .bars .bar-cur { fill: var(--lime); }
.bars .axis { stroke: var(--line); }
.bars text { font: 11px var(--mono); }
.bars .bar-l { fill: var(--muted); } .bars .bar-v { fill: var(--text); }

/* data tables */
.dt { width: 100%; border-collapse: collapse; }
.dt th { font: 500 11.5px var(--mono); color: var(--muted); text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--side); white-space: nowrap; }
.dt td { padding: 12px 20px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.dt tr:last-child td { border-bottom: 0; }
.dt tbody tr { cursor: default; }
.dt tbody tr[data-href] { cursor: pointer; }
.dt tbody tr:hover { background: var(--hover); }
.dt .num { text-align: right; font: 13px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.dt.compact td { padding: 10px 0; }
.dt.compact td + td { padding-left: 14px; }
.rowlink { color: var(--text); text-decoration: none; font-weight: 600; }
.rowlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.role { font-size: 13px; color: var(--muted); }

/* toolbar: tabs + search */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--hover); color: var(--text); }
.tabs em { font: 11px var(--mono); font-style: normal; color: var(--off); }
.search { position: relative; margin: 0; width: 240px; font-weight: 400; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--off); }
.search input { margin: 0; height: 32px; padding: 0 10px 0 32px; font-size: 13px; background: var(--bg); }
.nomatch { padding: 16px 20px; }

.empty-box { padding: 28px 8px; display: grid; justify-items: start; gap: 6px; }
.empty-box b { font-size: 15px; } .empty-box p { margin: 0 0 10px; color: var(--muted); max-width: 44ch; }

/* delivery detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.d-rail { position: sticky; top: 68px; }
.copy .btn { white-space: nowrap; }
.copy { margin: 0 0 10px; }
.vtrack { list-style: none; margin: 0; padding: 0 0 0 4px; }
.vtrack li { position: relative; padding: 0 0 14px 20px; border-left: 1px solid var(--line); margin-left: 3px; }
.vtrack li:last-child { border-left-color: transparent; padding-bottom: 0; }
.vtrack li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel); border: 1.5px solid var(--off); }
.vtrack li.on::before { background: var(--lime); border-color: var(--lime); }
.vtrack li.on { border-left-color: color-mix(in srgb, var(--lime) 45%, var(--line)); }
.vtrack li.cur::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 18%, transparent); }
.vtrack b { display: block; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.vtrack li.on b { color: var(--text); }
.vtrack span { font: 11.5px var(--mono); color: var(--off); }
.kv { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 9px 12px; margin: 0; font-size: 13.5px; }
.kv.wide { grid-template-columns: 120px minmax(0, 1fr); }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd a { color: var(--text); }
.kv .sub { font-size: 12px; color: var(--muted); }
.kv-h { margin: 10px 0 6px; font: 11.5px var(--mono); color: var(--muted); }
.plain { margin: 0; padding-left: 16px; color: var(--text); font-size: 13.5px; } .plain li { padding: 2px 0; }
.d-rail .notes { font-size: 12px; max-height: 220px; overflow: auto; }
.panel.danger { padding: 14px 20px; }
.panel.danger summary { font-size: 13px; }
.readycard .panel-h, .readycard h2 { color: var(--amber); }
.panel .up h3 { font: 500 12px var(--mono); text-transform: none; color: var(--text); }
.panel .up .row .hint { margin-left: 0; display: block; flex-basis: 100%; }

/* settings */
.set { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line2); }
.set:first-of-type { border-top: 0; padding-top: 2px; }
.set b { font-weight: 600; } .set p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 62ch; }

/* mobile: sidebar slides in */
.scrim { display: none; }
@media (max-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .d-rail { position: static; }
}
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; }
  .dwrap { margin-left: 0; }
  .menu-btn { display: grid; }
  .dbar.bare { display: flex; }
  .dbar { padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
  .dmain { padding: 20px max(16px, env(safe-area-inset-left, 0px)) 48px; }
  .search { width: 100%; }
  .hide-sm { display: none; }
  .dt th, .dt td { padding-left: 14px; padding-right: 14px; }
  .kpis.three { grid-template-columns: minmax(0, 1fr); } .kpis.three .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* account in the sidebar */
.who { display: flex; align-items: center; gap: 9px; padding: 8px 6px 2px 10px; min-width: 0; }
.av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--hover); border: 1px solid var(--line); font: 600 12px var(--sans); color: var(--text); }
.who-t { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.who-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-t small { font: 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.linkbtn:hover { color: var(--text); background: var(--hover); }

/* notices + settings bits */
.notice a { color: var(--lime); }
.notice.ok { border-color: color-mix(in srgb, var(--lime) 40%, var(--line)); } .notice.ok b { color: var(--lime); }
.notice.bad { border-color: color-mix(in srgb, var(--pink) 45%, var(--line)); } .notice.bad b { color: var(--pink); }
.ph2 { margin: 0 0 6px; font: 500 12px var(--mono); color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.panel + .panel { margin-top: 16px; }
.set-col { flex-direction: column; align-items: stretch; }
.payout-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.payout-form select { flex: 1 1 220px; width: auto; margin: 0; }
.set form { margin: 0; flex: none; }
.freebie { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--lime) 7%, transparent); color: var(--lime); font: 13px var(--mono); }

/* log in / sign up */
.authbody { min-height: 100vh; }
.auth { max-width: 400px; margin: 0 auto; padding: 56px 16px 40px; }
.auth-brand { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 26px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; }
.auth-brand svg { width: 24px; height: 24px; color: var(--lime); }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 26px 24px 22px; }
.auth-card h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.auth-card > p { margin: 4px 0 8px; font-size: 14px; }
.auth-card label { margin: 14px 0 0; }
.auth-card .btn-big { margin-top: 20px; }
.auth-err { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--pink) 10%, transparent); color: var(--pink); font-size: 14px; }
.field-err { display: block; margin-top: 6px; color: var(--pink); font-size: 13px; font-weight: 400; }
.hint-line { margin: 6px 0 0; font: 12px var(--mono); color: var(--muted); }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.dash .notice { display: block; line-height: 1.6; font-size: 13.5px; }
.dash .notice b { margin-right: 4px; }
