/* Vaqtio admin — warm minimal (same tokens as the app: frontend/app/assets/css/tailwind.css).
   No inline styles anywhere (CSP style-src 'self'): every look lives here. */

:root {
  --ground: #f7f5f2;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #6f6863;
  --brand: #c2410c;
  --on-ink: #ffffff;
  --summary: #292524;
  --danger: #b91c1c;
  --success: #15803d;
  --warning: #b45309;
  --info: #2f6690;
  --violet: #7c5c9e;
  --shadow-card: 0 1px 2px rgb(28 25 23 / 0.04), 0 8px 24px rgb(28 25 23 / 0.05);
  --shadow-float: 0 16px 40px rgb(28 25 23 / 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #151311; --surface: #1f1c19; --ink: #f5f2ee; --muted: #a8a29e;
    --brand: #f0885a; --on-ink: #1c1917; --summary: #2c2824;
    --danger: #f07167; --success: #4ade80; --warning: #f2b45a; --info: #8fb8d8; --violet: #c3a6e0;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    --shadow-float: 0 16px 40px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #151311; --surface: #1f1c19; --ink: #f5f2ee; --muted: #a8a29e;
  --brand: #f0885a; --on-ink: #1c1917; --summary: #2c2824;
  --danger: #f07167; --success: #4ade80; --warning: #f2b45a; --info: #8fb8d8; --violet: #c3a6e0;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  --shadow-float: 0 16px 40px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
:root {
  --surface-2: color-mix(in oklab, var(--ink) 5%, var(--surface));
  --hairline: color-mix(in oklab, var(--ink) 10%, var(--surface));
  --brand-50: color-mix(in oklab, var(--brand) 12%, transparent);
  --success-bg: color-mix(in oklab, var(--success) 14%, transparent);
  --warning-bg: color-mix(in oklab, var(--warning) 16%, transparent);
  --danger-bg: color-mix(in oklab, var(--danger) 12%, transparent);
  --info-bg: color-mix(in oklab, var(--info) 14%, transparent);
  --violet-bg: color-mix(in oklab, var(--violet) 14%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  background: var(--ground); color: var(--ink);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 28px; height: 28px; stroke-width: 1.5; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ─── Logo ─── */
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo .mark-bg { fill: var(--ink); }
.logo .mark-v { fill: var(--surface); }
.logo .mark-ray { stroke: var(--brand); }
.logo b { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.logo span { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ─── Login ─── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-card);
}
.login-card .logo { margin-bottom: 26px; }
.login-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 26px; margin-bottom: 4px; }
.login-card p.lead { color: var(--muted); margin-bottom: 22px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ─── Forms ─── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.input, .field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--hairline); cursor: pointer; }
.check:first-of-type { border-top: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.check b { display: block; font-weight: 600; }
.check small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer;
  background: var(--ink); color: var(--on-ink); white-space: nowrap; transition: opacity .15s, background .15s, border-color .15s;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
.btn-outline:hover { border-color: color-mix(in oklab, var(--ink) 30%, var(--surface)); opacity: 1; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 35%, var(--surface)); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Shell ─── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px 14px;
  border-right: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column;
}
.sidebar .logo { padding: 2px 10px 18px; }
.nav-group { margin-bottom: 10px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--ink); font-weight: 500; opacity: .82;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; opacity: 1; }
.nav a.active { background: var(--ink); color: var(--on-ink); opacity: 1; }
.nav a .count {
  margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; background: var(--brand); color: #fff;
}
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hairline); display: flex; gap: 6px; }
.sidebar-foot .btn { flex: 1; }
.topbar { display: none; }
.main { min-width: 0; padding: 28px 36px 64px; max-width: 1280px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -0.015em; line-height: 1.15; }
.page-head p { color: var(--muted); margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { font-size: 15px; font-weight: 650; }

/* ─── Cards / KPIs ─── */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-pad { padding: 18px 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 108px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--font-display); font-size: 32px; font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: auto; }
.kpi.accent { background: var(--summary); color: #f5f2ee; border-color: transparent; }
.kpi.accent .label, .kpi.accent .sub { color: color-mix(in oklab, #f5f2ee 70%, transparent); }
a.kpi { color: inherit; }
a.kpi:hover { text-decoration: none; border-color: color-mix(in oklab, var(--ink) 25%, var(--surface)); }
.kpi .sub .warn { color: var(--warning); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Segmented / chips / toolbar ─── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search .ic { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--hairline); background: var(--surface); height: 32px; padding: 0 12px; border-radius: 16px;
  font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip .n { font-weight: 700; opacity: .7; }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.b-green { background: var(--success-bg); color: var(--success); }
.b-amber { background: var(--warning-bg); color: var(--warning); }
.b-red { background: var(--danger-bg); color: var(--danger); }
.b-blue { background: var(--info-bg); color: var(--info); }
.b-violet { background: var(--violet-bg); color: var(--violet); }
.b-brand { background: var(--brand-50); color: var(--brand); }
.b-ink { background: var(--ink); color: var(--on-ink); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }

/* ─── Tables (become cards on phones) ─── */
.table-wrap { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td.actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cell-clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.more { display: flex; justify-content: center; padding: 14px; }

/* hairline list (card with rows) */
.list .li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--hairline); }
.list .li:first-child { border-top: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; }
.list-head h3 { font-size: 14px; font-weight: 650; }

/* ─── Empty / skeleton / error ─── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic-lg { color: var(--muted); margin-bottom: 10px; opacity: .8; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--hairline) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
.sk-line { height: 14px; margin: 8px 0; }
.sk-title { height: 32px; width: 240px; margin-bottom: 22px; }
.sk-kpi { height: 108px; border-radius: var(--radius); }
.sk-row { height: 48px; margin: 0; border-radius: 0; border-bottom: 1px solid var(--surface); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition: none !important; } }

/* ─── Charts ─── */
.spark { display: block; width: 100%; height: 56px; }
.spark rect { fill: var(--brand); opacity: .85; }
.spark.ink rect { fill: var(--ink); opacity: .7; }
.bar { display: block; width: 100%; height: 8px; }
.bar .track { fill: var(--surface-2); }
.bar .fill { fill: var(--brand); }
.chart-card { padding: 16px 18px; }
.chart-card .label { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.stars { display: inline-flex; gap: 1px; color: var(--warning); vertical-align: middle; }
.stars .ic { width: 14px; height: 14px; }
.stars .on { fill: currentColor; }
.stars .off { color: var(--hairline); fill: currentColor; }

/* ─── Toggle switch ─── */
.switch { position: relative; width: 46px; height: 26px; border-radius: 13px; border: 0; background: var(--hairline); cursor: pointer; flex: none; transition: background .2s var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.setting { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--hairline); }
.setting:first-child { border-top: 0; }
.setting .grow { flex: 1; }
.setting b { display: block; font-weight: 600; margin-bottom: 2px; }
.setting p { color: var(--muted); font-size: 13px; }

/* ─── Dialog ─── */
dialog.dlg {
  border: 1px solid var(--hairline); border-radius: 18px; padding: 0; width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
}
dialog.dlg::backdrop { background: rgb(20 18 16 / .45); }
dialog.dlg[open] { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-body { padding: 22px 22px 6px; max-height: calc(100vh - 160px); overflow-y: auto; }
.dlg-body h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.dlg-body > p { color: var(--muted); margin-bottom: 16px; }
.dlg-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; background: var(--surface-2); }
.dlg-icon.danger { background: var(--danger-bg); color: var(--danger); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }

/* ─── Drawer ─── */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(20 18 16 / .35); z-index: 60; opacity: 0; transition: opacity .2s var(--ease); }
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--ground); z-index: 61;
  border-left: 1px solid var(--hairline); box-shadow: var(--shadow-float); overflow-y: auto;
  transform: translateX(100%); transition: transform .24s var(--ease);
}
.drawer.open { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 2; background: var(--ground); padding: 18px 22px 14px; border-bottom: 1px solid var(--hairline); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.drawer-body { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 14px; }
.dl { display: grid; grid-template-columns: 140px 1fr; }
.dl > div { padding: 10px 18px; border-top: 1px solid var(--hairline); min-width: 0; overflow-wrap: anywhere; }
.dl > div:nth-child(-n+2) { border-top: 0; }
.dl .k { color: var(--muted); font-size: 13px; padding-right: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-row > div { padding: 14px 16px; border-left: 1px solid var(--hairline); }
.stat-row > div:first-child { border-left: 0; }
.stat-row b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 24px; }
.stat-row span { color: var(--muted); font-size: 12px; }
.access-card { padding: 18px 20px; }
.access-card .big { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin: 6px 0 2px; }
.access-card .btn-group { margin-top: 14px; }

/* ─── Toasts ─── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: 420px; padding: 11px 14px; border-radius: 12px;
  background: var(--summary); color: #f5f2ee; box-shadow: var(--shadow-float); font-weight: 500; animation: pop .2s var(--ease);
}
.toast.error { background: var(--danger); color: #fff; }
.toast .ic { color: #9be3b4; }
.toast.error .ic { color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .main { padding: 24px 24px 64px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; align-content: start; }
  .sidebar {
    position: sticky; top: 52px; z-index: 40; height: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--hairline); scrollbar-width: none; background: var(--ground);
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar > .logo, .nav-label, .sidebar-foot { display: none; }
  .nav-group, .nav { display: contents; }
  .nav a { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--surface); font-size: 13px; margin-right: 6px; }
  .nav a .ic { display: none; }
  .nav a.active { border-color: var(--ink); }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 41; height: 52px; align-items: center; justify-content: space-between;
    padding: 0 12px 0 16px; background: var(--surface); border-bottom: 1px solid var(--hairline);
  }
  .topbar .logo svg { width: 26px; height: 26px; }
  .topbar .logo b { font-size: 17px; }
  .main { padding: 18px 16px 56px; }
  .page-head h1 { font-size: 25px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { min-height: 96px; padding: 14px; }
  .kpi .value { font-size: 26px; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar .chips { flex-basis: 100%; }
  .row2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl > div.k { padding-bottom: 0; }
  .dl > div:not(.k) { border-top: 0; padding-top: 2px; }
  .dl > div:first-child { border-top: 0; }

  /* table → cards */
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody tr { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; box-shadow: var(--shadow-card); }
  .tbl td { border: 0; padding: 6px 14px; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .tbl td.lead { display: block; text-align: left; padding-top: 8px; }
  .tbl td.lead::before { display: none; }
  .tbl td.num { text-align: right; }
  .tbl td.actions { justify-content: flex-start; padding-top: 8px; padding-bottom: 8px; }
  .tbl td.actions::before { display: none; }
  .tbl td.actions .btn-group { justify-content: flex-start; flex-wrap: wrap; }
  .tbl td.empty-cell { display: block; }
  .tbl td.empty-cell::before { display: none; }
  .tbl tbody tr.clickable:hover td { background: transparent; }
  .cell-clip { max-width: none; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
  .stat-row b { font-size: 20px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
}

/* small extras */
.li.clickable { cursor: pointer; }
.li.clickable:hover { background: var(--surface-2); }
.li-bar { padding: 7px 0; }
.li-bar .label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.share { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.share .bar { flex: 1; }
.cell-sub.warn { color: var(--warning); font-weight: 600; }
.setting .dlg-icon { margin: 0; flex: none; }
.kpi .label .badge { margin-left: -2px; }
.gap-top { margin-top: 24px; }
@media (min-width: 861px) {
  .shell { background: linear-gradient(90deg, var(--surface) 0 247px, var(--hairline) 247px 248px, var(--ground) 248px); }
}
@media (max-width: 860px) {
  .tbl td > .cv { min-width: 0; text-align: right; }
  .tbl td.lead > .cv, .tbl td.actions > .cv { text-align: left; width: 100%; }
}
