:root {
  /* bizbook.ai: navy + cyan from the logo, cool paper neutrals */
  --bg: #f3f5f9; --panel: #ffffff; --ink: #14213d; --muted: #59657a; --faint: #8792a6;
  --line: #e2e6ee; --line-strong: #cbd2de; --accent: #0b2a6f; --accent-2: #00b4dc; --accent-soft: #e5f6fb; --accent-ink: #ffffff;
  --side: #ffffff; --side-ink: #3b4760; --side-active: #eaf6fc;
  --ok: #1b8a4b; --ok-soft: #e7f5ec; --warn: #a86400; --warn-soft: #fdf3e2; --bad: #b42318; --bad-soft: #fdecea;
  --radius: 12px; --shadow: 0 1px 2px rgba(11, 42, 111, .05);
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.hide { display: none !important; }
.boot { padding: 40px; color: var(--muted); }

/* layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 236px, var(--bg) 236px); }
.side { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.wm { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--accent); letter-spacing: -.3px; }
.wm span { color: var(--accent-2); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 12px; letter-spacing: -.3px; }
.side select { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; margin-bottom: 12px; }
.side nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.side nav a:hover { background: #f3f6fb; text-decoration: none; color: var(--accent); }
.side nav a.active { background: var(--side-active); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent-2); }
.side .sep { height: 1px; background: var(--line); margin: 12px 4px; }
.side .grow { flex: 1; }
.side .me { font-size: 12px; color: var(--faint); padding: 8px 10px 2px; word-break: break-all; }
.side .credit { font-size: 11px; color: var(--faint); padding: 2px 10px 4px; }
.side .credit b, .credit-auth b { color: var(--accent); font-weight: 600; }
.credit-auth { text-align: center; font-size: 12px; color: var(--faint); margin: 18px 0 0; }
.auth-logo { display: block; width: 190px; max-width: 70%; margin: 0 auto 6px; }
.side .me button { background: none; border: 0; color: var(--muted); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.ico { width: 16px; height: 16px; flex: none; opacity: .85; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px 0; flex-wrap: wrap; }
.top h1 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0; letter-spacing: -.2px; color: var(--accent); }
.top .spacer { flex: 1; }
.content { padding: 18px 28px 48px; }
.syncpill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #bbb; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.dot.spin { background: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

/* components */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h3 { margin: 0; font-size: 15px; }
.pb { padding: 16px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
@media (max-width: 860px) {
  .panel > table, .pb table, .grid table { display: block; overflow-x: auto; }
  .totals { flex-wrap: wrap; gap: 6px 18px; }
  td:first-child { white-space: nowrap; }
  .kpi .v { font-size: 19px; }
}
.kpi { padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi .d { font-size: 12px; color: var(--faint); }
.two { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #faf9f6; position: sticky; top: 0; }
tbody tr:hover { background: #fbfaf7; }
tr.click { cursor: pointer; }
tr.group td { background: #f6f5f0; font-weight: 600; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line-strong); background: #faf9f6; }
.tablewrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: 0 0 var(--radius) var(--radius); }
.cancel td { color: var(--faint); text-decoration: line-through; }
.drcr { font-size: 11px; color: var(--faint); margin-left: 4px; }
.tag { white-space: nowrap; display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eeece5; color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.acc { background: var(--accent-soft); color: var(--accent); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #0e6e6433; border-color: var(--accent); }
.filters input[type=search] { flex: 1; min-width: 180px; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }

.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; cursor: pointer; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.danger { background: var(--panel); color: var(--bad); border-color: #ebc0bb; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.link { background: none; border: 0; color: var(--accent); padding: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 12px 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; }
.note { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.note.warn { background: var(--warn-soft); } .note.bad { background: var(--bad-soft); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps b { display: block; }
.code { font: 600 26px/1.2 Consolas, "Courier New", monospace; letter-spacing: 3px; background: #f6f5f0; border: 1px dashed var(--line-strong); padding: 12px 16px; border-radius: 10px; text-align: center; }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; font-family: Consolas, monospace; }

/* lines editor */
.lines th, .lines td { padding: 6px 6px; border: 0; background: none; }
.lines td input, .lines td select { width: 100%; }
.lines .x { background: none; border: 0; color: var(--faint); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.totals { display: flex; justify-content: flex-end; gap: 28px; padding: 10px 6px; font-variant-numeric: tabular-nums; }
.totals b { font-size: 16px; }

/* bar chart */
.chart { width: 100%; height: 220px; }
.chart text { font-size: 11px; fill: var(--faint); font-family: inherit; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .panel { width: 100%; max-width: 400px; padding: 28px; }
.auth h1 { margin: 12px 0 4px; font-size: 21px; font-family: var(--display); font-weight: 600; color: var(--accent); text-align: center; }
.auth p.muted { text-align: center; }
.auth .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 10px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(23, 38, 43, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 14px; width: 100%; max-width: 720px; max-height: 90vh; overflow: auto; position: relative; padding: 22px; }
.modal-box h2 { margin: 0 0 12px; font-size: 18px; }
.modal-x { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 26px; color: var(--faint); cursor: pointer; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 13px; margin-bottom: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 10px; font-size: 13px; }
.bar-row .bar { grid-column: 1 / -1; height: 6px; background: #eeece5; border-radius: 3px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.progress { height: 6px; background: #eeece5; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

/* dashboard period + receivables */
.periodbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13px; font-weight: 500; border: 0; background: none; color: var(--muted); padding: 6px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--accent); background: #f3f6fb; }
.seg button.on { background: var(--accent); color: #fff; }
.kpi .v { color: var(--accent); }
.kpi.bal .v { color: var(--ink); }
.kpis + .kpis { margin-top: -4px; }
.pie-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pie-wrap svg { flex: none; }
.donut-k { font-size: 11px; fill: var(--faint); font-family: inherit; }
.donut-v { font-size: 17px; font-weight: 600; fill: var(--accent); font-family: var(--display); }
.pie-legend { flex: 1; min-width: 210px; display: grid; gap: 7px; }
.pl-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 74px; gap: 8px; align-items: center; font-size: 13px; }
.pl-row > i { width: 10px; height: 10px; border-radius: 3px; }
.pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row .tag { justify-self: end; }
.agebar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 16px 0 8px; background: #eef1f6; }
.agebar i { display: block; height: 100%; }
.agelegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.agelegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.agelegend b { color: var(--ink); font-weight: 600; }
.agecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.agecards > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.agecards b { font-size: 17px; color: var(--accent); font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 8px; align-items: center; margin: 10px 0 6px; font-weight: 500; }
@media (max-width: 860px) { .seg { display: none; }  .pl-row { grid-template-columns: 10px minmax(0, 1fr) auto 58px; } }

.two > .panel { align-self: start; }

/* entry type picker */
.picker { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pick-group { display: grid; gap: 5px; }
.pick-group > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.pick-group > div { display: flex; flex-wrap: wrap; gap: 5px; }
.picker button { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.picker button:hover { border-color: var(--accent); color: var(--accent); }
.picker button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
h3.sub { font-size: 13px; margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.billbox { margin-top: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; background: #fafbfd; }
.bb-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bb-row .f { font-size: 12px; font-weight: 600; color: var(--muted); }
.bb-row label { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
.bb-row .bn { width: 160px; }
#pending { margin-top: 8px; }
.btnrow { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.mhead { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding-right: 26px; }
.mhead h2 { margin-bottom: 12px; }
.lines select { width: 100%; }
.lines .gd { min-width: 120px; }
.navhead { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 4px 10px 2px; }

/* admin */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; padding: 8px 0 4px 4px; }
.checkgrid label { display: flex; gap: 7px; align-items: center; font-size: 13px; }
.checkgrid.tall { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.chips { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.chiplist { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; min-height: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; font-weight: 500; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.chipadd { display: flex; gap: 6px; } .chipadd input { flex: 1; }
.logo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.logo-box { width: 150px; height: 84px; border: 1px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 92%; max-height: 92%; object-fit: contain; }
.seg.mini { padding: 2px; } .seg.mini button { font-size: 12px; padding: 4px 9px; }
.pfmt td { padding: 5px 4px; border-bottom: 1px solid var(--line); } .pfmt td:last-child { text-align: right; }

/* print preview */
.modal-box.wide { max-width: 1000px; }
.print-stage { background: #e9edf3; border-radius: 10px; padding: 14px; overflow: auto; max-height: 70vh; display: flex; justify-content: center; }
.print-stage iframe { border: 0; background: #fff; box-shadow: 0 2px 12px rgba(11, 42, 111, .15); }
.print-stage iframe.a4 { width: 794px; height: 1123px; max-width: 100%; }
.print-stage iframe.pos { width: 290px; height: 1100px; }
@media (max-width: 860px) { .print-stage iframe.a4 { width: 100%; height: 800px; } .grid.two[style] { grid-template-columns: 1fr !important; } }
.lines.nobatch .bcol { display: none; }
.lines .hsn { margin-top: 2px; }
.lines .disc { min-width: 56px; }
.pinfo { margin: 0 0 12px; } .pinfo summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.lines .qty, .lines .rate { min-width: 72px; }
.lines .bat { min-width: 96px; }
.lines input[type=date] { min-width: 136px; }
#itab:not(.nobatch) { min-width: 1180px; }
#itab .it { min-width: 160px; }

/* ---- Parties, Cash & Bank, party page ---- */
.navgrp summary { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; font-weight: 500; cursor: pointer; list-style: none; }
.navgrp summary::-webkit-details-marker { display: none; }
.navgrp summary:hover { background: #f3f6fb; color: var(--accent); }
.navgrp .chev { margin-left: auto; font-size: 11px; color: var(--faint); transition: transform .15s; }
.navgrp[open] .chev { transform: rotate(180deg); }
.side nav a.sub { padding: 6px 10px 6px 38px; font-size: 13.5px; }
.tabs .cnt .tag { margin-left: 4px; font-size: 11px; padding: 0 6px; }
.exp { display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { margin: -4px 0 10px; font-size: 13px; }
.party-head { padding: 16px 18px 6px; margin-bottom: 14px; }
.party-head .ph-main { display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.party-head h2 { margin: 0; font-family: var(--display); font-size: 20px; }
.pcontact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.pkpis { display: flex; gap: 22px; flex-wrap: wrap; }
.pkpis > div { display: flex; flex-direction: column; gap: 2px; } .pkpis b { font-size: 17px; font-family: var(--display); }
.notes-wrap { display: grid; gap: 14px; padding: 14px; background: var(--bg); }
.notes-wrap .panel { margin: 0; }
.note-card { padding: 12px 16px; border-top: 1px solid var(--line); }
.note-card:first-child { border-top: 0; }
.note-card.done .nc-text { color: var(--muted); }
.nc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.nc-text { white-space: pre-wrap; margin: 2px 0; }
.nc-hist { margin-top: 8px; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 13px; display: grid; gap: 6px; }
.nc-hist.hide { display: none; }
.lr-hint { font-size: 11.5px; color: var(--accent); }
@media (max-width: 860px) { .pkpis { gap: 14px; } .party-head { padding: 14px; } }
.tag .x { background: none; border: 0; cursor: pointer; padding: 0 0 0 4px; color: inherit; font-size: 14px; line-height: 1; }
.lines.nodisc .dcol { display: none; }
.optrow { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin: 2px 0 6px; }
.optrow .check { margin: 0; }
.optrow select { padding: 4px 8px; font-size: 13px; }
.vtgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.vtgrid.disabled { opacity: .45; pointer-events: none; }
.vtk { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.vtk-h { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.vtl { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0 22px; font-size: 13px; }
.vtl label { display: flex; gap: 6px; align-items: center; }
@media (max-width: 860px) { .seg.mini { display: inline-flex; } .filters .exp { width: 100%; } }
.notes-wrap .tablewrap table { min-width: 560px; }
.vt-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.vt-pick label { margin: 0; font-weight: 600; }
.vt-pick select { min-width: 280px; max-width: 100%; font-size: 15px; font-weight: 600; padding: 9px 12px; }
.conn-row { display: flex; gap: 18px 30px; flex-wrap: wrap; align-items: flex-start; }
.conn-row > div { min-width: 200px; }
.conn-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.conn-row .tag { margin-top: 4px; display: inline-block; }

/* ===== header (company, search, Ask AI, user menu) ===== */
.hdr { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 10px 28px; min-height: 62px; }
.hdr .spacer { flex: 1; }
.hdr-logo { display: none; }
.cosw { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 6px; text-align: left; background: none; border: 0; padding: 4px 8px; border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); min-width: 0; max-width: 340px; }
.cosw:hover { background: #f3f6fb; }
.cosw-n { font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .01em; }
.chev2 { font-size: 13px; color: var(--muted); align-self: center; }
.cosw-s { grid-column: 1 / 3; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsearch { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.hsearch input { width: 100%; padding: 10px 40px 10px 40px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; background: #fff; }
.hsearch input:focus { outline: 2px solid #0b2a6f22; border-color: var(--accent); }
.hs-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); display: flex; }
.hs-ico .ico { width: 18px; height: 18px; }
.hs-k { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px/1.4 Consolas, monospace; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; background: #fff; }
.hs-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(11,42,111,.16); max-height: 70vh; overflow: auto; padding: 6px; z-index: 40; }
.hs-g { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.hs-res button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.hs-res button.on, .hs-res button:hover { background: var(--side-active); }
.hs-res button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-empty { padding: 14px; color: var(--muted); }
.askai { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #b9e5f2; background: linear-gradient(135deg, #e9f8fd, #eef2fb); color: var(--accent); font: 600 14px var(--display); padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.askai:hover { border-color: var(--accent-2); }
.askai .ico { width: 18px; height: 18px; color: var(--accent-2); opacity: 1; }
.newtag { font-style: normal; font-size: 10px; background: #e5484d; color: #fff; padding: 1px 6px; border-radius: 6px; letter-spacing: .04em; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font: 600 14px var(--display); cursor: pointer; flex: none; display: grid; place-items: center; }
.avatar.big { width: 44px; height: 44px; font-size: 16px; }
.iconbtn { background: none; border: 0; color: var(--accent); padding: 6px; border-radius: 8px; cursor: pointer; display: flex; }
.iconbtn .ico { width: 22px; height: 22px; }
.m-only { display: none !important; }
.top { padding-top: 18px; }
.top h1:empty { display: none; }
/* popups / sheets */
.pop { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(11,42,111,.18); padding: 6px; min-width: 240px; max-width: 360px; max-height: 80vh; overflow: auto; }
.pop a, .pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }
.pop a:hover, .pop button:hover, .pop button.on { background: var(--side-active); text-decoration: none; }
.pop.cos button { flex-direction: column; align-items: flex-start; gap: 2px; }
.pop-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 2px; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-user { display: flex; gap: 12px; align-items: center; padding: 8px 10px; }
.pop-user .tag { margin-top: 4px; display: inline-block; }
.pop-credit { font-size: 11px; color: var(--faint); padding: 6px 10px 4px; } .pop-credit b { color: var(--accent); }
.pop .ico { width: 17px; height: 17px; color: var(--muted); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 8px; font-size: 17px; }
.sheet-h .x, .ai-h .x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; width: auto; }
.chev3 { margin-left: auto; color: var(--faint); font-size: 18px; }
.pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-width: none; border-radius: 18px 18px 0 0; max-height: 85vh; padding: 10px 10px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 0 0 100vmax rgba(9,20,45,.45); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.pop.sheet a, .pop.sheet button:not(.x) { padding: 13px 12px; font-size: 15.5px; border-bottom: 1px solid #f0f2f6; border-radius: 0; }
/* Ask AI drawer */
.aidrawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; z-index: 70; box-shadow: -10px 0 40px rgba(11,42,111,.18); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: .6; } }
.ai-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-h b { font-family: var(--display); font-size: 16px; color: var(--accent); }
.ai-h .ico { width: 20px; height: 20px; color: var(--accent-2); opacity: 1; }
.ai-body { flex: 1; overflow: auto; padding: 12px 16px; background: var(--bg); }
.ai-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 10px 0 6px; }
.ins { display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.ins:hover { text-decoration: none; border-color: var(--line-strong); }
.ins b { display: block; font-size: 14px; } .ins span { color: var(--muted); font-size: 13px; }
.ins.ok { border-left-color: var(--ok); } .ins.bad { border-left-color: var(--bad); } .ins.warn { border-left-color: #e3a008; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-q { background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; text-align: left; }
.bub { padding: 10px 12px; border-radius: 12px; margin: 8px 0; max-width: 92%; font-size: 14px; line-height: 1.5; }
.bub.me { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bub.ai { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.ai ul { margin: 4px 0; padding-left: 18px; } .bub.err { color: var(--bad); } .bub.typing { color: var(--muted); }
.ai-in { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.ai-in input { flex: 1; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
/* bottom tabs + create button (phone) */
.btabs, .actbar, .navback, .t-only { display: none !important; }
/* create menu: tiles with icons */
.pop.create { width: 460px; max-width: calc(100vw - 16px); padding: 8px; }
.pop.create.up { animation: popup .16s ease-out; box-shadow: 0 -6px 30px rgba(11,42,111,.18), 0 0 0 100vmax rgba(9,20,45,.28); }
@keyframes popup { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.ctgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 2px 6px; }
.pop .ctgrid a.ct { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 500; line-height: 1.25; min-height: 82px; border-bottom: 1px solid var(--line); }
.pop .ctgrid a.ct .ico { width: 26px; height: 26px; color: var(--accent); }
.pop .ctgrid a.ct:hover { border-color: var(--accent-2); }
.ct-sales .ico, .ct-receipt .ico, .ct-quotation .ico, .ct-sales_order .ico, .ct-delivery_note .ico, .ct-credit_note .ico { color: #0b7a4b !important; }
.ct-purchase .ico, .ct-payment .ico, .ct-purchase_order .ico, .ct-receipt_note .ico, .ct-debit_note .ico { color: #b4540a !important; }
.qcreate a .sico { stroke-width: 1.7; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn .sico, .hbill .sico { width: 17px; height: 17px; }
/* tablet + phone: sidebar becomes a drawer, bottom tabs and action bar */
@media (max-width: 1024px) {
  .t-only { display: flex !important; }
  .hide.t-only { display: none !important; }
  .shell { display: block; background: var(--bg); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; max-width: 84vw; z-index: 90; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(9,20,45,.25); overflow-y: auto; height: auto; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  body.navopen .side { transform: none; }
  .navback { display: block !important; position: fixed; inset: 0; z-index: 85; background: rgba(9,20,45,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.navopen .navback { opacity: 1; pointer-events: auto; }
  .hdr { padding-left: 12px; gap: 10px; }
  #menuBtn { margin-right: -2px; } #menuBtn .ico { width: 24px; height: 24px; }
  .hdr-logo { display: block; flex: none; }
  .hbill { display: flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px 8px 11px; font: 600 14px var(--display); cursor: pointer; white-space: nowrap; flex: none; }
  .content { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .btabs { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .btabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; border-radius: 12px; }
  .btabs a .ico { width: 22px; height: 22px; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; }
  .btabs a.on { color: var(--accent); } .btabs a.on .ico { background: var(--side-active); }
  .actbar { display: flex !important; gap: 10px; position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); z-index: 31; padding: 8px 12px; background: linear-gradient(to top, rgba(244,246,250,1) 60%, rgba(244,246,250,0)); }
  .actbar button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 10px; font: 600 15px var(--display); cursor: pointer; box-shadow: 0 4px 14px rgba(11,42,111,.16); max-width: 340px; }
  .actbar { justify-content: center; }
  .actbar .ab-collect { background: #fff; color: #0b7a4b; border: 1.5px solid #0b7a4b; }
  .actbar .ab-create { background: var(--accent); color: #fff; border: 1.5px solid var(--accent); }
  .actbar .ico { width: 20px; height: 20px; opacity: 1; }
  .actbar .hide { display: none; }
}
.hbill .l2 { display: none; }
@media (max-width: 420px) { .hbill .l1 { display: none; } .hbill .l2 { display: inline; } .hbill { padding: 8px 11px 8px 9px; font-size: 13.5px; gap: 4px; } .ctgrid { grid-template-columns: repeat(2, 1fr); } }
/* reports hub */
.rhub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rhub .panel h3 { margin: 0; padding: 12px 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.rhub a { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--ink); border-bottom: 1px solid #f0f2f6; }
.rhub a:last-child { border-bottom: 0; } .rhub a:hover { background: #f7f9fc; text-decoration: none; }
.rhub a span { color: var(--faint); font-size: 12.5px; display: block; }
.period-dd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.period-dd select { padding: 8px 34px 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font: 600 14px var(--display); color: var(--accent); background: #fff; }
.msum, .qcreate, .rchips { display: none; }

@media (max-width: 860px) {
  .hdr { padding: 8px 12px; gap: 6px; min-height: 56px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .cosw { flex: 1; max-width: none; padding: 2px 4px; }
  .cosw-n { font-size: 14px; }
  .hsearch { display: none; }
  body.searching .hsearch { display: block; position: fixed; inset: 0 0 auto 0; max-width: none; z-index: 80; background: #fff; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; box-shadow: 0 0 0 100vmax rgba(9,20,45,.35); }
  body.searching .hs-ico { left: 25px; top: calc(31px + env(safe-area-inset-top, 0px)); }
  body.searching .hs-k { display: none; }
  body.searching .hs-res { position: static; margin-top: 8px; box-shadow: none; max-height: calc(100vh - 90px); }
  .m-only { display: flex !important; }
  .pop .m-only { display: block !important; }
  .askai { padding: 8px 10px; } .askai span, .askai .newtag { display: none; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .top { padding: 12px 16px 0; } .top h1 { font-size: 19px; }
  .content { padding: 12px 12px calc(150px + env(safe-area-inset-bottom, 0px)); }
  .aidrawer { width: 100vw; }
  .msum { display: block; } .qcreate, .rchips { display: flex; }
  .d-only { display: none !important; }
  .modal-box { border-radius: 16px 16px 0 0; }
}
/* phone home: summary list, quick create, report chips */
.msum .panel { overflow: hidden; }
.msum .row { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid #eef1f6; color: var(--ink); text-decoration: none; font-size: 15px; }
.msum .row:last-child { border-bottom: 0; }
.msum .row b { font-variant-numeric: tabular-nums; font-size: 16px; }
.msum .collect { font-size: 12px; background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe3cc; border-radius: 999px; padding: 2px 10px; margin-left: auto; margin-right: 10px; font-weight: 600; }
.msum .mh { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.msum .mh h3 { margin: 0; font-size: 16px; font-weight: 600; }
.msum .mh select { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 28px 6px 12px; font: 600 13px var(--display); color: var(--accent); background: #fff; }
.qcreate { gap: 4px; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 6px; margin: 12px 0; overflow-x: auto; }
.qcreate a { flex: 1; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); text-decoration: none; text-align: center; }
.qcreate a .ico { width: 24px; height: 24px; color: var(--accent); padding: 9px; background: var(--side-active); border-radius: 12px; box-sizing: content-box; opacity: 1; }
.rchips { gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.rchips a { white-space: nowrap; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 7px 12px; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.sec-h { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 8px; font-weight: 600; font-size: 15px; }
.sec-h a { font-size: 13px; font-weight: 600; }
/* tables as cards on phones */
@media (max-width: 640px) {
  .tablewrap table.cards, .tablewrap table.cards tbody, .tablewrap table.cards tr, .tablewrap table.cards td { display: block; width: auto; }
  .tablewrap table.cards thead { display: none; }
  .tablewrap table.cards tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 8px 10px; padding: 8px 12px; }
  .tablewrap table.cards td { border: 0; padding: 3px 0; text-align: right; display: flex; justify-content: space-between; gap: 12px; white-space: normal; }
  .tablewrap table.cards td:first-child { font-weight: 600; text-align: left; display: block; font-size: 15px; }
  .tablewrap table.cards td[data-label]:not(:first-child)::before { content: attr(data-label); color: var(--faint); font-size: 12.5px; text-align: left; font-weight: 400; }
  .tablewrap table.cards td:empty { display: none; }
  .tablewrap table.cards tr.total { background: var(--side-active); }
  .tablewrap.cardwrap { max-height: none; overflow: visible; }
}
/* financial statements */
.tabs a.tabl { padding: 12px 12px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.tabl.on { color: var(--ink); border-color: var(--accent); }
.fin2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.fin2 > .tablewrap:first-child { border-right: 1px solid var(--line); }
table.fin td { padding: 8px 14px; }
table.fin tr.grp td { font-weight: 600; }
table.fin tr.grp.click { cursor: pointer; } table.fin tr.grp.click:hover td { background: #f7f9fc; }
table.fin .tw { display: inline-block; width: 12px; color: var(--faint); transition: transform .15s; }
table.fin tr.open .tw { transform: rotate(90deg); }
table.fin tr.lrow td { font-size: 13.5px; color: var(--muted); }
table.fin tr.sub td { font-style: italic; color: var(--muted); }
table.fin tr.tot td { font-weight: 700; border-top: 2px solid var(--line-strong); background: #fafbfd; }
table.fin tr.net td { font-weight: 700; } table.fin tr.net.good td { color: var(--ok); } table.fin tr.net.bad td { color: var(--bad); }
table.fin tr.warnrow td { color: var(--warn); }
.fin-sum { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); }
.fin-sum > div { background: var(--bg); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 160px; }
.fin-sum b { font-size: 17px; } .fin-sum b.good { color: var(--ok); } .fin-sum b.bad { color: var(--bad); }
@media (max-width: 860px) { .fin2 { grid-template-columns: 1fr; } .fin2 > .tablewrap:first-child { border-right: 0; border-bottom: 1px solid var(--line); } table.fin td { padding: 8px 10px; } }
/* compact dashboard */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dcard { display: flex; flex-direction: column; overflow: hidden; }
.dh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; min-height: 48px; }
.dh h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dh a { font-size: 14px; font-weight: 600; }
.attn .dh { background: #fdf1f1; }
.bang { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; }
.dsel { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); padding: 4px 2px; cursor: pointer; max-width: 60%; font-size: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; flex: 1; }
.tile2 { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 34px 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 70px; justify-content: center; }
.tile2:nth-child(odd) { border-right: 1px solid var(--line); }
.tile2:hover { background: #f7f9fc; text-decoration: none; }
.tile2 .tl { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tile2.red .tl { color: #c62f35; }
.tile2 b { font-size: 16.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile2 .tn { font-size: 12.5px; color: var(--faint); }
.tile2 .tc { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; line-height: 1; }
.totboxes { display: flex; gap: 12px; padding: 12px 16px 4px; flex-wrap: wrap; }
.totbox { flex: 1; min-width: 180px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border-radius: 8px; padding: 9px 12px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.totbox:hover { text-decoration: none; background: #eaf0f8; }
.totbox b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dchart { padding: 6px 12px 0; flex: 1; }
.dchart .chart { height: 190px; }
.dfoot { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-top: 8px; }
.dfoot.three { grid-template-columns: 1fr 1fr 1fr; margin-top: auto; }
.dfoot > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; text-align: center; font-size: 13.5px; }
.dfoot > div + div { border-left: 1px solid var(--line); }
.dfoot .fl { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; color: var(--ink); }
.dfoot b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dfoot .up { color: var(--ok); font-weight: 600; } .dfoot .down { color: #c62f35; font-weight: 600; }
.agewrap { display: flex; align-items: center; justify-content: space-around; gap: 16px; padding: 10px 16px; flex: 1; flex-wrap: wrap; }
.agelist { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.agelist a { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.agelist a:hover { text-decoration: none; color: var(--accent); }
.agelist i { height: 10px; border-radius: 3px; }
.agelist b { font-variant-numeric: tabular-nums; font-size: 13.5px; }
@media (max-width: 1100px) { .dgrid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .tile2 b { font-size: 15.5px; } .dfoot.three .fl { font-size: 11px; } .dgrid { margin-top: 12px; } }
.dlatest th { font-size: 13px; } .dlatest td { font-size: 14.5px; } .dlatest td.num { font-size: 13.5px; } .dlatest td, .dlatest th { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 860px) { table.fin td:first-child { white-space: normal; } table.fin td { font-size: 14px; } table.fin tr.lrow td { font-size: 13px; } table.fin .num { padding-left: 4px; } .tile2 .tl { font-size: 11.5px; } }
.vtmatrix { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 340px; margin: 6px 0; }
.vtmatrix.disabled { opacity: .45; pointer-events: none; }
.vtmatrix td, .vtmatrix th { padding: 6px 10px; }
.vtmatrix select, .vtSame { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 13px; }
.vbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.editbar { background: var(--warn-soft); border: 1px solid #f0d9b0; color: #7a4a00; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.editbar b { color: var(--ink); }
/* ---------- Configuration window ---------- */
.cfgbtn { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 999px; padding: 7px 13px 7px 10px; font: 600 14px var(--display); cursor: pointer; flex: none; }
.cfgbtn:hover { border-color: var(--accent-2); color: var(--accent); }
.cfgbtn .ico { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 1240px) { .cfgbtn span { display: none; } .cfgbtn { padding: 8px; } }
@media (max-width: 860px) { .cfgbtn { display: none; } }
.cfg { min-height: 100vh; background: #f6f7fb; }
.cfg-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 28px; min-height: 62px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.cfg-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 210px; }
.cfg-brand:hover { text-decoration: none; }
.cfg-gear { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--side-active); color: var(--accent); }
.cfg-gear .ico { width: 20px; height: 20px; color: var(--accent); opacity: 1; }
.cfg-brand b { display: block; font: 600 16px var(--display); }
.cfg-brand small { display: block; font-size: 12px; color: var(--faint); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-search { flex: 1; max-width: 460px; margin: 0 auto; position: relative; }
.cfg-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.cfg-search input { width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; background: #fafbfd; }
.cfg-search input:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; background: #fff; }
.cfg-close { background: none; border: 0; color: #c62f35; font: 600 14px var(--display); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; padding: 8px 4px; }
.cfg-close b { font-size: 20px; line-height: 1; font-weight: 500; }
.cfg-home { max-width: 1040px; margin: 0 auto; padding: 22px 24px 60px; }
.cfg-sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 20px; margin-bottom: 18px; }
.cfg-sec h2 { margin: 0 0 14px; font: 600 17px var(--display); color: var(--ink); }
.cfg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.cfg-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; background: #fff; }
.cfg-card h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font: 600 14.5px var(--display); }
.cfg-ci { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.cfg-ci .ico { width: 16px; height: 16px; opacity: 1; }
.cfg-ci.blue { background: #e8f0fe; color: #1a56db; } .cfg-ci.blue .ico { color: #1a56db; }
.cfg-ci.violet { background: #efe9fd; color: #6d3fd8; } .cfg-ci.violet .ico { color: #6d3fd8; }
.cfg-ci.orange { background: #fdf0e3; color: #c25a0a; } .cfg-ci.orange .ico { color: #c25a0a; }
.cfg-ci.green { background: #e5f6ec; color: #0b7a4b; } .cfg-ci.green .ico { color: #0b7a4b; }
.cfg-ci.teal { background: #e2f5f6; color: #0b7285; } .cfg-ci.teal .ico { color: #0b7285; }
.cfg-card a { display: block; padding: 8px 6px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.cfg-card a small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.cfg-card a:hover { background: #f3f6fb; color: var(--accent); text-decoration: none; }
.cfg-detail { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.cfg-nav { background: #fff; border-right: 1px solid var(--line); padding: 14px 10px 40px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.cfg-nh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 12px 10px 4px; }
.cfg-nav a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.cfg-nav a:hover { background: #f3f6fb; text-decoration: none; }
.cfg-nav a.on { background: var(--side-active); color: var(--accent); font-weight: 600; }
.cfg-main { padding: 18px 28px 60px; min-width: 0; }
.cfg-crumb { font-size: 13px; color: var(--faint); margin-bottom: 4px; } .cfg-crumb span { margin: 0 4px; }
.cfg-main h1 { margin: 0 0 14px; font: 600 21px var(--display); color: var(--accent); }
.cfg-content { padding: 0 !important; max-width: 1100px; }
.cfgstack { display: grid; gap: 14px; max-width: 860px; }
.cfgstack h3, .cfgai h2 { margin-top: 0; }
.cfgai { max-width: 760px; }
@media (max-width: 860px) {
  .cfg-top { padding: 8px 12px; gap: 8px; flex-wrap: wrap; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .cfg-brand { min-width: 0; flex: 1; } .cfg-close span { display: none; } .cfg-close b { font-size: 26px; }
  .cfg-search { order: 3; flex-basis: 100%; max-width: none; }
  .cfg-home { padding: 12px 10px 40px; } .cfg-sec { padding: 14px 12px; } .cfg-cards { grid-template-columns: 1fr; }
  .cfg-detail { display: block; } .cfg-nav { display: none; }
  .cfg-main { padding: 12px 12px 60px; }
}
.party-head .pedit { margin-left: 8px; }
