/* Sekolah BijakMedia — "meja pejabat" (office desk) design system.
   Tactile, real-world materials for a fee & receipt system:
     desk  = soft sage linen page background          paper = sheets, slips, panels, cards
     binder = leather sidebar cover (brand-tinted)    ledger = ruled tables, double-ruled totals
     stamps/enamel = status chips                      raised keys = buttons, inset fields = inputs
   White-label: every brand colour comes from --brand / --accent (set inline per school in _head.php).
   Shades are derived with color-mix(); never hard-code a school colour.

   ---------------------------------------------------------------- DESIGN TOKENS (use these in features.css)
   Surfaces   --desk, --desk-2 (page)  --sheet (paper)  --sheet-2 (paper tint / table head)  --paper (= desk, legacy)
              --leather, --leather-hi (sidebar/binder, brand-tinted)  --manila (inactive folder tab)
   Ink        --ink (text)  --ink-2 (secondary)  --muted (tertiary, AA on paper)  --rule / --rule-2 (lines)
   Brand      --brand --accent (per school)  --brand-hi --brand-lo (gradient stops)  --brand-soft (tint)
              --brand-ink (text on brand)  --brand-text (brand as readable text on paper)  --focus (focus ring)
   Status     --ok/--ok-soft  --warn/--warn-soft  --stamp/--stamp-soft (red ink)  --info/--info-soft
   Radii      --r-xs 4px  --r-sm 7px  --radius 12px  --r-lg 16px  --r-pill 999px
   Shadows    --sh-1 (sheet resting on desk)  --sh-2 (lifted sheet / popover)  --sh-3 (floating tray)
              --sh-inset (engraved field)  --sh-key (raised key)  --sh-key-press (pressed key)  --hl (top highlight)
   Gradients  --g-paper (paper face)  --g-key (neutral raised key)  --g-brand (brand raised key)
   Spacing    --s1 4 · --s2 8 · --s3 12 · --s4 16 · --s5 24 · --s6 32 · --s7 48
   Example (raised card):  .x { background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--sh-1); }
   Example (raised key):   .k { background: var(--g-key); border: 1px solid var(--rule-key); box-shadow: var(--sh-key); } .k:active { box-shadow: var(--sh-key-press); }
   Example (inset field):  .f { background: var(--field); border: 1px solid var(--rule-field); box-shadow: var(--sh-inset); }
   ---------------------------------------------------------------- */

