/* ============================================================
   GST Desk -- styles
   Colours are defined as roles, light/dark swapped from a single place. Teal brand.
   ============================================================ */

:root {
  color-scheme: light;
  --bg:        #eef2f5;
  --surface:   #ffffff;
  --surface-2: #f4f7f9;
  --surface-3: #e7eef2;
  --border:    #dde5ea;
  --border-strong: #c3d0d7;

  --text:   #10222b;
  --text-2: #3d525d;
  --muted:  #74878f;

  --brand:      #18495c;
  --brand-2:    #215e75;
  --brand-ink:  #18495c;
  --brand-soft: #d5e2e8;
  --brand-tint: #e9f1f4;
  --on-brand:   #ffffff;

  --series-1: #2a78d6;   /* Amazon */
  --series-2: #eb6834;   /* Flipkart */
  --series-3: #c2307f;   /* Meesho */
  --series-4: #1baf7a;   /* Excel upload */
  --series-5: #6a4ce2;   /* Bill Entry (validator: light band + CVD pass) */
  /* chart tokens -- measure, de-emphasis, sequential (5 class) */
  --m-1: #257de0; --m-2: #00b894; --m-3: #f47230;
  --vz-muted: #b7c1c8; --vz-grid: #e8edf0; --vz-axis: #c3d0d7;
  --sq-0: #eef2f5; --sq-1: #b6d5f8; --sq-2: #84b9f3; --sq-3: #519ced; --sq-4: #2370cd; --sq-5: #0f4a96;
  --sq2-1: #fde3d3; --sq2-2: #fbc3a1; --sq2-3: #f79a66; --sq2-4: #d9612a; --sq2-5: #a84614;
  --seq-1: #8fb9c9;
  --seq-2: #2f7591;

  --good: #0f7a4f;  --good-soft: #e0f2e9;
  --warn: #9a6200;  --warn-soft: #fbf0d9;
  --crit: #b3282a;  --crit-soft: #fbe3e3;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16,34,43,.05), 0 6px 18px rgba(16,34,43,.05);
  --appbar-h: 56px;
  --rail-w: 232px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0f1518;
  --surface:   #172024;
  --surface-2: #1d282d;
  --surface-3: #253238;
  --border:    #2b393f;
  --border-strong: #3c4d55;
  --text:   #eef4f6;
  --text-2: #bccad0;
  --muted:  #8a9ba2;
  --brand:      #2c7895;
  --brand-2:    #3a8aa8;
  --brand-ink:  #7cc0d9;
  --brand-soft: #1f3a45;
  --brand-tint: #19303a;
  --series-1: #3f8be0; --series-2: #e07040; --series-3: #d4529a; --series-4: #26b582; --series-5: #9887ef;
  --m-1: #338ced; --m-2: #00a888; --m-3: #e76624;
  --vz-muted: #50616a; --vz-grid: #243137; --vz-axis: #3c4d55;
  --sq-0: #1d282d; --sq-1: #0e3d7e; --sq-2: #1757ac; --sq-3: #2370cd; --sq-4: #338ced; --sq-5: #84b9f3;
  --sq2-1: #4a2410; --sq2-2: #7a3815; --sq2-3: #b4521e; --sq2-4: #e2702f; --sq2-5: #f6a676;
  --seq-1: #24566a; --seq-2: #4a9ab8;
  --good: #3cb47e;  --good-soft: #153024;
  --warn: #d9a03a;  --warn-soft: #33290f;
  --crit: #ec7272;  --crit-soft: #3a1d1d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 19px; }
h2 { font-size: 14.5px; }
h3 { font-size: 15px; }
p  { margin: 0; }
a  { color: var(--brand-ink); }
.muted { color: var(--muted); font-size: 12.5px; }
.mono { font-family: var(--mono); }
.up { text-transform: uppercase; }
.grow { flex: 1; }
.center { text-align: center; }
.pad { padding: 10px 18px 6px; }
.pad-form { padding: 14px 18px; }
.mt { margin-top: 8px; }
.ml { margin-left: 14px; }
.w-auto { width: auto !important; }
[hidden] { display: none !important; }
kbd {
  font: 11px var(--mono); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
}

/* ------------------------------------------------------------ app bar */
.appbar {
  position: fixed; z-index: 40; top: 8px; left: 8px; right: 8px; height: var(--appbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px;
  background: var(--brand); color: var(--on-brand);
  border-radius: 12px; box-shadow: 0 6px 18px rgba(24,73,92,.25);
}
.brand {
  display: flex; align-items: center; gap: 9px; border: 0; background: none; color: inherit;
  font: inherit; font-size: 16px; cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.brand svg { width: 24px; height: 24px; }
.brand:hover { background: rgba(255,255,255,.08); }

.client-pick { position: relative; }
.client-btn {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 360px;
  padding: 5px 10px 5px 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: inherit; font: inherit;
}
.client-btn:hover { background: rgba(255,255,255,.14); }
.client-meta { display: flex; flex-direction: column; text-align: left; min-width: 0; line-height: 1.2; flex: 1; }
.client-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-meta small { font: 11px var(--mono); opacity: .75; }
.chev { width: 14px; height: 14px; opacity: .8; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #e4eef2; color: var(--brand); letter-spacing: .02em;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; background: var(--brand-soft); }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; width: 380px; z-index: 50;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0,0,0,.22); overflow: hidden;
}
.dropdown input { margin: 10px; width: calc(100% - 20px); }
.dropdown-list { max-height: 340px; overflow: auto; padding: 0 6px 6px; }
.dropdown-list button {
  display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; border: 0;
  background: none; padding: 7px 8px; border-radius: 7px; color: var(--text); font: inherit; cursor: pointer;
}
.dropdown-list button:hover, .dropdown-list button.is-active { background: var(--brand-tint); }
.dropdown-list .avatar { width: 28px; height: 28px; font-size: 11px; background: var(--brand-soft); }
.dropdown-list small { display: block; font: 11px var(--mono); color: var(--muted); }
.dropdown-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); }

.period-pick { display: flex; gap: 6px; align-items: center; }
.period-pick select {
  width: auto; padding: 6px 28px 6px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid rgba(255,255,255,.2); background-color: rgba(255,255,255,.1); color: #fff;
}
.period-pick select option { color: #111; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.portal { color: #fff; opacity: .85; font-size: 12.5px; text-decoration: underline dotted; display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.portal svg { width: 12px; height: 12px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px;
}
.icon-btn svg { width: 17px; height: 17px; }
.appbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn.ghost { color: var(--muted); }
.icon-btn.ghost:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------ rail */
.rail {
  position: fixed; top: calc(var(--appbar-h) + 16px); bottom: 8px; left: 8px; width: var(--rail-w);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; padding: 10px 8px; overflow: auto;
}
nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 5px; }
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.nav-item.is-active svg { opacity: 1; }
.nav-item:disabled { opacity: .38; cursor: not-allowed; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--brand); color: #fff; }
.rail-foot { margin-top: auto; padding: 10px; font-size: 11.5px; }

