/* GST Fetch – Glass UI (v2.7). No external fonts or assets (strict CSP).
   Frosted-glass panels over a soft aurora background. Every panel keeps enough
   opacity for figures and tables to stay easy to read. */
:root {
  --bg: #e9f3f1;
  --ink: #0f2420; --ink-2: #2f463f; --muted: #587069; --faint: #93a8a1;
  --line: rgba(15, 52, 46, .13); --line-2: rgba(15, 52, 46, .08);
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .78); --glass-3: rgba(255, 255, 255, .44);
  --glass-edge: rgba(255, 255, 255, .78); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --blur: blur(18px) saturate(165%);
  --side-a: rgba(9, 46, 42, .84); --side-b: rgba(13, 31, 52, .80); --side-ink: #cfe5de; --side-dim: #86a9a0; --side-2: rgba(255,255,255,.08);
  --primary: #0f766e; --primary-2: #0b5f58; --primary-soft: rgba(20, 184, 166, .14); --primary-line: rgba(15, 118, 110, .32);
  --accent: #34d399; --accent-2: #a7f3d0; --violet: #7c83f0;
  --ok: #138a46; --ok-soft: rgba(34, 197, 94, .14); --ok-line: rgba(21, 128, 61, .28);
  --bad: #c0352b; --bad-soft: rgba(239, 68, 68, .12); --bad-line: rgba(192, 53, 43, .30);
  --warn: #a15c07; --warn-soft: rgba(245, 158, 11, .15); --warn-line: rgba(161, 92, 7, .30);
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 1px rgba(15, 52, 46, .04), 0 10px 30px -14px rgba(15, 60, 55, .28);
  --shadow-hi: 0 2px 4px rgba(15, 52, 46, .05), 0 22px 44px -18px rgba(15, 60, 55, .38);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--ink);
  font: 13.5px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: transparent; }
/* aurora: fixed, static (no animation, so the glass blur stays cheap) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 6% 10%, rgba(45, 212, 191, .50), transparent 70%),
    radial-gradient(34% 42% at 96% 4%, rgba(129, 140, 248, .42), transparent 70%),
    radial-gradient(40% 46% at 82% 92%, rgba(56, 189, 248, .36), transparent 70%),
    radial-gradient(42% 46% at 14% 96%, rgba(110, 231, 183, .55), transparent 70%),
    radial-gradient(30% 34% at 52% 48%, rgba(251, 191, 36, .13), transparent 70%),
    linear-gradient(135deg, #e3f4ef 0%, #edf2fb 50%, #e6f6f4 100%); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13.5px; font-weight: 650; }
p { margin: 0 0 10px; }
a { color: var(--primary); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
svg.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--accent-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(15, 52, 46, .18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(15, 52, 46, .30); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes sheen { from { background-position: -200% 0; } to { background-position: 200% 0; } }
main.enter > * { animation: rise .45s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .05s; }
main.enter > *:nth-child(3) { animation-delay: .10s; }
main.enter > *:nth-child(4) { animation-delay: .15s; }
main.enter > *:nth-child(5) { animation-delay: .20s; }
main.enter > *:nth-child(n+6) { animation-delay: .24s; }
.pagehead > div:first-child { animation: fade .35s var(--ease) both; }

/* ------------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px; z-index: 6;
  display: flex; flex-direction: column; color: var(--side-ink); border-radius: 22px; overflow: hidden;
  background: linear-gradient(165deg, var(--side-a) 0%, var(--side-b) 100%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 50px -22px rgba(6, 30, 40, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); }
.side::before { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(52, 211, 153, .30), transparent 70%); }
.side::after { content: ""; position: absolute; width: 240px; height: 240px; left: -110px; bottom: -100px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 131, 240, .26), transparent 70%); }
.side > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand img { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255,255,255,.18); }
.brand b { display: block; color: #fff; font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.brand small { display: block; color: var(--side-dim); font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 4px 12px 12px; overflow-y: auto; }
.nav-label { color: var(--side-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
  padding: 14px 10px 5px; }
.tab { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent;
  color: var(--side-ink); border: 1px solid transparent; padding: 8px 10px 8px 12px; border-radius: 11px; cursor: pointer; font: inherit; font-size: 13.5px;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s, transform .18s var(--ease); }
.tab svg.ico { opacity: .8; transition: opacity .18s, transform .25s var(--ease); }
.tab:hover { background: var(--side-2); color: #fff; transform: translateX(2px); }
.tab:hover svg.ico { opacity: 1; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab.on { color: #fff; font-weight: 600; border-color: rgba(255, 255, 255, .16);
  background: linear-gradient(120deg, rgba(52, 211, 153, .26), rgba(124, 131, 240, .16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px -10px rgba(0, 0, 0, .5); }
.tab.on svg.ico { opacity: 1; color: var(--accent); transform: scale(1.08); }
.tab.on::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: grow-y .3s var(--ease) both; }
.tab .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 12px; }
.side-foot .who { color: #fff; font-weight: 600; font-size: 13px; }
.side-foot .timer { color: var(--side-dim); margin: 2px 0 10px; display: flex; align-items: center; gap: 6px; }
.side-foot .timer::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .2), 0 0 8px var(--accent); }
.side-foot .btn, .side-foot .btn.ghost { width: 100%; justify-content: center; background: rgba(255, 255, 255, .08); color: #fff;
  border-color: rgba(255, 255, 255, .22); backdrop-filter: none; }
.side-foot .btn.ghost:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .38); color: #fff; }

.content { min-width: 0; display: flex; flex-direction: column; }
.pagehead { margin: 14px 18px 0; padding: 14px 22px; border-radius: var(--radius);
  background: var(--glass-2); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), var(--glass-hi);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: sticky; top: 14px; z-index: 4; }
.pagehead > div:first-child { min-width: 0; }
.pagehead .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
main { padding: 20px 18px 60px; max-width: 1420px; width: 100%; }

/* ------------------------------------------------------------------ glass cards / grids */
.card, .stats, .stat.tile, .kpi, .action-tile, .segmented, .result {
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.card { background: linear-gradient(140deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .56));
  border: 1px solid var(--glass-edge); border-radius: var(--radius); margin-bottom: 18px;
  box-shadow: var(--shadow), var(--glass-hi); transition: box-shadow .25s var(--ease); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.card-b { padding: 16px 20px 20px; }
.card-b.flush { padding: 0; }
.card-b.flush > .tablewrap { border-radius: 0 0 var(--radius) var(--radius); }
.card-f { padding: 10px 20px; border-top: 1px solid var(--line-2); background: rgba(255, 255, 255, .35); border-radius: 0 0 var(--radius) var(--radius); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; margin-bottom: 18px; }
.grid-fetch { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid2 > *, .grid-main > *, .grid-fetch > *, .dash-top > * { min-width: 0; }
.grid2 > .card, .grid-main > .card, .grid-fetch > .card { margin-bottom: 0; }
.gap { height: 16px; }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--glass);
  border: 1px solid var(--glass-edge); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow), var(--glass-hi); }
