/* Gestão de Imóveis — estilos */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e2e7e5;
  --text: #17201d;
  --muted: #5d6b66;
  --brand: #0f6b5c;
  --brand-600: #0c5a4d;
  --brand-50: #e7f3f0;
  --side-bg: #0f1f1b;
  --side-text: #c4d3ce;
  --side-active: #1b3a33;
  --pos: #0f7a4f;
  --neg: #b42318;
  --warn-bg: #fff7e6;
  --warn-border: #f4d28a;
  --warn-text: #7a4b00;
  --ok-bg: #e8f6ee;
  --ok-border: #a7dcbc;
  --ok-text: #0d5c36;
  --err-bg: #fdecea;
  --err-border: #f3b8b1;
  --err-text: #8f1d13;
  --alta: #b45309;
  --alta-bg: #fef3e2;
  --baixa: #1d4ed8;
  --baixa-bg: #e8effd;
  --chart-rec: #0f6b5c;
  --chart-des: #c2410c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 1px 3px rgba(16, 24, 20, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1412; --surface: #141d1a; --surface-2: #18231f; --border: #26332e; --text: #e4ece9; --muted: #92a29c;
    --brand: #34b39a; --brand-600: #2a9a84; --brand-50: #16302a; --side-bg: #090f0d; --side-text: #a9bab4; --side-active: #16302a;
    --pos: #4cc38a; --neg: #f97066; --warn-bg: #2b2210; --warn-border: #5c4513; --warn-text: #f5c66b; --ok-bg: #0f2a1d;
    --ok-border: #1f5a3c; --ok-text: #7dd9a8; --err-bg: #2d1412; --err-border: #6b2620; --err-text: #ffa198;
    --alta: #f5a524; --alta-bg: #2e2211; --baixa: #7aa2ff; --baixa-bg: #151f38; --chart-rec: #34b39a; --chart-des: #f08a4b;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1412; --surface: #141d1a; --surface-2: #18231f; --border: #26332e; --text: #e4ece9; --muted: #92a29c;
  --brand: #34b39a; --brand-600: #2a9a84; --brand-50: #16302a; --side-bg: #090f0d; --side-text: #a9bab4; --side-active: #16302a;
  --pos: #4cc38a; --neg: #f97066; --warn-bg: #2b2210; --warn-border: #5c4513; --warn-text: #f5c66b; --ok-bg: #0f2a1d;
  --ok-border: #1f5a3c; --ok-text: #7dd9a8; --err-bg: #2d1412; --err-border: #6b2620; --err-text: #ffa198;
  --alta: #f5a524; --alta-bg: #2e2211; --baixa: #7aa2ff; --baixa-bg: #151f38; --chart-rec: #34b39a; --chart-des: #f08a4b;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.02rem; font-weight: 650; margin-bottom: .75rem; }
