/* Tsona – Finance Admin · plain CSS, no build step.
   Look: a ledger book on a dark green desk – cream paper, ruled lines, brass coins, serif headings and typewriter
   figures; the navigation is a row of coloured index tabs sticking out of the book.
   Sections: fonts · tokens · base · desk + top bar · menus · coin switch · book + tabs · layout · overview · tables ·
   stamps · invoices · budgets · reports · accounts · settings · forms · overlays · login · responsive · print */

/* fonts (SIL Open Font License, see assets/fonts/OFL.txt) */
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap; src: url("../fonts/literata-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap; src: url("../fonts/literata-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap; src: url("../fonts/literata-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Noto Serif Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-serif-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-400-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }

/* tokens */
:root {
    --serif: "Literata", "Noto Serif Georgian", Georgia, serif;
    --sans: "IBM Plex Sans", "Noto Sans Georgian", system-ui, sans-serif;
    --mono: "IBM Plex Mono", "IBM Plex Sans", "Noto Sans Georgian", ui-monospace, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] {
    color-scheme: light;
    --desk: #163a2e; --desk-2: #1e4a3b; --desk-ink: #ece5d2; --desk-muted: #a9bba9;
    --paper: #f7f2e6; --paper-2: #efe7d4; --card: #fffdf7; --line: #ddd2ba; --rule: #e9dfc9;
    --ink: #1e2a24; --muted: #6b6655; --faint: #9b9480;
    --green: #2f6f4f; --green-ink: #1f5a40; --green-soft: #e2ecdf; --red: #a63c2d; --red-soft: #f6e2dc;
    --brass: #b8893b; --brass-soft: #f4e8cc; --blue: #3f5f86; --blue-soft: #e2e8f1; --plum: #7a4f6d;
    --shadow: 0 24px 50px -30px rgba(40, 30, 10, .45), 0 2px 6px -3px rgba(40, 30, 10, .12);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --desk: #08110d; --desk-2: #0f1d17; --desk-ink: #e6dfcc; --desk-muted: #8fa194;
    --paper: #141d19; --paper-2: #1a2520; --card: #1b2722; --line: #2f3d36; --rule: #26332d;
    --ink: #ebe4d2; --muted: #aaa591; --faint: #7a786c;
    --green: #7cc49a; --green-ink: #3f8a63; --green-soft: rgba(124, 196, 154, .13); --red: #e28d7b; --red-soft: rgba(226, 141, 123, .13);
    --brass: #d8ae63; --brass-soft: rgba(216, 174, 99, .14); --blue: #93b3da; --blue-soft: rgba(147, 179, 218, .13); --plum: #c897b9;
    --shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.i18n-wait body { visibility: hidden; }
body { margin: 0; min-height: 100vh; font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--desk) radial-gradient(ellipse at 20% -10%, var(--desk-2), transparent 60%) fixed; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.flag { stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 4px; background: var(--brass); color: #1e2a24; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }

/* desk + top bar */
.desk { max-width: 1600px; margin: 0 auto; padding: 0 18px 28px; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 64px 14px 4px; color: var(--desk-ink); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f3dc9f, #c99a45 55%, #8a6526); box-shadow: 0 3px 0 #6e5020, 0 8px 14px -6px rgba(0, 0, 0, .6); }
.brand-mark i { width: 22px; height: 22px; border: 2.5px solid rgba(60, 40, 10, .55); border-radius: 50%; }
.brand-mark i::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-top: 2.5px solid rgba(60, 40, 10, .7); border-radius: 1px; }
.brand-word { font: 600 21px/1.1 var(--serif); letter-spacing: .01em; }
.brand-word small { display: block; color: var(--desk-muted); font: 400 12px var(--sans); letter-spacing: 0; }
.search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 440px; min-width: 0; margin-left: 18px; padding: 9px 14px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 4px; background: rgba(255, 255, 255, .06); color: var(--desk-muted); text-align: left; }
.search:hover { background: rgba(255, 255, 255, .1); }
.search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 0 6px; border: 1px solid currentColor; border-radius: 3px; font: 500 11.5px var(--mono); opacity: .8; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none; color: inherit; }
.top .icon-btn { color: var(--desk-ink); }
.icon-btn:hover { background: rgba(127, 127, 100, .16); }
.dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border: 2px solid var(--desk); border-radius: 50%; background: #e0715d; }
[data-theme="dark"] .t-sun, [data-theme="light"] .t-moon { display: none; }
.me { padding: 0; border: 0; background: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brass-soft); color: var(--ink); font: 600 13px var(--sans); box-shadow: inset 0 0 0 2px var(--brass); flex: none; }
.top .avatar { background: #efe3c3; color: #1e2a24; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* menus */
.dd { position: relative; }
.menu { position: absolute; z-index: 50; min-width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.menu > a, .menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 4px; background: none; text-align: left; text-decoration: none; }
.menu > a:hover, .menu > button:hover { background: var(--paper-2); }
.me-menu { right: 0; top: calc(100% + 8px); }
.me-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.me-who b { display: block; }
.me-who small { color: var(--muted); }
.me-theme { display: none !important; }
.bell-menu { right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 28px)); padding: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 360px; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.bell-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 10px; border-radius: 4px; font-size: 14px; }
.bell-list li.is-new { background: var(--brass-soft); }
.bell-list small { display: block; color: var(--muted); font-size: 12.5px; }
.bell-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: var(--ic); }
.bell-ico svg { width: 17px; height: 17px; }
.link { padding: 0; border: 0; background: none; color: var(--green); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* language switch: a stack of coins, the flag is the face */
.coin { display: inline-grid; width: 42px; height: 42px; padding: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #f6e3ad, #c99a45 58%, #8a6526); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35), 0 3px 0 #6e5020, 0 6px 10px -4px rgba(0, 0, 0, .45); transition: transform .35s var(--ease); flex: none; }
.coin.mini { width: 30px; height: 30px; padding: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 2px 0 #6e5020; }
.coin-face { display: grid; overflow: hidden; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(80, 55, 15, .55); }
.coin-face .flag { width: 100%; height: 100%; transform: scale(1.7); }
.coin-btn { display: flex; align-items: center; gap: 8px; padding: 4px 12px 6px 5px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 30px; background: rgba(255, 255, 255, .06); color: var(--desk-ink); }
.coin-btn:hover .coin { transform: rotate(-20deg); }
.coin-code { font: 500 12.5px var(--mono); letter-spacing: .08em; }
.coin-menu { right: 0; top: calc(100% + 10px); width: 250px; padding: 14px; background: linear-gradient(170deg, var(--card), var(--paper-2)); }
.coin-head { margin: 0 0 10px 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.coin-stack { display: grid; gap: 2px; }
.coin-opt { display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 6px; background: none; text-align: left; }
.coin-opt:hover { background: var(--paper); }
.coin-opt:hover .coin { transform: translateY(-3px) rotate(-14deg); }
.coin-text b { display: block; font-weight: 600; }
.coin-text small { color: var(--muted); font: 500 11.5px var(--mono); letter-spacing: .1em; }
.coin-opt[aria-current="true"] { background: var(--brass-soft); box-shadow: inset 3px 0 0 var(--brass); }

/* the book: page + index tabs */
.book { display: grid; grid-template-columns: minmax(0, 1fr) 50px; align-items: start; }
.page { position: relative; min-width: 0; min-height: calc(100vh - 100px); padding: 34px clamp(18px, 3.4vw, 48px) 0 clamp(30px, 4.4vw, 64px); border-radius: 4px 2px 2px 4px; background: var(--paper); box-shadow: inset 18px 0 22px -20px rgba(0, 0, 0, .45), 3px 3px 0 -1px var(--paper-2), 6px 6px 0 -2px var(--line), var(--shadow); outline: none; }
.page::before { content: ""; position: absolute; top: 24px; bottom: 24px; left: 13px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line) 0 9px, transparent 9px 18px); }
.tabs { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 5px; padding-top: 36px; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 44px; padding: 12px 0 14px; border-radius: 0 9px 9px 0; background: var(--tc); color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; box-shadow: inset 6px 0 8px -6px rgba(0, 0, 0, .35), 2px 2px 0 rgba(0, 0, 0, .15); transform: translateX(-6px); transition: transform .2s var(--ease), width .2s var(--ease); }
.tab span { writing-mode: vertical-rl; }
.tab svg { width: 18px; height: 18px; }
.tab:hover { transform: translateX(-2px); }
.tab[aria-current="page"] { width: 50px; background: var(--paper); color: var(--tc); transform: translateX(-2px); box-shadow: inset 0 3px 0 var(--tc), 2px 2px 0 rgba(0, 0, 0, .12); }
.tab-badge { min-width: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: var(--red); font: 600 11px/20px var(--mono); text-align: center; }
.tab[aria-current="page"] .tab-badge { background: var(--red); color: #fff; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 40px; padding: 16px 0 22px; border-top: 3px double var(--line); color: var(--faint); font-size: 12.5px; }

/* page layout */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 3px double var(--line); }
.eyebrow { margin-bottom: 6px; color: var(--brass); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.page-head h1 { font-size: clamp(28px, 3.3vw, 40px); }
.lead { max-width: 66ch; margin-top: 8px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.sheet { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: 0 12px 26px -24px rgba(60, 40, 10, .5); }
.sheet-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 19px; }
.sheet-head p { margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.keys > span { display: inline-flex; align-items: center; gap: 6px; }
.keys i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.keys i.line { height: 3px; border-radius: 2px; }
.empty { padding: 30px; color: var(--muted); text-align: center; font-family: var(--serif); }

/* overview */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi { position: relative; display: grid; gap: 2px; min-width: 0; padding: 16px 18px 12px; border: 1px solid var(--line); border-top: 4px solid var(--kc, var(--brass)); border-radius: 4px; background: var(--card); }
.kpi[data-kpi="income"] { --kc: var(--green); } .kpi[data-kpi="expense"] { --kc: var(--red); } .kpi[data-kpi="receivable"] { --kc: var(--blue); }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi b { font: 500 clamp(21px, 2vw, 26px)/1.25 var(--mono); letter-spacing: -.02em; overflow-wrap: anywhere; }
.delta { color: var(--muted); font-size: 12.5px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 100%; height: 32px; margin-top: 6px; stroke: var(--kc, var(--brass)); stroke-width: 1.8; }
.spark .area { fill: color-mix(in srgb, var(--kc, var(--brass)) 14%, transparent); stroke: none; }
.chart { position: relative; height: 270px; }
.chart > svg { width: 100%; height: 100%; overflow: visible; stroke: none; }
.chart .grid-line { stroke: var(--rule); stroke-width: 1; }
.chart .zero { stroke: var(--line); stroke-width: 1.5; }
.chart .axis { fill: var(--faint); font: 500 11px var(--mono); }
.chart .bar-in { fill: var(--green); } .chart .bar-out { fill: var(--red); opacity: .82; }
.chart .net-line { fill: none; stroke: var(--brass); stroke-width: 2.4; }
.chart .net-dot { fill: var(--card); stroke: var(--brass); stroke-width: 2; }
.chart .fc-line { fill: none; stroke: var(--green); stroke-width: 2.2; }
.chart .fc-area { fill: color-mix(in srgb, var(--green) 12%, transparent); }
.chart .fc-low { stroke: var(--red); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .fc-ev-in { fill: var(--green); } .chart .fc-ev-out { fill: var(--red); }
.chart .today { stroke: var(--brass); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.chart .is-hover { opacity: 1 !important; filter: brightness(1.1); }
.tip { position: absolute; z-index: 5; min-width: 150px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.tip b { display: block; font-family: var(--serif); }
.tip div { display: flex; justify-content: space-between; gap: 14px; }
.tip span.mono { font-size: 12.5px; }
.cat-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cat-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.cat-bars .bar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.cat-bars .bar i { display: block; height: 100%; border-radius: 4px; background: var(--cc); }
.cat-bars b { font: 500 13.5px var(--mono); }
.cdot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--cc); vertical-align: 1px; }
.due { display: grid; margin: 0; padding: 0; list-style: none; }
.due li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.due li:last-child { border-bottom: 0; }
.due time { display: grid; place-items: center; width: 50px; padding: 4px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font: 500 11px/1.2 var(--mono); text-align: center; color: var(--muted); }
.due time b { display: block; color: var(--ink); font-size: 17px; }
.due .who { min-width: 0; }
.due .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.due .who small { color: var(--muted); font-size: 12.5px; }
.due .amt { text-align: right; }
.due .amt b { display: block; font: 500 14px var(--mono); }
.due .amt .btn { white-space: normal; text-align: right; }

/* tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.table-wrap.flat { border: 0; }
.sheet .table-wrap { border: 0; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1.5px solid var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
td.num, th.num { text-align: right; }
td.num { font-family: var(--mono); font-size: 14px; }
.ledger td.desc { white-space: normal; min-width: 220px; }
.ledger td.desc b { font-weight: 600; }
.ledger td.desc small { display: block; color: var(--muted); font-size: 12.5px; }
.ledger td.date { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.ledger tr.is-selected td { background: var(--brass-soft); }
.tick-col { width: 42px; padding-right: 0; }
.tick { width: 18px; height: 18px; margin: 0; accent-color: var(--green); vertical-align: middle; }
.sort { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.sort::after { content: " ↕"; opacity: .4; }
.sort[data-dir="asc"]::after { content: " ↑"; opacity: 1; }
.sort[data-dir="desc"]::after { content: " ↓"; opacity: 1; }
.chip-select { max-width: 190px; padding: 4px 26px 4px 10px; border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--line)); border-radius: 3px; background-color: var(--card); font-size: 13.5px; }
.rec { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--line); border-radius: 50%; background: none; color: transparent; }
.rec svg { width: 16px; height: 16px; stroke-width: 2.4; }
.rec:hover { border-color: var(--green); color: var(--faint); }
.rec[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff; }
.sum-line { margin: -4px 0 12px; color: var(--muted); font-size: 13.5px; }
.sum-line b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.bulk { position: sticky; top: 10px; z-index: 10; display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-bottom: 12px; padding: 10px 14px; border-radius: 4px; background: var(--desk); color: var(--desk-ink); box-shadow: var(--shadow); }
.bulk > b { align-self: center; }
.bulk .mini-field span { color: var(--desk-muted); }
.bulk .btn { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: var(--desk-ink); }
.bulk .btn:hover { background: rgba(255, 255, 255, .16); }
.more { display: flex; justify-content: center; margin-top: 14px; }
.tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-bottom: 16px; }
.tools .field-search { flex: 1 1 220px; max-width: 340px; }
.mini-field { display: grid; gap: 3px; min-width: 0; }
.mini-field > span { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.mini-field .select, .mini-field .input { padding-top: 7px; padding-bottom: 7px; }

/* stamps (status) */
.stamp { display: inline-block; padding: 2px 9px; border: 1.5px solid currentColor; border-radius: 3px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.stamp.is-paid { color: var(--green); transform: rotate(-3deg); }
.stamp.is-sent { color: var(--blue); }
.stamp.is-draft { color: var(--faint); border-style: dashed; }
.stamp.is-overdue { color: var(--red); background: var(--red-soft); }

/* invoices */
.aging-sheet { margin-bottom: 22px; }
.aging { display: grid; gap: 14px; }
.aging-bar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; background: var(--paper-2); }
.aging-bar i { height: 100%; background: var(--ac); transition: width .4s var(--ease); }
.aging-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.aging-keys div { padding: 10px 12px; border-left: 4px solid var(--ac); background: var(--paper); }
.aging-keys small { display: block; color: var(--muted); font-size: 12.5px; }
.aging-keys b { font: 500 17px var(--mono); }
.lines { margin: 4px 0; }
.lines th, .lines td { padding: 6px 6px; border-bottom: 1px solid var(--rule); }
.lines td:first-child { width: 50%; }
.lines .input { padding: 7px 9px; }
.lines td.num { width: 110px; }
.lines .qty { width: 70px; text-align: right; }
.lines .price { width: 110px; text-align: right; }
.totals { display: grid; justify-content: end; gap: 4px; margin-top: 6px; font-size: 14.5px; }
.totals div { display: grid; grid-template-columns: auto 140px; gap: 16px; }
.totals span:last-child { font-family: var(--mono); text-align: right; }
.totals .grand { padding-top: 6px; border-top: 1.5px solid var(--ink); font-weight: 600; font-size: 17px; }
.check-field { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 42px; }
.check-field span { color: var(--ink) !important; font-size: 14.5px !important; }
.paper { padding: clamp(18px, 4vw, 40px); border: 1px solid var(--line); background: #fffef9; color: #1e2a24; font-size: 14px; box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .4); }
.paper header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 3px double #d8ccb0; }
.paper h3 { font-size: 24px; }
.paper .meta { display: grid; gap: 2px; text-align: right; }
.paper .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0; }
.paper .parties small { display: block; color: #6b6655; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.paper table th { color: #6b6655; border-bottom-color: #1e2a24; }
.paper table td { border-bottom-color: #ece3cf; }
.paper .totals { margin-top: 14px; }
.paper .totals .grand { border-top-color: #1e2a24; }
.paper footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #ece3cf; color: #6b6655; font-size: 12.5px; }
.paper .stamp { margin-top: 10px; }

/* budgets */
.month-nav { align-items: center; gap: 6px; }
.month-nav b { min-width: 150px; font: 600 18px var(--serif); text-align: center; }
.month-nav .icon-btn { border-color: var(--line); background: var(--card); }
.bu-summary { display: grid; justify-items: center; align-content: start; gap: 16px; position: relative; }
.ring { width: 180px; height: 180px; stroke: none; }
.ring circle { fill: none; stroke-width: 12; }
.ring-bg { stroke: var(--paper-2); }
.ring-fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease), stroke .3s; }
.ring-fg.is-warn { stroke: var(--brass); } .ring-fg.is-over { stroke: var(--red); }
.ring-text { position: absolute; top: 20px; display: grid; place-items: center; align-content: center; gap: 4px; width: 180px; height: 180px; text-align: center; }
.ring-text b { font: 500 30px/1 var(--mono); }
.ring-text small { color: var(--muted); }
.facts { display: grid; width: 100%; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); }
.budgets { display: grid; margin: 0 0 16px; padding: 0; list-style: none; }
.budgets li { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) 160px 74px; align-items: center; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.budgets .name { font-weight: 600; }
.budgets .track { position: relative; height: 12px; border-radius: 2px; background: var(--paper-2); }
.budgets .track i { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; border-radius: 2px; background: var(--cc); }
.budgets li.is-over .track i { background: repeating-linear-gradient(-45deg, var(--red) 0 6px, color-mix(in srgb, var(--red) 70%, transparent) 6px 12px); }
.budgets .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); left: var(--pace); }
.budgets .amt { font: 500 13.5px var(--mono); text-align: right; white-space: nowrap; }
.budgets .amt small { display: block; color: var(--muted); font-family: var(--sans); font-size: 12px; }
.budgets li.is-over .amt small { color: var(--red); font-weight: 600; }
.budgets .limit-input { width: 110px; padding: 6px 8px; text-align: right; }
.budget-add { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding-top: 6px; }
.budget-add .input { width: 140px; }

/* reports */
.statement { font-size: 14px; }
.statement th, .statement td { padding: 8px 12px; }
.statement th:first-child, .statement td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 190px; white-space: normal; }
.statement td { font-family: var(--mono); font-size: 13.5px; text-align: right; }
.statement td:first-child { font-family: var(--sans); font-size: 14px; text-align: left; }
.statement th { text-align: right; }
.statement th:first-child { text-align: left; }
.statement tr.group td { padding-top: 16px; border-bottom: 0; font-family: var(--serif); font-weight: 600; text-align: left; }
.statement tr.sub td:first-child { padding-left: 24px; color: var(--muted); }
.statement tr.total td { border-top: 1px solid var(--ink); font-weight: 600; }
.statement tr.net td { border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 600; font-size: 15px; }
.statement tr.margin td { color: var(--muted); border-bottom: 0; }
.statement td.sum-col, .statement th.sum-col { background: var(--paper); }
.donut-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 20px; }
.donut { width: 200px; height: 200px; stroke: none; }
.donut path { stroke: var(--card); stroke-width: 2; transition: opacity .2s; }
.donut text { fill: var(--ink); font: 500 15px var(--mono); }
.donut text.small { fill: var(--muted); font: 400 11px var(--sans); }
.legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.legend li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.legend b { font: 500 13px var(--mono); }
.legend small { min-width: 40px; color: var(--muted); font-family: var(--mono); text-align: right; }

/* accounts */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 22px; }
.acct { position: relative; display: grid; gap: 4px; min-width: 0; padding: 18px 20px 14px; border-radius: 6px; background: linear-gradient(150deg, color-mix(in srgb, var(--ac) 88%, #000), var(--ac)); color: #f6f0df; box-shadow: var(--shadow); overflow: hidden; }
.acct::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border: 18px solid rgba(255, 255, 255, .07); border-radius: 50%; }
.acct .bank { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.acct h3 { font-size: 18px; }
.acct .iban { font: 500 12.5px var(--mono); letter-spacing: .06em; opacity: .8; }
.acct .bal { margin-top: 8px; font: 500 24px var(--mono); }
.acct .conv { font-size: 12.5px; opacity: .8; }
.acct svg.spark { stroke: rgba(255, 255, 255, .8); }
.acct svg.spark .area { fill: rgba(255, 255, 255, .12); }
.convert { color: var(--muted); font-size: 13.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.mix { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.mix li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.mix .cur { display: grid; place-items: center; height: 40px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font: 500 13px var(--mono); }
.mix .bar { height: 10px; border-radius: 2px; background: var(--paper-2); overflow: hidden; }
.mix .bar i { display: block; height: 100%; background: var(--brass); }
.mix b { font: 500 14px var(--mono); }
.mix small { display: block; color: var(--muted); font-size: 12px; text-align: right; }

/* settings */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings > div:not(.set-nav) { display: grid; gap: 20px; min-width: 0; }
.set-nav { position: sticky; top: 20px; display: grid; gap: 2px; border-left: 1.5px solid var(--line); }
.set-nav button { margin-left: -1.5px; padding: 9px 14px; border: 0; border-left: 3px solid transparent; background: none; color: var(--muted); font-weight: 600; text-align: left; }
.set-nav button[aria-selected="true"] { border-left-color: var(--brass); color: var(--ink); background: linear-gradient(90deg, var(--brass-soft), transparent); }
.cat-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.cat-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr) 150px auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.cat-list input[type="color"] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); cursor: pointer; }
.cat-list .uses { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.switches { display: grid; margin: 0; padding: 0; list-style: none; }
.switches li { border-bottom: 1px solid var(--rule); }
.switches li:last-child { border-bottom: 0; }
.switches label { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; cursor: pointer; }
.switches b { display: block; font-weight: 600; }
.switches small { color: var(--muted); font-size: 13px; }
.switch { -webkit-appearance: none; appearance: none; position: relative; width: 44px; height: 24px; margin: 0; border-radius: 12px; background: var(--line); transition: background .2s; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.danger-zone h2 { font-size: 17px; }
.danger-zone p { color: var(--muted); font-size: 13.5px; }

/* forms + buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .1s; }
.btn:hover { border-color: var(--brass); background: var(--brass-soft); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { border-color: var(--green-ink); background: var(--green-ink); color: #fbf7ea; box-shadow: 0 2px 0 color-mix(in srgb, var(--green-ink) 60%, #000); }
.btn-primary:hover { border-color: var(--green-ink); background: color-mix(in srgb, var(--green-ink) 85%, #000); }
.btn-danger { border-color: var(--red); background: var(--red); color: #fff; }
.btn-danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 85%, #000); }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .field > label { color: var(--muted); font-size: 13px; font-weight: 600; }
.input, .select { width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); outline: none; transition: border-color .2s, box-shadow .2s; }
.input[type="date"] { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; min-height: 42px; }
.input[type="date"]::-webkit-date-and-time-value { min-height: 1.4em; text-align: left; }
.select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field.is-invalid .input, .field.is-invalid .select, .input.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 600; }
.field-search { position: relative; }
.field-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; color: var(--faint); pointer-events: none; }
.field-search .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.seg button, .seg label { display: inline-flex; align-items: center; padding: 7px 13px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.seg > :last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: -2px; }
.seg-wide { display: flex; }
.seg-wide label { flex: 1; justify-content: center; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.row-actions button:hover { background: var(--paper-2); color: var(--ink); }
.row-actions svg { width: 17px; height: 17px; }
.row-gap { display: flex; align-items: center; gap: 8px; }

/* overlays */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
dialog.modal-wide { width: min(780px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(12, 26, 20, .5); }
dialog.modal[open] { animation: pop .2s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; border-bottom: 3px double var(--line); }
.modal-head h2 { font-size: 20px; }
.modal-body { display: grid; gap: 14px; padding: 18px 22px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--rule); }
.modal-foot .btn-danger { margin-right: auto; }
.paper-modal .modal-body { background: var(--paper-2); }
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 14vh 12px 12px; background: rgba(12, 26, 20, .45); }
.palette-box { width: min(600px, 100%); border: 1px solid var(--line); border-radius: 6px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 3px double var(--line); }
.palette-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; }
.palette-list { max-height: 52vh; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 4px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--brass-soft); box-shadow: inset 3px 0 0 var(--brass); }
.palette-list li small { margin-left: auto; color: var(--muted); font: 500 12.5px var(--mono); }
.palette-group { padding: 8px 12px 4px; color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: default !important; }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 95; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 4px; background: var(--desk); color: var(--desk-ink); box-shadow: var(--shadow); font-size: 14px; animation: pop .25s var(--ease); }
[data-theme="dark"] .toast { background: #22322b; }
.toast span { flex: 1; }
.toast svg { width: 18px; height: 18px; color: var(--brass); }
.toast button { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 3px; background: none; color: inherit; font-weight: 600; font-size: 13px; }
.toast.is-out { opacity: 0; transform: translateY(10px); transition: .25s; }

/* login + 404 */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(980px, 100%); border-radius: 6px; background: var(--paper); box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--desk) 70%, #000); overflow: hidden; }
.auth-page { display: grid; align-content: center; gap: 22px; padding: clamp(24px, 4.5vw, 52px); box-shadow: inset -22px 0 26px -26px rgba(0, 0, 0, .5); }
.auth-page h1 { font-size: 32px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-top .brand { color: var(--ink); }
.auth-top .coin-btn { border-color: var(--line); background: var(--card); color: var(--ink); }
.auth-art { position: relative; display: grid; align-content: space-between; gap: 24px; padding: 44px 40px 36px; background: var(--paper-2) repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px); box-shadow: inset 22px 0 26px -26px rgba(0, 0, 0, .5); }
.auth-art::before { content: ""; position: absolute; top: 0; bottom: 0; left: 64px; width: 1.5px; background: color-mix(in srgb, var(--red) 45%, transparent); }
.ruled { display: grid; gap: 14px; padding-left: 40px; }
.ruled span { height: 18px; width: var(--w); border-radius: 2px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.stack { position: absolute; right: 44px; top: 170px; display: grid; }
.stack i { width: 92px; height: 18px; margin-top: -6px; border-radius: 50%; background: linear-gradient(#e6c57c, #a77b30); box-shadow: 0 3px 0 #6e5020; }
.stack i:nth-child(2) { margin-left: 6px; } .stack i:nth-child(4) { margin-left: -5px; }
.auth-quote { position: relative; padding-left: 40px; font: 600 19px/1.45 var(--serif); }
.auth-quote small { display: block; margin-top: 10px; color: var(--muted); font: 400 13px var(--sans); }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw button { position: absolute; right: 4px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.lost { display: grid; place-items: center; min-height: 100vh; padding: 70px 16px 30px; }
.lost-sheet { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; width: min(560px, 100%); padding: clamp(24px, 5vw, 48px); border-radius: 4px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.lost-no { font: 500 72px/1 var(--mono); color: var(--brass); letter-spacing: -.04em; }
.lost-rows { display: grid; gap: 8px; width: 100%; }
.lost-rows span { height: 12px; border-bottom: 1px solid var(--rule); }
.lost-rows .is-gap { border-bottom: 2px dashed var(--red); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.lost h1 { font-size: clamp(24px, 4vw, 30px); }
.lost p { max-width: 420px; color: var(--muted); }
.lost .btn { white-space: normal; }
.lost-lang { position: fixed; top: 16px; right: 16px; z-index: 5; }

/* responsive */
@media (max-height: 860px) and (min-width: 901px) {
    .tab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .tab { padding: 14px 0; }
}
@media (max-width: 1280px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
    .bu-summary { grid-template-columns: 180px minmax(0, 1fr); align-items: center; justify-items: start; }
    .ring-text { top: 20px; left: 22px; }
}
@media (max-width: 900px) {
    .desk { padding: 0 0 84px; }
    .top { padding: 10px 12px; gap: 8px; }
    .search { margin-left: auto; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
    .search span, .search kbd { display: none; }
    .top-actions { margin-left: 0; gap: 4px; }
    .book { grid-template-columns: minmax(0, 1fr); }
    .page { min-height: 0; padding: 24px 16px 0 26px; border-radius: 0; box-shadow: inset 14px 0 16px -16px rgba(0, 0, 0, .45); }
    .page::before { left: 9px; }
    .tabs { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: row; gap: 4px; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: none; background: var(--desk); box-shadow: 0 -8px 20px -10px rgba(0, 0, 0, .5); }
    .tab { flex: 1 0 auto; flex-direction: row; justify-content: center; width: auto; min-width: 64px; padding: 10px 12px 14px; border-radius: 9px 9px 0 0; transform: translateY(6px); }
    .tab span { writing-mode: horizontal-tb; }
    .tab:hover { transform: translateY(3px); }
    .tab[aria-current="page"] { width: auto; transform: translateY(0); box-shadow: inset 0 3px 0 var(--tc); }
    .tab:not([aria-current="page"]) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .tab-badge { position: absolute; top: 2px; right: 4px; }
    .grid { gap: 16px; }
    .span-6 { grid-column: span 12; }
    .settings { grid-template-columns: minmax(0, 1fr); }
    .set-nav { position: static; display: flex; overflow-x: auto; border-left: 0; border-bottom: 1.5px solid var(--line); }
    .set-nav button { margin: 0 0 -1.5px; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .set-nav button[aria-selected="true"] { border-bottom-color: var(--brass); background: none; }
    .auth-book { grid-template-columns: minmax(0, 1fr); }
    .auth-art { display: none; }
    .aging-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .toasts { bottom: 90px; }
}
@media (max-width: 640px) {
    .brand-word small { display: none; }
    .brand-word { font-size: 19px; }
    .coin-btn { padding-right: 9px; }
    .icon-btn { width: 36px; height: 36px; }
    .kpis { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .sheet { padding: 16px; }
    .page-head .head-actions { width: 100%; }
    .page-head .head-actions .btn { flex: 1; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .tools .mini-field { flex: 1 1 140px; }
    .tools .seg { width: 100%; }
    .budgets li { grid-template-columns: minmax(0, 1fr) auto; }
    .budgets .track { grid-column: 1 / -1; grid-row: 2; }
    .budgets .row-actions { grid-row: 1; grid-column: 2; }
    .budgets .amt { grid-row: 3; grid-column: 1 / -1; text-align: left; }
    .bu-summary { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .ring-text { left: 50%; margin-left: -90px; top: 16px; }
    .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .legend { width: 100%; }
    .cat-list li { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .cat-list li .select { grid-column: 2; }
    .cat-list .uses { grid-column: 2; }
    .due li { grid-template-columns: 50px minmax(0, 1fr); }
    .due .amt { grid-column: 2; text-align: left; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
    .due .amt .btn { padding-left: 0; text-align: left; }
    .paper .parties { grid-template-columns: minmax(0, 1fr); }
    .totals div { grid-template-columns: auto 110px; }
    .toasts { right: 12px; width: calc(100vw - 24px); }
    .chart { height: 230px; }
}
@media (max-width: 380px) {
    .top-theme { display: none !important; }
    .me-theme { display: flex !important; }
    .coin-code { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
    body { background: #fff; }
    .top, .tabs, .foot, .toasts, .head-actions, .tools, .bulk { display: none !important; }
    .desk { padding: 0; }
    .page { box-shadow: none; padding: 0; }
    .page::before { display: none; }
    .sheet { box-shadow: none; break-inside: avoid; }
    body.printing-invoice .desk { display: none; }
    body.printing-invoice dialog.paper-modal { position: static; display: block; width: 100%; max-height: none; border: 0; box-shadow: none; }
    body.printing-invoice .paper-modal .modal-head { display: none; }
    body.printing-invoice .paper-modal .modal-body { padding: 0; background: #fff; }
}
