/* ISP Office — styles */
:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #f9f9f7;
  --ink: #161615;
  --ink-2: #52514e;
  --muted: #7d7b75;
  --line: #e6e5df;
  --line-2: #d2d1ca;
  --accent: #1c5cab;
  --accent-hover: #184f95;
  --accent-ink: #ffffff;
  --accent-text: #1c5cab;
  --accent-soft: #e9f1fc;
  --good: #0ca30c;
  --good-ink: #0b6a0b;
  --good-soft: #e6f5e4;
  --warn: #fab219;
  --warn-ink: #7a5000;
  --warn-soft: #fff3d6;
  --serious: #ec835a;
  --serious-ink: #9a3f17;
  --serious-soft: #fdece4;
  --bad: #d03b3b;
  --bad-ink: #a62828;
  --bad-soft: #fbe8e8;
  --info: #2a78d6;
  --info-ink: #1c5cab;
  --info-soft: #e7f0fc;
  --violet-ink: #4a3aa7;
  --violet-soft: #eeebfb;
  --neutral-soft: #efeeea;
  --bar: #2a78d6;
  --track: #dbe8f8;
  --overlay: rgba(20, 20, 18, 0.45);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 16, 14, 0.06), 0 1px 1px rgba(16, 16, 14, 0.03);
  --shadow-lg: 0 10px 30px rgba(16, 16, 14, 0.18);
  --nav-h: 64px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1b1b1a;
    --surface-2: #222221;
    --ink: #f4f4f1;
    --ink-2: #c3c2b7;
    --muted: #8f8d86;
    --line: #2d2d2b;
    --line-2: #3b3b38;
    --accent: #256abf;
    --accent-hover: #2a78d6;
    --accent-text: #86b6ef;
    --accent-soft: #172a42;
    --good-ink: #5fd35f;
    --good-soft: #15301a;
    --warn-ink: #f2c35a;
    --warn-soft: #382c10;
    --serious-ink: #f2a382;
    --serious-soft: #3a2117;
    --bad-ink: #f28a8a;
    --bad-soft: #3c1818;
    --info-ink: #86b6ef;
    --info-soft: #162a42;
    --violet-ink: #b4abf2;
    --violet-soft: #252040;
    --neutral-soft: #2a2a28;
    --bar: #3987e5;
    --track: #1f3554;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); min-height: 100vh; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.45rem; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.6em; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.bold { font-weight: 650; }
.good-text { color: var(--good-ink); }
.bad-text { color: var(--bad-ink); }
.warn-text { color: var(--warn-ink); }
@media (max-width: 899px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 900px) {
  .only-mobile { display: none !important; }
}

