:root {
  --side: #252866;
  --side-2: #2f3380;
  --brand: #3b3fa8;
  --brand-d: #2d3089;
  --brand-soft: #eceefc;
  --accent: #f2a516;
  --accent-d: #d98f08;
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #1b1d3a;
  --muted: #666a86;
  --line: #e0e2ee;
  --ok: #12805c;
  --danger: #c8382d;
  --warn: #b7791f;
  --radius: 8px;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h4 { margin: 0; font-weight: 600; }
h2 { font-size: 26px; line-height: 1.2; }
a { color: inherit; }
code { background: #e9ebf7; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.r { text-align: right; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.mt { margin-top: 16px; }
.mb { margin-bottom: 14px; }
.m0 { margin: 0; }
.pad { padding: 12px; }
.grow { flex: 1; }
.link { color: var(--brand); cursor: pointer; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 500; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-outline { background: #fff; color: var(--brand); border-color: #c9cceb; }
.btn-outline:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #a82a20; border-color: #a82a20; }
.btn.btn-outline.btn-danger { background: #fff; color: var(--danger); border-color: #ecc4c0; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: #6f7391; display: inline-flex; }
.icon-btn:hover { background: #eceefa; color: var(--text); }
.icon-btn.danger:hover { background: #fbe4e1; color: var(--danger); }
.row { display: flex; align-items: center; gap: 8px; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ---------- shell: sidebar + main ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: #cfd1f3; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 18px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-word { font-family: var(--display); font-size: 18px; font-weight: 600; color: #fff; line-height: 1.15; }
.logo-mark { width: 56px; height: 56px; border-radius: 12px; background: var(--accent); color: var(--side); font-family: var(--display); font-size: 34px; font-weight: 600; display: grid; place-items: center; }
.logo-mark.sm { width: 34px; height: 34px; font-size: 21px; border-radius: 9px; }
.biz-card { display: flex; flex-direction: column; gap: 1px; padding: 11px 13px; border-radius: 8px; background: var(--side-2); text-decoration: none; color: #fff; border: 1px solid rgba(255, 255, 255, 0.1); }
.biz-card:hover { border-color: rgba(255, 255, 255, 0.3); }
.biz-label { font-size: 11.5px; color: #a9acdf; }
.biz-name { font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.biz-sub { font-size: 12px; color: #b5b8e6; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-h { font-size: 12px; color: #8f93d3; padding: 14px 12px 5px; }
.nav-h:first-child { padding-top: 2px; }
.tab { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: #c5c8f0; font-size: 14px; font-weight: 500; position: relative; }
.tab:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.tab.on { background: rgba(255, 255, 255, 0.13); color: #fff; }
.tab.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.tab.foot { margin-top: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 30; }
.top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; place-items: center; cursor: pointer; color: var(--text); }
.search-pill { display: flex; align-items: center; gap: 10px; min-width: 300px; padding: 8px 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.search-pill:hover { border-color: #c4c7e6; }
.search-pill span { flex: 1; }
.search-pill kbd { font: inherit; font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.fy-select { font: inherit; font-size: 13px; font-weight: 500; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; width: auto; }
.btn-create { font: inherit; font-weight: 600; background: var(--accent); color: #2a1c00; border: 0; padding: 9px 16px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-create:hover { background: var(--accent-d); }
.btn-create .plus { font-size: 18px; line-height: 1; font-weight: 600; }
.caret { font-size: 10px; }
.round-btn { background: transparent; border: 0; color: var(--text); width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; position: relative; }
.round-btn:hover { background: var(--bg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); border: 1px solid #d3d6f3; display: grid; place-items: center; cursor: pointer; }
.dotc { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.dropdown { position: relative; }
.menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 210px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(27, 29, 58, 0.16); padding: 6px; z-index: 50; max-height: 70vh; overflow: auto; }
.menu.open { display: block; }
.menu-right { left: auto; right: 0; min-width: 240px; }
.menu-wide { left: auto; right: 0; min-width: 300px; }
.menu button { width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 9px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: inherit; }
.menu button:hover { background: var(--brand-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-sec { padding: 6px 12px 2px; font-size: 12px; color: var(--muted); }
.menu-empty { padding: 14px; }
.ic-pad { width: 16px; display: inline-block; }
main#view { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 70px; }

/* ---------- page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 3px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-h h4 { font-size: 15px; }
.card-t { margin-bottom: 12px; font-size: 16px; font-family: var(--display); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: #fff; color: var(--muted); }
.search input { border: 0; outline: 0; padding: 8px 0; font: inherit; width: 240px; max-width: 60vw; background: transparent; }
.search input:focus { outline: 0; }
.seg { display: inline-flex; gap: 22px; border-bottom: 1px solid var(--line); }
.seg button { font: inherit; font-weight: 500; border: 0; background: none; color: var(--muted); padding: 8px 2px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--brand); border-bottom-color: var(--brand); }
.seg.sm button { font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; padding: 5px 13px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: #4a4e6d; }
.chip.on, .chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat { padding: 13px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-v { font-family: var(--display); font-size: 21px; font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; font-weight: 500; }
.tag.customer, .tag.both { background: var(--brand-soft); color: var(--brand); }
.tag.vendor { background: #fdf0cf; color: #7a4d00; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px; border-radius: 4px; font-weight: 500; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.paid { background: #dcf3e9; color: #0d6a4a; }
.badge.partial { background: #fdf0cf; color: #7a4d00; }
.badge.unpaid { background: #e6e8f3; color: #43466a; }
.badge.overdue { background: #fbe4e1; color: #a52a20; }
.banner { background: #fff8e6; border: 1px solid #f3dca0; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 10px; background: #f8f9fd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #eceef7; vertical-align: middle; }
.tbl tbody tr:hover { background: #f8f9fe; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.strong td { font-weight: 600; background: #f8f9fd; }
.tbl tfoot td { font-weight: 600; background: #f8f9fd; border-top: 2px solid var(--line); }
.tbl small { color: var(--muted); font-weight: 400; }
.acts { display: inline-flex; }
.empty { text-align: center; padding: 42px 10px; color: var(--muted); }
.empty.small { padding: 18px; }
.empty p { margin: 8px 0 0; }
.rep-h { margin: 20px 0 8px; font-size: 15px; font-family: var(--display); }
.rep-group { margin: 26px 0 10px; font-family: var(--display); font-size: 17px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.rep-card { font: inherit; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; cursor: pointer; align-items: center; color: inherit; }
.rep-card:hover { border-color: var(--brand); background: #fafaff; }
.rep-card b { display: block; font-weight: 600; }
.rep-card small { color: var(--muted); font-size: 12.5px; }

/* ---------- forms ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.fld label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.fld.inline { display: flex; align-items: center; gap: 8px; }
.fld.inline label { margin: 0; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); border: 1px solid #cfd2e6; border-radius: 6px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d6d9f6; border-color: var(--brand); }
input[type='checkbox'] { width: auto; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin: 0 !important; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0; }
.big-input { font-size: 16px; padding: 12px; }
.gs-row { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; cursor: pointer; text-align: left; }
.gs-row:hover { background: var(--brand-soft); }

/* ---------- invoice editor ---------- */
.items-wrap { margin: 16px 0 10px; border: 1px solid var(--line); border-radius: 6px; }
.tbl.items td, .tbl.items th { padding: 6px; }
.tbl.items input, .tbl.items select { padding: 6px 8px; font-size: 13px; }
.tbl.items input[type='number'] { text-align: right; min-width: 74px; }
.tbl.items .in-hsn { min-width: 80px; }
.totals { background: #f8f9fd; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.tr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; }
.tr input[type='number'] { width: 130px; text-align: right; padding: 5px 8px; }
.tr.grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 10px; font-size: 18px; font-family: var(--display); font-weight: 600; }
.tr.paynow { border-top: 1px dashed #c4c8e2; margin-top: 10px; padding-top: 10px; }
.tr.paynow select { width: 130px; }
.alloc-sum { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 14px; background: #f8f9fd; border: 1px solid var(--line); border-radius: 6px; gap: 12px; flex-wrap: wrap; }
.al { width: 130px; text-align: right; padding: 5px 8px; }

/* ---------- dashboard ---------- */
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-sub { margin: 18px 0 16px; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; border-top: 3px solid var(--brand); }
.cell { padding: 18px 20px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell:last-child { border-right: 0; }
.cell-l { color: var(--muted); font-size: 13px; }
.cell-v { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.cell-s { font-size: 12.5px; color: var(--muted); }
.cell .spark { margin-top: 10px; height: 34px; }
.g12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c12 { grid-column: span 12; }
.kpi.two { display: flex; gap: 40px; margin-bottom: 12px; }
.kpi-v { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.2; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.spark i { flex: 1; background: #dfe1f6; border-radius: 2px 2px 0 0; min-width: 6px; }
.spark i.on { background: var(--brand); }
.out-total { font-size: 13px; margin-bottom: 10px; }
.agebar { display: flex; height: 12px; border-radius: 3px; background: #eceef7; overflow: hidden; margin-bottom: 18px; gap: 2px; }
.ages { display: flex; }
.ag-group { padding-right: 22px; margin-right: 22px; }
.ag-group + .ag-group { border-left: 1px solid var(--line); padding-left: 22px; }
.ag-group.wide { flex: 1; }
.ag-h { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ag-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ag { display: grid; grid-template-columns: 12px auto; column-gap: 6px; align-items: center; }
.ag small { grid-column: 2; color: var(--muted); }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #eceef7; }
.chart .axis { font-size: 11px; fill: #8b8fae; font-family: var(--body); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); justify-content: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.mini { width: 100%; border-collapse: collapse; }
.mini td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini tr.strong td { font-weight: 600; border-bottom: 0; }
.hbar { margin-bottom: 11px; }
.hb-top { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.hb { height: 5px; background: #eceef7; border-radius: 3px; margin-top: 4px; }
.hb i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.act { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eceef7; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.quick { font: inherit; font-weight: 500; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; color: inherit; text-align: left; }
.quick:hover { border-color: var(--brand); background: #fafaff; }
.q-ic { width: 40px; height: 40px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(27, 29, 58, 0.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; display: flex; flex-direction: column; max-height: 92vh; box-shadow: 0 24px 64px rgba(27, 29, 58, 0.35); }
.modal.sm { max-width: 440px; } .modal.md { max-width: 620px; } .modal.lg { max-width: 900px; } .modal.xl { max-width: 1180px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 19px; }
.modal-b { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-f { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: #fafbff; border-radius: 0 0 12px 12px; }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--side); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); border-left: 4px solid var(--accent); }
.toast.err { background: #8f241b; border-left-color: #ffb4ab; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--side); color: #fff; padding: 60px 56px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.auth-side h1 { font-size: 40px; line-height: 1.1; }
.auth-side p { font-size: 17px; max-width: 420px; color: #d5d7f5; margin: 0; }
.auth-side ul { padding-left: 18px; line-height: 2; color: #d5d7f5; }
.auth-main { display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin-bottom: 10px; }
.auth-card .fld { margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .cell:nth-child(2) { border-right: 0; }
  .cell:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform 0.2s ease; }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(27, 29, 58, 0.45); z-index: 80; }
  .menu-btn { display: grid; }
  .search-pill { min-width: 0; }
  .search-pill span, .search-pill kbd { display: none; }
  .search-pill { padding: 9px; }
  .c4, .c5, .c6, .c7 { grid-column: span 12; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .span-3 { grid-column: span 2; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px; }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; }
  .fy-select { max-width: 110px; }
  main#view { padding: 18px 12px 60px; }
  h2 { font-size: 22px; }
  .strip { grid-template-columns: 1fr; }
  .cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .cell:last-child { border-bottom: 0; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .modal-back { padding: 0; }
  .modal { max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .search input { width: 150px; }
  .ages { flex-direction: column; gap: 10px; }
  .ag-group + .ag-group { border-left: 0; padding-left: 0; }
  .btn-create .caret { display: none; }
}


/* ---------- subscription ---------- */
.sub-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 28px; font-size: 13.5px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sub-banner.trial { background: #eceefc; color: #232670; }
.sub-banner.warn { background: #fff4d6; color: #6b4300; }
.sub-banner.expired { background: #fbe4e1; color: #7a1d15; }
.sub-banner.info { background: #eef0f5; color: #43466a; }
.plan-chip { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 4px; background: #e6e8f3; color: #43466a; }
.plan-chip.trial { background: var(--brand-soft); color: var(--brand); }
.plan-chip.active { background: #dcf3e9; color: #0d6a4a; }
.plan-chip.expired { background: #fbe4e1; color: #a52a20; }
.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 18px; border: 2px solid var(--brand); border-radius: var(--radius); background: #fafaff; }
.plan-card h3 { font-size: 20px; margin-bottom: 4px; }
.plan-price { font-family: var(--display); font-size: 34px; font-weight: 600; color: var(--brand); white-space: nowrap; line-height: 1; }
.plan-price small { font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.side-links { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 12.5px; }
.side-links a { color: #a9acdf; text-decoration: none; }
.side-links a:hover { color: #fff; text-decoration: underline; }
.auth-price { margin-top: 10px; padding: 12px 16px; border-left: 4px solid var(--accent); background: rgba(255, 255, 255, 0.09); border-radius: 0 6px 6px 0; color: #fff; max-width: 420px; }
.auth-card a { color: var(--brand); }

/* ---------- policy pages ---------- */
body.docs { background: #fff; }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--side); }
.doc-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-size: 19px; font-weight: 600; }
.doc-top nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.doc-top nav a { color: #cfd1f3; text-decoration: none; }
.doc-top nav a:hover, .doc-top nav a.on { color: #fff; text-decoration: underline; }
.doc { max-width: 780px; margin: 0 auto; padding: 40px 24px 60px; line-height: 1.7; }
.doc h1 { font-size: 34px; margin-bottom: 6px; }
.doc h2 { font-size: 20px; margin: 30px 0 6px; }
.doc p, .doc li { color: #33364f; }
.doc .updated { color: var(--muted); margin-bottom: 24px; }
.doc .draft { background: #fff8e6; border: 1px solid #f3dca0; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 20px; }
.doc mark { background: #ffe9a8; padding: 0 4px; border-radius: 3px; }
.doc-foot { border-top: 1px solid var(--line); padding: 20px 28px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 640px) { .sub-banner { padding: 10px 14px; } .plan-card { flex-direction: column; align-items: flex-start; } }
