/* ISS Studio · Salon — warm paper, espresso ink, terracotta accent */
:root {
  color-scheme: light;
  --paper: #f5f0e8;
  --paper-2: #efe8dc;
  --card: #fffdf9;
  --ink: #1e1a16;
  --ink-2: #5e554c;
  --ink-3: #8f857a;
  --line: #e4dacb;
  --line-2: #d6cab8;
  --accent: #9a3b22;
  --accent-ink: #fff7f1;
  --accent-soft: #f3e2d6;
  --gold: #a88450;
  --good: #2f7d4f;
  --good-soft: #e0efe4;
  --bad: #b3261e;
  --bad-soft: #f7e0dc;
  --warn: #a8660f;
  --warn-soft: #f6ead3;
  --bar: #9a3b22;
  --shadow: 0 1px 0 rgba(30, 26, 22, .04), 0 8px 24px -12px rgba(30, 26, 22, .18);
  --shadow-lg: 0 24px 60px -20px rgba(30, 26, 22, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 68px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { background: radial-gradient(120% 140% at 100% 0%, #6b3322 0%, transparent 60%), linear-gradient(160deg, #3a2e25 0%, #261e18 100%); border: 1px solid #3d342c; }
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14110e; --paper-2: #1a1612; --card: #1f1a16; --ink: #f3ece2; --ink-2: #c3b8aa; --ink-3: #8d8276;
    --line: #2f2822; --line-2: #3d342c; --accent: #e0896b; --accent-ink: #1e120d; --accent-soft: #3a241b; --gold: #d4b27a;
    --good: #6cc38f; --good-soft: #1d3326; --bad: #f08a80; --bad-soft: #3d1f1c; --warn: #e3ad5c; --warn-soft: #3a2d17; --bar: #e0896b;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] .hero { background: radial-gradient(120% 140% at 100% 0%, #6b3322 0%, transparent 60%), linear-gradient(160deg, #3a2e25 0%, #261e18 100%); border: 1px solid #3d342c; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14110e; --paper-2: #1a1612; --card: #1f1a16; --ink: #f3ece2; --ink-2: #c3b8aa; --ink-3: #8d8276;
  --line: #2f2822; --line-2: #3d342c; --accent: #e0896b; --accent-ink: #1e120d; --accent-soft: #3a241b; --gold: #d4b27a;
  --good: #6cc38f; --good-soft: #1d3326; --bad: #f08a80; --bad-soft: #3d1f1c; --warn: #e3ad5c; --warn-soft: #3a2d17; --bar: #e0896b;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 500 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0; font-variation-settings: 'SOFT' 50, 'opsz' 72; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 17px; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.serif { font-family: var(--serif); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot / login ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { font: italic 400 56px var(--serif); color: var(--ink-3); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.login { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(28px + var(--safe-t)) 20px calc(24px + var(--safe-b)); max-width: 520px; margin: 0 auto; }
.login-brand { text-align: center; margin: 12px 0 28px; }
.login-brand .mark { font: italic 400 64px/1 var(--serif); letter-spacing: -.03em; }
.login-brand .mark::after { content: ''; display: block; width: 44px; height: 3px; background: var(--accent); margin: 10px auto 0; border-radius: 2px; }
.login-brand p { margin: 12px 0 0; color: var(--ink-2); }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.who button {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px 8px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--shadow); transition: transform .15s;
}
.who button:active { transform: scale(.97); }
.who .role { font-size: 11px; color: var(--ink-3); margin-top: -6px; }
.avatar {
  --c: var(--accent); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font: 500 22px var(--serif); color: #fff; background: var(--c); flex: none;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}
.avatar.sm { width: 34px; height: 34px; font-size: 15px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; box-shadow: none; }
.pin-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 4px; }
.pin-dots { display: flex; gap: 14px; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: all .15s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.1); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.keypad button {
  height: 76px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font: 400 28px var(--serif);
  box-shadow: var(--shadow); transition: background .1s, transform .1s;
}
.keypad button:active { background: var(--accent-soft); transform: scale(.95); }
.keypad button.ghost { border: 0; background: transparent; box-shadow: none; font: 600 14px var(--sans); color: var(--ink-2); }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .brand { font: italic 400 24px/1 var(--serif); letter-spacing: -.02em; }
.topbar .brand small { font: 600 11px var(--sans); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-left: 8px; vertical-align: 3px; }
.topbar .spacer { flex: 1; }
.page { padding: 8px 16px 0; max-width: 1180px; margin: 0 auto; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; font-size: 13.5px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 8px var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--card) 88%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.tabbar a {
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
  color: var(--ink-3); padding: 8px 0; transition: color .15s;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { color: var(--accent); }
.fab {
  justify-self: center; width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; box-shadow: var(--shadow-lg); transform: translateY(-14px); transition: transform .15s;
}
.fab:active { transform: translateY(-14px) scale(.94); }
.fab svg { width: 26px; height: 26px; }

.sidenav { display: none; }

@media (min-width: 960px) {
  .shell { padding-bottom: 40px; padding-left: 248px; }
  .tabbar { display: none; }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 248px; padding: 26px 16px;
    border-right: 1px solid var(--line); background: var(--paper-2); gap: 2px; z-index: 25;
  }
  .sidenav .brand { font: italic 400 34px/1 var(--serif); padding: 0 12px 4px; }
  .sidenav .brand-sub { font-size: 12px; color: var(--ink-3); padding: 0 12px 24px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
  .sidenav a { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; }
  .sidenav a svg { width: 20px; height: 20px; color: var(--ink-3); }
  .sidenav a:hover { background: var(--card); }
  .sidenav a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
  .sidenav a.on svg { color: var(--accent); }
  .sidenav .add { margin: 18px 0 10px; }
  .sidenav .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
  .topbar .brand { display: none; }
  .page { padding: 8px 32px 0; }
  h1 { font-size: 36px; }
}

/* ---------- cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid > .card + .card, .grid > * + * { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .md-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .lg-g3 { grid-template-columns: 1.4fr 1fr; } }
.section { margin-top: 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }

/* hero number card */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; color: #f5ece0;
  background: radial-gradient(120% 140% at 100% 0%, #5a2a1c 0%, transparent 55%), linear-gradient(160deg, #2a221c 0%, #1b1612 100%);
  box-shadow: var(--shadow-lg);
}
.hero .tiny { color: rgba(245,236,224,.6); }
.hero .big { font: 400 52px/1 var(--serif); letter-spacing: -.03em; margin: 8px 0 6px; font-variation-settings: 'opsz' 144; }
.hero .big small { font-size: 22px; margin-left: 4px; color: rgba(245,236,224,.6); }
.hero .row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(245,236,224,.14); }
.hero .row div { font-size: 13px; color: rgba(245,236,224,.65); }
.hero .row b { display: block; font: 500 19px var(--serif); color: #f5ece0; margin-top: 2px; }
.hero::after { content: 'iss'; position: absolute; right: -8px; bottom: -34px; font: italic 400 150px/1 var(--serif); color: rgba(245,236,224,.045); pointer-events: none; }

.kpi { padding: 16px; }
.kpi .v { font: 500 26px/1.1 var(--serif); letter-spacing: -.02em; margin-top: 6px; }
.kpi .d { font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 99px; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--paper-2); color: var(--ink-3); }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; }
.item:first-child { border-top: 0; }
button.item:active, a.item:active { background: var(--paper-2); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item .amt { text-align: right; }
.item .amt b { font: 500 17px var(--serif); display: block; }
.item .amt span { font-size: 12px; color: var(--ink-3); }
.day-sep { display: flex; justify-content: space-between; padding: 16px 4px 8px; font-size: 12.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pay-ic { display: inline-flex; align-items: center; gap: 3px; }
.pay-ic svg { width: 13px; height: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); display: inline-block; flex: none; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.empty .serif { font-size: 20px; color: var(--ink-2); font-style: italic; display: block; margin-bottom: 4px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 14.5px; text-decoration: none; transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; min-height: 52px; font-size: 15.5px; border-radius: 16px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }

.monthbar { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.monthbar button { width: 36px; height: 36px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; }
.monthbar button:active { background: var(--paper-2); }
.monthbar button svg { width: 18px; height: 18px; }
.monthbar span { min-width: 132px; text-align: center; font: 500 16px var(--serif); text-transform: capitalize; }

.seg { display: flex; background: var(--paper-2); border-radius: 14px; padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 99px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin: 0 2px 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; border: 1px solid var(--line-2); background: var(--card); border-radius: 14px; padding: 12px 14px;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
textarea.input { min-height: 76px; resize: vertical; }
.money-input { position: relative; }
.money-input .input { font: 400 30px var(--serif); padding: 10px 50px 10px 16px; min-height: 64px; letter-spacing: -.01em; }
.money-input::after { content: attr(data-cur); position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font: 400 18px var(--serif); pointer-events: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.row-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 16px; }
.svc-grid button {
  min-height: 54px; border: 1px solid var(--line-2); background: var(--card); border-radius: 14px; font-weight: 700; font-size: 13.5px; padding: 8px;
  line-height: 1.2; transition: all .12s;
}
.svc-grid button small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.svc-grid button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.svc-grid button.on small { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.preview-earn { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin: 4px 0 16px; font-weight: 700; }
.preview-earn b { font: 500 22px var(--serif); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line-2); background: var(--c); }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- sheet (bottom modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, .45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper); border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + var(--safe-b)); box-shadow: var(--shadow-lg);
  animation: up .28s cubic-bezier(.2,.9,.3,1); overscroll-behavior: contain;
}
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 560px; border-radius: 24px; max-height: 88dvh; animation: pop .22s ease-out; padding-bottom: 22px; }
  .sheet .grip { display: none; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
}
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-align: left; box-shadow: var(--shadow); }
.choice-grid button svg { width: 26px; height: 26px; color: var(--accent); }
.choice-grid button b { font: 500 17px var(--serif); }
.choice-grid button span { font-size: 12.5px; color: var(--ink-3); margin-top: -6px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px); z-index: 80; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); transition: all .25s; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); color: #fff; }
@media (min-width: 960px) { #toast { bottom: 28px; } }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { text-align: right; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; padding-left: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t tfoot td { font-weight: 800; border-top: 1.5px solid var(--line-2); }

/* master cards (mobile) */
.mcard { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.mcard:first-child { border-top: 0; }
.mcard .stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mcard .stats div { background: var(--paper-2); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; color: var(--ink-3); }
.mcard .stats b { display: block; font: 500 15px var(--serif); color: var(--ink); margin-top: 2px; }
.only-mobile { display: block; } .only-desk { display: none; }
@media (min-width: 820px) { .only-mobile { display: none; } .only-desk { display: block; } }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font: 600 10.5px var(--sans); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--bar); transition: opacity .15s; }
.chart .bar.dim { opacity: .35; }
.chart .bar.weekend { fill: color-mix(in srgb, var(--bar) 55%, var(--paper)); }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.4; white-space: nowrap; transform: translate(-50%, -100%); box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip b { font-weight: 800; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.hbar .lbl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; border-radius: 0 5px 5px 0; background: var(--paper-2); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--c, var(--bar)); transition: width .5s cubic-bezier(.2,.9,.3,1); }
.hbar .v { font-weight: 700; text-align: right; min-width: 72px; }
.hbar .v small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.split-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--card); margin: 10px 0 8px; }
.split-bar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* closing */
.cash-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14.5px; }
.cash-grid .tot { font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.diff-box { border-radius: 16px; padding: 14px 16px; margin-top: 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.diff-box b { font: 500 22px var(--serif); }
.diff-box.ok { background: var(--good-soft); color: var(--good); }
.diff-box.minus { background: var(--bad-soft); color: var(--bad); }
.diff-box.plus { background: var(--warn-soft); color: var(--warn); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.info { background: var(--accent-soft); color: var(--accent); }

/* logs */
.log-item { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.log-item:first-child { border-top: 0; }
.log-item .top { display: flex; justify-content: space-between; gap: 10px; }
.log-diff { margin-top: 8px; font-size: 12.5px; background: var(--paper-2); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.log-diff .k { color: var(--ink-3); }
.log-diff del { color: var(--bad); text-decoration: line-through; margin-right: 6px; }
.log-diff ins { color: var(--good); text-decoration: none; }

.menu-list .item svg { width: 22px; height: 22px; color: var(--accent); }
.chev { width: 18px; height: 18px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .tabbar, .sidenav, .topbar, .fab, .no-print, #toast { display: none !important; }
  .shell { padding: 0 !important; }
  body { background: #fff; }
  .card, .list { box-shadow: none; break-inside: avoid; }
}

/* inline icons inside text containers */
h2 svg, h3 svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.chip svg { width: 13px; height: 13px; }
.diff-box svg { width: 18px; height: 18px; vertical-align: -3px; }
.avatar svg { width: 18px; height: 18px; }
.empty.small { padding: 16px; }