/* ---------- layout ---------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.demo-pill { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn-ink); }
.userbtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 5px 10px 5px 6px; border-radius: 99px; cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.userbtn .uname { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 0.9rem; }

.body { display: flex; }
.sidenav { display: none; }
.main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 24px); }
.content { max-width: 1120px; margin: 0 auto; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 0.72rem; font-weight: 600; background: none; border: 0; text-decoration: none; cursor: pointer; position: relative;
}
.bottomnav .active { color: var(--accent-text); }
.navbadge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; }
@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; width: 232px; flex: none;
    position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
    padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidenav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: var(--ink-2); font-weight: 560; text-decoration: none; position: relative;
  }
  .sidenav a:hover { background: var(--surface-2); }
  .sidenav a.active { background: var(--accent-soft); color: var(--accent-text); }
  .sidenav .navbadge { position: static; margin-left: auto; }
  .sidenav .navsep { height: 1px; background: var(--line); margin: 8px 6px; }
  .main { padding: 24px 28px 48px; }
}

/* ---------- page ---------- */
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 0.88rem; margin-bottom: 8px; cursor: pointer; background: none; border: 0; padding: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
}
.span2 { grid-column: 1 / -1; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 8px 0 4px; }
.card.pad { padding: 16px; }
.card.link { cursor: pointer; transition: border-color 0.15s; }
.card.link:hover { border-color: var(--line-2); }
.callout { border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.callout.info { background: var(--info-soft); }
.callout.warn { background: var(--warn-soft); }
.callout.bad { background: var(--bad-soft); }
.callout.good { background: var(--good-soft); }
.callout .ic { flex: none; margin-top: 1px; }
.callout.info .ic { color: var(--info-ink); }
.callout.warn .ic { color: var(--warn-ink); }
.callout.bad .ic { color: var(--bad-ink); }
.callout.good .ic { color: var(--good-ink); }

/* hero money card */
.hero { padding: 18px 18px 16px; }
.hero .label { color: var(--ink-2); font-weight: 600; font-size: 0.9rem; }
.hero .value { font-size: 2.6rem; font-weight: 680; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; }
.hero .value .cur { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-right: 6px; letter-spacing: 0; }

/* stat tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .label { color: var(--ink-2); font-size: 0.84rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 1.4rem; font-weight: 680; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value .cur { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-right: 4px; }
.tile .foot { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.tile.hero-tile { grid-column: 1 / -1; }
.tile.hero-tile .value { font-size: 2.2rem; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* meter */
.meter { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--bar); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.hbar { height: 10px; border-radius: 0 4px 4px 0; background: var(--bar); min-width: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 620; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad-ink); border-color: var(--line-2); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-text); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 0.88rem; border-radius: 8px; }
.btn.big { min-height: 52px; font-size: 1.02rem; padding: 0 20px; }
.btn.block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .flabel { font-weight: 600; font-size: 0.88rem; color: var(--ink-2); }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field .err { font-size: 0.82rem; color: var(--bad-ink); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); font-size: 16px; outline: none;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.big { font-size: 1.5rem; font-weight: 650; min-height: 56px; }
.money-wrap { position: relative; }
.money-wrap .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.money-wrap .input { padding-left: 50px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.92rem; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.seg { display: inline-flex; background: var(--neutral-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-size: 0.9rem; min-height: 36px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 620; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--neutral-soft); color: var(--ink-2); font-size: 0.74rem; font-weight: 700; }
.count.hot { background: var(--bad); color: #fff; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; font-size: 0.8rem; font-weight: 640; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); }
.chip svg { flex: none; }
.chip.good { background: var(--good-soft); color: var(--good-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.serious { background: var(--serious-soft); color: var(--serious-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.chip.info { background: var(--info-soft); color: var(--info-ink); }
.chip.violet { background: var(--violet-soft); color: var(--violet-ink); }
.chip.plain { background: transparent; border: 1px solid var(--line-2); }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.t th { text-align: left; font-weight: 620; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); border-bottom: 0; }
table.t tr.sub td { background: var(--surface-2); font-weight: 650; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--surface-2); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { color: var(--muted); font-size: 0.84rem; margin-top: 1px; }
.item .amt { font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.unit-tag { flex: none; min-width: 44px; height: 36px; padding: 0 8px; border-radius: 8px; background: var(--neutral-soft); display: grid; place-items: center; font-weight: 700; font-size: 0.86rem; }
.group-title { padding: 10px 16px 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; justify-content: space-between; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sumline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.sumline > :last-child { white-space: nowrap; text-align: right; }
.sumline.total { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.05rem; }

/* months strip */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.mcell { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; background: var(--surface); }
.mcell .m { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.mcell .s { margin-top: 4px; font-size: 0.78rem; font-weight: 650; }
.mcell.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mcell.paid { background: var(--good-soft); border-color: transparent; }
.mcell.paid .s { color: var(--good-ink); }
.mcell.partial { background: var(--warn-soft); border-color: transparent; }
.mcell.partial .s { color: var(--warn-ink); }
.mcell.unpaid .s { color: var(--bad-ink); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.modal { background: var(--surface); width: 100%; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: up 0.18s ease-out; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .modal { max-width: 560px; border-radius: 16px; max-height: 88vh; }
  .modal.wide { max-width: 900px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; background: #20201f; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-weight: 550; animation: up 0.2s ease-out; }
.toast.bad { background: #8f1f1f; }
.toast.good { background: #135f13; }
.toast-action { background: transparent; border: 1px solid rgba(255, 255, 255, 0.6); color: #fff; border-radius: 8px; padding: 2px 10px; font-weight: 700; cursor: pointer; margin-left: 6px; }
.quickpay { flex: none; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.empty .big { font-size: 1rem; color: var(--ink-2); font-weight: 620; margin-bottom: 4px; }
.loading { display: flex; justify-content: center; padding: 40px; color: var(--muted); }
.loading .spin { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.dim { opacity: 0.55; transition: opacity 0.2s; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.kv dd { margin: 0; font-weight: 560; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 0.95rem; letter-spacing: 0.04em; }
.recovery { font-family: ui-monospace, Consolas, monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.06em; text-align: center; padding: 16px; border: 2px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); word-break: break-all; }
.qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 10px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.photo-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); }
.photo-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }
.alert-list .item { min-height: 50px; }
.alert-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-ic.bad { background: var(--bad-soft); color: var(--bad-ink); }
.alert-ic.warn { background: var(--warn-soft); color: var(--warn-ink); }
.alert-ic.info { background: var(--info-soft); color: var(--info-ink); }
.alert-ic.good { background: var(--good-soft); color: var(--good-ink); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; }
@media (min-height: 700px) { .login-wrap { align-items: center; } }
.login { width: 100%; max-width: 520px; }
.login .brand { justify-content: center; margin-bottom: 18px; font-size: 1.15rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; box-shadow: var(--shadow); min-height: 72px; }
.person:hover { border-color: var(--accent); }
.person .n { font-weight: 680; font-size: 1.02rem; }
.person .r { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.keypad button { height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 1.4rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.keypad button:active { background: var(--accent-soft); }
.keypad button.fn { font-size: 0.95rem; color: var(--ink-2); }

/* ---------- receipt / print ---------- */
.receipt { background: #fff; color: #111; max-width: 720px; margin: 0 auto; padding: 28px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.receipt h1 { font-size: 20px; }
.receipt table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.receipt th, .receipt td { border-bottom: 1px solid #e3e3e3; padding: 6px 4px; text-align: left; }
.receipt td.num, .receipt th.num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt .sign { display: flex; gap: 40px; margin-top: 40px; }
.receipt .sign div { flex: 1; border-top: 1px solid #333; padding-top: 4px; font-size: 12px; color: #444; }
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .topbar, .sidenav, .bottomnav, .toasts, .no-print, .page-head .actions, .tabs { display: none !important; }
  .main { padding: 0 !important; }
  .card { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
  .receipt { border: 0; padding: 0; }
  .print-only { display: block; }
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f6f6f6; --ink: #000; --ink-2: #333; --muted: #555; --line: #ddd; --line-2: #bbb; }
}
