:root {
  --ink: #182230;
  --muted: #687386;
  --line: #e2e7ee;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --accent: #3164d6;
  --green: #16845b;
  --amber: #a76200;
  --red: #c63d4d;
  --purple: #7757b7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.main-content { padding: 34px 0 70px; }
.topbar { background: #172235; color: #fff; }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: #fff; font-weight: 800; letter-spacing: -.02em; font-size: 20px; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 19px; }
.nav-links a { color: #cbd5e5; font-size: 14px; }
.nav-links a:hover { color: #fff; }
.link-button { background: none; border: 0; color: #cbd5e5; cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.link-button:hover { color: #fff; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
h1, h2, h3 { letter-spacing: -.025em; margin: 0 0 8px; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
.subtitle, .muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.grid { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(6, 1fr); margin-bottom: 26px; }
.two-col { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 2px 7px #20304b08; }
.metric { padding: 17px 18px; }
.metric-value { display: block; font-size: 28px; font-weight: 800; margin: 5px 0 0; }
.metric-label { color: var(--muted); font-size: 13px; }
.section { margin-top: 25px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 10px; text-align: left; vertical-align: middle; font-size: 14px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 9px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-healthy { color: var(--green); background: #e6f7ef; }
.status-degraded { color: var(--amber); background: #fff2da; }
.status-down { color: var(--red); background: #fde9eb; }
.status-paused { color: var(--purple); background: #f1ecfb; }
.status-unknown { color: #617083; background: #edf1f5; }
.button, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font: inherit; font-weight: 700; padding: 9px 14px; }
.button:hover { background: #244fab; text-decoration: none; }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.button.danger { background: var(--red); border-color: var(--red); }
.button.small { padding: 6px 10px; font-size: 12px; }
.inline-form { display: inline; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 17px; }
.filters .field { min-width: 150px; margin: 0; }
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
input, select, textarea { border: 1px solid #cfd7e3; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; padding: 9px 10px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #3164d622; outline: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.form-card { max-width: 850px; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.check-row { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr auto; gap: 8px; align-items: end; margin-bottom: 9px; }
.check-row .field { margin: 0; }
.check-row label { font-size: 11px; }
.check-row input, .check-row select { padding: 7px; font-size: 13px; }
.flash { border-radius: 8px; padding: 12px 15px; margin-bottom: 18px; font-size: 14px; }
.flash.notice { background: #e5f5ee; color: #176a4d; }
.flash.alert { background: #fde9eb; color: #a52c3b; }
.empty { color: var(--muted); text-align: center; padding: 30px 15px; }
.incident-card { border-left: 4px solid var(--red); }
.event-list { display: grid; gap: 0; }
.event { border-bottom: 1px solid var(--line); padding: 12px 0; }
.event:last-child { border-bottom: 0; }
.event-time { color: var(--muted); float: right; font-size: 12px; }
.timeline { display: grid; grid-template-columns: repeat(48, 1fr); gap: 2px; height: 28px; }
.timeline-cell { border-radius: 3px; min-width: 2px; background: #d9e0e8; }
.timeline-cell.healthy { background: #48b78b; }
.timeline-cell.degraded { background: #e3a62e; }
.timeline-cell.down { background: #d95c69; }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 9px 14px; font-size: 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; word-break: break-word; }
.code-block { background: #172235; color: #e3eaf4; border-radius: 8px; padding: 13px; overflow: auto; white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-shell { min-height: 75vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.login-card .brand { color: var(--ink); display: block; margin-bottom: 25px; }
.danger-text { color: var(--red); }
.success-text { color: var(--green); }
.warning-text { color: var(--amber); }
.stack { display: grid; gap: 12px; }
.small { font-size: 12px; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar-inner, .page-heading { align-items: flex-start; flex-direction: column; padding: 16px 0; }
  .nav-links { flex-wrap: wrap; gap: 12px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .check-row { grid-template-columns: 1fr 1fr; }
  .check-row .wide { grid-column: span 2; }
}