.stat { padding: 15px 20px; border-left: 1px solid var(--line-2); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.4px; }
.stat .d { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* stat tiles (dashboard) */
.stats.tiles { background: transparent; border: 0; box-shadow: none; gap: 14px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.stats.tiles.mini { grid-template-columns: repeat(2, minmax(0, 300px)); }
.stat.tile { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(140deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .5));
  border: 1px solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--shadow), var(--glass-hi);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.stat.tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(20, 184, 166, .16), transparent 70%); }
.stat.tile.ok::after { background: radial-gradient(circle, rgba(34, 197, 94, .16), transparent 70%); }
.stat.tile.bad::after { background: radial-gradient(circle, rgba(239, 68, 68, .18), transparent 70%); }
.stat.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi), var(--glass-hi); }
.tile-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(20, 184, 166, .22), rgba(124, 131, 240, .16)); color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 10px -4px rgba(15, 118, 110, .35); }
.tile-ico svg.ico { width: 19px; height: 19px; }
.tile-txt { min-width: 0; flex: 1; }
.stat.tile.ok .tile-ico { background: linear-gradient(135deg, rgba(34, 197, 94, .24), rgba(52, 211, 153, .14)); color: var(--ok); }
.stat.tile.bad .tile-ico { background: linear-gradient(135deg, rgba(239, 68, 68, .22), rgba(251, 146, 60, .14)); color: var(--bad); }

/* dashboard */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; margin-bottom: 18px; }
.dash-top > .card { margin-bottom: 0; }
.health { display: flex; gap: 26px; align-items: center; padding: 24px 28px; overflow: hidden; position: relative;
  background: linear-gradient(125deg, rgba(255, 255, 255, .80) 0%, rgba(220, 252, 239, .62) 55%, rgba(204, 238, 250, .55) 100%); }
.health::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, .30), rgba(52, 211, 153, 0) 70%); pointer-events: none; }
.health::before { content: ""; position: absolute; left: 30%; bottom: -120px; width: 260px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 131, 240, .16), transparent 70%); pointer-events: none; }
.health > * { position: relative; z-index: 1; }
.health.fair { background: linear-gradient(125deg, rgba(255, 255, 255, .80) 0%, rgba(255, 244, 214, .66) 60%, rgba(255, 232, 196, .55) 100%); }
.health.fair::after { background: radial-gradient(circle, rgba(245, 158, 11, .26), transparent 70%); }
.health.poor { background: linear-gradient(125deg, rgba(255, 255, 255, .80) 0%, rgba(255, 228, 225, .66) 60%, rgba(254, 215, 210, .55) 100%); }
.health.poor::after { background: radial-gradient(circle, rgba(239, 68, 68, .24), transparent 70%); }
.health h2 { font-size: 19px; margin: 2px 0 6px; letter-spacing: -.3px; }
.health p { max-width: 520px; }
.health .row { margin-top: 12px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--primary); }
.health.fair .eyebrow { color: var(--warn); } .health.poor .eyebrow { color: var(--bad); }
.health-ring { position: relative; width: 132px; height: 132px; flex: none; border-radius: 50%;
  background: rgba(255, 255, 255, .55); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 26px -12px rgba(15, 60, 55, .35); }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .track { stroke: rgba(15, 118, 110, .10); }
