/* app.css v1.3.12 — three themes, no build step */

:root,
[data-theme="light"] {
    --bg: #f3f6f9;
    --surface: #ffffff;
    --surface-2: #eef3f7;
    --text: #142033;
    --muted: #5b6b7c;
    --line: #d7e0e8;
    --primary: #0f6e56;
    --primary-hover: #0c5945;
    --primary-soft: #e7f5ef;
    --accent: #1d4ed8;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --ok: #067647;
    --ok-bg: #e7f8ef;
    --warn: #b54708;
    --warn-bg: #fff6eb;
    --sidebar: #10231c;
    --sidebar-text: #d7efe4;
    --sidebar-active: #1a3b30;
    --header: #ffffff;
    --shadow: 0 10px 30px rgba(16, 35, 28, 0.06);
    --radius: 14px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f1419;
    --surface: #171e26;
    --surface-2: #12181f;
    --text: #e8eef4;
    --muted: #9aa8b6;
    --line: #2a3541;
    --primary: #3dd6a3;
    --primary-hover: #2bb98a;
    --primary-soft: #14352c;
    --accent: #7ab0ff;
    --danger: #ff7a70;
    --danger-bg: #3a1d1b;
    --ok: #3dd6a3;
    --ok-bg: #14352c;
    --warn: #f5b942;
    --warn-bg: #3a2d12;
    --sidebar: #0b1015;
    --sidebar-text: #c5d0da;
    --sidebar-active: #1c2732;
    --header: #171e26;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="premium"] {
    --bg: #f6f1e8;
    --surface: #fffdf8;
    --surface-2: #efe6d6;
    --text: #1c140c;
    --muted: #6d5c48;
    --line: #e4d5bb;
    --primary: #8a5a12;
    --primary-hover: #6e470c;
    --primary-soft: #f3e6cf;
    --accent: #1f4d3a;
    --danger: #9b1c1c;
    --danger-bg: #f8e8e8;
    --ok: #1f4d3a;
    --ok-bg: #e4efe9;
    --warn: #9a6700;
    --warn-bg: #f7ecd3;
    --sidebar: #1c140c;
    --sidebar-text: #f0e2c8;
    --sidebar-active: #3a2a18;
    --header: #fffdf8;
    --shadow: 0 12px 28px rgba(28, 20, 12, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.app-frame { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px; color: #fff; font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(145deg, #3ecf8e, #0f6e56);
}
.nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav a, .nav button {
    display: block; color: var(--sidebar-text); padding: 9px 12px;
    border-radius: 10px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer;
}
.nav a:hover, .nav a.is-active { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.nav .nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 12px 4px; opacity: .6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--header);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 20px;
}
.topbar-user { color: var(--muted); font-size: .92rem; display: flex; gap: 12px; align-items: center; }
.content { padding: 22px; flex: 1; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.muted { color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.stat { font-size: 1.4rem; font-weight: 700; margin: 4px 0; }

.button, button.button, input[type=submit] {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
    background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; font: inherit;
}
.button:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.button-primary { background: var(--primary); color: #fff; }
.stack > * + * { margin-top: 10px; }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.button-ghost:hover { color: var(--text); background: var(--surface-2); }
.button-danger { background: var(--danger); }
.button-sm { min-height: 32px; padding: 0 10px; font-size: .85rem; }

.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
    width: 100%; min-height: 38px; padding: 8px 10px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 90px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.table-wrap { overflow: auto; }
.data-grid { max-height: calc(100vh - 260px); }
.data-grid table.data { min-width: 760px; width: max(100%, 760px); }
.data-grid thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--surface); box-shadow: 0 1px 0 var(--line);
}
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-side { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.settings-side a { padding: 8px 10px; border-radius: 10px; color: var(--text); }
.settings-side a.is-active, .settings-side a:hover { background: var(--surface-2); text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 10px; }

.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; white-space: pre-line; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.is-readonly { background: var(--surface-2); }
.invoice-wrap .card h2 { margin-top: 0; }
.customer-chip { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.totals-bar { display: flex; gap: 18px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 40; }
.modal[hidden] { display: none; }
.modal-card { width: min(520px, calc(100% - 24px)); }
#invoice-lines input[type=number], #purchase-line-body input[type=number], #debit-line-body input[type=number] { min-width: 72px; }
.filter-panel .filter-basic, .filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
}
.filter-advanced { margin: 8px 0 12px; }
.filter-advanced summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.totals-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.totals-strip div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.totals-strip strong { display: block; font-size: 1.05rem; }
@media (max-width: 960px) {
    .filter-panel .filter-basic, .filter-grid, .totals-strip { grid-template-columns: 1fr 1fr; }
}
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--ok-bg); color: var(--ok); }

.guest-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.guest-card { width: min(460px, 100%); }

.menu-toggle { display: none; }
.overlay { display: none; }

.pos-frame { display: grid; grid-template-columns: 1.4fr .9fr; min-height: 100vh; }
.pos-left, .pos-right { padding: 16px; }
.pos-right { background: var(--surface); border-left: 1px solid var(--line); }
.cart-line { display: grid; grid-template-columns: 1fr 70px 90px 32px; gap: 6px; align-items: center; margin-bottom: 8px; }
.pos-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.pos-card {
    display: flex; flex-direction: column; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; cursor: pointer; color: inherit; padding: 0; font: inherit;
}
.pos-card:hover { border-color: var(--primary); text-decoration: none; }
.pos-card-img { display: block; aspect-ratio: 1 / 1; background: var(--surface-2); }
.pos-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.pos-card-price { font-weight: 700; color: var(--primary); }
.pos-card-add { font-size: .8rem; font-weight: 700; color: var(--accent); margin-top: 4px; }
.pos-cart { margin: 12px 0; max-height: 280px; overflow: auto; }
.item-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.search-box, .ref-select { position: relative; z-index: 8; }
.search-box:focus-within, .ref-select:focus-within { z-index: 30; }
.search-results { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; z-index: 40; max-height: 240px; overflow: auto; box-shadow: var(--shadow); }
.search-results button { width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 8px 10px; cursor: pointer; }
.search-results button:hover { background: var(--surface-2); }
.lock-banner {
    background: var(--warn-bg);
    color: var(--warn);
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    margin-bottom: 12px;
}
.json-block {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
    max-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
    white-space: pre;
}
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
table.data tfoot th { font-size: .8rem; text-transform: none; letter-spacing: 0; color: var(--text); }

.print-sheet { width: 210mm; max-width: 100%; margin: 0 auto; background: #fff; color: #111; padding: 16px; }
.print-actions { margin: 12px auto; width: 210mm; max-width: 100%; }
@media print {
    .print-actions, .no-print { display: none !important; }
    body { background: #fff; color: #111; }
    a { color: inherit; text-decoration: none; }
}

.fbr-statl {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: .88rem;
}
.fbr-statl-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #8a94a0; display: inline-block; flex-shrink: 0;
}
.fbr-statl.is-active { color: #067647; }
.fbr-statl.is-active .fbr-statl-dot { background: #12b76a; }
.fbr-statl.is-inactive { color: #b42318; }
.fbr-statl.is-inactive .fbr-statl-dot { background: #d92d20; }
.fbr-statl.is-unknown, .fbr-statl.is-pending { color: var(--muted); }
.fbr-statl.is-unknown .fbr-statl-dot, .fbr-statl.is-pending .fbr-statl-dot { background: #667085; }

.invoice-print {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #111;
    font-size: 12px;
    line-height: 1.45;
}
.invoice-print h1, .invoice-print h2 { margin: 0; color: #111; }
.invp-head {
    display: grid;
    grid-template-columns: 1.4fr .9fr auto;
    gap: 16px;
    align-items: start;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.invp-brand { display: flex; gap: 12px; align-items: flex-start; }
.invp-logo { max-height: 64px; max-width: 140px; object-fit: contain; }
.invp-brand h1 { font-size: 20px; letter-spacing: .01em; }
.invp-brand p { margin: 4px 0 0; color: #444; font-size: 11px; }
.invp-meta { text-align: right; }
.invp-doctype {
    margin: 0; font-size: 11px; letter-spacing: .14em;
    text-transform: uppercase; color: #555; font-weight: 700;
}
.invp-number { margin: 2px 0 6px; font-size: 18px; font-weight: 700; }
.invp-meta p { margin: 2px 0; }
.invp-fiscal { text-align: center; min-width: 110px; }
.invp-badge {
    border: 1px solid #111; border-radius: 8px; padding: 6px 8px; margin-bottom: 8px;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.invp-badge strong { display: block; font-size: 16px; letter-spacing: .08em; }
.invp-badge span { display: block; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.invp-badge-fbr { background: #e8f5ee; color: #0f5132; border-color: #0f5132; }
.invp-badge-pra { background: #eef4fb; color: #123a63; border-color: #123a63; }
.invp-qr { width: 96px; height: 96px; margin: 0 auto; }
.invp-qr svg { width: 96px; height: 96px; display: block; }
.invp-qr-cap { margin: 4px 0 0; font-size: 9px; color: #555; }
.invp-parties {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 14px;
}
.invp-parties h2 {
    font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
    color: #555; margin-bottom: 4px;
}
.invp-parties p { margin: 0; }
.invp-pill {
    display: inline-block; border: 1px solid #ccc; border-radius: 999px;
    padding: 0 7px; font-size: 10px; margin-left: 6px; text-transform: capitalize;
}
.invp-lines { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.invp-lines th, .invp-lines td {
    padding: 6px 6px; border-bottom: 1px solid #d9d9d9;
    vertical-align: top; text-align: left;
}
.invp-lines thead th {
    font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid #111; background: #f4f4f4;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.invp-lines .num { text-align: right; white-space: nowrap; }
.invp-lines tbody tr { page-break-inside: avoid; }
.invp-bottom { display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: start; }
.invp-notes p { margin: 0 0 6px; color: #555; }
.invp-totals { width: 100%; border-collapse: collapse; }
.invp-totals th { text-align: left; font-weight: 600; padding: 4px 8px 4px 0; }
.invp-totals td { text-align: right; padding: 4px 0; white-space: nowrap; }
.invp-grand th, .invp-grand td {
    border-top: 2px solid #111; font-size: 14px; padding-top: 8px;
}

@media print {
    .invoice-print .invp-lines thead { display: table-header-group; }
    .invoice-print .invp-head, .invoice-print .invp-bottom { page-break-inside: avoid; }
}

.doc-page { max-width: 1280px; }
.doc-toolbar {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.doc-toolbar h1 { margin: 0; font-size: 1.35rem; }
.doc-split {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; margin-bottom: 12px;
}
.doc-panel h2 {
    margin: 0 0 10px; font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.party-search { margin-bottom: 8px; }
.party-card {
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    background: var(--surface-2);
}
.party-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.party-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .85rem;
}
.party-grid .full { grid-column: 1 / -1; }
.party-grid .k { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.item-toolbar {
    display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px;
}
.item-toolbar .search-box { flex: 1; min-width: 220px; }
.lines-table th, .lines-table td { padding: 6px 6px; font-size: .82rem; white-space: nowrap; }
.lines-table th.num, .lines-table td.num, .lines-table tfoot th.num { text-align: right; }
.lines-table input[type=number] { min-width: 68px; min-height: 32px; padding: 4px 6px; text-align: right; }
.lines-table tfoot { background: var(--surface-2); }
.lines-table tfoot th { font-weight: 700; }
.summary-grid {
    display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 8px; margin-top: 12px;
}
.summary-grid div {
    border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2);
}
.summary-grid span { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.summary-grid strong { font-size: 1.05rem; }
.summary-grid .is-grand { background: var(--primary-soft); border-color: transparent; }
.doc-actions-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 1100px) {
    .doc-split, .summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
    .grid-4, .grid-2, .form-grid, .pos-frame, .doc-split, .party-grid, .summary-grid, .settings-layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-105%); z-index: 20; transition: transform .2s; }
    .sidebar.is-open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .overlay.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; }
}

.lines-table .fiscal-col { display: none; }
.lines-table .fiscal-col.is-on { display: table-cell; }
.lines-table .js-remaining { font-weight: 700; color: var(--ok); }
.dn-ref-warn { color: var(--warn); margin-top: 8px; font-size: .9rem; }

.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-hero {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    align-items: flex-end;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 80%, transparent), var(--surface) 55%);
    box-shadow: var(--shadow);
}
.dash-hero h1 { margin: 2px 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.dash-kicker {
    margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted);
}
.dash-period { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dash-period-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dash-pill {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    color: var(--text); font-size: .82rem; font-weight: 600;
}
.dash-pill:hover { text-decoration: none; background: var(--surface-2); }
.dash-pill.is-on { background: var(--primary); border-color: transparent; color: #fff; }
.dash-custom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dash-custom[hidden] { display: none; }
.dash-custom input[type=date] { width: auto; min-width: 140px; min-height: 34px; }

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.dash-kpi {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 14px 14px 12px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 2px;
}
.dash-kpi::after {
    content: ""; position: absolute; right: -20px; top: -24px; width: 90px; height: 90px;
    border-radius: 50%; background: var(--primary-soft); opacity: .7; pointer-events: none;
}
.dash-kpi span { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dash-kpi strong { font-size: 1.28rem; letter-spacing: -.02em; z-index: 1; }
.dash-kpi em { font-style: normal; font-size: .78rem; color: var(--muted); }
.dash-kpi.is-warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.dash-ico { width: 18px; height: 18px; color: var(--primary); margin-bottom: 8px; z-index: 1; }

.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-action {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 12px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    font-weight: 600; font-size: .86rem; box-shadow: var(--shadow);
}
.dash-action:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--primary); }
.dash-action .dash-ico { margin: 0; }
.dash-action.is-primary { background: var(--primary); color: #fff; border-color: transparent; }
.dash-action.is-primary .dash-ico { color: #fff; }

.dash-grid, .dash-grid-bottom {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px;
}
.dash-grid-bottom { grid-template-columns: 1.3fr .85fr .85fr; }
.dash-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.dash-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.dash-card-head h2 { margin: 0; font-size: 1.02rem; }
.dash-card-head p { margin: 4px 0 0; }
.dash-sub { margin: 14px 0 8px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dash-mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dash-mini-kpis div {
    background: var(--surface-2); border-radius: 12px; padding: 10px;
}
.dash-mini-kpis span { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.dash-mini-kpis strong { font-size: 1.05rem; }
.dash-chart { height: 220px; }
.dash-chart svg { width: 100%; height: 100%; display: block; }
.dash-chart-empty {
    height: 220px; display: grid; place-items: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 12px; font-size: .9rem;
}
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li {
    display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
    padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.dash-list li:last-child { border-bottom: 0; }
.dash-list li > div { display: flex; flex-direction: column; min-width: 0; }
.dash-list em { font-style: normal; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.dash-table th, .dash-table td { font-size: .82rem; }
.dash-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dash-alerts a {
    display: block; padding: 10px 12px; border-radius: 12px; color: inherit;
    border: 1px solid var(--line); background: var(--surface-2);
}
.dash-alerts a:hover { text-decoration: none; border-color: var(--primary); }
.dash-alerts strong { display: block; }
.dash-alerts span { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.dash-alerts .is-danger a { background: var(--danger-bg); border-color: transparent; }
.dash-alerts .is-warn a { background: var(--warn-bg); border-color: transparent; }
.dash-alerts .is-info a { background: var(--primary-soft); border-color: transparent; }

@media (max-width: 1100px) {
    .dash-grid, .dash-grid-bottom { grid-template-columns: 1fr 1fr; }
    .dash-mini-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
    .dash-hero, .dash-period { align-items: stretch; }
    .dash-period, .dash-period-pills { align-items: stretch; justify-content: flex-start; }
    .dash-grid, .dash-grid-bottom { grid-template-columns: 1fr; }
}
