:root {
  color: #172033;
  background: #f4f6f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f6f8; }
button, input, select { font: inherit; }

.topbar {
  min-height: 68px;
  padding: 0 32px;
  background: #10243e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { color: #fff; text-decoration: none; font-size: 19px; font-weight: 750; }
.main-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.main-nav a { color: #d8e1eb; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.hero { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; margin-bottom: 28px; }
.hero h1, .login-intro h1 { margin: 8px 0 12px; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.04em; }
.hero p { max-width: 720px; margin: 0; color: #586477; font-size: 18px; line-height: 1.6; }
.eyebrow { color: #28766f; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.status-pill, .readonly-badge, .tag, .stage { border-radius: 999px; white-space: nowrap; }
.status-pill { padding: 10px 14px; background: #e3f4ee; color: #17624f; font-weight: 700; }
.status-pill span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #1c8c68; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.metric-card, .panel, .login-card { background: #fff; border: 1px solid #dfe4ea; border-radius: 18px; box-shadow: 0 12px 36px rgba(20, 39, 63, .06); }
.metric-card { padding: 24px; }
.metric-card strong { display: block; margin: 10px 0 6px; font-size: 24px; }
.metric-card small, .muted, .section-row p { color: #687487; }
.metric-label { color: #526071; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.panel { padding: 28px; }
.panel + .panel { margin-top: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 28px; }
.tag, .stage { padding: 7px 11px; background: #edf1f5; color: #526071; font-size: 13px; font-weight: 700; }
.section-row { display: flex; justify-content: space-between; gap: 18px; padding: 18px 0; border-top: 1px solid #e8ebef; }
.section-row p { margin: 5px 0 0; }
.button { border: 0; border-radius: 10px; padding: 11px 17px; cursor: pointer; font-weight: 750; }
.button-primary { width: 100%; margin-top: 8px; background: #d9ff57; color: #10243e; }
.button-primary:hover { background: #c9f047; }
.button-accent { background: #d9ff57; color: #10243e; }
.button-accent:hover { background: #c9f047; }
.button-disabled { opacity: .48; }
.button-quiet { background: rgba(255,255,255,.1); color: #fff; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; }
.alert-danger, .alert-warning { background: #fff0ed; color: #8c2f24; }
.alert-success { background: #e3f4ee; color: #17624f; }

.hero-compact h1, .page-heading h1 { margin: 7px 0 10px; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.page-heading p { color: #687487; margin: 0; max-width: 760px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 22px; padding: 18px; }
.filters label { display: grid; gap: 6px; min-width: 150px; color: #526071; font-size: 13px; font-weight: 700; }
.filters input, .filters select { min-height: 42px; padding: 9px 11px; border: 1px solid #ccd4de; border-radius: 9px; background: #fff; color: #172033; }
.filters .check { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: auto; min-height: 42px; }
.filters .check input { min-height: auto; }
.meta-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 22px; padding: 20px 24px; }
.meta-strip div { display: grid; gap: 6px; }
.meta-strip span { color: #687487; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 11px; border-bottom: 1px solid #e8ebef; text-align: left; vertical-align: top; }
th { color: #526071; background: #f7f9fb; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { min-width: 88px; }
td small, td code { color: #687487; overflow-wrap: anywhere; }
.json-cell { max-width: 260px; overflow-wrap: anywhere; font-size: 12px; }
.empty-state { padding: 34px; border: 1px dashed #ccd4de; border-radius: 12px; color: #687487; text-align: center; background: #f8fafb; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 22px; }
.report-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.report-card h2 { margin: 0; font-size: 30px; }
.report-card p { margin: 0 0 8px; color: #687487; line-height: 1.55; }
.report-card .button { text-decoration: none; }
.report-contract h2 { margin-top: 0; }
.report-contract li + li { margin-top: 8px; }
.report-readonly { margin-top: 0; background: #e3f4ee; color: #17624f; border: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 9px 13px; border-radius: 999px; color: #526071; background: #e8edf2; text-decoration: none; font-weight: 700; font-size: 14px; }
.tabs a.active { color: #10243e; background: #d9ff57; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 18px; color: #687487; }
.pagination a { color: #17624f; font-weight: 700; }
pre { max-width: 420px; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.state { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #edf1f5; font-weight: 750; font-size: 12px; }
.state-success { background: #e3f4ee; color: #17624f; }
.state-partial, .state-failed { background: #fff0ed; color: #8c2f24; }
.state-running, .state-queued { background: #fff6d8; color: #775d00; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.25fr .75fr; }
.login-intro { padding: clamp(40px, 8vw, 110px); color: #fff; background: #10243e; display: flex; flex-direction: column; justify-content: center; }
.login-intro .eyebrow { color: #d9ff57; }
.login-intro p { max-width: 650px; color: #c8d2df; font-size: 19px; line-height: 1.65; }
.readonly-badge { align-self: flex-start; margin-top: 26px; padding: 10px 14px; background: rgba(217,255,87,.12); color: #e8ff9c; border: 1px solid rgba(217,255,87,.32); }
.login-card { align-self: center; width: min(420px, calc(100% - 40px)); margin: 40px auto; padding: 34px; }
.login-card h2 { margin: 0 0 8px; font-size: 28px; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
.login-card label { margin-top: 6px; font-size: 14px; font-weight: 700; }
.login-card input { width: 100%; padding: 12px 13px; border: 1px solid #cdd4dc; border-radius: 10px; background: #fff; }
.login-card input:focus { outline: 3px solid rgba(40,118,111,.18); border-color: #28766f; }

@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 44vh; padding: 48px 28px; }
  .status-grid { grid-template-columns: 1fr; }
  .kpi-grid, .meta-strip { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .topbar { padding: 12px 20px; flex-wrap: wrap; gap: 10px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page { width: min(100% - 28px, 1180px); padding-top: 28px; }
}

@media (max-width: 520px) {
  .kpi-grid, .meta-strip { grid-template-columns: 1fr; }
  .filters { align-items: stretch; }
  .filters label, .filters button { width: 100%; }
}
