:root {
  color-scheme: light;
  --ink: #1b1828;
  --muted: #656174;
  --purple: #6242d3;
  --line: #e9e6f0;
  --soft: #f4efff;
  --canvas: #f8f7fb;
  --green: #176149;
  --amber: #85500e;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
i { display: inline-flex; align-items: center; justify-content: center; }
h1, h2, p { margin: 0; }
.skip { position: fixed; z-index: 3; left: 12px; top: -60px; padding: 8px 12px; background: white; }
.skip:focus { top: 12px; }
.shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 27px 18px 20px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; width: fit-content; }
.brand b { display: block; font-size: 17px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; }
.brand small { display: block; margin-top: 5px; font-size: 9px; font-weight: 750; color: var(--muted); letter-spacing: .13em; }
.label { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.nav-label { margin: 42px 0 12px 10px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 10px; color: var(--muted); font-weight: 600; border-radius: 9px; }
.sidebar nav a:hover, .text-btn:hover { background: var(--canvas); color: var(--ink); }
.sidebar nav a[aria-current] { background: var(--soft); color: #5334bf; font-weight: 750; }
.side-bottom { margin-top: auto; padding-top: 25px; }
.workspace-note, .profile { display: flex; align-items: center; gap: 10px; }
.workspace-note { padding: 11px 10px; color: var(--purple); background: #faf7ff; border: 1px solid #f0eafa; border-radius: 10px; }
.workspace-note b, .profile b { display: block; color: var(--ink); font-size: 13px; }
.workspace-note small, .profile small { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.profile { margin: 18px 2px 8px; }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; background: var(--soft); border-radius: 50%; color: var(--purple); font-size: 11px; font-weight: 750; }
.text-btn { display: inline-flex; gap: 8px; align-items: center; border: 0; background: transparent; border-radius: 8px; padding: 8px; color: var(--muted); font-size: 12px; }
.text-btn svg { width: 16px; height: 16px; }
.main-shell { min-width: 0; }
.topbar { height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 34px; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb span { margin: 0 8px; color: #9a95a7; }
.breadcrumb b { color: var(--ink); font-weight: 650; }
.preview { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #e9dffc; border-radius: 30px; color: #5533b2; background: #faf7ff; font-weight: 700; font-size: 11px; white-space: nowrap; }
.preview span, .eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #805aee; }
main#content { max-width: 1440px; margin: auto; padding: 29px 34px 22px; outline: none; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
h1 { font-size: clamp(25px, 3.2vw, 42px); line-height: 1.12; font-weight: 760; letter-spacing: -.052em; }
.hero p { margin-top: 8px; color: var(--muted); }
.date-control { display: inline-flex; flex: none; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12px; }
.date-control i { color: var(--purple); }
.date-control select { padding: 0 3px; border: 0; background: transparent; font-weight: 650; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 17px; align-items: start; }
#primary, .rail { min-width: 0; display: grid; gap: 15px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.metric { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; }
.metric:hover { border-color: #cfc1f5; }
.metric i, .signal-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--soft); color: var(--purple); }
.metric span { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric b { font-size: clamp(20px, 2.3vw, 29px); line-height: 1.08; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: 10px; }
.panel { min-width: 0; overflow: hidden; }
.panel-heading { padding: 14px 16px 8px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.panel h2 { font-size: 16px; font-weight: 740; letter-spacing: -.02em; }
.panel-heading p, .panel-note { margin-top: 3px; color: var(--muted); font-size: 11px; }
.panel-note { padding: 8px 16px 15px; }
.segments { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 16px 0; }
.segments button { padding: 5px 8px; font-size: 11px; background: #fff; border: 0; border-radius: 6px; color: var(--muted); font-weight: 650; }
.segments button[aria-pressed="true"] { color: var(--purple); background: var(--soft); }
.chart { padding: 6px 14px 1px; }
.chart svg { display: block; width: 100%; height: auto; max-height: 245px; }
.chart text { font: 10px "Segoe UI", system-ui, sans-serif; fill: #696477; }
.grid { stroke: #eeeaf4; }
.inline-link { display: inline-flex; align-items: center; gap: 5px; color: var(--purple); font-size: 11px; font-weight: 750; white-space: nowrap; }
.inline-link svg { width: 14px; height: 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
thead { color: var(--muted); background: #faf9fc; font-size: 10px; }
th, td { padding: 8px 16px; border-top: 1px solid var(--line); }
tbody th { font-weight: 650; }
tbody small { display: block; color: var(--muted); font-weight: 400; margin-top: 1px; font-size: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 40px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--green); background: #e9f7f0; }
.pill.warn, .signal-icon.warn { color: var(--amber); background: #fff3dd; }
.signals { padding: 1px 14px 9px; }
.signal { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.signal + .signal { border-top: 1px solid var(--line); }
.signal-icon { flex: none; }
.signal b, .signal small { display: block; }
.signal b { font-size: 12px; }
.signal small, .rail-cost small { color: var(--muted); font-size: 11px; }
.rail-cost { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 16px 11px; }
.rail-cost b, .spend-total b { font-size: 26px; font-weight: 750; letter-spacing: -.045em; }
.bars { display: grid; gap: 9px; padding: 0 16px 11px; }
.bars div { display: grid; grid-template-columns: 1fr auto; gap: 3px; font-size: 11px; }
.bars div span { color: var(--muted); }
progress { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; border-radius: 5px; overflow: hidden; appearance: none; background: #f0ecf8; }
progress::-webkit-progress-bar { background: #f0ecf8; }
progress::-webkit-progress-value { background: #8a68ef; border-radius: 5px; }
progress::-moz-progress-bar { background: #8a68ef; }
.rail-link { padding: 9px 16px 11px; border-top: 1px solid var(--line); }
.source { padding: 0 16px 9px; }
.source div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 11px; }
.source div + div { border-top: 1px solid var(--line); }
.source span { color: var(--muted); }
.source b { text-align: right; }
.spend-total { display: grid; padding: 10px 16px 14px; }
.spend-total span { color: var(--muted); font-size: 11px; }
footer { display: flex; gap: 10px; justify-content: space-between; padding-top: 16px; color: var(--muted); font-size: 10px; }
footer span:first-child { letter-spacing: .09em; font-weight: 700; }
.error { color: #9d2525; margin-bottom: 10px; }
.sign-in { display: grid; place-items: center; min-height: 100vh; padding: 18px; }
.login { width: min(100%, 420px); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login-title { margin: 25px 0 20px; }
.login-title h1 { margin: 5px 0 8px; font-size: 32px; }
.login-title p, .login-note { color: var(--muted); }
.login form, .login label { display: grid; gap: 7px; }
.login form { gap: 13px; }
.login label { font-weight: 650; }
.login input { width: 100%; border: 1px solid #dcd7e8; border-radius: 8px; padding: 8px 10px; background: #fff; }
.primary { border: 0; border-radius: 8px; padding: 10px 13px; background: var(--purple); color: #fff; font-weight: 750; }
.primary:disabled { opacity: .7; }
.login-note { font-size: 11px; }
.login .error:empty { display: none; }
.login .error { margin: 0; }
@media (max-width: 1130px) {
  .shell { grid-template-columns: 183px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  main#content, .topbar { padding-inline: 22px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) 228px; }
}
@media (max-width: 925px) {
  .dashboard { grid-template-columns: 1fr; }
  .rail { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; margin-top: 12px; gap: 3px; }
  .sidebar nav a { padding: 7px; gap: 4px; font-size: 12px; }
  .sidebar nav svg { width: 15px; height: 15px; }
  .nav-label, .profile, .workspace-note { display: none; }
  .side-bottom { position: absolute; top: 17px; right: 14px; padding: 0; }
  .topbar { height: 46px; }
  .topbar, main#content { padding-inline: 14px; }
  main#content { padding-top: 19px; }
  .hero { flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
