/* VRS Invoice: app UI. Near-black, sharp 2px geometry, one emerald accent (vrseclabs.in tokens). */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin-v5.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-mono-latin-v6.woff2) format('woff2'); }

:root {
    --bg: #08090B;
    --surface: #0E1014;
    --surface-2: #14171C;
    --surface-3: #1B1F26;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #F4F5F7;
    --text-2: #A3AAB6;
    --text-3: #808897;
    --accent: #1FBF75;
    --accent-strong: #17A863;
    --accent-dim: rgba(31, 191, 117, 0.12);
    --warn: #E8A23A;
    --warn-dim: rgba(232, 162, 58, 0.12);
    --danger: #F06262;
    --danger-dim: rgba(240, 98, 98, 0.12);
    --r: 2px;
    --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --side-w: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 14px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'ss01', 'tnum';
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); font-weight: 500; }
h2 small { color: var(--text-3); font-family: var(--mono); letter-spacing: 0; margin-left: 6px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-3); padding: 1px 5px; border-radius: var(--r); }
kbd { font: 500 10px/1 var(--mono); padding: 3px 5px; border: 1px solid currentColor; border-radius: var(--r); opacity: 0.55; margin-left: 6px; }
small { font-size: 12px; color: var(--text-3); font-weight: 400; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.95em; letter-spacing: -0.01em; }
.upper { text-transform: uppercase; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--bg); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Shell ── */
body.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 22px;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #0B0C0F 0%, var(--bg) 100%);
}
.side-brand { display: flex; align-items: baseline; gap: 8px; padding: 0 6px; }
.side-brand img { height: 22px; width: auto; display: block; }
.side-brand span { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.side-new { justify-content: space-between; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: var(--r);
    color: var(--text-2); font-weight: 500;
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.side-nav a span { font: 500 11px/1 var(--mono); color: var(--text-3); }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); border-left-color: var(--accent); }
.side-nav a[aria-current="page"] span { color: var(--accent); }
.side-user { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.side-user-name { display: flex; flex-direction: column; font-weight: 500; }
.side-user-name small { overflow: hidden; text-overflow: ellipsis; }
.side-user form { margin: 0; }

.main { padding: 32px 40px 80px; min-width: 0; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head--tight { margin-bottom: 18px; }
.page-head .muted { margin-top: 6px; }
.eyebrow { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 12px; }
.eyebrow .link { color: var(--text-2); }
.mono-title { font-family: var(--mono); font-weight: 500; letter-spacing: -0.03em; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px;
    font: 500 13px/1 var(--font); color: var(--text);
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #04130B; font-weight: 600; }
.btn--accent:hover { background: #2AD186; border-color: #2AD186; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: var(--danger-dim); }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row form { margin: 0; }
.btn-col, .btn-col form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link--danger { color: var(--danger); }
.icon-btn {
    width: 28px; height: 28px; display: inline-grid; place-items: center;
    background: transparent; color: var(--text-3); border: 1px solid transparent; border-radius: var(--r);
    font: 500 14px/1 var(--mono); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn--danger:hover { color: var(--danger); border-color: var(--danger); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; }
.chip {
    height: 28px; padding: 0 10px; border-radius: var(--r);
    background: transparent; color: var(--text-2); border: 1px solid var(--line-strong);
    font: 500 12px/1 var(--mono); cursor: pointer;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }

/* ── Forms ── */
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); min-width: 0; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label small { display: inline; }
input, select, textarea {
    width: 100%; min-width: 0;
    font: 400 14px/1.4 var(--font); color: var(--text);
    background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r);
    padding: 9px 11px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input[readonly] { color: var(--text-2); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[type="date"] { color-scheme: dark; }
input::placeholder, textarea::placeholder { color: #5C6370; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 13px; color: var(--text); font-weight: 400; cursor: pointer; }
label.check input { margin: 0; flex: none; width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
.field-error { color: var(--danger); font-size: 12px; margin-top: -4px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 0 1 auto; }
.row > .grow { flex: 1 1 180px; }
.row-btn { height: 40px; }
.w-s { width: 86px; }
.w-m { width: 140px; }
.w-l { max-width: 340px; }
.card {
    margin: 0 0 16px; padding: 20px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface);
    display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card legend {
    float: left; width: 100%; padding: 0; margin-bottom: 2px;
    font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3);
}
.card legend + * { clear: both; }
.legend-note { color: var(--text-2); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 2px; gap: 2px; align-self: flex-start; }
.seg label { display: flex; flex-direction: row; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { padding: 7px 14px; font-size: 13px; color: var(--text-2); border-radius: var(--r); transition: background 0.15s, color 0.15s; }
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.form-narrow { max-width: 760px; }
.settings { max-width: 980px; }
.copy { display: flex; gap: 6px; margin-top: 12px; }
.copy input { font: 12px/1.3 var(--mono); }

/* ── Flash ── */
.flash { padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash--ok { color: #7CE3B0; border-color: rgba(31, 191, 117, 0.35); background: var(--accent-dim); }
.flash--error { color: #FFA3A3; border-color: rgba(240, 98, 98, 0.4); background: var(--danger-dim); }
.flash--warn { color: #F6C47A; border-color: rgba(232, 162, 58, 0.4); background: var(--warn-dim); }

/* ── Panels, KPIs, tables ── */
.panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 20px; margin-bottom: 16px; min-width: 0; }
.panel > h2 { margin-bottom: 14px; }
.panel--flush { padding: 0; overflow-x: auto; }
.panel--todo { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-color: rgba(232, 162, 58, 0.35); background: linear-gradient(90deg, var(--warn-dim), transparent 60%); }
.panel--todo h2 { margin: 0; color: var(--warn); }
.todo { display: flex; gap: 8px 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; flex: 1; }
.todo li { font-size: 13px; }
.todo li::before { content: '○'; color: var(--warn); margin-right: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.empty { color: var(--text-2); padding: 18px 0; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.kpi { background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.kpi h2 { margin-bottom: 10px; }
.kpi-val { font: 500 26px/1.1 var(--mono); letter-spacing: -0.04em; }
.kpi-sub { font: 500 14px/1.3 var(--mono); color: var(--text-2); }
.kpi-foot { margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--text-3); }
.kpi--accent::before, .kpi--warn::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 2px; }
.kpi--accent::before { background: var(--accent); }
.kpi--accent .kpi-val { color: var(--accent); }
.kpi--warn::before { background: var(--warn); }

.chart { width: 100%; height: auto; display: block; }
.chart-hit { fill: transparent; }
.chart g:hover .chart-hit { fill: rgba(255, 255, 255, 0.03); }
.chart-inv { fill: #3A404B; }
.chart-col { fill: var(--accent); }
.chart-lbl { fill: var(--text-3); font: 500 11px var(--mono); }
.chart-base { stroke: var(--line-strong); }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text-2); }
.lg { display: inline-block; width: 8px; height: 8px; margin-right: -8px; }
.lg--inv { background: #3A404B; }
.lg--col { background: var(--accent); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; color: var(--text-2); font-weight: 500; }
.table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.table td form { margin: 0; display: inline; }
.panel .table th:first-child, .panel .table td:first-child { padding-left: 20px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; border-radius: var(--r); border: 1px solid; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; }
.badge--draft { color: var(--text-2); border-color: var(--line-strong); }
.badge--due { color: #8CB8FF; border-color: rgba(140, 184, 255, 0.35); }
.badge--part { color: #C9A6FF; border-color: rgba(201, 166, 255, 0.35); }
.badge--overdue { color: var(--warn); border-color: rgba(232, 162, 58, 0.45); background: var(--warn-dim); }
.badge--paid { color: var(--accent); border-color: rgba(31, 191, 117, 0.45); background: var(--accent-dim); }
.badge--void { color: var(--danger); border-color: rgba(240, 98, 98, 0.4); }
.tag { font: 500 10px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line-strong); color: var(--text-2); border-radius: var(--r); margin-left: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { flex: 1 1 260px; }
.filters select { flex: 0 1 200px; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows a { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rows li:last-child a { border-bottom: 0; }
.rows a:hover .rows-main { color: var(--accent); }
.rows-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows-late { color: var(--warn); font: 500 11px var(--mono); }
.rows-amt { font-family: var(--mono); }

/* ── Editor ── */
.editor { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; margin: -8px 0 0; }
.editor-form { min-width: 0; }
.editor-preview { position: sticky; top: 20px; min-width: 0; }
.preview-bar { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-2); margin-bottom: 10px; }
.dot { width: 7px; height: 7px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); transition: background 0.2s; }
.dot.is-busy { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.dot.is-error { background: var(--danger); }
.preview-frame { overflow: hidden; border: 1px solid var(--line); background: #1A1D23; padding: 16px; max-height: calc(100vh - 70px); overflow-y: auto; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; gap: 10px; padding: 12px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); animation: item-in 0.35s var(--ease); }
.item-grip { font: 500 11px/1 var(--mono); color: var(--text-3); padding-top: 13px; }
.item-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.item-desc { font-weight: 500; }
.item-nums { display: flex; gap: 8px; }
.item-nums label:nth-child(1) { width: 92px; }
.item-nums label:nth-child(2) { width: 70px; }
.item-nums label:nth-child(3) { width: 80px; }
.item-nums .grow { flex: 1; }
.item-tools { display: flex; flex-direction: column; gap: 2px; }
.item.is-leaving { opacity: 0; transform: translateX(8px); transition: opacity 0.18s, transform 0.18s; }
@keyframes item-in { from { opacity: 0; transform: translateY(-4px); } }
.editor-bar {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 14px 0; margin-top: 4px;
    background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.editor-bar--static { position: static; justify-content: flex-start; background: none; }
.editor-total { margin-right: auto; font: 500 20px/1 var(--mono); letter-spacing: -0.03em; }
.editor-total small { font-family: var(--font); letter-spacing: 0; margin-right: 8px; }

/* ── Invoice detail ── */
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.invoice-paper { background: #1A1D23; border: 1px solid var(--line); padding: 24px; overflow: hidden; min-width: 0; }
.invoice-side .panel { margin-bottom: 12px; }
.sum { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sum dt { color: var(--text-2); }
.sum dd { margin: 0; font-family: var(--mono); }
.sum-strong { border-top: 1px solid var(--line); padding-top: 10px; }
.sum-strong dt { color: var(--text); font-weight: 600; }
.sum-strong dd { font-size: 18px; color: var(--accent); }
.pays { list-style: none; margin: 0 0 14px; padding: 0; }
.pays li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pays li > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pays strong { font-family: var(--mono); font-weight: 500; }
.pays form { margin: 0; }
.pay-form .row > label { flex: 1 1 120px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--text-3); }
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); }

/* ── Gate (login/setup) and public page ── */
body.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1000px 500px at 50% -10%, rgba(31, 191, 117, 0.08), transparent 60%), var(--bg); }
.gate-card { width: 100%; max-width: 400px; padding: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); position: relative; }
.gate-card::before { content: ''; position: absolute; top: -1px; left: -1px; width: 48px; height: 2px; background: var(--accent); }
.gate-card img { height: 24px; width: auto; margin-bottom: 28px; }
.gate-card h1 { margin-bottom: 8px; }
.gate-card > .muted { margin-bottom: 24px; }
.gate-card form { margin-top: 8px; }
body.public { background: #15171C; }
.public-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 14px 24px; background: rgba(8, 9, 11, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.public-bar img { height: 20px; width: auto; }
.public-meta { display: flex; gap: 12px; align-items: center; margin-right: auto; color: var(--text-2); }
.invoice-paper--public { border: 0; background: transparent; max-width: 920px; margin: 0 auto; padding: 32px 16px 64px; }

/* ── Partners, bills and intake ── */
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gate-card--wide { max-width: 720px; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details > summary { cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 1280px) {
    .editor { grid-template-columns: minmax(0, 1fr); }
    .editor-preview { position: static; }
    .preview-frame { max-height: none; }
    .invoice-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
    body.app { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .side-nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; }
    .side-nav a { border-left: 0; border-bottom: 2px solid transparent; }
    .side-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
    .side-nav a span { display: none; }
    .side-new { margin-left: auto; }
    .side-new kbd { display: none; }
    .side-user { display: none; }
    .main { padding: 20px 16px 64px; }
    h1 { font-size: 23px; }
    .kpi-val { font-size: 20px; }
    .editor { grid-template-columns: minmax(0, 1fr); }
    .item-nums { flex-wrap: wrap; }
    .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}

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