/* RDMNS Finance — design tokens & components (follows the studio UI/UX spec) */
:root {
  --blue: #4f93c9; --blue-deep: #2e6ca4; --blue-tint: #eaf2fa; --blue-tint2: #dcebf7;
  --ink: #16181d; --ink-2: #4a4f59; --ink-3: #878d99;
  --line: #e7eaef; --line-2: #eef1f5; --bg: #f6f7f9; --surface: #fff;
  --ok: #1f9d55; --okbg: #e7f6ee; --warn: #c2410c; --warnbg: #fdeee5;
  --red: #dc2626; --redbg: #fdeaea; --amber: #b45309; --amberbg: #fdf3e3;
  --shadow: 0 1px 2px rgba(20,24,40,.04), 0 8px 24px rgba(20,24,40,.06);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --vh: 100vh;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: var(--blue-deep); text-decoration: none; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--ink-3); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .bad { color: var(--red); } .amber { color: var(--amber); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .25s; }
.loader img { width: 96px; animation: pulse 1.4s ease-in-out infinite; }
.loader.out { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.96); } }
.fade-in { animation: fadein .3s ease both; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: #f2f3f5; }
.login-col { width: 100%; max-width: 380px; text-align: center; }
.login-badge { width: 64px; height: 64px; border-radius: 16px; background: var(--ink); display: grid; place-items: center; margin: 0 auto 18px; }
.login-badge img { width: 44px; }
.login h1 { font-size: 22px; letter-spacing: -.4px; }
.login .muted { margin: 4px 0 22px; }
.login-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; text-align: left; display: grid; gap: 12px; }
.login-card label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: grid; gap: 5px; }
.login-card input { background: #f2f3f5; border-color: transparent; }
.btn-pill { border: 0; border-radius: 30px; background: #000; color: #fff; font: 600 15px var(--font); padding: 13px; cursor: pointer; margin-top: 4px; }
.btn-pill:disabled { opacity: .6; }
.banner { border-radius: 10px; padding: 9px 12px; font-size: 13px; background: var(--redbg); color: var(--red); }
.banner.ok { background: var(--okbg); color: var(--ok); }
.hint { font-size: 12px; color: var(--ink-3); margin: 0; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.brand img { width: 40px; }
.brand b { display: block; font-size: 16px; letter-spacing: -.2px; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--ink-3); }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; overscroll-behavior: contain; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font: 500 14px var(--font); border: 0; background: none; cursor: pointer; text-align: left; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--line-2); }
.nav-item.active { background: var(--blue-tint); color: var(--blue-deep); font-weight: 650; }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--warnbg); color: var(--warn); border-radius: 20px; padding: 0 7px; font-weight: 700; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px 14px; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); padding: 2px 10px 6px; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.sync.saving i { background: var(--blue); } .sync.error i { background: var(--red); }
.main { min-width: 0; padding: 30px 38px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); }
.hamburger { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.actions:empty { display: none; }
.actions .spacer { flex: 1; }
.scrim { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn.primary:hover { background: #255d90; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--redbg); border-color: #f6c9c9; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.ibtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-3); display: inline-grid; place-items: center; cursor: pointer; transition: all .12s; }
.ibtn:hover { border-color: var(--line); background: var(--surface); color: var(--ink); }
.ibtn.del:hover { color: var(--red); border-color: #f6c9c9; background: var(--redbg); }
.ibtn.on { color: var(--ok); background: var(--okbg); }
.ibtn svg.i { width: 16px; height: 16px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--okbg); color: var(--ok); }
.pill.red { background: var(--redbg); color: var(--red); }
.pill.orange { background: var(--warnbg); color: var(--warn); }
.pill.amber { background: var(--amberbg); color: var(--amber); }
.pill.blue { background: var(--blue-tint); color: var(--blue-deep); }
.pill.yellow { background: #fdf6da; color: #8a6d00; }

/* ---------- inputs ---------- */
input, select, textarea { font: 14px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,147,201,.18); }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23878d99' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue-deep); padding: 0; }
.inline { width: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; align-content: start; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.search { position: relative; }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; }
.search input { padding-left: 32px; }

/* segmented */
.seg { display: inline-flex; background: #eceef2; border-radius: 20px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 16px; padding: 5px 13px; font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .12s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,24,40,.12); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 4px 11px; font: 600 12px var(--font); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }

/* ---------- cards / panels ---------- */
.panel { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 15px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-3); }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-body { padding: 16px 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .panel { margin-bottom: 0; }
.stack { display: grid; gap: 18px; margin-bottom: 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.kpi .lbl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi .lbl svg.i { width: 16px; color: var(--ink-3); }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--ink-3); }
.kpi.accent { background: linear-gradient(135deg, #4f93c9, #2e6ca4); color: #fff; }
.kpi.accent .lbl, .kpi.accent .lbl svg.i, .kpi.accent .sub { color: rgba(255,255,255,.85); }
.kpi.green .val { color: var(--ok); } .kpi.red .val { color: var(--red); }
.kpi.bl-bank { border-left: 4px solid var(--blue); } .kpi.bl-cash { border-left: 4px solid var(--ok); }

/* ---------- tables ---------- */
.twrap { overflow-x: auto; touch-action: pan-x pan-y; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.t td.wrap { white-space: normal; min-width: 180px; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:hover { background: var(--blue-tint); }
.t .r { text-align: right; font-variant-numeric: tabular-nums; }
.t .acts { text-align: right; width: 1%; }
.t tr.void td { color: var(--ink-3); text-decoration: line-through; }
.t tr.void td.acts, .t tr.void td .pill { text-decoration: none; }
.t tr.linked { background: #f6fafe; }
.t tr.unlinked td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.t tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--line); }
.t tr.hl td { background: var(--amberbg); }
.t .sub { font-size: 11.5px; color: var(--ink-3); }

/* ---------- progress ---------- */
.prog .top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.prog .bar { height: 10px; border-radius: 10px; background: var(--line-2); overflow: hidden; }
.prog .bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #6aa7d8, #2e6ca4); transition: width .4s ease; }
.prog.done .bar i { background: linear-gradient(90deg, #39b56f, #1f9d55); }
.prog .bot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- horizontal bars ---------- */
.hbars { display: grid; gap: 12px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.hbar .lbl span:last-child { color: var(--ink-3); font-weight: 500; }
.hbar .trk { height: 24px; position: relative; }
.hbar .fill { height: 100%; border-radius: 6px; background: var(--blue); transition: width .35s ease; min-width: 4px; display: flex; align-items: center; justify-content: flex-end; }
.hbar .fill.red { background: #e86f5a; } .hbar .fill.green { background: #3aa86b; } .hbar .fill.orange { background: #f08a3c; }
.hbar .amt { font-size: 11.5px; font-weight: 700; white-space: nowrap; padding: 0 8px; font-variant-numeric: tabular-nums; }
.hbar .amt.in { color: #fff; }
.hbar .amt.out { position: absolute; top: 50%; transform: translateY(-50%); color: var(--ink); }

/* month columns chart */
.cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 190px; padding-top: 8px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.col .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.col .pair i { display: block; width: 42%; max-width: 16px; border-radius: 4px 4px 1px 1px; background: var(--blue); transition: height .4s ease; min-height: 2px; }
.col .pair i.e { background: #e86f5a; }
.col span { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: var(--blue); }
.legend i.e { background: #e86f5a; }

/* ---------- account cards ---------- */
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acct { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; border: 2px solid transparent; cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .12s, transform .12s; }
.acct:hover { transform: translateY(-1px); }
.acct.on { border-color: var(--blue); background: var(--blue-tint); }
.acct .n { font-weight: 700; font-size: 14px; }
.acct .m { font-size: 12px; color: var(--ink-3); }
.acct .b { font-size: 20px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }

/* ---------- list rows ---------- */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t2 { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.click { cursor: pointer; } .row.click:hover { background: var(--blue-tint); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 38px 20px; color: var(--ink-3); }
.empty svg.i { width: 34px; height: 34px; stroke-width: 1.4; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; }

/* ---------- picker ---------- */
.picker { position: relative; }
.picker .opts { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.picker .opt { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker .opt:hover, .picker .opt.on { background: var(--blue-tint); }
.picker .opt b { font-weight: 600; } .picker .opt div { font-size: 12px; color: var(--ink-3); }

/* ---------- match suggestions ---------- */
.match { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; transition: all .12s; }
.match:hover { border-color: var(--blue); background: var(--blue-tint); }
.match .grow { flex: 1; min-width: 0; }
.match .t2 { font-size: 12px; color: var(--ink-3); }
.matches { display: grid; gap: 8px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 4px; margin-right: 12px; font: 600 13px var(--font); color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--blue-deep); border-color: var(--blue-deep); }
.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 16px; padding: 12px 14px; background: #fafbfc; border-radius: 10px; }
.info dt { color: var(--ink-3); } .info dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- modal ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15,18,25,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fadein .15s; }
.modal { background: var(--surface); width: 720px; max-width: 100%; max-height: calc(var(--vh) - 40px); border-radius: 18px; box-shadow: 0 24px 60px rgba(15,18,25,.3); display: flex; flex-direction: column; animation: scalein .18s ease; }
.modal.wide { width: 980px; } .modal.narrow { width: 440px; }
@keyframes scalein { from { opacity: 0; transform: scale(.96); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #1d2129; color: #fff; padding: 10px 18px; border-radius: 30px; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop .2s ease; transition: opacity .3s; max-width: 90vw; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--red); }
.toast.out { opacity: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- voucher paper ---------- */
.doc-bar { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: rgba(246,247,249,.92); backdrop-filter: blur(6px); padding: 10px 0; margin: -10px 0 8px; }
.doc-bar .spacer { flex: 1; }
.paper-wrap { overflow-x: auto; padding: 6px 2px 20px; }
.voucher { width: 210mm; min-height: 148mm; background: #fff; margin: 0 auto; box-shadow: 0 2px 6px rgba(20,24,40,.06), 0 14px 40px rgba(20,24,40,.10); padding: 11mm 10mm 7mm; color: #111827; font-family: Inter, var(--font); position: relative; display: flex; flex-direction: column; }
.v-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 7mm; }
.v-head img { width: 25mm; }
.v-head .tt { text-align: right; }
.v-title { font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: #0f172a; text-transform: uppercase; }
.v-org { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: #475569; text-transform: uppercase; margin-top: 4px; }
.v-ref { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: #94a3b8; text-transform: uppercase; margin-top: 3px; display: flex; justify-content: flex-end; align-items: center; gap: 3px; }
.v-lbl { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px; }
.v-box { background: #f8fafc; border: 1px solid #eef2f6; border-radius: 12px; padding: 14px 15px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 6mm; }
.v-val { font-size: 15px; font-weight: 500; color: #111827; }
.v-amt { font-size: 19px; font-weight: 800; color: #0f172a; letter-spacing: -.3px; display: flex; align-items: baseline; gap: 5px; }
.v-words { font-size: 8.5px; font-weight: 700; color: #475569; text-transform: uppercase; margin-top: 3px; letter-spacing: .02em; }
.v-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 4mm; }
.v-line { border-bottom: 1px solid #e5e7eb; padding-bottom: 6px; }
.v-field { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; min-height: 58px; font-size: 15px; }
.v-field.soft { background: #f8fafc; font-style: italic; color: #64748b; font-size: 13.5px; }
.v-foot { margin-top: auto; padding-top: 5mm; border-top: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.v-appr { border: 1px solid #e5e7eb; background: #fafbfc; border-radius: 12px; padding: 11px 15px; width: 50%; }
.v-appr .v-lbl { font-size: 8px; }
.v-appr b { display: block; font-size: 13px; font-weight: 800; letter-spacing: .04em; color: #0f172a; text-transform: uppercase; }
.v-appr span { font-size: 10px; font-weight: 600; color: #475569; }
.v-sig { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: #94a3b8; text-transform: uppercase; text-align: right; }
.v-addr { text-align: center; font-size: 8px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-top: 4mm; padding-top: 3mm; border-top: 1px solid #f1f5f9; letter-spacing: .02em; }
.v-stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-18deg); font-size: 64px; font-weight: 800; color: rgba(220,38,38,.16); border: 6px solid rgba(220,38,38,.16); border-radius: 14px; padding: 2px 24px; letter-spacing: .1em; pointer-events: none; }
.v-in { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: transparent; border: 0; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; width: calc(100% + 8px); box-shadow: none; }
.v-in:hover { background: #fffbe8; }
.v-in:focus { background: #fffbe8; box-shadow: 0 0 0 2px rgba(79,147,201,.45); }
textarea.v-in { resize: none; min-height: 0; overflow: hidden; display: block; }
.v-in.amt { width: 100%; }
select.v-in { background-image: none; padding-right: 4px; appearance: none; cursor: pointer; }
.v-in.ref { width: 26mm; text-align: right; padding: 0 2px; margin: 0; }
.doc-side { max-width: 210mm; margin: 0 auto 18px; }
.paper-scaler { transform-origin: top left; }

/* ---------- report print header ---------- */
.print-only { display: none; }
.rep-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.rep-head img { width: 56px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; height: var(--vh); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .app.drawer .sidebar { transform: none; }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(15,18,25,.35); z-index: 30; }
  .hamburger { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); flex: none; }
  .main { padding: 20px 18px 50px; }
  .form { grid-template-columns: 1fr; }
  .modal, .modal.wide { width: 100%; }
  .cols { gap: 4px; }
}
@media (max-width: 640px) {
  body { font-size: 13.5px; touch-action: pan-y; }
  .main { padding: 0 12px 40px; }
  .page-head { position: sticky; top: 0; z-index: 20; background: rgba(246,247,249,.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin: 0 -12px 12px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .page-head h1 { font-size: 19px; }
  .page-head p { display: none; }
  .actions > .btn, .actions > .seg, .actions > select, .actions > .search, .actions > input { flex: 1 1 100%; }
  .actions > .btn.half { flex: 1 1 calc(50% - 4px); }
  .actions .spacer { display: none; }
  .seg { display: flex; } .seg button { flex: 1; }
  .kpis { grid-template-columns: 1fr; gap: 12px; }
  .kpi .val { font-size: 22px; }
  input, select, textarea { font-size: 16px; }
  .modal-scrim { padding: 0; }
  .modal, .modal.wide, .modal.narrow { width: 100%; height: var(--vh); max-height: none; border-radius: 0; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .left { margin: 0; }
  .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
  .row { padding: 11px 14px; }
  .prog .bar { height: 7px; }
  .v-in { font-size: inherit; }
  .doc-bar .btn { flex: 1 1 calc(50% - 4px); }
  .doc-bar .spacer { display: none; }
  .cols span { font-size: 9px; }
}
@media (max-width: 400px) { .kpi .val { font-size: 20px; } }

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .page-head, .actions, .doc-bar, .doc-side, .toasts, #modalRoot, .no-print, .hamburger, .scrim { display: none !important; }
  .app { display: block; } .main { padding: 0; max-width: none; }
  .panel, .kpi { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
  .print-only { display: block; }
  .twrap { overflow: visible; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  body.print-voucher .voucher { box-shadow: none; margin: 0; width: 100%; min-height: calc(148mm - 2px); }
  body.print-voucher .paper-wrap { padding: 0; overflow: visible; }
  body.print-voucher .paper-scaler { transform: none !important; width: auto !important; height: auto !important; }
  .v-in { background: transparent !important; box-shadow: none !important; }
}

/* ---------- financial statements & approval letters ---------- */
.prog.over .bar i { background: linear-gradient(90deg, #f08a7a, #dc2626); }
.fs-pages { display: grid; gap: 8px; }
.fs-page { width: 210mm; min-height: 297mm; background: #fff; margin: 0 auto; padding: 18mm 17mm 16mm; color: #111; font: 12.5px/1.45 "Times New Roman", Times, Georgia, serif; box-shadow: 0 2px 6px rgba(20,24,40,.06), 0 14px 40px rgba(20,24,40,.10); position: relative; }
.fs-org { font-size: 20px; font-weight: 700; border-bottom: 2px solid #111; padding-bottom: 2px; font-family: Inter, var(--font); letter-spacing: -.2px; }
.fs-sub { font-size: 15px; font-weight: 700; border-bottom: 2px solid #111; padding: 3px 0 2px; margin-bottom: 26px; font-family: Inter, var(--font); }
.fs-sub2 { font-size: 13.5px; font-weight: 700; border-bottom: 2px solid #111; padding: 3px 0 2px; margin: -24px 0 20px; font-family: Inter, var(--font); }
.fs-title { text-align: center; font-weight: 700; font-size: 15px; margin-bottom: 26px; line-height: 1.7; }
.u { text-decoration: underline; text-underline-offset: 3px; }
table.fs-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fs-t td, .fs-t th { padding: 2px 4px; vertical-align: top; font-weight: inherit; text-align: left; }
.fs-t th { font-weight: 700; border-bottom: 1px solid #111; }
.fs-t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; position: relative; }
.fs-t .lb { padding-left: 22px; }
.fs-t .lb.b { font-weight: 700; padding-left: 4px; }
.fs-t .ind { padding-left: 34px; }
.fs-t .nt { text-align: center; font-size: 11.5px; }
.fs-t tr.sec td { padding-top: 12px; font-weight: 700; }
.fs-t tr.gap td { height: 8px; }
.fs-t tr.tot td { padding-top: 10px; }
.fs-t .ul { border-bottom: 1px solid #111; }
.fs-t .ol { border-top: 1px solid #111; }
.fs-t .dbl { border-bottom: 3px double #111; }
.fs-t.sm { font-size: 11.5px; }
.fs-detail { font-size: 11.5px; padding-left: 0; }
.fs-t td.fs-detail { padding-left: 22px; }
.fs-rp { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #111; }
.fs-rp > div { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px 0; }
.fs-rp > div + div { border-left: 1px solid #111; }
.fs-end { margin-top: 10px; }
.fs-cert { margin: 26px 0 30px; font-size: 12px; }
.fs-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; font-size: 12px; }
.fs-sign .dots, .fs-audit .dots { letter-spacing: 1px; color: #555; margin-bottom: 2px; }
.fs-date { margin-top: 26px; font-size: 12px; }
.fs-audit { margin-top: 30px; padding-top: 14px; border-top: 1px solid #ccc; font-size: 12px; }
.fs-h { font-size: 13.5px; font-weight: 700; margin: 18px 0 6px; text-decoration: underline; text-underline-offset: 3px; font-family: Inter, var(--font); }
.fs-annex { margin-bottom: 16px; break-inside: avoid; }
.fs-annex .an { width: 62%; }
.fs-note p, .fs-annex p { margin: 0 0 6px; font-size: 12.5px; }
.fs-page .v-in { font-family: inherit; }
.fs-page .v-in.r { text-align: right; width: calc(100% + 8px); }
.fs-page .v-in.no { width: 3em; }
.fs-page textarea.v-in { width: 100%; margin: 0; }
.fs-x { position: absolute; right: -24px; top: 1px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-3); cursor: pointer; font: 14px/1 var(--font); padding: 0; }
.fs-x:hover { color: var(--red); border-color: #f6c9c9; background: var(--redbg); }
.fs-h .fs-x, .sec .fs-x { position: static; margin-left: 6px; }
.fs-add { border: 1px dashed #b9c6d6; background: var(--blue-tint); color: var(--blue-deep); border-radius: 6px; padding: 2px 10px; font: 600 11.5px var(--font); cursor: pointer; margin: 3px 0; }
.fs-mini { border: 0; background: none; color: var(--blue-deep); font: 600 10.5px var(--font); cursor: pointer; padding: 0 2px; }
.fs-kind { width: auto; font-size: 11px; padding: 1px 22px 1px 6px; height: auto; display: inline-block; }
.fs-pages.editing .fs-page, .fs-page.editing { padding-right: 24mm; }
.fs-page.letter { font: 13px/1.5 Calibri, Inter, var(--font); }
.ap-org { margin-bottom: 14px; }
.ap-date { width: 40mm; margin-bottom: 8px; }
.ap-to { margin-bottom: 10px; }
.ap-subj { font-size: 14px; text-decoration: underline; margin: 12px 0 8px; }
.ap-t { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11.5px; table-layout: fixed; }
.ap-t th, .ap-t td { border: 1px solid #333; padding: 4px 5px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.ap-t th { font-weight: 700; background: #f4f6f8; }
.ap-t .r { text-align: right; position: relative; font-variant-numeric: tabular-nums; }
.ap-t tr.no-print td { border: 0; }
.ap-foot { font-size: 11.5px; white-space: pre-wrap; margin-bottom: 10px; }
.ap-h { font-size: 13px; margin: 10px 0 4px; }
.ap-close { margin-top: 12px; font-weight: 700; }
.ap-sign { margin-top: 34px; }
.empty-ta { min-height: 1.4em; }
@media print {
  body.print-statement .fs-page, body.print-approval .fs-page { box-shadow: none; margin: 0; width: 210mm; min-height: 296mm; break-after: page; padding-right: 17mm; }
  body.print-statement .fs-pages { display: block; }
  body.print-statement .paper-wrap, body.print-approval .paper-wrap { padding: 0; overflow: visible !important; }
  body.print-statement .paper-scaler, body.print-approval .paper-scaler { transform: none !important; width: auto !important; height: auto !important; }
  .fs-add, .fs-x, .fs-mini, .fs-kind { display: none !important; }
  textarea.v-in { resize: none; }
  body.print-voucher .v-stamp { display: block; }
}
.fs-rp .fs-t.sm { font-size: 10.5px; line-height: 1.3; }
.fs-rp .fs-t td { padding: 1px 3px; }
.fs-rp .fs-t .lb { padding-left: 10px; }
.fs-rp .fs-t .ind, .fs-rp .fs-t td.fs-detail { padding-left: 18px; }
.fs-rp .fs-t tr.gap td { height: 4px; }
@media print { .fs-rp { display: flex; } .fs-rp > div { flex: 1 1 50%; min-width: 0; } }
@media print {
  body.print-voucher .voucher { height: 147mm; min-height: 0 !important; padding: 8mm 9mm 4mm; overflow: hidden; break-after: avoid; }
  body.print-voucher .v-head { margin-bottom: 4mm; }
  body.print-voucher .v-head img { width: 22mm; }
  body.print-voucher .v-box { margin-bottom: 4mm; padding: 11px 14px; }
  body.print-voucher .v-row { margin-bottom: 3mm; }
  body.print-voucher .v-field { min-height: 46px; padding: 9px 12px; }
  body.print-voucher .v-foot { padding-top: 3mm; }
  body.print-voucher .v-addr { margin-top: 3mm; padding-top: 2mm; }
  body.print-voucher #view > :not(.paper-wrap) { display: none !important; }
}
a.row, a.acct { color: inherit; }
.fs-org.caps, .fs-sub.caps { text-transform: uppercase; font-family: "Times New Roman", Times, Georgia, serif; letter-spacing: .01em; }
.fs-sub.caps { margin-bottom: 30px; }
.fs-title.plain { font-weight: 400; font-size: 14px; }
.fs-annex .an.wide { width: 100%; }
.fs-foot { border: 1px solid #333; padding: 5px 8px; font-size: 11px; margin-top: 6px; }

.t tr.novoucher { background: #fff6f6; }
.t tr.novoucher td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.t tr.novoucher:hover { background: var(--redbg); }
.btn.sm.issue { height: 24px; padding: 0 8px; font-size: 11.5px; margin-left: 4px; }

/* ---------- view-only accounts ---------- */
.ro-badge { margin: 0 10px 8px; padding: 4px 10px; border-radius: 20px; background: var(--amberbg); color: var(--amber); font-size: 12px; font-weight: 700; text-align: center; }
body.readonly .btn.primary:not(.ro-ok), body.readonly .btn.danger, body.readonly .ibtn.del, body.readonly [data-save]:not(.ro-ok),
body.readonly [data-issue], body.readonly .fs-add, body.readonly .fs-x, body.readonly .fs-mini, body.readonly .admin-only,
body.readonly #imp, body.readonly #auto, body.readonly #bulkv, body.readonly #chk, body.readonly #impHist, body.readonly #hist,
body.readonly #save, body.readonly #dup, body.readonly #del, body.readonly #mode, body.readonly #regen, body.readonly #addv,
body.readonly #gen, body.readonly #new, body.readonly #add, body.readonly #addAcct, body.readonly #editAcct, body.readonly #reset,
body.readonly label.btn, body.readonly [data-a="new"], body.readonly #clear, body.readonly #tdel,
body.readonly .tabs button[data-t="new"], body.readonly .tabs button[data-t="cat"], body.readonly .tabs button[data-t="xfer"], body.readonly .tabs button[data-t="edit"],
body.readonly #vsave, body.readonly #csave, body.readonly #xsave, body.readonly .actions a.btn[href*="voucher/new"], body.readonly .panel a.btn.primary,
body.readonly .acts .ibtn.del { display: none !important; }
body.readonly .v-in:disabled, body.readonly .doc-side :disabled, body.readonly .form :disabled { opacity: 1; color: inherit; -webkit-text-fill-color: currentColor; cursor: default; background: transparent; }
