:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647084;
  --line: #dce2ea;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --primary: #2357d8;
  --primary-dark: #183f9e;
  --accent: #dff4ec;
  --warning: #fff3cd;
  --danger: #b42318;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.55; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
.site-header { background: #10233f; color: white; box-shadow: 0 2px 12px rgb(15 35 64 / 18%); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: .65rem 1.25rem; display: flex; gap: 1rem; align-items: center; flex-wrap: nowrap; }
.brand { color: white; text-decoration: none; font-size: 1.2rem; font-weight: 750; white-space: nowrap; }
.main-nav { display: flex; flex: 1 1 auto; flex-wrap: nowrap; gap: .2rem; align-items: center; min-width: 0; }
.main-nav a { color: #dbe7ff; text-decoration: none; padding: .35rem .5rem; border-radius: 8px; font-size: .88rem; white-space: nowrap; }
.main-nav a:hover, .main-nav a:focus-visible { background: rgb(255 255 255 / 12%); color: white; }
.mode-badge, .status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .2rem .6rem; font-size: .78rem; font-weight: 700; }
.mode-badge { margin-left: auto; background: #c9f4e4; color: #124b3b; }
.status-badge { background: #e8edf5; color: #344054; }
.status-badge.approved, .status-badge.active { background: var(--accent); color: #12634e; }
.status-badge.draft, .status-badge.waiting { background: var(--warning); color: #725500; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.page-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.eyebrow { color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .3rem; }
h1, h2, h3 { line-height: 1.2; margin-top: 0; }
.manual-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: .45rem; }
h2 { font-size: 1.25rem; margin-bottom: .8rem; }
.lede, .muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.card { grid-column: span 12; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 6px 22px rgb(20 40 75 / 5%); }
.card-link { text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-2px); border-color: #9ab2e8; color: inherit; }
.metric { grid-column: span 3; }
.metric strong { display: block; font-size: 1.7rem; }
.stack { display: grid; gap: 1rem; }
.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.notice { background: #e9f2ff; border-left: 4px solid var(--primary); padding: .8rem 1rem; border-radius: 8px; }
.notice.warning { background: var(--warning); border-color: #d69e00; }
.alert { color: var(--danger); background: #feeceb; border: 1px solid #f5b8b4; padding: .8rem 1rem; border-radius: 8px; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); border: 1px dashed #b8c2d1; border-radius: 10px; }
label { display: grid; gap: .35rem; color: #344054; font-weight: 650; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; border: 1px solid #aeb8c6; border-radius: 8px; padding: .65rem .75rem; background: white; color: var(--ink); }
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(35 87 216 / 25%); outline-offset: 2px; }
button, .button { display: inline-flex; justify-content: center; border: 0; border-radius: 8px; padding: .67rem .95rem; background: var(--primary); color: white; text-decoration: none; font-weight: 700; cursor: pointer; }
button:hover, .button:hover { background: var(--primary-dark); color: white; }
.button.secondary, button.secondary { background: #e7ecf4; color: #26344a; }
.button.danger, button.danger { background: var(--danger); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 680px; }
th, td { text-align: left; vertical-align: top; padding: .8rem .9rem; border-bottom: 1px solid var(--line); }
th { color: #475467; background: #f7f9fc; font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.action-cell form { margin-top: .6rem; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.25rem; }
.definition-grid dt { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; }
.definition-grid dd { margin: .15rem 0 0; }
.chart { display: grid; gap: 1rem; }
.chart-row { display: grid; grid-template-columns: 9rem 1fr auto; gap: .75rem; align-items: center; }
progress { width: 100%; height: 1rem; accent-color: var(--primary); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, #10233f, #285aa8); }
.auth-page .container { width: min(430px, 100%); margin: 0; }
.auth-card { width: min(430px, 100%); background: white; border-radius: 18px; padding: clamp(1.4rem, 5vw, 2.2rem); box-shadow: 0 24px 60px rgb(0 0 0 / 25%); }
.auth-card form { display: grid; gap: 1rem; }
.error-code { font-size: 4rem; font-weight: 800; color: #9aacbf; margin: 0; }
.footer { color: var(--muted); font-size: .85rem; margin-top: 2rem; }
@media (min-width: 720px) { .card.half { grid-column: span 6; } .card.third { grid-column: span 4; } }
@media (max-width: 860px) {
  .header-inner { align-items: flex-start; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  .mode-badge { margin-left: auto; }
  .metric { grid-column: span 6; }
  .definition-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { width: min(100% - 1rem, 1180px); margin-top: 1rem; }
  .header-inner { padding: .8rem; gap: .75rem; }
  .page-heading { display: block; }
  .metric { grid-column: span 12; }
  .card { padding: 1rem; border-radius: 10px; }
  .inline { display: grid; align-items: stretch; }
  .inline > * { width: 100%; }
  .chart-row { grid-template-columns: 1fr; gap: .25rem; }
  button, .button { width: 100%; }
}