.ring .arc { stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 0 4px rgba(34, 197, 94, .45)); }
.ring.fair .arc { stroke: #d99a2b; filter: drop-shadow(0 0 4px rgba(217, 154, 43, .45)); }
.ring.poor .arc { stroke: var(--bad); filter: drop-shadow(0 0 4px rgba(192, 53, 43, .4)); }
.ring.idle .arc { stroke: transparent; filter: none; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 28px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); animation: rise .4s var(--ease) both; }
.due-list li:first-child { border-top: 0; padding-top: 0; }
.due-list li:nth-child(2) { animation-delay: .06s; } .due-list li:nth-child(3) { animation-delay: .12s; } .due-list li:nth-child(4) { animation-delay: .18s; }
.due-date { width: 46px; height: 46px; border-radius: 12px; color: var(--primary-2);
  background: linear-gradient(135deg, rgba(20, 184, 166, .20), rgba(124, 131, 240, .14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex: none; }
.due-date b { font-size: 17px; } .due-date span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.due-date.over { background: linear-gradient(135deg, rgba(239, 68, 68, .2), rgba(251, 146, 60, .14)); color: var(--bad); }
.due-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.due-list li.notice { cursor: pointer; }
.due-list li.notice:hover .due-txt b { color: var(--primary); }
.mbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: end; height: 160px; }
.mbar { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; min-width: 0; }
.mbar .col { flex: 1; width: 100%; max-width: 36px; background: rgba(15, 52, 46, .06); border-radius: 9px; display: flex; align-items: flex-end; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 52, 46, .06); }
.mbar .col i { display: block; width: 100%; height: 0; border-radius: 9px; background: linear-gradient(180deg, #67e8f9, #14b8a6 55%, var(--primary));
  box-shadow: 0 0 12px rgba(20, 184, 166, .35); transition: height .8s var(--ease); }
.mbar.full .col i { background: linear-gradient(180deg, var(--accent), var(--ok)); box-shadow: 0 0 12px rgba(52, 211, 153, .4); }
.mbar:nth-child(2) i { transition-delay: .03s; } .mbar:nth-child(3) i { transition-delay: .06s; } .mbar:nth-child(4) i { transition-delay: .09s; }
.mbar:nth-child(5) i { transition-delay: .12s; } .mbar:nth-child(6) i { transition-delay: .15s; } .mbar:nth-child(7) i { transition-delay: .18s; }
.mbar:nth-child(8) i { transition-delay: .21s; } .mbar:nth-child(9) i { transition-delay: .24s; } .mbar:nth-child(10) i { transition-delay: .27s; }
.mbar:nth-child(11) i { transition-delay: .30s; } .mbar:nth-child(12) i { transition-delay: .33s; }
.mbar .pct { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mbar .lbl { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, rgba(20, 184, 166, .28), rgba(124, 131, 240, .24)); color: var(--primary-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }

/* action tiles (Reconcile → year-end) */
.action-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.action-tile { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 15px 16px; border: 1px solid var(--glass-edge);
  border-radius: 14px; background: rgba(255, 255, 255, .5); cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--glass-hi);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s, background-color .2s; }
.action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi), var(--glass-hi); border-color: var(--primary-line); background: rgba(255, 255, 255, .8); }
.action-tile:disabled { opacity: .6; cursor: progress; transform: none; }
.action-tile .tile-txt { display: flex; flex-direction: column; gap: 3px; }
.action-tile b { font-size: 14px; }
ul.ticks { list-style: none; margin: 0; padding: 0; }
ul.ticks li { display: flex; gap: 9px; padding: 6px 0; font-size: 13px; color: var(--ink-2); }
ul.ticks li svg { color: var(--ok); margin-top: 2px; }

/* tools: segmented tabs + result */
.segmented { display: inline-flex; gap: 4px; padding: 5px; background: var(--glass-3); border: 1px solid var(--glass-edge); border-radius: 14px;
  margin-bottom: 18px; flex-wrap: wrap; max-width: 100%; box-shadow: var(--shadow), var(--glass-hi); }
.seg { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px;
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background-color .2s var(--ease), color .2s, box-shadow .2s; }
.seg:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
.seg.on { background: rgba(255, 255, 255, .92); color: var(--primary-2); font-weight: 600; box-shadow: 0 4px 12px -4px rgba(15, 60, 55, .3), var(--glass-hi); }
.seg.on svg.ico { color: var(--primary); }
.tool-area.enter > * { animation: rise .35s var(--ease) both; }
.tool-area.enter > *:nth-child(2) { animation-delay: .05s; }
.result { margin-top: 16px; padding: 15px 17px; border-radius: 14px;
  background: linear-gradient(125deg, rgba(220, 252, 239, .8), rgba(204, 238, 250, .6));
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), 0 10px 24px -14px rgba(15, 118, 110, .45); animation: pop .3s var(--ease) both; }
.result .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--primary); font-weight: 700; }
.result .v { font-size: 27px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; margin: 2px 0; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 600; font-size: 12px; color: var(--ink-2); margin: 12px 0 5px; }
form > label:first-child, .card-b > label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; height: 38px; padding: 6px 12px; border: 1px solid rgba(15, 52, 46, .16); border-radius: var(--radius-sm); font: inherit;
  background: rgba(255, 255, 255, .72); color: var(--ink); box-shadow: inset 0 1px 2px rgba(15, 52, 46, .05);
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
input[type=text]:hover, input[type=password]:hover, input[type=search]:hover, input[type=date]:hover, select:hover, textarea:hover { background: rgba(255, 255, 255, .88); }
textarea { height: auto; min-height: 140px; resize: vertical; line-height: 1.5; padding: 9px 12px; }
select { padding-right: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(20, 184, 166, .18); }
input.invalid { border-color: var(--bad); background: rgba(255, 245, 244, .9); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; flex: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.hint.bad { color: var(--bad); } .hint.good { color: var(--ok); }
.checks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.checks label, label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; color: var(--ink); font-size: 13px; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; padding: 6px 12px;
  border: 1px solid rgba(15, 52, 46, .16); border-radius: 999px; background: rgba(255, 255, 255, .62); font-weight: 500 !important; font-size: 12.5px !important;
  color: var(--ink-2) !important; cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.chip:hover { border-color: var(--primary-line); background: rgba(255, 255, 255, .85); }
.chip:has(input:checked) { border-color: var(--primary); background: linear-gradient(120deg, rgba(20, 184, 166, .18), rgba(52, 211, 153, .12));
  color: var(--primary-2) !important; box-shadow: 0 4px 12px -6px rgba(15, 118, 110, .5); }
.chip:has(input:disabled) { cursor: default; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.section-t { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--primary); font-weight: 700; margin: 18px 0 2px; }
.tool-row { margin-top: 12px; }
.tool-row input[type=file] { width: auto; flex: 0 1 260px; }
.lock-foot { margin-top: 14px; } .lock-foot .hint { margin: 0; }
input[type=file]:not([hidden]) { display: block; width: 100%; max-width: 100%; font: inherit; font-size: 13px; padding: 7px 8px;
  border: 1px dashed rgba(15, 118, 110, .35); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .45); color: var(--ink-2); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12.5px; margin-right: 10px; padding: 5px 12px; cursor: pointer;
  border: 1px solid var(--primary-line); border-radius: 8px; background: rgba(255, 255, 255, .9); color: var(--primary-2); }
