/* Tuckshop Wallet. One stylesheet, no build step.
   Brand colour comes from Settings as --brand; everything else derives from it. */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --brand: #1d5b4a;
  --on-brand: #ffffff;
  --ink: #17212b;
  --slate: #56616d;
  --line: #dfe4e0;
  --chalk: #f1f4f1;
  --paper: #ffffff;
  --sherbet: #ffcf4a;
  --in: #17764a;
  --out: #17212b;
  --danger: #b8322a;
  --danger-tint: #fbeceb;
  --warn-tint: #fff5d6;
  --brand-deep: var(--brand);
  --brand-tint: #e8f0ed;
  --r-s: 8px;
  --r-m: 14px;
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(23, 33, 43, .06), 0 8px 24px -12px rgba(23, 33, 43, .18);
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --brand-deep: color-mix(in srgb, var(--brand) 82%, #000);
    --brand-tint: color-mix(in srgb, var(--brand) 9%, #fff);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--chalk); }
h1, h2, h3 { font-family: var(--display); font-weight: 650; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-deep); text-underline-offset: 3px; }
img { max-width: 100%; }
small { font-size: .82rem; color: var(--slate); }
.vh, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--paper); padding: 8px 12px; border-radius: var(--r-s); }
:focus-visible { outline: 3px solid var(--sherbet); outline-offset: 2px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.grow { flex: 1; }
.muted { color: var(--slate); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--slate); padding: 18px 0; }
.ico { flex: none; vertical-align: -4px; }
[hidden] { display: none !important; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; letter-spacing: -.01em; }
.brand-logo { height: 34px; width: auto; }
.brand-mark { position: relative; width: 30px; height: 30px; flex: none; display: inline-block; }
.brand-mark i { position: absolute; width: 12px; height: 12px; border: 3px solid currentColor; border-radius: 3px; }
.brand-mark i:nth-child(1) { top: 0; left: 0; }
.brand-mark i:nth-child(2) { top: 0; right: 0; }
.brand-mark i:nth-child(3) { bottom: 0; left: 0; }
.brand-mark b { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--sherbet); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; line-height: 1.2; padding: 11px 18px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--slate); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand-deep); }
.btn-quiet:hover { background: var(--brand-tint); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #e7c2bf; }
.btn-danger:hover { background: var(--danger-tint); border-color: var(--danger); }
.btn-small { padding: 6px 12px; min-height: 34px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: none; border: 0; padding: 10px; color: inherit; cursor: pointer; border-radius: var(--r-s); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Forms ---------- */
.field { margin: 0 0 16px; }
.field label, .label { display: block; font-weight: 600; margin: 0 0 6px; }
.field .hint { display: block; font-weight: 400; color: var(--slate); font-size: .88rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; color: inherit; padding: 10px 12px; min-height: 44px; border: 1.5px solid #c6cec9; border-radius: var(--r-s); background: var(--paper);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); outline-offset: 0; }
input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1.5px solid #c6cec9; border-radius: var(--r-s); background: var(--paper); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.cols { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 160px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 10px 16px; border: 1.5px solid #c6cec9; border-radius: var(--r-s); background: var(--paper); font-weight: 600; cursor: pointer; min-width: 84px; text-align: center; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-deep); }
.seg input:focus-visible + span { outline: 3px solid var(--sherbet); outline-offset: 2px; }

/* ---------- Flash + badges ---------- */
.flash { padding: 12px 16px; border-radius: var(--r-s); margin: 0 0 18px; border: 1.5px solid; font-weight: 500; }
.flash-ok { background: #e7f4ec; border-color: #a9d5bb; color: #0f5132; }
.flash-error { background: var(--danger-tint); border-color: #e7c2bf; color: #7d1f19; }
.flash-info { background: var(--warn-tint); border-color: #ecd58f; color: #5b4300; }
.badge { display: inline-block; font-size: .78rem; font-weight: 650; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge-ok { background: #e1f1e8; color: #0f5132; }
.badge-wait { background: var(--warn-tint); color: #6b4f00; }
.badge-off { background: #eceff1; color: #47525d; }
.tag-demo { display: inline-block; background: var(--sherbet); color: #3b2c00; font-weight: 700; font-size: .78rem; padding: 2px 8px; border-radius: 4px; }

/* ---------- Surfaces ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; margin: 0 0 20px; }
.panel > h2:first-child { margin-bottom: 14px; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin: 0 0 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--slate); }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; margin-bottom: 10px; }

/* Figures: no card kit, just type on the page ground */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 0 0 24px; border-top: 2px solid var(--ink); }
.figure { padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); }
.figure dt { color: var(--slate); font-size: .9rem; }
.figure dd { margin: 2px 0 0; font-family: var(--display); font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure dd small { display: block; font-family: var(--body); font-weight: 400; letter-spacing: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--slate); font-size: .85rem; padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.table .who a { font-weight: 600; text-decoration: none; }
.table .who a:hover { text-decoration: underline; }
.table tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; }
.amt-in { color: var(--in); }
.amt-out { color: var(--out); }
.struck { text-decoration: line-through; color: var(--slate); }
details.undo > summary { list-style: none; cursor: pointer; white-space: nowrap; }
details.undo > summary::-webkit-details-marker { display: none; }
details.undo[open] { width: 160px; }
details.undo input { min-height: 36px; padding: 6px 8px; font-size: .9rem; }
details.undo form { display: grid; gap: 6px; margin-top: 8px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--slate); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.filters .field { margin: 0; flex: 0 1 170px; }
.filters .field.wide { flex: 1 1 220px; }

/* ---------- Avatars ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; object-fit: cover; background: var(--brand-tint); color: var(--brand-deep); font-family: var(--display); font-weight: 700; flex: none; border-radius: 10px; }
.avatar-sm { width: 38px; height: 38px; font-size: .85rem; border-radius: 8px; }
.avatar-md { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-lg { width: 112px; height: 112px; font-size: 2rem; border-radius: 14px; }
.avatar-xl { width: 100%; max-width: 260px; aspect-ratio: 1; height: auto; font-size: 4rem; border-radius: 18px; }
.avatar-none { border: 2px dashed #b9c6c0; }

/* ---------- Console shell (school admin + platform) ---------- */
.console { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--brand); color: var(--on-brand); padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-super { background: var(--ink); color: #fff; }
.side .brand { margin: 0 6px 18px; }
.side nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.side nav a, .side-foot a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: var(--r-s); color: inherit; text-decoration: none; font-weight: 500; opacity: .86; }
.side nav a:hover, .side-foot a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.side nav a[aria-current=page], .side-foot a[aria-current=page] { background: rgba(255, 255, 255, .18); opacity: 1; font-weight: 700; }
.side .count { background: var(--sherbet); color: #3b2c00; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.side-label { font-size: .8rem; opacity: .65; margin: 10px 12px 4px; }
.side-school { margin: -8px 6px 16px; opacity: .8; font-size: .92rem; }
.school-switch { margin: 0 6px 10px; }
.school-switch select { background: rgba(255, 255, 255, .1); color: inherit; border-color: rgba(255, 255, 255, .3); }
.school-switch option { color: var(--ink); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .2); display: flex; flex-direction: column; gap: 2px; font-size: .95rem; }
.side-foot form { padding: 9px 12px; }
.side-foot .linklike { text-decoration: none; opacity: .86; }
.console-bar { display: none; }
.main-wrap { display: flex; flex-direction: column; min-width: 0; }
.main { padding: 32px clamp(18px, 4vw, 44px) 40px; max-width: 1080px; width: 100%; flex: 1; }
.main-wide { max-width: 1320px; }

/* ---------- App shell (parents + tuckshop) ---------- */
.topbar { background: var(--brand); color: var(--on-brand); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding: 12px clamp(14px, 4vw, 32px); }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.topbar nav a, .topbar nav .linklike { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: var(--r-s); font-weight: 500; opacity: .88; }
.topbar nav a[aria-current=page] { background: rgba(255, 255, 255, .18); opacity: 1; font-weight: 700; }
.topbar nav a:hover, .topbar nav .linklike:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.main-app { margin: 0 auto; max-width: 760px; padding: 26px 16px 40px; }
.main-app.main-wide { max-width: 1040px; }

.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; color: var(--slate); font-size: .85rem; }
.foot a { color: inherit; }
.foot .gear { display: inline-flex; opacity: .6; }
.foot .gear:hover { opacity: 1; }

/* ---------- Sign-in and other public pages ---------- */
.area-public { background: var(--brand); }
.main-public { min-height: calc(100vh - 60px); display: grid; align-items: center; padding: 28px 16px; }
.foot-public { color: rgba(255, 255, 255, .75); }
.auth { width: 100%; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.auth-pitch { color: var(--on-brand); }
.auth-pitch .brand { font-size: 1.2rem; margin-bottom: 26px; }
.auth-pitch h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.02; margin-bottom: 18px; max-width: 12ch; }
.auth-pitch p { font-size: 1.08rem; max-width: 34ch; opacity: .9; }
.auth-form { background: var(--paper); border-radius: 20px; padding: clamp(22px, 4vw, 34px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5); }
.auth-form h2 { font-size: 1.45rem; margin-bottom: 18px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 16px; font-size: .95rem; }
.auth-single { max-width: 480px; grid-template-columns: 1fr; }
.notice-page { background: var(--paper); border-radius: 20px; padding: 32px; max-width: 520px; margin: 0 auto; }

/* The learner card shown on the sign-in page: the thing the whole system is about */
.idcard { margin-top: 30px; width: min(340px, 100%); aspect-ratio: 85.6 / 54; background: var(--paper); color: var(--ink); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .55); transform: rotate(-3deg); }
.idcard-school { font-size: .78rem; color: var(--slate); }
.idcard-name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; margin-top: 4px; }
.idcard-meta { font-size: .82rem; color: var(--slate); margin-top: 4px; }
.idcard-bal { align-self: end; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.idcard-bal small { display: block; font-family: var(--body); font-weight: 400; }
.idcard .qr { width: 104px; height: 104px; align-self: center; }
.idcard-left { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }

.demo-box { margin-top: 18px; padding: 14px; border-radius: var(--r-s); background: var(--warn-tint); border: 1.5px dashed #d9bd62; }
.demo-box p { margin: 0 0 10px; font-size: .92rem; }
.demo-box .actions { gap: 8px; }

/* ---------- Till slip: statements and receipts ---------- */
.slip { position: relative; background: var(--paper); padding: 26px 22px 30px; margin: 0 0 22px; filter: drop-shadow(0 1px 1px rgba(23, 33, 43, .08)) drop-shadow(0 10px 18px rgba(23, 33, 43, .08)); }
.slip::before, .slip::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background-size: 20px 10px; background-repeat: repeat-x; }
.slip::before { top: -10px; background-image: linear-gradient(135deg, transparent 50%, var(--paper) 50%), linear-gradient(225deg, transparent 50%, var(--paper) 50%); background-position: 0 0, 10px 0; background-size: 10px 10px; }
.slip::after { bottom: -10px; background-image: linear-gradient(45deg, transparent 50%, var(--paper) 50%), linear-gradient(315deg, transparent 50%, var(--paper) 50%); background-position: 0 0, 10px 0; background-size: 10px 10px; transform: scaleY(-1); }
.slip h2 { margin-bottom: 4px; }
.slip-lines { list-style: none; margin: 0; padding: 0; }
.slip-day { font-weight: 700; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px dashed #b9c2bd; }
.slip-day:first-child { margin-top: 6px; }
.slip-line { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.slip-what small { display: block; }
.slip-dots { flex: 1; border-bottom: 2px dotted #c3ccc7; transform: translateY(-4px); min-width: 20px; }
.slip-amt { font-family: var(--display); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip-line.in .slip-amt { color: var(--in); }
.slip-line.struck .slip-what, .slip-line.struck .slip-amt { text-decoration: line-through; color: var(--slate); }
.slip-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); font-weight: 700; }
.slip-total strong { font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* ---------- Parent: children ---------- */
.kids { display: grid; gap: 16px; margin: 0 0 26px; }
.kid { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.kid-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.15; }
.kid-meta { color: var(--slate); font-size: .92rem; }
.kid-balance { font-family: var(--display); font-weight: 700; font-size: 2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.kid-balance.low { color: var(--danger); }
.kid .actions { grid-column: 1 / -1; }
.kid .actions .btn { flex: 1 1 140px; }
.kid-pending { background: var(--warn-tint); border-style: dashed; border-color: #d9bd62; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-bottom: 16px; }
.amounts .seg span, .amounts label span { font-family: var(--display); font-size: 1.15rem; padding: 16px 8px; }
.photo-pick { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-pick .preview { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: var(--brand-tint); border: 2px dashed #b9c6c0; display: block; }
.photo-pick .preview.has { border-style: solid; border-color: var(--line); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; display: grid; place-items: center; }

/* ---------- Tuckshop till ---------- */
.till { display: grid; gap: 16px; }
.viewfinder { position: relative; background: #0d1318; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 62vh; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder .frame { position: absolute; inset: 14% 22%; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(13, 19, 24, .45); border: 3px solid var(--sherbet); pointer-events: none; }
.viewfinder .vf-msg { position: absolute; inset: auto 0 0 0; padding: 12px 16px; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-weight: 600; }
.viewfinder .vf-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 24px; }
.viewfinder .vf-off p { max-width: 30ch; margin: 0 auto 14px; }
.till-search { position: relative; }
.till-results { list-style: none; margin: 8px 0 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.till-results li + li { border-top: 1px solid var(--line); }
.till-results button, .till-results a { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: none; border: 0; font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.till-results button:hover, .till-results button:focus-visible, .till-results a:hover, .till-results a:focus-visible { background: var(--brand-tint); }
.till-results .bal { margin-left: auto; font-family: var(--display); font-weight: 650; font-variant-numeric: tabular-nums; }
.customer { background: var(--paper); border-radius: 20px; border: 1px solid var(--line); padding: 18px; display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 18px; align-items: start; }
.customer-name { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 1rem + 2.4vw, 2.2rem); line-height: 1.05; letter-spacing: -.02em; }
.customer-bal { margin: 10px 0 14px; }
.customer-bal strong { display: block; font-family: var(--display); font-size: clamp(2rem, 1.4rem + 3vw, 3rem); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.amount-entry { display: flex; align-items: center; gap: 8px; background: var(--chalk); border: 2px solid var(--ink); border-radius: 14px; padding: 6px 14px; margin-bottom: 10px; }
.amount-entry span { font-family: var(--display); font-weight: 700; font-size: 1.8rem; }
.amount-entry input { border: 0; background: transparent; font-family: var(--display); font-weight: 700; font-size: 2.2rem; padding: 4px 0; min-height: 0; width: 100%; font-variant-numeric: tabular-nums; }
.amount-entry input:focus { outline: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quick button { flex: 1 1 64px; }
.btn-charge { font-size: 1.25rem; padding: 18px; min-height: 64px; font-family: var(--display); }
.till-error { background: var(--danger-tint); border: 2px solid var(--danger); color: #7d1f19; border-radius: 16px; padding: 18px; font-weight: 600; }
.till-error h2 { color: var(--danger); margin-bottom: 6px; }
.receipt { text-align: center; }
.receipt .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--in); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.receipt .tick .ico { width: 44px; height: 44px; stroke-width: 2.6; }
.receipt h2 { font-size: 1.9rem; margin-bottom: 2px; }
.receipt .slip-lines { text-align: left; margin-top: 16px; }

/* ---------- QR cards (screen + print) ---------- */
.cards-sheet { display: grid; grid-template-columns: repeat(auto-fill, 85.6mm); gap: 6mm; justify-content: start; }
.qcard { width: 85.6mm; height: 54mm; background: #fff; color: #17212b; border: 1px solid #c6cec9; border-radius: 3mm; padding: 4mm; display: grid; grid-template-columns: 1fr 34mm; gap: 3mm; overflow: hidden; break-inside: avoid; }
.qcard-left { display: flex; flex-direction: column; min-width: 0; }
.qcard-school { font-size: 7.5pt; color: #56616d; line-height: 1.2; }
.qcard-row { display: flex; gap: 2.5mm; align-items: center; margin-top: 2.5mm; }
.qcard-photo { width: 15mm; height: 15mm; border-radius: 2mm; object-fit: cover; background: #e8f0ed; flex: none; display: grid; place-items: center; font-weight: 700; }
.qcard-name { font-family: var(--display); font-weight: 700; font-size: 11.5pt; line-height: 1.1; }
.qcard-meta { font-size: 7.5pt; color: #56616d; margin-top: 1mm; }
.qcard-foot { margin-top: auto; font-size: 6.5pt; color: #56616d; line-height: 1.25; }
.qcard .qr { width: 34mm; height: 34mm; align-self: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-big { width: 220px; height: 220px; background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-s); }
.code-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(86mm, 1fr)); gap: 0; }
.code-slip { border: 1px dashed #9aa5a0; padding: 5mm; font-size: 10pt; break-inside: avoid; background: #fff; }
.code-slip strong.code { font-family: var(--display); font-size: 16pt; letter-spacing: .12em; }

/* ---------- Health, mail, assistant ---------- */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 5px; }
.checks .pass .dot { background: var(--in); }
.checks .warn .dot { background: #d79b00; }
.checks .fail .dot { background: var(--danger); }
.checks strong { display: block; }
pre.log { background: #10171d; color: #dbe5df; padding: 14px; border-radius: var(--r-s); overflow: auto; font-size: .82rem; max-height: 380px; white-space: pre-wrap; word-break: break-word; }
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.chat .msg { padding: 12px 16px; border-radius: 14px; max-width: 78ch; white-space: pre-wrap; word-break: break-word; }
.chat .msg-user { background: var(--brand-tint); align-self: flex-end; }
.chat .msg-assistant { background: var(--paper); border: 1px solid var(--line); }
.mail-preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; font-weight: 500; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; border-bottom: 2px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--slate); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--brand); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); }
.table td small { display: inline-block; line-height: 1.35; }
.learner-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.learner-head .big { font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Tutorial ---------- */
.tour { position: fixed; inset: 0; z-index: 60; background: rgba(13, 19, 24, .6); display: grid; place-items: center; padding: 16px; }
.tour-box { background: var(--paper); border-radius: 20px; padding: 26px; width: min(520px, 100%); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.tour-count { color: var(--slate); font-size: .88rem; margin-bottom: 8px; }
.tour-step h2 { font-size: 1.5rem; }
.tour-step p { font-size: 1.05rem; min-height: 5.2em; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .console { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .18s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .side.open { transform: none; }
  .console-bar { display: flex; align-items: center; gap: 6px; background: var(--brand); color: var(--on-brand); padding: 6px 10px; position: sticky; top: 0; z-index: 40; }
  .console-bar-title { font-family: var(--display); font-weight: 700; }
  .main { padding: 22px 16px 32px; }
  .split, .split-wide { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-pitch h1 { max-width: none; }
  .idcard { display: none; }
  .customer { grid-template-columns: 1fr; }
  .customer .avatar-xl { max-width: 180px; }
}
@media (max-width: 520px) {
  .kid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 10px; }
  .panel { padding: 18px 16px; }
  .table td, .table th { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Print: cards and link-code slips only ---------- */
@media print {
  @page { size: A4; margin: 7mm 10mm; }
  body { background: #fff; }
  .side, .console-bar, .topbar, .foot, .flash, .no-print, .tour, .skip { display: none !important; }
  .console { display: block; }
  .main { padding: 0; max-width: none; }
  .cards-sheet { gap: 2.5mm 4mm; }
  .qcard { border-color: #999; }
  .panel { border: 0; padding: 0; }
}
