/* Kestrel POS — one stylesheet, light + dark, touch friendly. */
:root {
  color-scheme: light;
  --bg: #f4f3f0; --surface: #fcfcfb; --surface-2: #f0efeb; --surface-3: #e7e5df;
  --border: #e0ded7; --border-strong: #c9c6bd;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #7a7973;
  --accent: #2a78d6; --accent-ink: #ffffff; --accent-soft: #e3eefb;
  --ink-btn: #1b1b1a; --ink-btn-text: #fcfcfb;
  --good: #0f7b3e; --good-soft: #e2f3e8; --warn: #9a6200; --warn-soft: #fbf0d9; --bad: #c0332f; --bad-soft: #fbe5e4;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300;
  --grid: #e7e5df; --shadow: 0 1px 2px rgba(20, 20, 18, .06), 0 4px 16px rgba(20, 20, 18, .05);
  --radius: 10px; --radius-lg: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
    --border: #2f2f2c; --border-strong: #45443f;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
    --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1b2c42;
    --ink-btn: #f0efec; --ink-btn-text: #111110;
    --good: #4cc27c; --good-soft: #15301f; --warn: #e3a93a; --warn-soft: #33270e; --bad: #f07470; --bad-soft: #3a1a19;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300;
    --grid: #2a2a28; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
  --border: #2f2f2c; --border-strong: #45443f;
  --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
  --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1b2c42;
  --ink-btn: #f0efec; --ink-btn-text: #111110;
  --good: #4cc27c; --good-soft: #15301f; --warn: #e3a93a; --warn-soft: #33270e; --bad: #f07470; --bad-soft: #3a1a19;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300;
  --grid: #2a2a28; --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; color: var(--text-2); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink-btn); color: var(--ink-btn-text); display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-3); letter-spacing: 0; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .sep { height: 1px; background: var(--border); margin: 8px 6px; }
.side-foot { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.who { min-width: 0; flex: 1; line-height: 1.25; }
.who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; }
.main { min-width: 0; padding: 22px 28px 48px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--text-3); }
.mobile-bar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .main { padding: 16px 16px 40px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap; user-select: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
.btn.primary:hover { opacity: .9; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 52px; font-size: 16px; padding: 0 22px; border-radius: 10px; }
.btn svg, .cust-btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 36px; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.input, select.input, textarea.input { height: 38px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 34px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 550; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- cards & tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 18px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge svg { width: 12px; height: 12px; }

/* ---------- command center ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--text-2); font-weight: 550; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.cc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-8, .span-4, .span-6, .span-5, .span-7 { grid-column: span 12; } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.alert-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.alert svg { width: 16px; height: 16px; flex: none; }
.alert.warn svg { color: var(--warn); } .alert.bad svg { color: var(--bad); } .alert.good svg { color: var(--good); }
.meter { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-line:last-child { border-bottom: 0; }
.stat-line b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .lbl { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .catlbl { fill: var(--text-2); font-size: 12px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar { transition: opacity .12s; }
.chart.hovering .bar:not(.on) { opacity: .45; }
.chart .xhair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; width: 14px; border-radius: 2px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 120px; }
.tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.tip .tr { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.tip .tr span { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); }
.tip .tr i { width: 8px; height: 8px; border-radius: 2px; }
.tip .tr em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 9, .45); display: grid; place-items: center; z-index: 80; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { background: var(--ink-btn); color: var(--ink-btn-text); padding: 10px 16px; border-radius: 10px; font-weight: 550; box-shadow: var(--shadow); animation: rise .18s; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0 0 18px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { height: 62px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 22px; font-weight: 600; cursor: pointer; }
.pinpad button:active { background: var(--surface-3); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 8px 0 4px; height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.demo-hint { margin-top: 16px; font-size: 12.5px; color: var(--text-3); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; height: 100vh; overflow: hidden; background: var(--bg); }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-top { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pos-top .search { flex: 1; }
.pos-top .input { height: 46px; font-size: 16px; }
.pos-cats { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; cursor: pointer; }
.chip.on { background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
.pos-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.tile { position: relative; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px; min-height: 104px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.tile:hover { border-color: var(--border-strong); }
.tile:active { transform: scale(.98); background: var(--surface-2); }
.tile .t-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .t-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 6px; }
.tile .t-price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tile .t-stock { font-size: 11.5px; color: var(--text-3); }
.tile .t-stock.low { color: var(--warn); font-weight: 600; }
.tile .t-swatch { width: 26px; height: 4px; border-radius: 2px; }
.tile.out { opacity: .55; }
.pos-right { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cust-btn { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: transparent; cursor: pointer; text-align: left; min-width: 0; }
.cust-btn.set { border-style: solid; background: var(--accent-soft); border-color: transparent; }
.cust-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart { flex: 1; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.cart-line .cl-name { font-weight: 600; font-size: 13.5px; }
.cart-line .cl-sub { font-size: 12px; color: var(--text-3); }
.cart-line .cl-total { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.qty { justify-self: start; display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.qty button { width: 40px; height: 36px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; font-weight: 600; }
.qty span { min-width: 38px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-empty { display: grid; place-items: center; height: 100%; color: var(--text-3); text-align: center; padding: 30px; }
.cart-empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }
.totals { padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.totals .tl { display: flex; justify-content: space-between; padding: 2px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.totals .tl.grand { color: var(--text); font-size: 24px; font-weight: 700; padding-top: 6px; letter-spacing: -.01em; }
.pay-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 12px 14px 14px; }
.pay-btn { height: 64px; font-size: 19px; font-weight: 700; border-radius: 12px; border: 0; cursor: pointer; background: var(--good); color: #fff; }
:root[data-theme="dark"] .pay-btn { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .pay-btn { color: #0b0b0b; } }
.pay-btn:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm { height: 58px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pm.on { border-color: var(--accent); background: var(--accent-soft); }
.pm svg { width: 18px; height: 18px; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keypad button { height: 54px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 18px; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; }
.keypad button.quick { font-size: 14px; background: var(--surface); }
.tender { font-size: 34px; font-weight: 700; text-align: right; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.change { display: flex; justify-content: space-between; font-size: 18px; font-weight: 650; padding: 12px 14px; border-radius: 12px; background: var(--good-soft); color: var(--good); margin-top: 10px; }
.change.short { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr 340px; } .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
@media (max-width: 700px) { .pos { grid-template-columns: 1fr; height: auto; overflow: visible; } .pos-right { min-height: 70vh; } }

/* ---------- documents (invoice view) ---------- */
.doc { background: #fff; color: #111; border-radius: 12px; border: 1px solid var(--border); padding: 36px 40px; max-width: 860px; }
.doc .doc-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.doc h1 { font-size: 26px; }
.doc .from { white-space: pre-line; color: #555; font-size: 13px; }
.doc table th { color: #666; border-color: #ddd; }
.doc table td { border-color: #eee; }
.doc .doc-totals { margin-left: auto; width: 280px; margin-top: 12px; }
.doc .doc-totals div { display: flex; justify-content: space-between; padding: 5px 0; font-variant-numeric: tabular-nums; }
.doc .doc-totals .g { font-weight: 700; font-size: 17px; border-top: 2px solid #111; margin-top: 4px; padding-top: 8px; }
.stamp { display: inline-block; border: 2px solid; border-radius: 6px; padding: 2px 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.stamp.paid { color: #0f7b3e; } .stamp.unpaid, .stamp.partial { color: #b45309; } .stamp.void { color: #c0332f; }

/* receipt (80mm thermal) */
.receipt { width: 300px; font: 12.5px/1.35 var(--mono); color: #000; background: #fff; padding: 14px; margin: 0 auto; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .big { font-size: 16px; font-weight: 700; }
#print-area { display: none; }

@media print {
  body { background: #fff; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
  .shell { display: block; } .side, .mobile-bar, .no-print, .page-head .btn { display: none !important; }
  .main { padding: 0; } .doc { border: 0; padding: 0; max-width: none; }
  @page { margin: 12mm; }
}
