/* Midwest Tire dashboard — Operate-mode UI. Tokens first; components use tokens only. */
:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --panel-2: #f9f8f5;
  --ink: #17181a;
  --ink-2: #4a4d52;
  --ink-3: #6b6f75;
  --line: #e2dfd8;
  --line-2: #cfcbc2;
  --accent: #b4410f;          /* signal orange, 5.6:1 on white */
  --accent-ink: #ffffff;
  --accent-soft: #fbeee6;
  --ok: #1d6b3a;
  --ok-soft: #e5f3e9;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --info: #1f4f8a;
  --info-soft: #e7eef8;
  --shadow: 0 1px 2px rgba(23, 24, 26, .06), 0 1px 1px rgba(23, 24, 26, .04);
  --radius: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 220px;
  color-scheme: light;
}
/* Night mode (default). The server sets data-theme on <html> from the 'theme' cookie. */
:root[data-theme="dark"] {
  --bg: #121315;
  --panel: #1b1c1f;
  --panel-2: #222327;
  --ink: #eceae6;
  --ink-2: #b9b7b2;
  --ink-3: #9a9893;
  --line: #2e3034;
  --line-2: #3d3f44;
  --accent: #f08a4b;
  --accent-ink: #1b0d04;
  --accent-soft: #3a2316;
  --ok: #6fcf8e;
  --ok-soft: #17301f;
  --warn: #e8b84a;
  --warn-soft: #33290f;
  --bad: #f28b82;
  --bad-soft: #3a1d1b;
  --info: #8fb6ea;
  --info-soft: #1a2738;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.mono, .size { font-family: var(--mono); font-size: .94em; }
.size { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.muted { color: var(--ink-3); }
.num { text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: var(--s4) var(--s3);
  border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: var(--s4);
}
.brand { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2); font-weight: 700; font-size: 15px; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; border: 6px solid var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding: 0 var(--s3);
  border-radius: 6px; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }
.side-foot button { width: 100%; justify-content: flex-start; }

.main { min-width: 0; padding: var(--s5) var(--s6) 96px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.crumb a { color: var(--ink-3); }

.mobile-top, .tabbar { display: none; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel, .stack > * + * { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-body { padding: var(--s4); }
.panel-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.grid-2 > .panel + .panel, .grid-2 .stack > .panel { margin-top: 0; }
.grid-2 .stack { display: flex; flex-direction: column; gap: var(--s4); }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
/* sibling spacing is for block flow only; grids use gap */
.kpis > *, .grid-2 > *, .grid-even > * { margin-top: 0 !important; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { padding: var(--s4); }
.kpi-label { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.kpi-sub { font-size: 13px; color: var(--ink-3); }
.kpi a { color: inherit; }

/* weekly bars */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--s2); align-items: end; height: 150px; padding-top: var(--s2); }
.bar { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; min-height: 0; }
.bar-fill { flex: 1; background: var(--ink-3); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-fill.exp { background: var(--line-2); }
.bar.now .bar-fill:not(.exp) { background: var(--accent); }
.legend { display: flex; gap: var(--s3); font-size: 13px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-sales { background: var(--ink-3); } .sw-exp { background: var(--line-2); }

/* live search */
.live-wrap { position: relative; }
.live-results.loading { opacity: .6; transition: opacity .15s; }
.live-float {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14); max-height: 360px; overflow-y: auto;
}
ul.live-list { list-style: none; margin: 0; padding: 4px; }
.live-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  min-height: 44px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none;
}
.live-item:hover, .live-item:focus-visible { background: var(--accent-soft); outline: none; text-decoration: none; }
.live-main { font-weight: 600; }
.live-sub { font-size: 13px; color: var(--ink-3); }
.live-new .live-main { color: var(--accent); }
ul.live-list li + li .live-new { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.picker-row.is-out td { color: var(--ink-3); }
.picker-row.is-out .size { color: var(--ink-3); }

/* day / night switch: shows the mode you'd switch TO */
.theme-toggle .when-dark, .theme-toggle .when-light { display: inline-flex; align-items: center; gap: var(--s3); }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }      /* in night: offer Day */
:root:not([data-theme="dark"]) .theme-toggle .when-dark { display: none; } /* in day: offer Night */
.mobile-top .actions { flex-wrap: nowrap; gap: var(--s1); }
.mobile-top .theme-toggle .tt-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login .theme-toggle { margin: var(--s4) auto 0; display: flex; width: max-content; }

/* invoice: custom part/fee fields */
.custom-fields[hidden] { display: none; }

/* refunds */
ol.steps { list-style: none; display: flex; gap: var(--s2); margin: var(--s2) 0 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); flex-wrap: wrap; }
ol.steps li { display: flex; align-items: center; gap: var(--s2); }
ol.steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line-2); }
ol.steps li[aria-current="step"] { color: var(--accent); }
ol.steps li.done a { color: var(--ink-2); }
.refund-table .pick-cell { width: 1%; vertical-align: top; padding-top: 14px; }
.refund-table .pick-cell input { width: 20px; height: 20px; accent-color: var(--accent); }
.refund-row.is-picked td { background: var(--accent-soft); }
.refund-row.is-done td { color: var(--ink-3); }
.refund-row .qty-in { width: 76px; min-height: 36px; }
fieldset.restock { border: 0; padding: 8px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s4); align-items: center; }
fieldset.restock legend { float: left; width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; }
fieldset.restock .check { min-height: 32px; font-size: 14px; }
fieldset.restock[disabled] { display: none; }
fieldset.restock.need legend { color: var(--bad); }
fieldset.restock.need legend::after { content: " (required)"; }
@media (max-width: 760px) {
  .refund-table .pick-cell { display: flex !important; justify-content: flex-start; padding: 0 0 4px; width: auto; }
  .refund-table .pick-cell::before { content: none !important; }
}