input[type=file]::file-selector-button:hover { background: #fff; border-color: var(--primary); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 37px; border: 1px solid rgba(255, 255, 255, .25);
  background: linear-gradient(135deg, #14a394 0%, var(--primary) 55%, #0e5f6e 100%);
  color: #fff; padding: 0 16px; border-radius: 11px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px -8px rgba(15, 118, 110, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: filter .15s, box-shadow .2s, transform .1s, background-color .15s, border-color .15s; }
.btn:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 10px 22px -8px rgba(15, 118, 110, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(20, 184, 166, .3); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.green { background: linear-gradient(135deg, #22c55e 0%, var(--ok) 55%, #0f7a5a 100%); box-shadow: 0 6px 16px -8px rgba(19, 138, 70, .8), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn.green:hover { box-shadow: 0 10px 22px -8px rgba(19, 138, 70, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.ghost { background: rgba(255, 255, 255, .62); color: var(--ink-2); border-color: rgba(15, 52, 46, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 6px -4px rgba(15, 60, 55, .2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.ghost:hover { background: rgba(255, 255, 255, .92); border-color: var(--primary-line); color: var(--primary-2); filter: none; }
.btn.danger { background: linear-gradient(135deg, #ef4444, var(--bad) 60%, #9b2a22); box-shadow: 0 6px 16px -8px rgba(192, 53, 43, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; font-weight: 500; border-radius: 9px; }
.btn.block { width: 100%; justify-content: center; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-size: 12.5px; }
.link:hover { text-decoration: underline; }

/* alerts / badges */
.alert { padding: 11px 14px; border-radius: 12px; margin: 10px 0; font-size: 12.5px; border: 1px solid transparent; border-left-width: 3px; animation: fade .3s both;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.alert.err { background: rgba(254, 226, 222, .78); color: #7a1a12; border-color: var(--bad-line); border-left-color: var(--bad); }
.alert.warn { background: rgba(255, 241, 205, .8); color: #6b4004; border-color: var(--warn-line); border-left-color: var(--warn); }
.alert.ok { background: rgba(214, 245, 226, .8); color: #0f5132; border-color: var(--ok-line); border-left-color: var(--ok); }
.alert.info { background: rgba(214, 245, 240, .78); color: var(--primary-2); border-color: var(--primary-line); border-left-color: var(--primary); }
.alert .row { margin-top: 10px; }
.alert.stop { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; font-size: 13px; }
.alert.stop > svg.ico { width: 20px; height: 20px; margin-top: 1px; }
.alert.stop b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.badge, .status { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(15, 52, 46, .08); color: var(--ink-2); white-space: nowrap; line-height: 19px; border: 1px solid rgba(255, 255, 255, .6); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status.login::before, .status.fetching::before, .status.queued::before { animation: pulse 1.2s ease-in-out infinite; }
.status.done, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.status.error, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.status.cancelled { background: rgba(15, 52, 46, .08); color: var(--muted); }
.status.login, .status.fetching, .status.queued, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.side .badge { background: rgba(52, 211, 153, .22); color: #d1fae5; border-color: rgba(52, 211, 153, .3); }

/* ------------------------------------------------------------------ tables */
.tablewrap { overflow: auto; max-height: 64vh; }
.card-b:not(.flush) .tablewrap { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .35); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { position: sticky; top: 0; background: rgba(240, 248, 246, .94); text-align: left; font-weight: 650; color: var(--muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 240px; }
tbody td { transition: background-color .12s; }
tbody tr:hover td { background: rgba(255, 255, 255, .7); }
tr.bad td { background: rgba(254, 226, 222, .62); color: #7a1a12; }
tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.warn td { background: rgba(255, 241, 205, .66); color: #6b4004; }
tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tbody tr.bad:hover td { background: rgba(253, 213, 208, .85); } tbody tr.warn:hover td { background: rgba(255, 232, 180, .85); }
tr.total td { background: rgba(222, 240, 235, .96); font-weight: 700; border-top: 1px solid rgba(15, 52, 46, .2); position: sticky; bottom: 0; }
td.actions { text-align: right; }
td.actions .btn + .btn { margin-left: 4px; }
td.acts-wrap { white-space: normal; text-align: right; min-width: 210px; }
td.acts-wrap .btn { margin: 2px 0 2px 4px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* coverage */
.cov { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cov .track { width: 48px; height: 6px; background: rgba(15, 52, 46, .08); border-radius: 4px; overflow: hidden; }
.cov .track i { display: block; height: 100%; background: linear-gradient(90deg, #2dd4bf, var(--primary)); border-radius: 4px; animation: grow-x .7s var(--ease) both; transform-origin: left; }
.cov.full .track i { background: linear-gradient(90deg, var(--accent), var(--ok)); }
.cov.none { color: var(--faint); }
table.matrix { font-size: 12px; }
table.matrix th, table.matrix td { padding: 6px 4px; text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; padding-left: 12px; white-space: nowrap; }
table.matrix td.m span { display: inline-block; width: 16px; height: 16px; border-radius: 5px; background: rgba(15, 52, 46, .08); vertical-align: middle; }
table.matrix td.m.have span { background: linear-gradient(135deg, var(--accent), var(--ok)); box-shadow: 0 0 6px rgba(52, 211, 153, .5); }
table.matrix td.m.na span { background: transparent; border: 1px dashed var(--line); }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: rgba(15, 52, 46, .1); }
.legend i.have { background: var(--ok); }

/* progress */
.bar { height: 8px; background: rgba(15, 52, 46, .08); border-radius: 6px; overflow: hidden; margin: 10px 0 8px; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .5s var(--ease);
  background: linear-gradient(90deg, #67e8f9, #14b8a6, var(--primary)); box-shadow: 0 0 10px rgba(20, 184, 166, .5); }
.bar.login > i, .bar.fetching > i, .bar.queued > i { background: linear-gradient(90deg, #14b8a6 0%, #67e8f9 25%, #14b8a6 50%, #67e8f9 75%, #14b8a6 100%);
  background-size: 200% 100%; animation: sheen 2.4s linear infinite; }
.bar.done > i { background: linear-gradient(90deg, var(--accent), var(--ok)); }
.bar.error > i { background: var(--bad); box-shadow: none; } .bar.cancelled > i { background: var(--faint); box-shadow: none; }
.counts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.counts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.log { background: rgba(8, 32, 30, .86); color: #d6f5ec; font: 12px/1.6 var(--mono); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  padding: 10px 13px; max-height: 260px; overflow: auto; white-space: pre-wrap; margin-top: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

/* preview */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; padding: 14px 17px; cursor: pointer; border: 1px solid var(--glass-edge); background: linear-gradient(140deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .52));
  border-radius: var(--radius); box-shadow: var(--shadow), var(--glass-hi); transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
  animation: rise .4s var(--ease) both; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.kpi.bad::before { background: linear-gradient(90deg, #fb923c, var(--bad)); }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(n+4) { animation-delay: .12s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi), var(--glass-hi); }
.kpi.on { background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 2px var(--primary-line), var(--shadow); }
.kpi:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(20, 184, 166, .35); }
.kpi .t { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--ok); }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi.bad .n { color: var(--bad); }
.kpi .net { margin-top: 6px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.subtabs { display: flex; gap: 0; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); padding: 4px 10px 0; }
.subtab { position: relative; border: 0; background: transparent; padding: 11px 12px 10px; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--muted); margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.subtab:hover { color: var(--ink); }
.subtab.on { color: var(--primary); font-weight: 650; }
.subtab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #2dd4bf, var(--primary)); box-shadow: 0 0 8px rgba(20, 184, 166, .5); animation: grow-x .28s var(--ease) both; }
.subtab .dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--bad);
  color: #fff; font-size: 10.5px; text-align: center; line-height: 16px; font-weight: 600; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.toolbar input[type=search] { width: 240px; max-width: 100%; height: 32px; }
.notes { margin: 0; padding: 10px 18px 12px 34px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
.notes li { margin: 2px 0; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.meta b { color: var(--ink); font-weight: 600; }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend-inline i.r { background: var(--bad); } .legend-inline i.a { background: #d99a2b; }
.print-only { display: none; }

/* ------------------------------------------------------------------ auth screens */
.auth-wrap { display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; margin: 16px 0 16px 16px; border-radius: 26px; color: var(--side-ink); padding: 40px 38px 30px;
  display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(165deg, var(--side-a), var(--side-b));
  box-shadow: 0 30px 60px -28px rgba(6, 30, 40, .6), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); }
.auth-side::before { content: ""; position: absolute; width: 300px; height: 300px; right: -120px; top: -110px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(52, 211, 153, .34), transparent 70%); }
.auth-side::after { content: ""; position: absolute; width: 320px; height: 320px; left: -140px; bottom: -140px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 131, 240, .3), transparent 70%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand { padding: 0 0 28px; border: 0; }
.auth-side .brand img { width: 36px; height: 36px; }
.auth-side .brand b { font-size: 18px; }
.auth-side .lead { color: #fff; font-size: 18px; line-height: 1.45; font-weight: 550; margin: 12px 0 22px; max-width: 330px; letter-spacing: -.1px; }
.auth-side ul { list-style: none; margin: 0; padding: 0; }
.auth-side li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 13px; }
.auth-side li svg { margin-top: 2px; color: var(--accent); }
.auth-side .foot { margin-top: auto; color: var(--side-dim); font-size: 11.5px; }
.auth-main > * { animation: pop .4s var(--ease) both; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth { width: 450px; max-width: 100%; padding: 28px 30px 26px; border-radius: 22px; }
.auth h2 { font-size: 20px; margin-bottom: 6px; }
.auth h3 { margin: 18px 0 2px; }
.auth > p.muted { margin-bottom: 16px; }
.auth form .btn[type=submit] { margin-top: 16px; }
.auth .row .btn[type=submit] { margin-top: 0; }
.auth form > .row { margin-top: 16px; }
.meter { height: 4px; background: rgba(15, 52, 46, .08); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }
.code { font: 600 18px/1.5 var(--mono); letter-spacing: .5px; text-align: center; white-space: nowrap;
  background: rgba(255, 255, 255, .7); border: 1px dashed rgba(15, 118, 110, .45); border-radius: 12px; padding: 16px; margin: 14px 0; word-break: break-all; }
.qr { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
code { background: rgba(15, 52, 46, .07); padding: 1px 6px; border-radius: 5px; font: 12px var(--mono); word-break: break-all; }

/* modal + toasts */
.modal-bg { animation: fade .2s both; position: fixed; inset: 0; background: rgba(8, 32, 30, .35); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal { animation: pop .25s var(--ease) both; box-shadow: var(--shadow-hi); background: rgba(255, 255, 255, .9); border-radius: var(--radius); width: 520px; max-width: 94vw; padding: 20px 22px; }
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 36px); }
.toast { background: rgba(10, 40, 36, .86); color: #fff; padding: 11px 15px; border-radius: 12px; max-width: 420px; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .4); word-break: break-word; border-left: 3px solid var(--accent); animation: slide-in .3s var(--ease) both; }
.toast.err { border-left-color: #f0857b; background: rgba(70, 20, 18, .86); }

/* remote portal window (server mode) */
.remote-screen { display: block; width: 100%; max-width: 1280px; aspect-ratio: 1280 / 860; background: #e9edf2;
  border: 1px solid var(--line); border-radius: 12px; cursor: crosshair; margin: 0 0 10px; object-fit: contain; }
.remote-tools input { flex: 1 1 260px; }

/* client CSV import */
.import-res { max-height: 46vh; margin-top: 10px; }
.import-res td { vertical-align: top; font-size: 12.5px; white-space: normal; word-break: break-word; }
.import-res th:first-child, .import-res td:first-child { width: 44px; }
.import-res td:nth-child(2) { min-width: 150px; }
.import-res td .hint { margin-top: 1px; min-height: 0; }
.import-res td .badge { margin-right: 4px; }

/* compliance grid */
.cpl-table th.cplcell, .cpl-table td.cplcell { text-align: center; padding-left: 3px; padding-right: 3px; white-space: nowrap; }
.cpl-table td.actions, .cpl-table th:last-child { position: sticky; right: 0; z-index: 1; }
.cpl-table td.actions { background: rgba(246, 251, 250, .95); box-shadow: -8px 0 12px -10px rgba(15, 52, 46, .35); }
.cpl-table tr.bad td.actions { background: rgba(253, 236, 233, .97); }
.cpl { display: inline-block; min-width: 22px; padding: 1px 4px; margin: 1px; border-radius: 5px; font-size: 10.5px; font-weight: 700;
       line-height: 15px; text-align: center; border: 1px solid transparent; }
.cpl.filed { background: var(--ok-soft); color: var(--ok); border-color: rgba(21, 128, 61, .25); }
.cpl.pending { background: var(--primary-soft); color: var(--primary); border-color: rgba(15, 118, 110, .25); }
.cpl.late { background: var(--bad); color: #fff; box-shadow: 0 2px 6px -2px rgba(192, 53, 43, .6); }
.cpl.unknown { background: rgba(255, 255, 255, .7); color: var(--muted); border-color: rgba(15, 52, 46, .14); }
.cpl.na { background: transparent; color: #a9b8b3; border-style: dashed; border-color: rgba(15, 52, 46, .16); }
.cpl-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.cpl-legend .cpl { min-width: 14px; margin-right: 5px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid3 .span2 { grid-column: span 2; }
.stat.bad .v { color: var(--bad); } .stat.ok .v { color: var(--ok); }
.cpl-table td.locked { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(15, 118, 110, .07) 5px 10px); }
.cpl-table td.locked::after { content: "Locked"; display: block; font-size: 9px; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }

/* browsers without backdrop-filter: keep panels readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .stats, .stat.tile, .kpi, .pagehead, .segmented { background: rgba(255, 255, 255, .94); }
  .side, .auth-side { background: linear-gradient(165deg, #0b3a35, #10243a); }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid-main, .grid-fetch { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .stats.tiles .stat { border: 1px solid var(--glass-edge); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; margin: 0; border-radius: 0 0 18px 18px; z-index: 6; overflow: visible; }
  .side::before, .side::after { display: none; }
  .brand { padding: 10px 14px; border: 0; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0 8px 8px; }
  .nav-label { display: none; }
  .tab { width: auto; white-space: nowrap; border-radius: 10px; }
  .tab.on::before { left: 12px; right: 12px; top: auto; bottom: -1px; width: auto; height: 3px; animation-name: grow-x; }
  .tab:hover { transform: none; }
  .stats.tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .stats.tiles.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .health { flex-direction: column; align-items: flex-start; padding: 20px; }
  .mbars { gap: 4px; }
  .side-foot { display: flex; align-items: center; gap: 10px; padding: 0; position: absolute; top: 10px; right: 12px; border: 0; margin: 0; }
  .side-foot .who, .side-foot .timer { display: none; }
  .side-foot .btn, .side-foot .btn.ghost { width: auto; }
  .pagehead { position: static; margin: 12px 12px 0; padding: 14px 16px; }
  .pagehead .actions { margin-left: 0; }
  main { padding: 14px 12px 50px; }
  .card-h, .card-b { padding-left: 14px; padding-right: 14px; }
  .card-b.flush { padding: 0; }
  .grid2, .grid3, .field-row { grid-template-columns: minmax(0, 1fr); }
  .grid3 .span2 { grid-column: auto; }
  .toolbar { padding: 10px 14px; }
  .toolbar input[type=search] { width: 100%; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-main { align-items: flex-start; padding: 16px 12px; }
  .auth-side { margin: 12px 12px 0; padding: 18px 20px; border-radius: 18px; }
  .auth-side ul, .auth-side .foot, .auth-side .lead { display: none; }
  .auth-side .brand { padding: 0; }
  .auth { padding: 22px 18px; }
  .code { font-size: 15px; white-space: normal; }
  .remote-tools input { flex-basis: 100%; }
}

@media print {
  body::before { display: none; }
  /* recovery code page: print only the code */
  body:has(.print-area) * { visibility: hidden; }
  body:has(.print-area) .print-area, body:has(.print-area) .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .noprint { display: none !important; }
  /* reports: A4 landscape, no app chrome, every row visible */
  @page { size: A4 landscape; margin: 11mm; }
  html, body { background: #fff; font-size: 10.5px; }
  * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .side, .pagehead .actions, .toolbar input, .toolbar label, .toolbar .legend-inline, .subtabs, #toasts { display: none !important; }
  .shell { display: block; }
  .pagehead { position: static; margin: 0; padding: 0 0 8px; border: 0; background: none; box-shadow: none; }
  main { padding: 0; max-width: none; }
  main > *, .kpi, .due-list li { animation: none !important; }
  .card, .kpi, .stat.tile { box-shadow: none !important; background: #fff !important; border: 1px solid #ccc; break-inside: auto; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .kpi { padding: 6px 9px; }
  .kpi .n { font-size: 15px; }
  .tablewrap { max-height: none !important; overflow: visible !important; }
  th { position: static; background: #f1f5f4; }
  tr.total td { position: static; }
  td, th { padding: 3px 6px; font-size: 9.5px; }
  tr { break-inside: avoid; }
  tr.bad td, tr.warn td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block; }
  .print-title { padding: 6px 0; font-size: 10px; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
.auth > .row { margin-top: 14px; }
.auth > .checks { margin-top: 12px; }

/* ================================================================== dark theme (default)
   Applies unless the user picked light (html[data-theme="light"]). Same glass panels,
   on a deep night background. Figures keep high contrast. */
html:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #061412;
  --ink: #e7f5f1; --ink-2: #c0d6cf; --muted: #91aba4; --faint: #5f7973;
  --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .07);
  --glass: rgba(17, 33, 37, .62); --glass-2: rgba(15, 30, 34, .76); --glass-3: rgba(255, 255, 255, .05);
  --glass-edge: rgba(255, 255, 255, .10); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
  --side-a: rgba(6, 26, 24, .78); --side-b: rgba(9, 18, 34, .78);
  --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: rgba(45, 212, 191, .14); --primary-line: rgba(45, 212, 191, .35);
  --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .13); --ok-line: rgba(74, 222, 128, .3);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .14); --bad-line: rgba(248, 113, 113, .32);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13); --warn-line: rgba(251, 191, 36, .3);
  --shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 14px 34px -16px rgba(0, 0, 0, .7);
  --shadow-hi: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -18px rgba(0, 0, 0, .8);
}
html:not([data-theme="light"]) body::before {
  background:
    radial-gradient(38% 46% at 6% 10%, rgba(20, 184, 166, .30), transparent 70%),
    radial-gradient(34% 42% at 96% 4%, rgba(99, 102, 241, .30), transparent 70%),
    radial-gradient(40% 46% at 82% 92%, rgba(14, 165, 233, .22), transparent 70%),
    radial-gradient(42% 46% at 14% 96%, rgba(16, 185, 129, .24), transparent 70%),
    radial-gradient(30% 34% at 52% 48%, rgba(168, 85, 247, .10), transparent 70%),
    linear-gradient(135deg, #04110f 0%, #08121f 50%, #05120f 100%); }
html:not([data-theme="light"]) ::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .16); }
html:not([data-theme="light"]) ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .28); }
html:not([data-theme="light"]) ::selection { background: rgba(45, 212, 191, .4); }
html:not([data-theme="light"]) .side { border-color: rgba(255, 255, 255, .09); }
html:not([data-theme="light"]) .card,
html:not([data-theme="light"]) .stat.tile,
html:not([data-theme="light"]) .kpi { background: linear-gradient(140deg, rgba(24, 44, 48, .74), rgba(13, 26, 30, .58)); }
html:not([data-theme="light"]) .kpi.on { background: rgba(30, 56, 60, .85); }
html:not([data-theme="light"]) .card-f { background: rgba(255, 255, 255, .03); }
html:not([data-theme="light"]) .card-b:not(.flush) .tablewrap { background: rgba(0, 0, 0, .15); }
html:not([data-theme="light"]) .health { background: linear-gradient(125deg, rgba(24, 44, 48, .8) 0%, rgba(16, 72, 58, .55) 55%, rgba(14, 52, 74, .5) 100%); }
html:not([data-theme="light"]) .health.fair { background: linear-gradient(125deg, rgba(24, 44, 48, .8) 0%, rgba(80, 60, 16, .5) 60%, rgba(70, 44, 12, .45) 100%); }
html:not([data-theme="light"]) .health.poor { background: linear-gradient(125deg, rgba(24, 44, 48, .8) 0%, rgba(84, 26, 26, .5) 60%, rgba(70, 20, 30, .45) 100%); }
html:not([data-theme="light"]) .health-ring { background: rgba(0, 0, 0, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 26px -12px rgba(0, 0, 0, .6); }
html:not([data-theme="light"]) .ring .track { stroke: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .tile-ico, html:not([data-theme="light"]) .due-date, html:not([data-theme="light"]) .avatar {
  background: linear-gradient(135deg, rgba(45, 212, 191, .2), rgba(99, 102, 241, .18)); color: var(--primary-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .stat.tile.ok .tile-ico { background: linear-gradient(135deg, rgba(74, 222, 128, .2), rgba(45, 212, 191, .12)); color: var(--ok); }
html:not([data-theme="light"]) .stat.tile.bad .tile-ico, html:not([data-theme="light"]) .due-date.over { background: linear-gradient(135deg, rgba(248, 113, 113, .22), rgba(251, 146, 60, .12)); color: var(--bad); }
html:not([data-theme="light"]) .mbar .col, html:not([data-theme="light"]) .cov .track, html:not([data-theme="light"]) .bar,
html:not([data-theme="light"]) .meter, html:not([data-theme="light"]) table.matrix td.m span, html:not([data-theme="light"]) .legend i { background-color: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) table.matrix td.m.na span { background: transparent; }
html:not([data-theme="light"]) table.matrix td.m.have span, html:not([data-theme="light"]) .legend i.have { background: linear-gradient(135deg, #34d399, #16a34a); }
html:not([data-theme="light"]) .action-tile { background: rgba(255, 255, 255, .04); }
html:not([data-theme="light"]) .action-tile:hover { background: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .seg:hover { background: rgba(255, 255, 255, .06); }
html:not([data-theme="light"]) .seg.on { background: rgba(45, 212, 191, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .35); }
html:not([data-theme="light"]) .result { background: linear-gradient(125deg, rgba(16, 72, 58, .6), rgba(14, 52, 74, .5)); }
/* forms */
html:not([data-theme="light"]) input[type=text], html:not([data-theme="light"]) input[type=password], html:not([data-theme="light"]) input[type=search],
html:not([data-theme="light"]) input[type=date], html:not([data-theme="light"]) select, html:not([data-theme="light"]) textarea {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
html:not([data-theme="light"]) input[type=text]:hover, html:not([data-theme="light"]) input[type=password]:hover, html:not([data-theme="light"]) input[type=search]:hover,
html:not([data-theme="light"]) input[type=date]:hover, html:not([data-theme="light"]) select:hover, html:not([data-theme="light"]) textarea:hover { background: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) input:focus, html:not([data-theme="light"]) select:focus, html:not([data-theme="light"]) textarea:focus {
  background: rgba(255, 255, 255, .09); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(45, 212, 191, .18); }
html:not([data-theme="light"]) select option { background: #0f2226; color: var(--ink); }
html:not([data-theme="light"]) input.invalid { background: rgba(248, 113, 113, .1); }
html:not([data-theme="light"]) input[type=checkbox] { accent-color: #14b8a6; }
html:not([data-theme="light"]) .chip { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
html:not([data-theme="light"]) .chip:hover { background: rgba(255, 255, 255, .09); }
html:not([data-theme="light"]) .chip:has(input:checked) { background: linear-gradient(120deg, rgba(45, 212, 191, .2), rgba(74, 222, 128, .1)); color: #ccfbf1 !important; }
html:not([data-theme="light"]) input[type=file]:not([hidden]) { background: rgba(255, 255, 255, .03); border-color: rgba(45, 212, 191, .3); }
html:not([data-theme="light"]) input[type=file]::file-selector-button { background: rgba(45, 212, 191, .14); color: #ccfbf1; border-color: rgba(45, 212, 191, .35); }
/* buttons */
html:not([data-theme="light"]) .btn { background: linear-gradient(135deg, #14b8a6 0%, #0f8f84 55%, #0b6a73 100%); border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 8px 20px -10px rgba(20, 184, 166, .8), inset 0 1px 0 rgba(255, 255, 255, .2); }
html:not([data-theme="light"]) .btn.green { background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #0f7a5a 100%); }
html:not([data-theme="light"]) .btn.danger { background: linear-gradient(135deg, #ef4444, #c0352b 60%, #9b2a22); }
html:not([data-theme="light"]) .btn.ghost { background: rgba(255, 255, 255, .06); color: var(--ink-2); border-color: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
html:not([data-theme="light"]) .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: var(--primary-line); }
/* alerts / badges */
html:not([data-theme="light"]) .alert.err { background: rgba(127, 29, 29, .38); color: #fecaca; }
html:not([data-theme="light"]) .alert.warn { background: rgba(120, 80, 10, .34); color: #fde68a; }
html:not([data-theme="light"]) .alert.ok { background: rgba(20, 83, 45, .38); color: #bbf7d0; }
html:not([data-theme="light"]) .alert.info { background: rgba(17, 94, 89, .32); color: #ccfbf1; }
html:not([data-theme="light"]) .badge, html:not([data-theme="light"]) .status { border-color: rgba(255, 255, 255, .08); background-color: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .status.done, html:not([data-theme="light"]) .badge.ok { background: var(--ok-soft); }
html:not([data-theme="light"]) .status.error, html:not([data-theme="light"]) .badge.bad { background: var(--bad-soft); }
html:not([data-theme="light"]) .status.login, html:not([data-theme="light"]) .status.fetching, html:not([data-theme="light"]) .status.queued,
html:not([data-theme="light"]) .badge.warn { background: var(--warn-soft); }
html:not([data-theme="light"]) .badge.blue { background: var(--primary-soft); }
/* tables */
html:not([data-theme="light"]) th { background: rgba(14, 30, 33, .96); }
html:not([data-theme="light"]) tbody tr:hover td { background: rgba(255, 255, 255, .05); }
html:not([data-theme="light"]) tr.bad td { background: rgba(127, 29, 29, .30); color: #fecaca; }
html:not([data-theme="light"]) tr.warn td { background: rgba(120, 80, 10, .28); color: #fde68a; }
html:not([data-theme="light"]) tbody tr.bad:hover td { background: rgba(153, 27, 27, .42); }
html:not([data-theme="light"]) tbody tr.warn:hover td { background: rgba(146, 96, 10, .4); }
html:not([data-theme="light"]) tr.total td { background: rgba(20, 52, 50, .97); border-top-color: rgba(255, 255, 255, .18); }
html:not([data-theme="light"]) .cpl-table td.actions { background: rgba(14, 30, 33, .96); box-shadow: -8px 0 12px -10px rgba(0, 0, 0, .7); }
html:not([data-theme="light"]) .cpl-table tr.bad td.actions { background: rgba(60, 22, 26, .97); }
html:not([data-theme="light"]) .cpl.unknown { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
html:not([data-theme="light"]) .cpl.na { color: #557069; border-color: rgba(255, 255, 255, .12); }
html:not([data-theme="light"]) .cpl.late { background: #dc2626; }
html:not([data-theme="light"]) .cpl-table td.locked { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(45, 212, 191, .08) 5px 10px); }
html:not([data-theme="light"]) .code { background: rgba(0, 0, 0, .25); border-color: rgba(45, 212, 191, .4); }
html:not([data-theme="light"]) code { background: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .log { background: rgba(0, 0, 0, .35); }
html:not([data-theme="light"]) .modal { background: rgba(15, 30, 34, .95); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:not([data-theme="light"]) .card, html:not([data-theme="light"]) .stats, html:not([data-theme="light"]) .stat.tile,
  html:not([data-theme="light"]) .kpi, html:not([data-theme="light"]) .pagehead, html:not([data-theme="light"]) .segmented { background: #10232a; }
}

/* theme switch (sidebar + login screens) */
.theme-btn { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #d1fae5; border: 1px solid rgba(255, 255, 255, .16); transition: background-color .15s, transform .2s var(--ease); }
.theme-btn:hover { background: rgba(255, 255, 255, .16); transform: rotate(-12deg); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn svg.ico { width: 17px; height: 17px; }
@media (max-width: 820px) { .side .brand .theme-btn { margin-right: 84px; } }

/* print is always light, whatever the screen theme */
@media print {
  html:not([data-theme="light"]) {
    color-scheme: light; --ink: #0f2420; --ink-2: #2f463f; --muted: #587069; --line: rgba(15, 52, 46, .13); --line-2: rgba(15, 52, 46, .08);
    --primary: #0f766e; --ok: #138a46; --bad: #c0352b; --warn: #a15c07; }
  html:not([data-theme="light"]) tr.bad td { background: #fde2de; color: #7a1a12; }
  html:not([data-theme="light"]) tr.warn td { background: #fff1cd; color: #6b4004; }
  html:not([data-theme="light"]) tr.total td { background: #deefeb; }
  html:not([data-theme="light"]) th { background: #f1f5f4; }
  html:not([data-theme="light"]) .code { background: #fff; }
}

/* bulk fetch */
.bulk-pick { margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.bulk-pick summary { cursor: pointer; font-weight: 600; }
.bulk-pick .row { margin: 8px 0 4px; }
.bulk-list { max-height: 220px; overflow: auto; display: grid; gap: 4px; }
.bulk-list .check { font-weight: 400; }
table.bulk tr.current td { background: var(--primary-soft); }
table.bulk td .badge { margin-left: 6px; }
table.bulk td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