:root {
  --desk: #dfe3dc;
  --desk-2: #d3d8cf;
  --paper: var(--desk);
  --sheet: #fdfdfb;
  --sheet-2: #f3f4ef;
  --manila: #e9e6da;
  --field: #fbfbf8;
  --ink: #1c2536;
  --ink-2: #444e62;
  --muted: #5f6879;
  --rule: #d2d6d0;
  --rule-2: #e4e7e1;
  --rule-key: #b9beb6;
  --rule-field: #b8beb9;
  --ledger: #dbe2ea;

  --brand: #0e6b57;
  --accent: #e8913a;
  --brand-ink: #ffffff;
  --brand-hi: color-mix(in srgb, var(--brand) 82%, #fff);
  --brand-lo: color-mix(in srgb, var(--brand) 84%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 11%, #fff);
  --brand-text: color-mix(in srgb, var(--brand) 85%, #000);
  --focus: color-mix(in srgb, var(--brand) 70%, #1a1a1a);
  --leather: color-mix(in srgb, var(--brand) 26%, #1a1e25);
  --leather-hi: color-mix(in srgb, var(--brand) 34%, #2a2f38);

  --ok: #10684f;
  --ok-soft: #e1f0e8;
  --warn: #8a5300;
  --warn-soft: #fbf0d4;
  --stamp: #b0222a;
  --stamp-soft: #fbe9e8;
  --info: #2e4fae;
  --info-soft: #e8eefb;
  --mark: #f4d35e;

  --r-xs: 4px;
  --r-sm: 7px;
  --radius-sm: 7px;
  --radius: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --hl: inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh-1: 0 1px 1px rgba(30, 38, 52, .07), 0 2px 4px -1px rgba(30, 38, 52, .07), 0 10px 22px -14px rgba(30, 38, 52, .28);
  --sh-2: 0 1px 2px rgba(30, 38, 52, .08), 0 6px 12px -4px rgba(30, 38, 52, .12), 0 22px 40px -18px rgba(30, 38, 52, .35);
  --sh-3: 0 -1px 0 rgba(30, 38, 52, .06), 0 -10px 30px -12px rgba(30, 38, 52, .28);
  --sh-inset: inset 0 1px 2px rgba(30, 38, 52, .13), inset 0 0 0 1px rgba(30, 38, 52, .02), 0 1px 0 rgba(255, 255, 255, .85);
  --sh-key: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 0 rgba(30, 38, 52, .06), 0 1px 2px rgba(30, 38, 52, .16), 0 3px 6px -3px rgba(30, 38, 52, .25);
  --sh-key-press: inset 0 2px 4px rgba(30, 38, 52, .25), inset 0 0 0 1px rgba(30, 38, 52, .05);
  --shadow: var(--sh-1);

  --g-paper: linear-gradient(180deg, #ffffff 0, var(--sheet) 60%, #f9faf6 100%);
  --g-key: linear-gradient(180deg, #ffffff 0, #f3f4f0 55%, #e7e9e3 100%);
  --g-brand: linear-gradient(180deg, var(--brand-hi) 0, var(--brand) 52%, var(--brand-lo) 100%);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --side-w: 264px;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23525b6c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --chev-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8ebf0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5.2l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--desk);
  /* linen weave: two faint cross-hatch threads + a soft lamp-light falloff */
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(255, 255, 255, .55), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(60, 70, 60, .035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--desk) 0, var(--desk-2) 100%);
  overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--s3); letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 var(--s3); }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; height: 2px; margin: var(--s5) 0; background: linear-gradient(var(--rule), var(--rule)) 0 0 / 100% 1px no-repeat, linear-gradient(#fff, #fff) 0 1px / 100% 1px no-repeat; }
s { color: var(--muted); }
svg { flex: none; }
.btn svg, .tabs svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- staff shell (binder + desk) */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s4) var(--s3) var(--s4);
  color: #d5dae4;
  background-color: var(--leather);
  background-image:
    /* stitching along the spine */
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 7px, transparent 7px 12px),
    /* sheen */
    radial-gradient(ellipse 140% 55% at 20% 0%, rgba(255, 255, 255, .09), transparent 70%),
    /* grain */
    repeating-radial-gradient(circle at 30% 40%, rgba(0, 0, 0, .07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, var(--leather-hi), var(--leather));
  background-size: 1.5px 100%, auto, 7px 7px, auto, auto;
  background-position: right 9px top 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, repeat, no-repeat;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06), inset -6px 0 10px -6px rgba(0, 0, 0, .55), 4px 0 14px -6px rgba(20, 24, 30, .45);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.side > *, .side nav > * { flex-shrink: 0; } /* short screens: scroll the sidebar, never squash menu items */
.side .logo { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2); color: #fff; text-decoration: none; }
.side .logo img { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; padding: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .08); }
.side .logo .mono, .plain-top .brand .mono {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none;
  background: var(--g-brand); border: 1px solid color-mix(in srgb, var(--brand) 60%, #000);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .35); text-shadow: 0 -1px 0 rgba(0, 0, 0, .3);
}
.side .logo b { font-size: 15px; line-height: 1.25; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: none; }
.side .grp { font-size: 12px; font-weight: 650; color: #a3abbb; padding: var(--s3) var(--s3) 3px; text-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.side nav a {
  position: relative; display: flex; align-items: center; gap: var(--s3);
  min-height: 40px; padding: 8px var(--s3); border-radius: 9px;
  color: #dde1ea; text-decoration: none; font-weight: 600; font-size: 14px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
/* current page = a paper index tab pushed into the binder */
.side nav a[aria-current="page"] {
  margin-right: calc(-1 * var(--s3)); border-radius: 9px 0 0 9px;
  color: var(--ink); text-shadow: none;
  background: linear-gradient(180deg, #fff, #f1f2ec);
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, .35), 0 3px 8px -2px rgba(0, 0, 0, .45);
}
.side nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side nav a[aria-current="page"] svg { color: var(--brand-text); opacity: 1; }
.side nav a .cnt {
  margin-left: auto; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px; color: #1b2030; text-shadow: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 1px rgba(0, 0, 0, .35);
}
.side svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side .branch-switch select { width: 100%; }

/* scope plate: branch + year, a recessed label holder riveted to the cover */
.scope {
  position: relative; display: grid; gap: 10px; padding: 12px 12px 10px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .26), rgba(0, 0, 0, .16));
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 255, 255, .09);
}
.scope::before, .scope::after { /* rivets */
  content: ""; position: absolute; top: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3f0e6, #a8a392 55%, #5d5a50);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}
.scope::before { left: 6px; } .scope::after { right: 6px; }
.scope-row { display: grid; gap: 3px; margin: 0; }
.scope-row label, .scope-lbl { display: block; margin: 0 0 0 2px; font-size: 11.5px; font-weight: 650; color: #b3bac8; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.scope-val {
  display: block; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #fff; line-height: 1.3;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 1px rgba(0, 0, 0, .3);
}
.side .scope select {
  min-height: 38px; padding: 7px 32px 7px 10px; font-size: 14px; font-weight: 700; color: #fff; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .45);
  background: var(--chev-light) right 11px center / 12px 8px no-repeat, linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .35);
}
.side .scope select:hover { background-color: rgba(255, 255, 255, .05); }
.side .scope select:focus-visible, .side :focus-visible { outline: 3px solid #ffd862; outline-offset: 1px; }
.side .scope select option { color: var(--ink); background: #fff; }
.scope-add { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 12.5px; font-weight: 650; color: #c7cdd9; text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.scope-add:hover { color: #fff; text-decoration: underline; }
.scope-add svg { width: 14px; height: 14px; }

/* binder footer: user card + logout */
.side { padding-bottom: 0; }
.side .foot { /* always in reach: sticks to the bottom of the binder while the menu scrolls */
  position: sticky; bottom: 0; z-index: 2; margin: auto calc(-1 * var(--s3)) 0; padding: var(--s3) 14px var(--s4);
  display: grid; gap: 10px; font-size: 13px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 7px, transparent 7px 12px) right 9px top 0 / 1.5px 100% no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--leather) 92%, #000), var(--leather));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .07), 0 -10px 16px -8px rgba(0, 0, 0, .45);
}
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; color: #fff; text-decoration: none; min-width: 0;
  background: rgba(0, 0, 0, .14); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .06);
}
.user-card:hover { background: rgba(0, 0, 0, .22); }
.user-card .avatar { width: 38px; height: 38px; font-size: 13.5px; }
.user-card .u { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.user-card .u b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.user-card .u small { font-size: 12px; color: #b7bfcc; }
.user-card svg { width: 16px; height: 16px; opacity: .7; }
.logout-form { margin: 0; }
.btn.logout {
  width: 100%; min-height: 42px; justify-content: center; color: #fff; font-size: 14px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .5); text-shadow: 0 -1px 0 rgba(0, 0, 0, .35);
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07) 55%, rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .45);
}
.btn.logout:hover { filter: none; background: linear-gradient(180deg, #c8424a, #a3242c 55%, #8c1d24); border-color: #5e1015; }
.btn.logout:active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45); transform: translateY(1px); }
.side .powered { font-size: 11px; color: #9aa2b2; text-align: center; }

/* desk area */
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: var(--s3); min-height: 58px;
  padding: 10px var(--s6);
  background: color-mix(in srgb, var(--desk) 82%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
  border-bottom: 1px solid rgba(30, 38, 52, .1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 6px 14px -12px rgba(30, 38, 52, .5);
  position: sticky; top: 0; z-index: 20;
}
.topbar .here { font-size: 13.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; flex: none; }
.topbar .who .chip { text-decoration: none; }
.topbar .menu-btn { display: none; width: 42px; height: 42px; padding: 0; }
.topbar .menu-btn svg { width: 20px; height: 20px; }
.top-acct { display: none; align-items: center; gap: 6px; }
.top-acct .avatar { width: 36px; height: 36px; font-size: 12.5px; text-decoration: none; }
.top-acct form { margin: 0; }
.top-acct .btn { width: 38px; height: 38px; padding: 0; }
.content { padding: var(--s5) var(--s6) var(--s7); max-width: 1320px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head h1 { margin: 0; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--ink-2); }

/* ---------------------------------------------------------------- notes: banners + flash (paper slips) */
.banner, .flash {
  position: relative; display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap;
  padding: 11px var(--s4) 11px 18px; border-radius: 10px; margin-bottom: var(--s4); font-size: 14px; color: var(--ink);
  background: var(--g-paper); border: 1px solid var(--rule); box-shadow: var(--sh-1);
}
.banner::before, .flash::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--muted); }
.banner.warn { background: linear-gradient(180deg, #fffbee, var(--warn-soft)); border-color: #ecd9a6; color: #4e3200; }
.banner.warn::before, .flash.warn::before { background: linear-gradient(#f2b63f, #c98a12); }
.banner.bad, .flash.error { background: linear-gradient(180deg, #fff6f5, var(--stamp-soft)); border-color: #edc3c1; color: #5d1016; }
.banner.bad::before, .flash.error::before { background: linear-gradient(#d4454c, var(--stamp)); }
.banner.info { background: linear-gradient(180deg, #fff, var(--brand-soft)); border-color: color-mix(in srgb, var(--brand) 22%, #fff); }
.banner.info::before { background: var(--brand); }
.flash.ok { background: linear-gradient(180deg, #f9fdfb, var(--ok-soft)); border-color: #bfdccd; color: #0b3d2e; }
.flash.ok::before { background: linear-gradient(#2a9a72, var(--ok)); }
.flash.info { background: linear-gradient(180deg, #fbfcff, var(--info-soft)); border-color: #c8d3f1; }
.flash.info::before { background: var(--info); }
.flash { display: block; }
.banner .btn, .banner form { margin-left: auto; }

/* ---------------------------------------------------------------- paper panels */
.panel {
  position: relative; background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s5); margin-bottom: var(--s5); box-shadow: var(--hl), var(--sh-1);
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.flush { padding: 0; overflow: hidden; overflow-x: auto; }
.panel-head {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, #fff, var(--sheet-2));
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.grid { display: grid; gap: var(--s5); }
.grid > .panel { margin-bottom: 0; }
.grid { margin-bottom: var(--s5); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side-r { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid.side-r > div > .panel:last-child { margin-bottom: 0; }

/* ledger figures row: one sheet, columns ruled like a summary page */
.figures {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--s5);
  background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--hl), var(--sh-1); overflow: hidden;
}
.figures > div { padding: var(--s4) var(--s5) 14px; border-left: 1px solid var(--rule-2); min-width: 0; position: relative; }
.figures > div:first-child { border-left: 0; }
.figures .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.figures .val { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.25; margin: 2px 0 2px; overflow-wrap: anywhere; }
.figures .val.red { color: var(--stamp); }
.figures .val.green { color: var(--ok); }
.figures .hint { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- ledger tables */
.table-wrap { /* wide ledgers scroll inside; edge shadows hint there is more */
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, var(--sheet) 30%, transparent) 0 0 / 36px 100% no-repeat local,
    linear-gradient(270deg, var(--sheet) 30%, transparent) 100% 0 / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(30, 38, 52, .2), transparent) 0 0 / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(30, 38, 52, .2), transparent) 100% 0 / 12px 100% no-repeat scroll;
}
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th {
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 10px var(--s3); white-space: nowrap;
  background: linear-gradient(180deg, #f8f9f5, #eef0ea);
  border-bottom: 3px double var(--rule-key);
}
table.t td { padding: 11px var(--s3); border-bottom: 1px solid var(--ledger); vertical-align: middle; }
.panel:not(.flush) table.t td:first-child, .panel:not(.flush) table.t th:first-child { padding-left: 0; }
.panel:not(.flush) table.t td:last-child, .panel:not(.flush) table.t th:last-child { padding-right: 0; }
.panel:not(.flush) table.t th { background: none; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, transparent); }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t th.num, table.t td.num { text-align: right; }
/* accounting totals: single rule above, double rule below */
table.t tfoot td, table.t tfoot tr:last-child td { font-weight: 800; border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); }
table.t .who { display: flex; align-items: center; gap: var(--s3); }
table.t a.row-link { color: var(--ink); font-weight: 650; text-decoration: none; }
table.t a.row-link:hover { text-decoration: underline; color: var(--brand-text); }
.empty { padding: var(--s7) var(--s5); text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; overflow: hidden;
  color: var(--brand-text);
  background: radial-gradient(circle at 35% 25%, #fff, var(--brand-soft) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent), inset 0 -2px 3px rgba(30, 38, 52, .08), 0 1px 2px rgba(30, 38, 52, .15);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 25px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent), 0 0 0 4px #fff, 0 2px 8px -2px rgba(30, 38, 52, .35); }

/* status chips: enamel pins */
.chip {
  --c: var(--ink-2); --cs: #eceee8;
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; line-height: 1.5; padding: 1px 9px 1px 8px;
  border-radius: 99px; white-space: nowrap; color: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cs) 55%, #fff), var(--cs));
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 1px rgba(30, 38, 52, .1);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .25); opacity: .85; }
.chip.paid, .chip.active, .chip.approved, .chip.valid, .chip.ok { --c: var(--ok); --cs: var(--ok-soft); }
.chip.partial, .chip.pending, .chip.warn { --c: var(--warn); --cs: var(--warn-soft); }
.chip.unpaid, .chip.overdue, .chip.declined, .chip.bad { --c: var(--stamp); --cs: var(--stamp-soft); }
.chip.void, .chip.inactive { --c: var(--muted); --cs: #eceee8; text-decoration: line-through; }
.chip.inactive { text-decoration: none; }
a.chip:hover { filter: brightness(.98); text-decoration: none; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 4px; color: #fff; margin: 1px 2px 1px 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 1px rgba(0, 0, 0, .15); text-shadow: 0 1px 0 rgba(0, 0, 0, .2); }

/* ---------------------------------------------------------------- forms: engraved fields */
label, .label { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: var(--s4); min-width: 0; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.req::after { content: " *"; color: var(--stamp); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], input[type=url], input[type=month], input[type=time], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; min-height: 42px; font: inherit; font-size: 15px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--rule-field); border-radius: 9px;
  background-color: var(--field); box-shadow: var(--sh-inset);
  transition: border-color .12s, box-shadow .12s;
}
input[type=color] { padding: 4px; width: 64px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; cursor: pointer; }
select[multiple] { background-image: none; padding-right: 12px; }
input::placeholder, textarea::placeholder { color: #8a92a0; }
input:hover:not(:focus):not([readonly]), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #9aa1a6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); outline: 0; background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(30, 38, 52, .1), 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }
input[readonly], input[disabled], select[disabled], textarea[disabled] { background-color: var(--sheet-2); color: var(--ink-2); }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; font-size: 13px; margin-right: 10px; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--ink);
  border: 1px solid var(--rule-key); background: var(--g-key); box-shadow: var(--sh-key);
}
/* tactile checkboxes and radios */
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 1px 0 0; width: 20px; height: 20px; cursor: pointer; vertical-align: -4px;
  border: 1px solid var(--rule-field); background-color: var(--field); box-shadow: var(--sh-inset);
  border-radius: 6px; transition: background-color .12s, border-color .12s;
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked {
  border-color: var(--brand-lo); background: var(--tick) center / 12px 10px no-repeat, var(--g-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 1px rgba(30, 38, 52, .25);
}
input[type=radio]:checked { border-color: var(--brand-lo); background: radial-gradient(circle, #fff 0 3.5px, transparent 4px), var(--g-brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 1px rgba(30, 38, 52, .25); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .5; cursor: not-allowed; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; color: var(--ink); margin-bottom: var(--s2); cursor: pointer; }
.row { display: grid; gap: 0 var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.money-in { position: relative; }
.money-in::before { content: "RM"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; z-index: 1; }
.money-in input { padding-left: 40px; text-align: right; font-variant-numeric: tabular-nums; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s4) var(--s5); margin: 0 0 var(--s5); background: rgba(255, 255, 255, .5); box-shadow: inset 0 1px 2px rgba(30, 38, 52, .04); min-width: 0; }
legend { font-weight: 750; padding: 0 var(--s2); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s4); }
.filters > * { flex: 0 1 auto; }
.filters input[type=search] { min-width: 260px; flex: 1 1 260px; max-width: 420px; }
.filters select, .filters input:not([type=search]) { width: auto; }
.filters .btn { min-height: 42px; }
.form-actions { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s4); flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons: raised keys */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2;
  padding: 9px 17px; border-radius: 10px; cursor: pointer; white-space: nowrap; text-decoration: none;
  color: var(--brand-ink); background: var(--g-brand);
  border: 1px solid color-mix(in srgb, var(--brand) 62%, #000);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 1px rgba(30, 38, 52, .18), 0 3px 7px -3px color-mix(in srgb, var(--brand) 60%, #000);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .22);
  transition: filter .12s, box-shadow .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06) saturate(1.04); text-decoration: none; }
.btn:active { transform: translateY(1px); filter: brightness(.96); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3), 0 0 0 rgba(0, 0, 0, 0); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.btn.ghost, .btn.danger {
  color: var(--ink); background: var(--g-key); border-color: var(--rule-key); box-shadow: var(--sh-key); text-shadow: 0 1px 0 #fff;
}
.btn.ghost:hover { filter: none; border-color: #9ea4a0; background: linear-gradient(180deg, #fff, #f6f7f3 55%, #eceee8); }
.btn.ghost:active, .btn.danger:active { box-shadow: var(--sh-key-press); background: linear-gradient(180deg, #e7e9e3, #f1f2ee); }
.btn.danger { color: var(--stamp); border-color: #ddb3b1; }
.btn.danger:hover { filter: none; background: linear-gradient(180deg, #fff, #fdf1f0 55%, #f8e2e1); border-color: #cc8e8b; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.lg { min-height: 50px; padding: 13px 24px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); transform: none; }
.btn.wa { --wa: #1f8f4e; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--wa) 80%, #fff), var(--wa) 52%, color-mix(in srgb, var(--wa) 84%, #000)); border-color: #136334; text-shadow: 0 -1px 0 rgba(0, 0, 0, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 1px rgba(30, 38, 52, .18), 0 3px 7px -3px #0d4d28; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.inline { display: inline; }

/* ---------------------------------------------------------------- the slip: invoice / receipt on real paper */
.slip {
  position: relative; max-width: 820px; padding: var(--s6) var(--s6) 108px;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0, rgba(255, 255, 255, .9), transparent 70%),
    linear-gradient(180deg, #fffefb, #fbfaf5);
  border: 1px solid #d9dad2; border-radius: 3px;
  box-shadow: 0 1px 1px rgba(30, 38, 52, .08), 0 4px 8px -2px rgba(30, 38, 52, .1), 0 24px 40px -22px rgba(30, 38, 52, .45);
}
.slip::before { /* perforated tear-off edge */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 10px;
  background: radial-gradient(circle at 7px -1px, var(--desk) 5px, transparent 5.5px) 0 0 / 14px 10px repeat-x;
}
.slip::after { /* faint ruled edge, like a receipt-book stub */
  content: ""; position: absolute; top: 18px; bottom: 18px; left: 14px; width: 0; border-left: 1px dashed rgba(30, 38, 52, .12);
}
.slip-head { display: flex; gap: var(--s5); justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s5); }
.slip-head .org { display: flex; gap: var(--s3); align-items: flex-start; min-width: 0; }
.slip-head .org img { width: 56px; height: 56px; object-fit: contain; }
.slip-head .doc { text-align: right; }
.slip-head .doc .kind { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.slip-head .doc .no { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand-text); font-size: 16px; }
.slip .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3) var(--s5); padding: var(--s4) 0; border-top: 1px dashed #c9ccc4; border-bottom: 1px dashed #c9ccc4; margin-bottom: var(--s4); font-size: 14px; }
.slip .meta .k { color: var(--muted); font-size: 12.5px; }
.slip table.t th { background: none; padding-left: 0; padding-right: 0; }
.slip table.t td { padding-left: 0; padding-right: 0; }
.slip table.t th + th, .slip table.t td + td { padding-left: var(--s3); }
.slip .totals { margin-left: auto; width: min(320px, 100%); font-size: 14px; position: relative; z-index: 1; }
.slip .totals div { display: flex; justify-content: space-between; gap: var(--s3); padding: 5px 0; font-variant-numeric: tabular-nums; }
.slip .totals .grand { border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 800; font-size: 17px; margin-top: 4px; padding: 8px 0 6px; }
/* rubber stamp: double frame, slightly uneven ink */
.stamp {
  position: absolute; left: 44px; bottom: 50px; transform: rotate(-9deg);
  border: 3px solid currentColor; border-radius: 9px; padding: 4px 16px;
  font-size: 26px; font-weight: 800; letter-spacing: .1em; opacity: .8;
  box-shadow: inset 0 0 0 2px #fffdf8, inset 0 0 0 3.5px currentColor;
  mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-image: repeating-linear-gradient(35deg, #000 0 3px, rgba(0, 0, 0, .78) 3px 4px, #000 4px 9px);
  mask-image: repeating-linear-gradient(35deg, #000 0 3px, rgba(0, 0, 0, .78) 3px 4px, #000 4px 9px);
}
.stamp.paid { color: var(--ok); }
.stamp.unpaid, .stamp.partial { color: var(--stamp); }
.stamp.void { color: var(--muted); }

/* ---------------------------------------------------------------- invoice line editor */
.lines td { padding: 6px; vertical-align: top; }
.lines input, .lines select { padding: 7px 9px; font-size: 14px; min-height: 38px; }
.lines .qty { width: 80px; }
.lines .amt { width: 130px; }
.lines .rm-line { color: var(--stamp); background: none; border: 0; font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.lines .rm-line:hover { background: var(--stamp-soft); }

/* ---------------------------------------------------------------- folder tabs */
.tabs {
  display: flex; gap: 3px; margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none;
  padding: 6px 2px 0; border-bottom: 1px solid var(--rule-key); box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; padding: 9px 16px 8px; font-weight: 650; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--rule-key); border-bottom: 0; border-radius: 10px 10px 0 0; margin-bottom: -1px;
  background: linear-gradient(180deg, #efede4, var(--manila));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -4px 6px -4px rgba(30, 38, 52, .12);
}
.tabs a:hover { color: var(--ink); background: linear-gradient(180deg, #f6f4ec, #ece9de); }
.tabs a[aria-current="page"] {
  color: var(--ink); z-index: 1; padding-top: 11px; margin-top: -3px;
  background: linear-gradient(180deg, #fff, var(--sheet)); border-color: var(--rule-key);
  box-shadow: inset 0 1px 0 #fff, 0 -2px 6px -3px rgba(30, 38, 52, .18);
}
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.tabs a .cnt { font-size: 12px; color: var(--muted); }
.tabs a:focus-visible { outline-offset: -3px; }

/* key-value list */
dl.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0 var(--s4); margin: 0; font-size: 14px; }
dl.kv dt, dl.kv dd { padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

.pagination { display: flex; gap: var(--s2); align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: var(--s3) var(--s4); font-size: 14px; border-top: 1px solid var(--rule-2); background: var(--sheet-2); }
.bulkbar { display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid #ead9a2; background: linear-gradient(180deg, #fffcef, #fbf2d3); flex-wrap: wrap; }
.bulkbar select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 14px; }
.bulkbar[hidden] { display: none; }

.copybox { display: flex; gap: var(--s2); min-width: 0; }
.copybox input { font-size: 13px; background-color: var(--sheet-2); min-width: 0; }
.copybox .btn { flex: none; }

/* numbered checklist: embossed coins */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 2px 0 var(--s4) 42px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: var(--brand-text);
  background: radial-gradient(circle at 35% 25%, #fff, var(--brand-soft) 75%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent), 0 1px 2px rgba(30, 38, 52, .2);
}
.steps li:has(> s)::before { content: "✓"; color: #fff; background: var(--g-brand); }

/* ---------------------------------------------------------------- auth / public pages */
.plain { min-height: 100vh; display: flex; flex-direction: column; }
.plain-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5); }
.plain-top .brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); font-weight: 800; min-width: 0; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.plain-top .brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; padding: 2px; box-shadow: 0 1px 2px rgba(30, 38, 52, .25); }
.plain-top nav { margin-left: auto; display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 650; }
.plain-top nav a { color: var(--ink); text-decoration: none; }
.plain-top nav a:hover { text-decoration: underline; }
.plain-top nav a.btn { color: var(--brand-ink); }
.plain-top nav a.btn.ghost { color: var(--ink); }
.plain-top nav a.btn:hover { text-decoration: none; }
.plain-main { flex: 1; padding: var(--s5) var(--s4); display: flex; justify-content: center; }
.plain-main > div, .land, .content { isolation: isolate; }
.card-narrow { width: min(440px, 100%); margin-top: 3vh; }
.card-mid { width: min(720px, 100%); }
.card-wide { width: min(980px, 100%); }
/* a sheet resting on a second sheet */
.authbox {
  position: relative; padding: var(--s6);
  background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--hl), var(--sh-2);
}
.authbox::before {
  content: ""; position: absolute; inset: 6px -5px -7px 5px; z-index: -1; border-radius: var(--r-lg);
  background: linear-gradient(180deg, #f6f6f1, #ecede6); border: 1px solid var(--rule); transform: rotate(1.2deg);
  box-shadow: 0 6px 18px -10px rgba(30, 38, 52, .4);
}
.authbox h1 { font-size: 24px; }
.plain-foot { text-align: center; font-size: 12.5px; color: var(--muted); padding: var(--s5); }
.plain-foot a { color: var(--ink-2); }

/* ---------------------------------------------------------------- landing */
.land { max-width: 1120px; margin: 0 auto; padding: 0 var(--s5); }
header.land { padding-top: var(--s4); padding-bottom: var(--s4); }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s7); align-items: center; padding: var(--s7) 0 64px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; margin-bottom: var(--s4); text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.hero .cta { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.hero { overflow-x: clip; overflow-clip-margin: 14px; }
.hero-slip { position: relative; isolation: isolate; transform: rotate(1.6deg); max-width: 520px; justify-self: center; width: 100%; }
.hero-slip::before, .hero-slip::after { /* the receipt book underneath */
  content: ""; position: absolute; z-index: -1; border-radius: 3px; border: 1px solid #d6d8cf;
  background: linear-gradient(180deg, #fbfbf6, #f1f1ea); box-shadow: 0 10px 24px -14px rgba(30, 38, 52, .45);
}
.hero-slip::before { inset: 14px -10px -12px 12px; transform: rotate(-4deg); }
.hero-slip::after { inset: 8px -4px -6px 6px; transform: rotate(-1.8deg); }
.hero-slip .slip { padding: var(--s5) var(--s5) 90px; }
.hero-slip .stamp { left: 28px; bottom: 26px; font-size: 22px; }
.band { padding: var(--s7) 0; }
.band > h2 { font-size: 26px; letter-spacing: -0.02em; }
/* features printed on one brochure sheet, columns ruled */
.feat {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--hl), var(--sh-1); overflow: hidden;
}
.feat > div { padding: var(--s5); border-left: 1px solid var(--rule-2); border-top: 1px solid var(--rule-2); }
.feat > div:nth-child(3n+1) { border-left: 0; }
.feat > div:nth-child(-n+3) { border-top: 0; }
.feat h3 { margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.feat h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--g-brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 1px rgba(30, 38, 52, .25); }
.feat p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.price-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); align-items: start; margin-top: var(--s5); }
.price {
  position: relative; background: var(--g-paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s5);
  box-shadow: var(--hl), var(--sh-1);
}
.price .amt { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.price ul { padding-left: 18px; margin: var(--s4) 0 0; font-size: 14px; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: var(--s3); }
.price li { margin-bottom: 6px; }
.price.featured { border-color: color-mix(in srgb, var(--brand) 45%, var(--rule)); box-shadow: var(--hl), var(--sh-2); transform: translateY(-6px); }
.price.featured::before { /* bound ribbon */
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 6px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--g-brand);
}

/* ---------------------------------------------------------------- parent app (mobile first) */
.papp { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 132px; }
.papp-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s4) 14px; color: #fff;
  background-color: var(--leather);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .26) 0 7px, transparent 7px 12px),
    radial-gradient(ellipse 120% 90% at 20% 0, rgba(255, 255, 255, .12), transparent 70%),
    repeating-radial-gradient(circle at 30% 40%, rgba(0, 0, 0, .07) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 70%, #2a2f38), color-mix(in srgb, var(--brand) 55%, #15181e));
  background-size: 100% 1.5px, auto, 7px 7px, auto;
  background-position: 0 calc(100% - 5px), 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12), 0 8px 18px -10px rgba(0, 0, 0, .55);
}
.papp-top img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.papp-top .t { font-weight: 800; line-height: 1.15; min-width: 0; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.papp-top .t small { display: block; font-weight: 500; opacity: .88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.papp-top a, .papp-top button { color: #fff; }
.papp-acts { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.papp-acts > a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 99px; text-decoration: none; font-size: 13.5px; font-weight: 700;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .3); }
.papp-acts > a:hover { background: rgba(255, 255, 255, .2); }
.papp-body { padding: var(--s4); }
.kid {
  position: relative; display: block; margin-bottom: var(--s4); padding: var(--s4) 18px; color: var(--ink); text-decoration: none;
  background: var(--g-paper); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--hl), var(--sh-1);
  transition: box-shadow .15s, transform .08s;
}
a.kid:hover { box-shadow: var(--hl), var(--sh-2); }
a.kid:active { transform: translateY(1px); box-shadow: var(--hl), var(--sh-1); }
a.kid::after { content: ""; position: absolute; right: 16px; top: 24px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .7; }
.kid-head { display: flex; gap: var(--s3); align-items: center; padding-right: 18px; }
.kid-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.kid-head .n { font-weight: 800; font-size: 16px; line-height: 1.2; }
.kid-head .c { font-size: 13px; color: var(--muted); }
.kid .owe { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px dashed #c9ccc4; }
.kid .owe .amt { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.kid .owe .amt.red { color: var(--stamp); }
.kid .owe .amt.green { color: var(--ok); }
.kid h1, .kid h2 { margin-top: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: var(--s3); align-items: center; padding: 13px 0; border-bottom: 1px solid var(--ledger); min-height: 56px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain input[type=checkbox] { width: 24px; height: 24px; border-radius: 7px; }
.list-plain input[type=checkbox]:checked { background-size: 14px 11px, auto; }
/* pay tray */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #ffffff, #f4f5f0); border-top: 1px solid var(--rule);
  box-shadow: inset 0 1px 0 #fff, var(--sh-3);
}
.paybar .in { max-width: 528px; margin: 0 auto; display: flex; gap: var(--s3); align-items: center; }
.paybar .tot { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paybar .btn { min-height: 52px; }

/* ---------------------------------------------------------------- language switch: a two-position slider */
.lang-switch {
  display: inline-flex; gap: 2px; padding: 3px; margin: 0; vertical-align: middle; border-radius: 999px;
  background: linear-gradient(180deg, #dfe2dc, #eceee9); border: 1px solid var(--rule-key); box-shadow: inset 0 1px 3px rgba(30, 38, 52, .2), 0 1px 0 rgba(255, 255, 255, .7);
}
.lang-switch button {
  border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 750; letter-spacing: .02em; line-height: 1.2;
  min-width: 34px; min-height: 28px; padding: 4px 9px; border-radius: 999px; color: var(--ink-2); cursor: pointer;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] {
  color: var(--brand-ink); background: var(--g-brand); text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(30, 38, 52, .35);
}
.lang-switch button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.papp-top .lang-switch { background: rgba(0, 0, 0, .22); border-color: rgba(0, 0, 0, .3); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .1); }
.papp-top .lang-switch button { color: rgba(255, 255, 255, .85); }
.papp-top .lang-switch button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(180deg, #fff, #e9ebe5); text-shadow: none; }
.plain-top .lang-switch { margin-left: auto; }
.plain-top nav ~ .lang-switch { margin-left: 0; }

/* dashboard chart (inline-styled bars in a 12-col grid): let month labels shrink */
.panel div[style*="repeat(12"] > div { min-width: 0; overflow: hidden; text-overflow: clip; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--rule-2); }
  .grid.side-r { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 999px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; z-index: 50;
    transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
  }
  .side.open { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 8px 0 24px -6px rgba(10, 14, 20, .5), 0 0 0 100vmax rgba(20, 26, 36, .45); }
  .topbar { padding: 8px var(--s4); min-height: 58px; }
  .topbar .menu-btn { display: inline-flex; }
  .top-acct { display: flex; }
  .content { padding: var(--s4) var(--s4) var(--s7); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: var(--s5) 0 var(--s6); gap: var(--s6); }
  .hero-slip { max-width: 480px; }
  .feat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat > div { border-top: 1px solid var(--rule-2) !important; border-left: 1px solid var(--rule-2) !important; }
  .feat > div:nth-child(odd) { border-left: 0 !important; }
  .feat > div:nth-child(-n+2) { border-top: 0 !important; }
  .price-row { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-left: auto; margin-right: auto; }
  .price.featured { transform: none; }
}
@media (max-width: 760px) {
  .grid.c2, .grid.c3, .row, .row.r3, .row.r4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 23px; }
  .page-head { gap: var(--s3); margin-bottom: var(--s4); align-items: flex-start; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .panel { padding: var(--s4); margin-bottom: var(--s4); }
  .grid { gap: var(--s4); margin-bottom: var(--s4); }
  .panel-head { padding: var(--s3) var(--s4); }
  .slip { padding: var(--s5) var(--s4) 96px var(--s5); }
  .slip-head .doc { text-align: left; }
  .slip .totals { width: 100%; }
  .stamp { left: 20px; bottom: 36px; font-size: 20px; }
  dl.kv { grid-template-columns: 116px minmax(0, 1fr); }
  .authbox { padding: var(--s5); }
  .filters input[type=search] { min-width: 0; max-width: none; flex-basis: 100%; }
  .filters select { flex: 1 1 140px; }
  .feat { grid-template-columns: minmax(0, 1fr); }
  .feat > div { border-left: 0 !important; border-top: 1px solid var(--rule-2) !important; }
  .feat > div:first-child { border-top: 0 !important; }
  .figures .val { font-size: 22px; }
  .figures > div { padding: var(--s3) var(--s4); }
  .tabs a { padding: 8px 12px 7px; font-size: 13.5px; }
  .tabs a[aria-current="page"] { padding-top: 10px; }
  .panel div[style*="repeat(12"] { gap: 3px !important; }
  .panel div[style*="repeat(12"].small { font-size: 10.5px; }
  .copybox { flex-wrap: wrap; }
  .table-wrap > table.t { min-width: 600px; }
  .copybox input { flex: 1 1 200px; }
  .banner .btn, .banner form { margin-left: 0; }
}
@media (max-width: 520px) {
  .figures { grid-template-columns: minmax(0, 1fr); }
  .figures > div { border-left: 0 !important; border-top: 1px solid var(--rule-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: var(--s3); }
  .figures > div:first-child { border-top: 0; }
  .figures .lbl { grid-column: 1; }
  .figures .val { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: center; font-size: 21px; }
  .figures .hint { grid-column: 1; }
  .topbar .who { margin-left: auto; gap: 6px; }
  .topbar .who > .chip { display: none; }
  .plain-top { padding: var(--s3) var(--s4); }
  .land { padding: 0 var(--s4); }
  .hero-slip { transform: rotate(1deg); }
  .hero-slip::before { inset: 12px -4px -10px 6px; }
  .hero .cta .btn { flex: 1 1 100%; }
  .plain-main { padding: var(--s4) var(--s3); }
  .authbox::before { inset: 5px -2px -6px 3px; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .paybar .btn { padding: 12px 16px; }
}
@media (max-width: 380px) {
  .papp-top .t { font-size: 14px; }
  .papp-acts { gap: 6px; }
  .kid .owe .amt { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .topbar, .page-head .actions, .no-print, .flash, .banner, .paybar, .lang-switch, .tabs, .papp-top { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff !important; color: #000; }
  .panel, .figures, .slip, .authbox, .kid, .price { box-shadow: none !important; background: #fff !important; }
  .slip { border: 0; padding: 0 0 96px; max-width: none; }
  .slip::before, .slip::after, .authbox::before, .hero-slip::before, .hero-slip::after { display: none; }
  .stamp { -webkit-mask-image: none; mask-image: none; box-shadow: none; mix-blend-mode: normal; }
  table.t th { background: none !important; }
  .chip { box-shadow: none; background: none; }
  a { color: inherit; text-decoration: none; }
  .grid:has(.slip) > :not(:has(.slip)), .slip ~ .form-actions, .form-actions:has(+ .slip) { display: none !important; }
  .grid:has(.slip) { display: block; }
  .btn, input, select, textarea { box-shadow: none !important; background: #fff !important; }
}
