@font-face { font-family: "Manrope"; src: url("fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
:root {
  color-scheme: light;
  --background: #eef3fb; --foreground: #0f2240; --card: #ffffff; --muted-foreground: #5a6b85; --soft: #e3ebf7; --line: #e1e8f3; --input: #cdd8ea; --zebra: #f6f9fd;
  --hero: #0e2a5c; --hero-ink: #ffffff; --hero-muted: #a8bde0; --hero-soft: #1d4180; --coral: #ff7a59;
  --primary: #0e2a5c; --primary-foreground: #ffffff; --ring: #2f6fe0; --shadow: 0 1px 2px rgba(14,42,92,.05), 0 12px 32px -18px rgba(14,42,92,.25);
  --good: #00785a; --good-soft: #dcf3ea; --warn: #99620a; --warn-soft: #fbeed6; --bad: #bf3226; --bad-soft: #fde6e2;
  --series-1: #2f6fe0; --series-2: #f0643c; --series-3: #0e9f8f; --series-4: #d99a00; --grid: #e6ecf6;
}
:root.dark {
  color-scheme: dark;
  --background: #07111f; --foreground: #e8eef9; --card: #0f1f33; --muted-foreground: #9db0cc; --soft: #18304f; --line: #1e3554; --input: #2c4669; --zebra: #13253c;
  --hero: #12305e; --hero-soft: #23477f; --primary: #ff7a59; --primary-foreground: #2a0e05; --shadow: none;
  --good: #63d6ad; --good-soft: #123b33; --warn: #eab464; --warn-soft: #3b2f1a; --bad: #ff9a8d; --bad-soft: #452420;
  --series-1: #4b8bf0; --series-2: #e8603a; --series-3: #18998a; --series-4: #b98200; --grid: #1a3150;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--background); color: var(--foreground); font: 500 14px/1.5 "Manrope", ui-sans-serif, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; } h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted-foreground); }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Top navigation */
.topnav { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 22px; padding: 12px 26px;
  background: color-mix(in srgb, var(--background) 58%, transparent); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topnav .brand { justify-self: start; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; display: block; }
.brand-mark { width: 32px; height: 32px; border-radius: 11px; background: var(--hero); color: var(--coral); display: grid; place-items: center; }
.nav-links { justify-self: center; display: flex; gap: 2px; padding: 4px; border-radius: 99px; overflow-x: auto; scrollbar-width: none; max-width: 100%;
  background: color-mix(in srgb, var(--card) 55%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--card) 70%, transparent); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.35); }
:root.dark .nav-links { border-color: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.nav-link { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 99px; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; }
.nav-link:hover { color: var(--foreground); }
.nav-link.active { background: var(--primary); color: var(--primary-foreground); }
.nav-count { background: var(--coral); color: #2a0e05; border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.nav-sep { width: 1px; background: var(--line); margin: 6px 4px; }
.nav-end { justify-self: end; display: flex; align-items: center; gap: 4px; }
.who { text-decoration: none; font-weight: 800; font-size: 13px; text-align: right; line-height: 1.2; padding: 0 8px; white-space: nowrap; }
.who small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); }
.content { max-width: 1320px; margin: 0 auto; padding: 10px 26px 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 10px 0 18px; }
.page-head > :first-child { margin-right: auto; }
h1 { font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }

/* Controls */
button, .btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 99px; border: 0; background: var(--soft); color: var(--foreground); cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .12s, transform .12s; }
button:hover, .btn:hover { filter: brightness(.96); }
button:active, .btn:active { transform: scale(.98); }
button.primary, .btn.primary { background: var(--primary); color: var(--primary-foreground); }
button.accent, .btn.accent { background: var(--coral); color: #2a0e05; }
button.ghost { background: transparent; }
button.icon-only, .btn.icon-only { width: 36px; padding: 0; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
input, select, textarea { font: inherit; font-weight: 600; height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 12px; background: var(--card); color: var(--foreground); max-width: 100%; }
input[type=file] { padding: 6px 10px; }
input[type=checkbox] { accent-color: var(--ring); width: 16px; height: 16px; }
input.q { width: 100px; text-align: right; font-variant-numeric: tabular-nums; height: 32px; }
input.tq { width: 88px; text-align: right; font-variant-numeric: tabular-nums; height: 32px; padding: 0 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row form { display: contents; }
label.field { display: block; font-weight: 700; margin-bottom: 14px; }
label.field input { display: block; width: 100%; margin-top: 6px; height: 42px; }
.date-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.datepick { position: relative; }
.datepick-btn { gap: 8px; }
.datepick-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: 300px; padding: 14px; border-radius: 20px; color: var(--foreground);
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 60px -20px rgba(14,42,92,.55); }
.datepick-pop[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dp-head b { font-size: 15px; }
.dp-head button { width: 34px; height: 34px; padding: 0; border-radius: 99px; background: var(--soft); color: var(--foreground); border: 0; font-size: 18px; }
.dp-head button:disabled { opacity: .35; cursor: default; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-dow { font-size: 11px; font-weight: 700; color: var(--muted-foreground); text-align: center; padding: 4px 0; }
.dp-day { height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted-foreground); opacity: .45; }
a.dp-day { color: var(--foreground); opacity: 1; background: var(--soft); font-weight: 700; }
a.dp-day:hover { background: var(--ring); color: #fff; }
.dp-day.off { font-style: italic; }
.dp-day.today { box-shadow: inset 0 0 0 2px var(--ring); opacity: 1; }
a.dp-day.sel, a.dp-day.sel:hover { background: var(--coral); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted-foreground); }
.dp-foot a { font-weight: 700; color: var(--ring); text-decoration: none; }
@media (max-width: 520px) { .datepick-pop { position: fixed; left: 16px; right: 16px; top: 120px; width: auto; } }


/* Hero */
.hero { background: var(--hero); color: var(--hero-ink); border-radius: 28px; padding: 28px 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; }
.hero-top { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--coral); }
.hero .btn, .hero select { background: var(--hero-soft); color: var(--hero-ink); border: 0; border-radius: 99px; }
.hero-figure { font-size: clamp(46px, 7vw, 80px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 14px; }
.hero-figure small { font-size: 18px; font-weight: 700; letter-spacing: 0; color: var(--hero-muted); }
.hero-label { font-weight: 700; color: var(--hero-muted); margin-top: 16px; }
.hero-ring { position: relative; width: 196px; height: 196px; grid-row: 2; grid-column: 2; align-self: center; }
.hero-ring svg { width: 100%; height: 100%; }
.hero-ring div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hero-ring b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-ring span { font-size: 12px; color: var(--hero-muted); }
.hero-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 24px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hero-soft); }
.hero-stats span { display: block; font-size: 12.5px; font-weight: 700; color: var(--hero-muted); }
.hero-stats b { display: block; font-size: 23px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-stats small { font-size: 12.5px; color: var(--hero-muted); }
.hero-stats .badge { display: inline-flex; font-size: 12px; background: var(--hero-soft); color: var(--hero-ink); }
.up-on-dark { color: #7fe3bf; } .down-on-dark { color: #ffb2a0; }

/* Cards */
.card { background: var(--card); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card-head .muted { font-size: 12.5px; }
.card-head .end { margin-left: auto; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.bento { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.report-card { position: sticky; top: 72px; }
.report-preview { display: block; width: 100%; max-height: 430px; object-fit: cover; object-position: top; border-radius: 14px; background: var(--soft); }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.report-actions .wide-btn { grid-column: 1 / -1; }
.delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell .track { flex: 1; height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar-cell .track i { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--soft); color: var(--muted-foreground); }
.badge .icon { width: 12px; height: 12px; stroke-width: 3; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; border-radius: 0 0 22px 22px; }
.table-wrap.tall { }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; }
th:first-child, td:first-child { padding-left: 22px; } th:last-child, td:last-child { padding-right: 22px; }
th { font-size: 12px; font-weight: 800; color: var(--muted-foreground); border-top: 0; background: var(--card); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; } th[data-sort]:hover { color: var(--foreground); }
tbody tr:nth-child(even) td { background: var(--zebra); }
tbody tr:hover td { background: var(--soft); }
tr[data-href] { cursor: pointer; }
.ai-fab { position: fixed; right: 20px; bottom: 20px; transition: bottom .2s; z-index: 30; height: 40px; padding: 0 15px 0 12px; font-size: 13px; border-radius: 99px; color: #fff;
  background: linear-gradient(135deg, #2f6fe0, #ff7a59); box-shadow: 0 10px 28px -10px rgba(14,42,92,.6); }
.ai-fab .icon { width: 16px; height: 16px; }
.ai-panel { position: fixed; right: 20px; bottom: 70px; z-index: 40; width: min(360px, calc(100vw - 40px)); height: min(470px, calc(100vh - 110px)); display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--card) 70%, transparent);
  background: color-mix(in srgb, var(--card) 82%, transparent); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 24px 60px -20px rgba(14,42,92,.55); }
.ai-panel[hidden] { display: none; }
.ai-panel header { display: flex; align-items: flex-start; gap: 8px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.ai-panel header div { flex: 1; }
.ai-panel header small { display: block; color: var(--muted-foreground); font-size: 12px; font-weight: 600; margin-top: 2px; }
.ai-panel header button { font-size: 20px; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 13.5px; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 6px; }
.ai-msg.assistant { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 6px; }
.ai-msg.error { align-self: flex-start; background: var(--bad-soft); color: var(--bad); }
.ai-msg.thinking { color: var(--muted-foreground); font-style: italic; }
.ai-hint { color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip { height: 30px; font-size: 12.5px; padding: 0 12px; }
.ai-panel form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-panel textarea { flex: 1; height: auto; min-height: 42px; max-height: 120px; padding: 10px 12px; resize: none; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 44px; height: 44px; padding: 0; border-radius: 99px; background: var(--primary); color: var(--primary-foreground); box-shadow: 0 8px 24px -8px rgba(14,42,92,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }
body.scrolled .ai-fab { bottom: 74px; }
body.scrolled .ai-panel { bottom: 124px; height: min(470px, calc(100vh - 164px)); }
.hero-pair { display: flex; flex-wrap: wrap; gap: 8px 48px; }
.hero-pair .hero-figure { font-size: clamp(40px, 5.4vw, 72px); }
.hero-pair .hero-sub { font-size: 13px; font-weight: 700; color: var(--hero-muted); margin-top: 4px; }
td a { text-decoration: none; font-weight: 700; } td a:hover { color: var(--ring); }
tr.off td { color: var(--muted-foreground); }
.matrix th, .matrix td { padding: 8px 10px; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--card); z-index: 2; }
.matrix tbody tr:nth-child(even) td:first-child { background: var(--zebra); }
.matrix thead th:first-child { z-index: 3; }
.matrix tfoot td { background: var(--card); border-top: 2px solid var(--line); }
input.cell { width: 72px; height: 30px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; border-radius: 8px; }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; font-weight: 700; color: var(--muted-foreground); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.legend i.line { height: 3px; width: 14px; }
.legend i.dash { height: 0; width: 14px; border-top: 2px dashed var(--muted-foreground); border-radius: 0; background: none; }
#tip { position: fixed; z-index: 50; display: none; background: var(--hero); color: #fff; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; pointer-events: none; min-width: 160px; }
#tip .t { font-weight: 800; margin-bottom: 4px; }
#tip .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
#tip .r span { display: inline-flex; align-items: center; gap: 6px; }
#tip .r i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

/* Lists and workflow */
.mini { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.mini:first-of-type { border-top: 0; }
.mini-title { font-size: 12.5px; font-weight: 800; color: var(--muted-foreground); margin-bottom: 4px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 12px 16px; font-weight: 700; }
.banner .btn { margin-left: auto; }
.reveal { background: var(--good-soft); border-radius: 16px; padding: 14px 16px; }
.reveal code { font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.step { display: flex; align-items: center; gap: 9px; color: var(--muted-foreground); font-weight: 700; }
.step b { width: 26px; height: 26px; border-radius: 99px; background: var(--soft); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.step.done { color: var(--foreground); } .step.done b { background: var(--good-soft); color: var(--good); }
.step.now { color: var(--foreground); } .step.now b { background: var(--coral); color: #2a0e05; }
.issue { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.issue:first-child { border-top: 0; padding-top: 0; } .issue:last-child { padding-bottom: 0; }
.issue-title { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--background); border-radius: 14px; padding: 14px; margin: 0; font: 500 12.5px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
pre.tall { max-height: 620px; overflow: auto; }
.err { color: var(--bad); font-weight: 700; } .ok { color: var(--good); font-weight: 700; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--hero); }
.auth .card { width: 100%; max-width: 400px; padding: 32px; border-radius: 28px; }
.auth .brand { margin-bottom: 22px; }
.auth h1 { margin-bottom: 4px; }
.auth form { margin-top: 20px; }
.auth button { width: 100%; height: 44px; }

@media (max-width: 1080px) { .bento, .wide, .two { grid-template-columns: minmax(0, 1fr); } .report-card { position: static; order: -1; } .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ai-fab span { display: none; }
  .ai-fab { width: 40px; padding: 0; justify-content: center; }
  .ai-panel { left: 10px; right: 10px; width: auto; bottom: 70px; height: min(470px, calc(100vh - 140px)); }
  body.scrolled .ai-panel { bottom: 124px; height: min(470px, calc(100vh - 194px)); }
  .topnav { display: flex; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .nav-end { margin-left: auto; }
  .nav-links { order: 3; width: 100%; justify-content: flex-start; }
  .content { padding: 8px 14px 56px; }
  .hero { padding: 22px 20px; border-radius: 22px; grid-template-columns: minmax(0, 1fr); }
  .hero-ring { grid-row: auto; grid-column: 1; width: 160px; height: 160px; justify-self: center; }
  .card { padding: 18px; border-radius: 18px; }
  .table-wrap { margin: 0 -18px -18px; border-radius: 0 0 18px 18px; }
  th:first-child, td:first-child { padding-left: 18px; } th:last-child, td:last-child { padding-right: 18px; }
}