code { font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; border: 1px solid var(--border); }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.pre { white-space: pre-wrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.right { text-align: right; }
.center { justify-content: center; }
.nowrap { white-space: nowrap; }
.link { color: var(--brand); font-weight: 500; }
.link:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.02rem; padding: 4px 10px 20px; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.brand-mark .ic { width: 19px; height: 19px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a, .navlike { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; color: var(--side-text); }
.sidebar nav a:hover, .navlike:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar nav a.active { background: var(--side-active); color: #fff; }
.sidebar nav a.active .ic { color: #5fd3b8; }
.navlike { background: none; border: 0; width: 100%; cursor: pointer; font: inherit; }
.logout { margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px; position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }
.icon-btn.menu-btn { display: none; }
.backdrop { display: none; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack > .card { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }
.empty { text-align: center; padding: 40px 20px; }
.empty h2 { margin-bottom: .4rem; }
.empty-sm { padding: 6px 0; margin: 0; }
.welcome h2 { margin-bottom: .5rem; }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.steps a { color: var(--brand); font-weight: 600; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpis-inline { grid-template-columns: repeat(3, 1fr); }
.card .kpis-inline { margin: 4px 0 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; display: block; }
.card .kpi { box-shadow: none; background: var(--surface-2); }
a.kpi:hover { border-color: var(--brand); }
.kpi-alert { border-color: var(--err-border); }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* Chart */
.chart-wrap { position: relative; height: 260px; }
.chart-foot { margin-top: 10px; font-size: .84rem; }
.legend { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lg-rec { background: var(--chart-rec); }
.lg-des { background: var(--chart-des); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; }
.list li + li { border-top: 1px solid var(--border); }
.list li a:hover { background: var(--surface-2); }
.mini { margin: 10px 0 0; padding-left: 1rem; font-size: .84rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 4px 0; }
.card.table-wrap > h2, .card.table-wrap > .card-head, .card.table-wrap > p { padding: 12px 20px 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.card:not(.table-wrap) .table th:first-child, .card:not(.table-wrap) .table td:first-child { padding-left: 0; }
.card:not(.table-wrap) .table th:last-child, .card:not(.table-wrap) .table td:last-child { padding-right: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { border-top: 1px solid var(--border); border-bottom: 0; color: var(--text); font-size: .92rem; text-transform: none; letter-spacing: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table a { color: var(--brand); font-weight: 500; }
.table-compact td, .table-compact th { padding: 8px 8px; }
tr.inactive td, .inactive { opacity: .55; }
.items { margin: 10px 0 12px; }
.bar-cell { width: 35%; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--chart-des); opacity: .75; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-paga { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.badge-aberta { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.badge-atrasada { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }
.badge-cancelada, .badge-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
.chip-season, .chip-alta { background: var(--alta-bg); color: var(--alta); border-color: transparent; }
.chip-baixa { background: var(--baixa-bg); color: var(--baixa); border-color: transparent; }
.chip-misto { background: linear-gradient(90deg, var(--alta-bg), var(--baixa-bg)); color: var(--text); border-color: transparent; }

/* Property cards */
.prop { display: flex; flex-direction: column; gap: 6px; transition: border-color .15s; }
.prop:hover { border-color: var(--brand); }
.prop h3 { font-size: 1.05rem; font-weight: 650; }
.prop p { margin: 0; }
.prop-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.prop-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }

/* Description lists */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 8px 0 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--border) 60%, var(--muted)); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
:root[data-theme="dark"] .btn-primary, .btn-primary { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger-ghost { background: transparent; color: var(--neg); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--err-bg); border-color: var(--err-border); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions-row form { margin: 0; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.inline-form .field { margin: 0; }
.danger-zone { margin-top: 8px; display: flex; justify-content: flex-end; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar.wrap { flex-wrap: wrap; }
.push-right { margin-left: auto; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border-radius: 7px; font-size: .86rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
.tabs a.on { background: var(--brand-50); color: var(--brand); }
.tabs a:hover:not(.on) { color: var(--text); }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav strong { min-width: 130px; text-align: center; text-transform: capitalize; }
.search { flex: 1; max-width: 420px; }
.total-line { font-variant-numeric: tabular-nums; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-between form { margin: 0; }

/* Forms */
.form { max-width: 980px; }
.section-title { margin: 22px 0 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.form > .section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 8px; }
.grid-form-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid-form-2 .span-2 { grid-column: auto; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; min-width: 0; }
.grid-form .field { margin-bottom: 0; }
.field > span, .label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.label { display: block; margin-bottom: 6px; }
input, select, textarea { font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
.toolbar select, .inline-form select { width: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.checks { display: grid; gap: 6px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); outline: 1px solid var(--border); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }
.months { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.month { cursor: pointer; }
.month input { position: absolute; opacity: 0; pointer-events: none; }
.month span { display: inline-block; min-width: 50px; text-align: center; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: capitalize; user-select: none; }
.month-wide span { min-width: 120px; }
.month input:checked + span { background: var(--alta-bg); border-color: var(--alta); color: var(--alta); }
.month-wide input:checked + span { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.month input:focus-visible + span { outline: 2px solid var(--brand); }
.preview { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin: 4px 0 8px; }
.preview:empty { display: none; }
[data-pay-form] .total-line { font-size: 1.05rem; margin: 10px 0; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.alert-aviso { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.alert-erro { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--brand-50), transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.brand-login { color: var(--text); padding: 0 0 6px; }
.login-card .btn { margin-top: 6px; height: 42px; }

/* Receipt */
.receipt-preview { max-width: 820px; margin: 0 auto 8px; }
.receipt { position: relative; background: #fff; color: #111; border: 1px solid #d6d6d6; border-radius: 6px; padding: 28px 32px; font-size: 14px; line-height: 1.6; overflow: hidden; }
.receipt .small { font-size: 12px; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 14px; }
.rc-title { font-size: 24px; font-weight: 800; letter-spacing: .12em; }
.rc-via { font-size: 11px; letter-spacing: .04em; font-weight: 600; color: #555; border: 1px solid #bbb; border-radius: 4px; padding: 1px 6px; vertical-align: middle; text-transform: uppercase; }
.rc-emitente { font-size: 13px; color: #333; }
.rc-box { border: 2px solid #111; border-radius: 6px; padding: 6px 14px; text-align: right; min-width: 170px; }
.rc-num { font-size: 12px; color: #444; font-variant-numeric: tabular-nums; }
.rc-valor { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-body { text-align: justify; margin: 0 0 12px; }
.rc-items { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 13px; }
.rc-items td, .rc-items th { padding: 4px 0; border-bottom: 1px dotted #bbb; text-align: left; }
.rc-items .num { text-align: right; font-variant-numeric: tabular-nums; }
.rc-items tfoot th { border-bottom: 0; border-top: 1px solid #111; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 13px; }
.rc-obs { font-size: 13px; margin: 6px 0 0; }
.rc-local { margin: 18px 0 0; text-align: right; }
.rc-sign { margin: 38px auto 0; width: 320px; max-width: 100%; text-align: center; font-size: 13px; }
.rc-line { border-top: 1px solid #111; margin-bottom: 4px; }
.rc-foot { margin-top: 12px; color: #666; text-align: center; }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; font-weight: 900; color: rgba(180, 35, 24, .16); transform: rotate(-18deg); pointer-events: none; letter-spacing: .1em; }
.print-page { background: #e9ecea; color-scheme: light; }
.print-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #ddd; position: sticky; top: 0; flex-wrap: wrap; --surface: #fff; --surface-2: #f4f6f5; --border: #dde2e0; --text: #17201d; --muted: #5d6b66; --brand: #0f6b5c; --brand-50: #e7f3f0; --brand-600: #0c5a4d; }
.sheet { width: 210mm; max-width: 100%; margin: 20px auto; background: #fff; padding: 12mm; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.sheet .receipt { border-radius: 0; }
.cut { border-top: 1px dashed #999; margin: 10mm 0; position: relative; text-align: center; }
.cut span { position: relative; top: -.75em; background: #fff; padding: 0 10px; font-size: 11px; color: #888; }

@media print {
  @page { size: A4; margin: 10mm; }
  .no-print { display: none !important; }
  body, .print-page { background: #fff; }
  .sheet { width: auto; margin: 0; padding: 0; box-shadow: none; }
  .receipt { break-inside: avoid; border-color: #999; }
}

/* Responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; }
  .icon-btn.menu-btn { display: inline-grid; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar h1 { font-size: 1.12rem; }
  .content { padding: 16px 16px 40px; }
}
@media (max-width: 640px) {
  .kpis, .kpis-inline { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.15rem; }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: 1 / -1; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dt { margin-top: 8px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-actions .btn span { display: inline; }
  .push-right { margin-left: 0; }
  .search { max-width: none; }
  .receipt { padding: 18px; }
  .rc-head { flex-direction: column; }
  .rc-box { text-align: left; }
  .sheet { padding: 8px; margin: 8px auto; }
  .table th, .table td { padding: 9px 8px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
}
@media (max-width: 420px) {
  .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1 / -1; }
}
