:root {
  --ink: #13233f;
  --muted: #637087;
  --line: #dce3ed;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --brand: #0d6b55;
  --brand-2: #06483c;
  --accent: #d9a520;
  --danger: #a33131;
  --warning: #956500;
  --shadow: 0 16px 40px rgba(20, 35, 63, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--brand); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  background: linear-gradient(180deg, #0d1c31 0%, #101b2c 100%);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; margin: 0 6px 24px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #18a47e, #d9a520); font-weight: 900;
}
.brand strong { display: block; font-size: 14px; letter-spacing: .02em; }
.brand small { color: #9eb0c8; }
.nav-label { margin: 18px 10px 8px; color: #7f93ad; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.nav a {
  display: block; padding: 9px 12px; border-radius: 9px; color: #c7d3e2;
  text-decoration: none; margin-bottom: 3px;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.main { min-width: 0; }
.topbar {
  height: 72px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3;
}
.topbar h1 { margin: 0; font-size: 20px; }
.content { padding: 28px 30px 60px; max-width: 1500px; margin: 0 auto; }
.grid { display: grid; gap: 18px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 15px;
  padding: 20px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.metric strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
.stack > * + * { margin-top: 14px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button, button {
  appearance: none; border: 0; background: var(--brand); color: #fff; border-radius: 9px;
  padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.button:hover, button:hover { background: var(--brand-2); }
.button.secondary, button.secondary { background: #e8edf4; color: var(--ink); }
.button.danger, button.danger { background: var(--danger); }
form.inline { display: inline; }
label { display: block; font-weight: 700; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 11px; border-radius: 9px; border: 1px solid #cbd5e2;
  background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(13,107,85,.14); border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 9px; align-items: start; font-weight: 500; }
.check input { width: auto; margin-top: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 9px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px; background: #e7edf5;
  color: #40506a; font-size: 11px; font-weight: 800;
}
.badge.active, .badge.approved, .badge.published, .badge.released, .badge.completed, .badge.healthy { background: #dff4ec; color: #075c45; }
.badge.pending, .badge.pending_review, .badge.draft, .badge.degraded { background: #fff0ca; color: #805500; }
.badge.failed, .badge.critical, .badge.rejected, .badge.open { background: #fde3e3; color: #922b2b; }
.notice { padding: 13px 15px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.notice.success { background: #e7f8f1; border-color: #9edcc8; color: #075c45; }
.notice.error { background: #fff0f0; border-color: #edb3b3; color: #8a2626; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #e2f1ec, var(--soft) 48%); }
.login { width: min(440px, 100%); }
.public-header { background: #0d1c31; color: #fff; }
.public-header .inner, .story, .public-footer { width: min(980px, calc(100% - 36px)); margin: auto; }
.public-header .inner { padding: 18px 0; display: flex; justify-content: space-between; align-items: center; }
.public-header a { color: #fff; text-decoration: none; }
.story { background: #fff; margin-top: 30px; margin-bottom: 30px; border: 1px solid var(--line); border-radius: 18px; padding: clamp(24px, 5vw, 60px); box-shadow: var(--shadow); }
.story h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; letter-spacing: -.04em; margin: 12px 0 18px; }
.story h2 { margin-top: 34px; }
.source-box { background: #edf5f2; border-left: 4px solid var(--brand); padding: 14px 16px; margin: 24px 0; }
.public-footer { padding: 15px 0 40px; color: var(--muted); }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .nav-label { grid-column: 1 / -1; }
  .topbar { padding: 0 18px; }
  .content { padding: 20px 16px 50px; }
  .metrics, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