/* ------------------------------------------------------------ main */
.main { margin: calc(var(--appbar-h) + 16px) 8px 0 calc(var(--rail-w) + 20px); padding: 0 8px 60px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 6px 0 14px; }
.pagehead-left p { margin-top: 2px; }
.pagehead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ buttons */
button { font: inherit; cursor: pointer; }
.primary, .soft, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.primary { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-2); }
.primary:disabled, .soft:disabled { opacity: .45; cursor: not-allowed; }
.primary.big { padding: 11px 22px; font-size: 14.5px; }
.soft { border: 1px solid var(--border); background: var(--brand-soft); color: var(--brand-ink); }
.soft:hover { filter: brightness(.97); border-color: var(--border-strong); }
.soft.white { background: var(--surface); color: var(--text); }
.danger { border: 1px solid transparent; background: var(--crit-soft); color: var(--crit); }
.danger:hover { border-color: var(--crit); }
.sm { padding: 5px 10px !important; font-size: 12.5px !important; }
.block { width: 100%; }
.soft svg, .primary svg, .danger svg { width: 15px; height: 15px; }
.icon-act {
  width: 70px; height: 32px; display: inline-grid; place-items: center; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--brand-soft); color: var(--brand-ink);
}
.icon-act svg { width: 15px; height: 15px; }
.icon-act.red { background: var(--crit-soft); color: var(--crit); }
.icon-act:hover { border-color: var(--border-strong); }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 5px 12px; border-radius: 6px; font-size: 12.5px; white-space: nowrap; }
.seg button.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg.dark { background: rgba(255,255,255,.1); }
.seg.dark button { color: rgba(255,255,255,.75); }
.seg.dark button.is-active { background: #fff; color: var(--brand); }
.seg.sm button { padding: 3px 9px; font-size: 12px; }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 9px 16px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.is-active { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------ form */
input[type=text], input[type=search], input[type=email], input[type=number], input[type=date],
input:not([type]), select, textarea, .search {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input.search, .search { width: 230px; }
.toolbar .muted { white-space: nowrap; }
.field { display: block; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.field-row { display: flex; gap: 8px; }
.hint { display: block; font-size: 11.5px; margin-top: 3px; min-height: 15px; color: var(--muted); }
.hint.ok { color: var(--good); }
.hint.err { color: var(--crit); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 14px 18px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); padding: 0; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.bf .form-grid.four { padding: 0; }
.span-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }
.row-gap { display: flex; gap: 10px; align-items: center; margin: 10px 0; }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.card-head p { margin-top: 2px; max-width: 760px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.toolbar.flat { margin: 0; }
.chip { padding: 5px 11px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.subtle { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge { padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.badge.new { position: absolute; top: -9px; left: 12px; background: var(--brand); color: #fff; font-size: 10px; padding: 2px 7px; }

.strip { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.strip-meta { display: flex; flex-direction: column; line-height: 1.25; }
.strip-meta b { font-size: 15px; }
.strip-meta small { font: 11.5px var(--mono); color: var(--muted); }
.month-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.month-tabs button { border: 0; background: none; padding: 6px 13px; border-radius: 6px; color: var(--text-2); font-size: 13.5px; }
.month-tabs button.is-active { background: var(--brand); color: #fff; font-weight: 600; }

/* ------------------------------------------------------------ list table (clients) */
.list-wrap { overflow: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13.5px; }
table.list th { text-align: left; font-size: 12px; font-weight: 700; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .03em; padding: 4px 14px; white-space: nowrap; }
table.list td { background: var(--surface); padding: 10px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table.list td:first-child { border-left: 1px solid var(--border); border-radius: 8px 0 0 8px; }
table.list td:last-child { border-right: 1px solid var(--border); border-radius: 0 8px 8px 0; }
table.list tr:hover td { background: var(--brand-tint); }
table.list tr.is-current td { background: var(--brand-tint); border-color: var(--brand-soft); }
table.list td.gst { font-family: var(--mono); color: var(--brand-ink); text-align: center; }
table.list .actions { display: flex; gap: 6px; justify-content: flex-end; }
table.list .trade { font-weight: 650; cursor: pointer; }

/* ------------------------------------------------------------ upload cards */
.up-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1180px) { .up-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.up-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; min-height: 196px;
}
.up-card.drag { outline: 2px dashed var(--brand); outline-offset: 3px; }
.up-top { display: flex; align-items: center; justify-content: space-between; }
.up-top b { font-size: 15px; }
.up-top em { font-style: normal; color: var(--muted); font-weight: 400; }
.logo-chip { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 5px; letter-spacing: .02em; }
.up-amt { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.up-amt b { font-variant-numeric: tabular-nums; color: var(--text); }
.up-files { display: flex; flex-direction: column; gap: 6px; }
.up-file { display: flex; gap: 6px; align-items: center; }
.up-file span {
  flex: 1; min-width: 0; padding: 5px 10px; border: 1px dashed var(--border-strong); border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.up-file span.bad { color: var(--crit); border-color: var(--crit); }
.up-file button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--crit); background: var(--surface); color: var(--crit); display: grid; place-items: center; }
.up-file button svg { width: 13px; height: 13px; }
.up-actions { margin-top: auto; display: flex; flex-direction: column; gap: 7px; }
.up-links { display: flex; justify-content: flex-end; gap: 12px; font-size: 11.5px; }
.up-links a { color: var(--text-2); text-decoration: none; cursor: pointer; }
.up-links a:hover { color: var(--brand-ink); text-decoration: underline; }
.up-desc { font-size: 13px; color: var(--text-2); }
.tagrow { display: flex; flex-wrap: wrap; gap: 5px; }
.tagrow span { font-size: 10.5px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.drop-hint {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
}
.drop-hint div { padding: 22px 30px; border-radius: 14px; background: var(--surface); border: 2px dashed var(--brand); font-weight: 600; color: var(--brand-ink); }

/* ------------------------------------------------------------ summary table */
table.sum-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sum-table th { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.sum-table th:nth-child(2), .sum-table th:first-child { text-align: left; }
.sum-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.sum-table td:first-child { color: var(--muted); text-align: left; width: 46px; }
.sum-table td:nth-child(2) { text-align: left; font-weight: 600; }
.sum-table td small { font-size: 10px; color: var(--muted); }
.sum-table tr.total td { background: var(--surface-3); font-weight: 700; }
.sum-table tr.zero td { color: var(--muted); }
.sum-table tr.zero td:nth-child(2) { font-weight: 500; }
.sum-table tr.post td { background: var(--surface); }
.sum-table td.act { text-align: center; width: 90px; }

.checks { list-style: none; margin: 0; padding: 8px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.checks li i { font-style: normal; font-weight: 800; width: 18px; text-align: center; }
.checks li.err  { background: var(--crit-soft); color: var(--crit); }
.checks li.warn { background: var(--warn-soft); color: var(--warn); }
.checks li.info { background: var(--surface-2); color: var(--text-2); }
.checks li.ok   { background: var(--good-soft); color: var(--good); }

/* ------------------------------------------------------------ popover */
.popover {
  position: absolute; z-index: 60; display: grid; grid-template-columns: repeat(3, 214px); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.22);
}
.pop-col { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border); }
.pop-col:last-child { border-right: 0; }
.pop-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.ficon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; font: 700 11px var(--mono); color: #fff; }
.ficon.json { background: #6b7c85; }
.ficon.tally { background: #2f7591; font-family: inherit; }
.ficon.xls { background: #1f7a45; font-family: inherit; }
.pop-col .check { font-size: 12.5px; }

/* ------------------------------------------------------------ KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi-row.slim .kpi { padding: 11px 15px; }
.kpi-row.slim .kpi-value { font-size: 21px; }
@media (max-width: 1080px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi.accent { box-shadow: var(--shadow), inset 3px 0 0 var(--brand); }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.kpi-value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--text-2); }
.split-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.split-tiles > div { background: var(--surface); padding: 13px 16px; }
.split-tiles span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.split-tiles strong { font-size: 19px; font-variant-numeric: tabular-nums; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; margin-bottom: 16px; border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius-sm); font-size: 13px; }
.msg { margin: 0 18px 14px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.msg.ok   { background: var(--good-soft); color: var(--good); }
.msg.err  { background: var(--crit-soft); color: var(--crit); }
.msg.info { background: var(--surface-2); color: var(--text-2); }
.modal .msg { margin: 0; }

/* ------------------------------------------------------------ charts */
.chart { padding: 16px 18px 18px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.bar-track { fill: var(--surface-2); }
.bar-label { fill: var(--text-2); font-size: 12px; }
.bar-value { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-sm { padding-top: 8px; }
.empty { padding: 28px 18px; color: var(--muted); font-size: 13px; text-align: center; }

/* ------------------------------------------------------------ data tables */
.table-wrap { overflow: auto; }
.table-wrap.tall { max-height: 64vh; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  text-align: left; padding: 9px 11px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.table-wrap tbody td { padding: 7px 11px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-wrap tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right !important; font-variant-numeric: tabular-nums; }
td.code { font-family: var(--mono); font-size: 12px; }
td.wrap { white-space: normal; min-width: 220px; }
tfoot td { padding: 9px 11px; font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-strong); white-space: nowrap; }
tr.is-nil td, tr.is-cancelled td { color: var(--muted); }
tr.is-cancelled td { text-decoration: line-through; }
tr.is-cancelled td.act { text-decoration: none; }
tr.is-changed td { background: var(--warn-soft); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag.inter { background: var(--surface-3); color: var(--text-2); }
.tag.intra { background: var(--brand-tint); color: var(--brand-ink); }
.tag.sec { background: var(--brand-soft); color: var(--brand-ink); border-radius: 5px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 7px; vertical-align: 1px; }
.neg { color: var(--crit); }
.pos { color: var(--good); }
td.act { text-align: right; }
td.act .acts { display: inline-flex; gap: 4px; }
.mini { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.mini:hover { background: var(--brand-tint); color: var(--brand-ink); }
.mini.red:hover { background: var(--crit-soft); color: var(--crit); }

td.edit input { width: 96px; padding: 4px 7px; font-family: var(--mono); font-size: 12px; }
td.edit input.wide { width: 170px; font-family: inherit; }
td.edit input.dirty { border-color: var(--warn); background: var(--warn-soft); }
#masterTable table { font-size: 12.5px; }
#masterTable td, #masterTable th { padding: 6px 9px; }
#masterTable td:nth-child(3) { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
#masterTable td:nth-child(2) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ bill form */
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bf { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.bf .form-grid { padding: 12px 14px; gap: 10px 12px; }
.items-wrap { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table.items { width: 100%; border-collapse: collapse; font-size: 13px; }
table.items th { background: var(--surface-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); padding: 7px 6px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.items td { padding: 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.items td.c, th.c { text-align: center; color: var(--muted); width: 30px; }
table.items input, table.items select { padding: 6px 7px; font-size: 13px; border-color: transparent; background: transparent; }
table.items input:hover, table.items select:hover { border-color: var(--border); }
table.items input:focus, table.items select:focus { background: var(--surface); }
table.items .w-desc { min-width: 220px; }
table.items .w-hsn { width: 92px; font-family: var(--mono); }
table.items .w-n { width: 84px; text-align: right; }
table.items .w-s { width: 70px; text-align: right; }
table.items .w-uqc { width: 76px; }
table.items .w-gst { width: 92px; }
table.items td.calc { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); padding-right: 10px; white-space: nowrap; }
table.items td.calc b { color: var(--text); }
table.items .rm { border: 0; background: none; color: var(--muted); font-size: 15px; width: 26px; }
table.items .rm:hover { color: var(--crit); }
.add-row { margin: 8px; }
.bill-foot { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-top: 14px; align-items: start; }
.bill-msgs ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.bill-msgs .err { color: var(--crit); }
.bill-msgs .warn { color: var(--warn); }
.bill-totals { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); }
.bill-totals div { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; font-size: 13px; }
.bill-totals .grand { border-top: 2px solid var(--brand); margin-top: 6px; padding-top: 7px; font-size: 17px; font-weight: 700; color: var(--brand-ink); }
.bill-totals .words { display: block; font-size: 11.5px; color: var(--muted); padding-top: 4px; }

/* ------------------------------------------------------------ bulk grid */
.bulk-wrap { overflow: auto; max-height: 62vh; }
table.bulk { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
table.bulk th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 10.5px; text-transform: uppercase; color: var(--text-2); padding: 7px 6px; border: 1px solid var(--border); white-space: nowrap; }
table.bulk td { border: 1px solid var(--border); padding: 0; }
table.bulk td.rn { text-align: center; color: var(--muted); width: 34px; background: var(--surface-2); font-size: 11px; }
table.bulk input, table.bulk select { border: 0; border-radius: 0; padding: 6px 6px; font-size: 12.5px; background: transparent; min-width: 0; }
table.bulk input:focus, table.bulk select:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--surface); }
table.bulk td.calc { text-align: right; padding: 0 8px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface-2); }
table.bulk td.st { padding: 0 8px; font-size: 11.5px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.bulk tr.ok td.st { color: var(--good); }
table.bulk tr.err td { background: var(--crit-soft); }
table.bulk tr.err td.st { color: var(--crit); }
table.bulk tr.warnrow td.st { color: var(--warn); }
table.bulk .bad { color: var(--crit); }
.bulk-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.bulk-foot b { color: var(--text); }

/* ------------------------------------------------------------ export */
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px; }
@media (max-width: 1100px) { .export-grid { grid-template-columns: 1fr 1fr; } }
.pick { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.pick:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pick input { margin-top: 2px; accent-color: var(--brand); width: 16px; height: 16px; }
.pick b { display: block; font-size: 13.5px; }
.pick em { font-style: normal; font-size: 12px; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 0 18px 6px; font-size: 13px; }
.export-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.built { list-style: none; margin: 0; padding: 0 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.built li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 8px 11px; background: var(--surface-2); border-radius: 7px; }
.built li span { font-family: var(--mono); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 -8px; background: var(--bg); border-top: 1px solid var(--border); }
#platformRows input { padding: 6px 8px; }

/* ------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(8,20,26,.45); display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(620px, 96vw); max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; }
.modal-box.sm { width: min(420px, 96vw); }
.modal-box.lg { width: min(860px, 96vw); }
.modal-box.xl { width: min(1240px, 97vw); }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; overflow: auto; }
.modal-body.form-grid { padding: 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.crumb { padding: 10px 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; }
.modal-list { overflow: auto; padding: 6px; max-height: 50vh; }
.modal-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 6px; color: var(--text); font-size: 13px; }
.modal-list button:hover { background: var(--surface-2); }

/* ------------------------------------------------------------ toast + busy */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95; padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 13px; font-weight: 500; box-shadow: 0 8px 28px rgba(0,0,0,.25); max-width: 80vw; }
.busy { position: fixed; inset: 0; z-index: 96; display: grid; place-content: center; justify-items: center; gap: 14px; background: color-mix(in srgb, var(--bg) 78%, transparent); color: var(--text-2); font-size: 13px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

@media (max-width: 900px) {
  :root { --rail-w: 64px; }
  .nav-item { font-size: 0; justify-content: center; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-group, .rail-foot, .nav-badge, .portal { display: none; }
  .client-btn { min-width: 0; }
  .bill-grid, .bill-foot { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ brand mark (v3) */
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: #fff; color: var(--brand); box-shadow: 0 2px 6px rgba(0,0,0,.15); overflow: hidden;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; background: #fff; }

/* ------------------------------------------------------------ branding settings */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 18px; }
.logo-slot { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.logo-prev { width: 84px; height: 84px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 1px dashed var(--border-strong); overflow: hidden; color: var(--muted); font-size: 11px; }
.logo-prev.dark { background: var(--brand); border-style: solid; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-prev .brand-mark { width: 52px; height: 52px; border-radius: 13px; }
.logo-prev .brand-mark svg { width: 34px; height: 34px; }
.logo-meta { flex: 1; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1100px) { .brand-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ rate convert */
.rc-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px 18px; }
.rc-explain { display: flex; gap: 12px; align-items: flex-start; max-width: 720px; }
.rc-explain p { margin-top: 2px; }
.rc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 18px; }
.rc-opts { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.rc-sel { width: 92px !important; padding: 5px 8px !important; font-size: 12.5px !important; }
.rc-sel.changed { border-color: var(--brand); background: var(--brand-tint); font-weight: 700; }
tr.rc-hl td { background: var(--brand-tint) !important; }
.was { font-size: 11px; color: var(--muted); margin-left: 4px; }
.rule-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-ink); margin-left: 6px; font-weight: 700; }
td.chk, th.chk { width: 30px; text-align: center; }
td.chk input, th.chk input { accent-color: var(--brand); width: 15px; height: 15px; }

/* ------------------------------------------------------------ quarterly */
.banner.info { border-left-color: var(--brand); background: var(--brand-tint); }
.q-month { color: var(--text-2); }
.q-total { font-weight: 700; }

#confirmText { white-space: pre-line; line-height: 1.6; }

#view-rates .table-wrap table { font-size: 12.5px; }
#view-rates .table-wrap tbody td, #view-rates .table-wrap thead th { padding: 6px 8px; }
td.rc-desc { white-space: normal; min-width: 200px; max-width: 320px; }
td.rc-desc small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
td.rc-desc small .dot { margin-right: 3px; }

/* Quarterly: check for a single line per B2CS / HSN */
.q-valid { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.q-valid.ok { background: var(--good-soft); color: var(--good); }
.q-valid.bad { background: var(--crit-soft); color: var(--crit); }
.q-valid small { font-weight: 500; opacity: .85; }
tr.neg-row td { color: var(--crit); }

#confirmText { white-space: pre-line; }

/* B2CS: state mapping + cash-back */
.sm-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.sm-tag.good { background: var(--good-soft); color: var(--good); }
.sm-tag.mid { background: var(--warn-soft); color: var(--warn); }
.sm-tag.bad { background: var(--crit-soft); color: var(--crit); }
.sm-tag.info { background: var(--brand-tint); color: var(--brand-ink); }
.sm-sel { padding: 4px 8px !important; font-size: 12.5px !important; max-width: 230px; }
.cb-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 18px; }
.cb-sum > div { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cb-sum span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.cb-sum b { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .cb-sum { grid-template-columns: 1fr 1fr; } }
.ti-grid { padding: 0 18px; }
.ti-in { width: 100%; min-width: 200px; }
.ti-in.bad { border-color: var(--crit) !important; background: var(--crit-soft); }
.up-file .up-recon { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-tint); border-radius: 999px; padding: 1px 7px; flex: none; }

/* HSN / rate master: HSN-wise (all platforms) */
.mg-table td { vertical-align: middle; }
.mg-tog { border: 0; background: var(--surface-3); color: var(--brand-ink); width: 24px; height: 24px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.mg-tog:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.mg-chs { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; min-width: 230px; max-width: 300px; }
.mg-ch { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; white-space: nowrap; }
.mg-ch em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.mg-multi { font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-tint); border-radius: 999px; padding: 1px 7px; }
.mg-src { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.mg-now { font-size: 12.5px; white-space: nowrap; }
.mg-sub > td { background: var(--surface-2); padding: 6px 10px 12px; }
.mg-mini { width: 100%; font-size: 12px; }
.mg-mini th { font-size: 11px; }
.mg-note { display: block; font-size: 10.5px; color: var(--warn); margin-top: 2px; }
td.edit input.bad { border-color: var(--crit); background: var(--crit-soft); }
#masterDigitsWrap { font-size: 12.5px; }
.mg-table td.edit input { width: 84px; }
.mg-table td.edit input.wide { width: 150px; }
.mg-table td.num { white-space: nowrap; }
#view-master .card-head h2 { white-space: nowrap; }

/* Change history */
.hist-user { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.hist-user input { width: 150px; }
.hist-list { display: flex; flex-direction: column; }
.hist-item { border-top: 1px solid var(--border); }
.hist-item.is-undone .hist-row { opacity: .55; }
.hist-row { display: grid; grid-template-columns: 28px 120px 150px minmax(0, 1fr) 70px auto; gap: 12px; align-items: center; padding: 10px 18px; }
.hist-when { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.hist-who { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-what { font-size: 12.5px; line-height: 1.45; }
.hist-n { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.hist-act { display: flex; gap: 6px; justify-content: flex-end; }
.hist-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-ink); margin-right: 4px; white-space: nowrap; }
.hist-tag.rates { background: var(--warn-soft); color: var(--warn); }
.hist-tag.undo { background: var(--surface-3); color: var(--text-2); }
.hist-tag.gone { background: var(--crit-soft); color: var(--crit); }
.hist-detail { padding: 0 18px 14px 58px; }
.hist-t { width: 100%; font-size: 12px; }
.hist-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 12.5px; }
.hist-rules ul { margin: 4px 0 0 18px; }
@media (max-width: 1000px) { .hist-row { grid-template-columns: 28px 1fr auto; } .hist-who, .hist-n { display: none; } }

/* Client PDF modal */
.cpdf-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.cpdf-kpis div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.cpdf-kpis div.pay { background: var(--good-soft); border-color: transparent; }
.cpdf-kpis span { font-size: 11.5px; color: var(--muted); }
.cpdf-kpis b { font-size: 16px; font-variant-numeric: tabular-nums; }
.cpdf-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cpdf-grid .field > span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cpdf-grid textarea { width: 100%; resize: vertical; font: inherit; font-size: 13px; line-height: 1.5; }
.cpdf-grid input { width: 220px; }
.cpdf-note { font-size: 12px; margin-top: 8px; }
#cpdfModal .modal-head .muted { font-size: 12px; }
@media (max-width: 640px) { .cpdf-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ================= Dashboard tabs + charts (v9) ================= */
.dash-tabs { margin-bottom: 16px; }
.dash-pane.is-loading { opacity: .55; transition: opacity .15s; }
.vz-host { padding: 6px 16px 8px; min-height: 40px; }
.vz-plot { width: 100%; overflow: hidden; }
svg.vz { display: block; max-width: 100%; height: auto; font-family: inherit; }
.vz .vz-grid { stroke: var(--vz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.vz .vz-base { stroke: var(--vz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.vz .vz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.vz .vz-cat { fill: var(--text-2); font-size: 12px; }
.vz .vz-lab { fill: var(--text); font-size: 11.5px; font-weight: 650; }
.vz .vz-none { fill: var(--muted); font-size: 12px; }
.vz .vz-short { fill: var(--crit); font-size: 10.5px; font-weight: 700; }
.vz .vz-hit { fill: transparent; outline: none; }
.vz .vz-hit:focus-visible { stroke: var(--brand); stroke-width: 2; }
.vz .vz-hover { fill: var(--brand); opacity: .06; pointer-events: none; }
.vz .vz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vz .vz-dot { stroke: var(--surface); stroke-width: 2; }
.vz .vz-cross { stroke: var(--vz-axis); stroke-width: 1; pointer-events: none; }
.vz .vz-conn { stroke: var(--vz-axis); stroke-width: 1; }
.vz .vz-db { stroke: var(--vz-axis); stroke-width: 2; }
.vz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 2px 2px; font-size: 12px; color: var(--text-2); }
.vz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vz-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vz-legend i.ln { height: 2px; width: 14px; border-radius: 1px; }
.vz-legend i.dot { border-radius: 50%; }
.vz-table { margin-top: 6px; font-size: 12.5px; }
.vz-table summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; font-size: 12px; padding: 4px 0; list-style: none; }
.vz-table summary::-webkit-details-marker { display: none; }
.vz-table summary::before { content: '▸ '; }
.vz-table[open] summary::before { content: '▾ '; }
.vz-table .table-wrap { max-height: 280px; }
.vz-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(16,34,43,.16); padding: 8px 10px; font-size: 12px; min-width: 150px; max-width: 280px; }
.vz-tip-t { font-weight: 700; margin-bottom: 4px; color: var(--text-2); font-size: 11.5px; }
.vz-tip-r { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.vz-tip-r i { width: 12px; height: 2.5px; border-radius: 2px; flex: none; }
.vz-tip-r b { font-variant-numeric: tabular-nums; font-weight: 700; }
.vz-tip-r span { color: var(--muted); }
.vz-tip-f { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); color: var(--text-2); }
.vz-scale { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 8px 2px 2px; }
.vz-scale span { display: inline-flex; align-items: center; gap: 5px; }
.vz-scale i { width: 14px; height: 10px; border-radius: 3px; }
.vz-scale-t { font-weight: 600; color: var(--text-2); }
.vz-stat { font-size: 13px; color: var(--text-2); margin: 4px 0 0; }
.vz-stat b { color: var(--text); }
/* calendar */
.vz-cal-wrap { display: flex; flex-wrap: wrap; gap: 22px; }
.vz-cal { flex: 0 1 300px; }
.vz-cal-h { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.vz-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.vz-cal-dow { font-size: 10.5px; color: var(--muted); text-align: center; }
.vz-cal-d { aspect-ratio: 1; border: 0; border-radius: 6px; font-size: 11px; color: var(--text-2); background: var(--sq-0); padding: 0; cursor: default; font-variant-numeric: tabular-nums; }
.vz-cal-d.c1 { background: var(--sq-1); } .vz-cal-d.c2 { background: var(--sq-2); } .vz-cal-d.c3 { background: var(--sq-3); color: #fff; }
.vz-cal-d.c4 { background: var(--sq-4); color: #fff; } .vz-cal-d.c5 { background: var(--sq-5); color: #fff; }
.vz-cal-d:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.vz-cal-f { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
:root[data-theme="dark"] .vz-cal-d.c1, :root[data-theme="dark"] .vz-cal-d.c2, :root[data-theme="dark"] .vz-cal-d.c3 { color: #e8f0f6; }
:root[data-theme="dark"] .vz-cal-d.c4, :root[data-theme="dark"] .vz-cal-d.c5 { color: #0b1a24; }
/* tile map */
.vz-tiles .vz-tile { outline: none; }
.vz-tiles .vz-tile rect { transition: opacity .12s; }
.vz-tiles .vz-tile:hover rect, .vz-tiles .vz-tile:focus rect { opacity: .82; }
.vz-tiles .vz-tile:focus-visible rect { stroke: var(--brand); stroke-width: 2; }
.vz-tiles .vz-tile.home rect { stroke: var(--text); stroke-width: 1.5; }
.vz-tile-t { font-size: 11px; font-weight: 700; fill: var(--text); }
.vz-tile-v { font-size: 9.5px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.vz-tile-t.inv, .vz-tile-v.inv { fill: #fff; }
:root[data-theme="dark"] .vz-tile-t, :root[data-theme="dark"] .vz-tile-v { fill: #e8f0f6; }
:root[data-theme="dark"] .vz-tile-t.inv, :root[data-theme="dark"] .vz-tile-v.inv { fill: #0b1a24; }
.vz-detail { padding: 4px 16px 14px; }
.vz-detail h3 { font-size: 13.5px; margin: 6px 0; }
/* heat table */
table.vz-heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; width: 100%; }
table.vz-heat th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: center; padding: 4px; }
table.vz-heat th:first-child { text-align: left; }
table.vz-heat td { text-align: center; padding: 6px 4px; border-radius: 5px; font-variant-numeric: tabular-nums; color: var(--text); outline: none; }
table.vz-heat td.rh { text-align: left; color: var(--text-2); white-space: nowrap; }
table.vz-heat td.na { color: var(--muted); }
table.vz-heat td.thin { color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.vz-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
table.vz-heat td.inv { color: #fff; }
table.vz-heat td:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
:root[data-theme="dark"] table.vz-heat td.inv { color: #0b1a24; }
/* treemap */
.vz-tm { outline: none; }
.vz-tm:hover rect, .vz-tm:focus rect { opacity: .85; }
.vz-tm-t { fill: #fff; font-size: 12px; font-weight: 700; }
.vz-tm-v { fill: #fff; font-size: 11px; opacity: .9; font-variant-numeric: tabular-nums; }
/* TCS small multiples */
.vz-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.vz-mbox { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px 4px; }
.vz-mbox h3 { font-size: 13px; margin: 2px 0 4px; display: flex; align-items: center; }
/* portfolio */
.pf-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-pill { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pf-pill.mute { background: var(--surface-3); color: var(--text-2); }
.pf-pill.info { background: var(--brand-tint); color: var(--brand-ink); }
.pf-pill.mid { background: var(--warn-soft); color: var(--warn); }
.pf-pill.good { background: var(--good-soft); color: var(--good); }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; padding: 12px 16px 16px; }
.pf-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.pf-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pf-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pf-top b { display: block; font-size: 14px; }
.pf-top .mono { font-size: 11px; }
.pf-nums { display: flex; gap: 14px; flex-wrap: wrap; min-height: 38px; align-items: center; }
.pf-nums div { display: flex; flex-direction: column; }
.pf-nums span { font-size: 11px; color: var(--muted); }
.pf-nums b { font-size: 15px; }
.pf-nums .muted { font-size: 12px; }
.pf-ch { font-size: 12px; min-height: 18px; }
.pf-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.pf-filed { font-size: 12px; display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); }
@media (max-width: 1100px) { .vz-map-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dash-pane.is-loading { transition: none; } }