/* expenses */
.month-nav { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.month-nav h2 { min-width: 9.5em; text-align: center; }
.month-nav .btn-sm { min-width: 36px; font-size: 18px; }
.month-nav .btn-sm:last-child { font-size: 13px; }
ul.catbars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.catbar-top { display: flex; justify-content: space-between; gap: var(--s3); font-size: 14px; }
.catbar { height: 6px; background: var(--panel-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.catbar > div { height: 100%; background: var(--ink-3); border-radius: 3px; }

/* profit & loss statement */
table.pl { width: 100%; border-collapse: collapse; }
.pl td { padding: 5px 0; }
.pl td:last-child { text-align: right; white-space: nowrap; }
.pl .pl-main td { font-weight: 600; padding-top: 10px; }
.pl .pl-sub td { color: var(--ink-3); font-size: 14px; padding: 2px 0 2px var(--s4); }
.pl .pl-sub td:last-child { padding-left: 0; }
.pl .pl-total td { font-weight: 600; border-top: 1px solid var(--line-2); padding-top: 8px; }
.pl .pl-net td { font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); padding-top: 10px; color: var(--ok); }
.pl .pl-net.neg td { color: var(--bad); }
.pl .pl-net td:first-child { color: var(--ink); }
.bar-val { font-size: 11px; color: var(--ink-3); text-align: center; white-space: nowrap; }
.bar-lbl { font-size: 11px; color: var(--ink-3); text-align: center; border-top: 1px solid var(--line); padding-top: 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 10px var(--s3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.t th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); white-space: nowrap; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.link-row { cursor: pointer; }
.t tbody tr.link-row:hover td { background: var(--panel-2); }
.t td.num, .t th.num { text-align: right; }
.t tfoot td { font-weight: 600; background: var(--panel-2); border-top: 1px solid var(--line-2); border-bottom: 0; }
.t .sub { display: block; font-size: 13px; color: var(--ink-3); }
.t .row-actions { display: flex; gap: var(--s2); justify-content: flex-end; }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-draft { background: var(--panel-2); color: var(--ink-2); border-color: var(--line-2); }
.b-editing { background: var(--warn-soft); color: var(--warn); }
.b-unpaid { background: var(--bad-soft); color: var(--bad); }
.b-partial { background: var(--warn-soft); color: var(--warn); }
.b-paid { background: var(--ok-soft); color: var(--ok); }
.b-void { background: var(--panel-2); color: var(--ink-3); text-decoration: line-through; }
.b-low { background: var(--warn-soft); color: var(--warn); }
.b-out { background: var(--bad-soft); color: var(--bad); }
.b-aged { background: var(--info-soft); color: var(--info); }
.b-used { background: var(--panel-2); color: var(--ink-2); border-color: var(--line-2); }
.qty-cell { font-weight: 600; }

/* ---------- forms ---------- */
label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: var(--s4); min-width: 0; }
.field .help { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--bad); margin-top: 4px; font-weight: 500; }
.field.has-err input, .field.has-err select { border-color: var(--bad); }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px;
}
textarea { min-height: 80px; resize: vertical; }
/* typed-or-picked fields: draw our own chevron, hide the browser's inconsistent one */
input.combo {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b6f75' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input.combo::-webkit-calendar-picker-indicator { opacity: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: var(--s2); font-weight: 500; color: var(--ink); min-height: 40px; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--s4); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-4 { grid-column: 1 / -1; }
.form-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: var(--s2) 0 var(--s3); grid-column: 1 / -1; padding-top: var(--s3); border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.inline-form { display: flex; gap: var(--s2); align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }
.filters input, .filters select { min-height: 36px; }
form { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; font: inherit; font-weight: 600; font-size: 14px;
  border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--panel-2); text-decoration: none; border-color: var(--ink-3); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(.92); border-color: var(--accent); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- flash / notices ---------- */
.flashes { margin-bottom: var(--s4); display: grid; gap: var(--s2); }
.flash, .notice { padding: 10px var(--s4); border-radius: 6px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash.error, .notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- key/value ---------- */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; }
dl.kv dt { color: var(--ink-3); font-size: 13px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- invoice ---------- */
.inv-head { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.totals { width: 100%; max-width: 320px; margin-left: auto; border-collapse: collapse; }
.totals td { padding: 4px 0; }
.totals td:last-child { text-align: right; }
.totals tr.grand td { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line-2); padding-top: 8px; }
.totals tr.due td { font-weight: 700; color: var(--accent); }
.line-edit input { min-height: 34px; padding: 4px 8px; }
.line-edit .qty-in { width: 70px; }
.line-edit .price-in { width: 100px; }
.picker-row td { padding-top: 8px; padding-bottom: 8px; }
.picker-row form { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.picker-row .pick-main { display: flex; gap: 6px; align-items: center; }
.picker-row .pick-opts { display: flex; gap: var(--s3); }
.picker-row .pick-opts .check { min-height: 32px; font-size: 13px; white-space: nowrap; }
.picker-row input[type=number] { width: 64px; min-height: 34px; }
.picker-row input.price-in { width: 92px; min-height: 34px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 var(--s3); overflow-x: auto; }
.tabs a { padding: 10px var(--s3); color: var(--ink-3); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }
details.disclose > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; min-height: 40px; display: flex; align-items: center; }
details.disclose > summary::-webkit-details-marker { display: none; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.login { width: 100%; max-width: 380px; }
.login .brand { padding: 0; margin-bottom: var(--s5); font-size: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 > .stack.aside-first { order: -1; }
  .main { padding: var(--s5) var(--s5) 96px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { display: block; }
  .side { display: none; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
    padding: 10px var(--s4); background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .main { padding: var(--s4) var(--s4) 100px; }
  .kpi-value { font-size: 22px; }
  .grid-even { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .filters > * { flex: 1 1 140px; }
  .bars { height: 120px; gap: 4px; }
  .bar-val { display: none; }

  /* tables -> cards */
  table.rt, .rt thead, .rt tbody, .rt tfoot, .rt tr, .rt td { display: block; width: 100%; }
  .rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rt tbody tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
  .rt tbody tr:last-child { border-bottom: 0; }
  .rt td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: var(--s3); text-align: right; }
  .rt td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; text-align: left; flex: none; }
  .rt td.primary { display: block; text-align: left; font-weight: 600; padding-bottom: 4px; }
  .rt td.primary::before { content: none; }
  .rt td.hide-sm { display: none; }
  .rt td:empty { display: none; }
  .rt tfoot tr { padding: var(--s3) var(--s4); }
  .rt .row-actions { justify-content: flex-end; width: 100%; }
  .rt td.actions-cell::before { content: none; }
}

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

/* ---------- print ---------- */
@media print {
  .side, .mobile-top, .tabbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .panel { box-shadow: none; border: 0; }
}
