/* ============================================================================
   IncidentDesk — Admin design system
   Operator console: deep navy-slate canvas, indigo primary, status semantics,
   monospace for operational detail. Self-hosted (CSP-safe), no runtime CDN.
   ============================================================================ */

:root {
  /* canvas + surfaces */
  --bg: #0b1020;
  --surface: #11182e;
  --surface-2: #161f3b;
  --surface-3: #1b2747;
  --border: #1f294a;
  --border-2: #2a3458;

  /* text */
  --text: #e6eaf6;
  --muted: #8b95b7;
  --faint: #5d6892;

  /* brand */
  --primary: #6366f1;
  --primary-2: #818cf8;
  --primary-ink: #ffffff;
  --accent: #d946ef;

  /* status */
  --operational: #22c55e;
  --degraded: #f59e0b;
  --partial: #fb923c;
  --major: #ef4444;
  --maintenance: #38bdf8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 14px 40px -18px rgba(0, 0, 0, .65);

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--sans); letter-spacing: -.01em; font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* subtle ambient background */
body.admin {
  background-image:
    radial-gradient(1100px 480px at 78% -8%, rgba(99, 102, 241, .10), transparent 60%),
    radial-gradient(900px 420px at 2% 6%, rgba(217, 70, 239, .06), transparent 55%);
  background-attachment: fixed;
}

/* ----- Layout ------------------------------------------------------------- */
.admin { display: block; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 40;
  background: linear-gradient(180deg, #0d1325, #0b1020);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.main { margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; }

.brand { padding: 20px 18px 14px; position: relative; }
.brand a { font-family: var(--sans); font-weight: 700; font-size: 18px; display: block; line-height: 1.1; }
.brand small { display: block; font-family: var(--ui); font-weight: 400; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-top: 4px; }
.brand-spine {
  position: absolute; left: 0; top: 18px; bottom: 14px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--accent));
}

.nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.nav-section { margin-top: 14px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); margin: 0 0 6px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; position: relative; transition: background .14s, color .14s;
}
.nav-link i { font-size: 16px; width: 18px; text-align: center; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--surface-3); color: #fff; }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--primary-2), var(--accent));
}
.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }

.scrim { display: none; }

/* ----- Topbar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, .72); backdrop-filter: blur(10px);
}
.topbar-title h1 { font-size: 17px; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--muted);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill.operational { color: #b7f7cd; border-color: rgba(34,197,94,.35); }
.status-pill.operational .dot { background: var(--operational); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.status-pill.degraded .dot { background: var(--degraded); }
.status-pill.partial .dot { background: var(--partial); }
.status-pill.major { color: #fecaca; border-color: rgba(239,68,68,.4); }
.status-pill.major .dot { background: var(--major); box-shadow: 0 0 0 4px rgba(239,68,68,.18); }
.status-pill.maintenance .dot { background: var(--maintenance); }

.usermenu { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-2);
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  font-weight: 700; cursor: pointer; font-family: var(--sans);
}
.usermenu .menu {
  position: absolute; right: 0; top: 46px; width: 220px; background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  overflow: hidden; z-index: 30;
}
.menu-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: 12px; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px; font-size: 13.5px; }
.menu-item:hover { background: var(--surface-3); }
.menu-item.danger { color: #fca5a5; }

.icon-btn { background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
.only-mobile { display: none; }

/* ----- Content ------------------------------------------------------------ */
.content { padding: 26px; max-width: 1240px; width: 100%; }

.cards {
  display: grid; gap: 16px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.card.stat { display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
a.card.stat:hover { border-color: var(--border-2); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
.stat-icon.operational { background: rgba(34,197,94,.14); color: var(--operational); }
.stat-icon.degraded { background: rgba(245,158,11,.14); color: var(--degraded); }
.stat-icon.partial { background: rgba(251,146,60,.14); color: var(--partial); }
.stat-icon.major { background: rgba(239,68,68,.14); color: var(--major); }
.stat-icon.maintenance { background: rgba(56,189,248,.14); color: var(--maintenance); }
.stat-num { font-family: var(--sans); font-size: 30px; font-weight: 700; line-height: 1; }
.stat-num small { font-size: 16px; color: var(--muted); font-weight: 500; }
.stat-label { margin: 0; color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; margin: 0; }
.link { color: var(--primary-2); font-size: 13px; }
.link:hover { text-decoration: underline; }

/* rows + feed */
.rows, .feed { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; }
.row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed li { display: flex; gap: 12px; padding: 10px 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none;
  background: var(--primary-2); box-shadow: 0 0 0 4px rgba(99,102,241,.14); }
.feed p { margin: 0 0 2px; }

.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-2); white-space: nowrap; }
.badge.operational { color: var(--operational); border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); }
.badge.degraded { color: var(--degraded); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.1); }
.badge.partial { color: var(--partial); border-color: rgba(251,146,60,.4); background: rgba(251,146,60,.1); }
.badge.major { color: #fca5a5; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.12); }
.badge.maintenance { color: var(--maintenance); border-color: rgba(56,189,248,.4); background: rgba(56,189,248,.1); }
.badge.muted { color: var(--muted); }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty i { font-size: 30px; color: var(--border-2); display: block; margin-bottom: 10px; }
.empty p { margin: 0 auto; max-width: 320px; font-size: 13.5px; }

/* ----- Forms -------------------------------------------------------------- */
.form-card h2 { font-size: 16px; margin: 0 0 4px; }
.form-card > .muted { margin-bottom: 16px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: #0c1226; color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .14s, box-shadow .14s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}
input::placeholder { color: #4f5a82; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.test-inline { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.test-inline input { width: 220px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: var(--primary-ink); border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  font-family: inherit; transition: background .14s, opacity .14s;
}
.btn:hover { background: #5457e6; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--major); }

/* tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-family: inherit;
  font-size: 14px; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: #fff; border-bottom-color: var(--primary); }

/* ----- Alerts + toasts ---------------------------------------------------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 18px; }
.alert.ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.32); color: #b7f7cd; }
.alert.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13.5px;
  transform: translateY(8px); opacity: 0; transition: transform .2s, opacity .2s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,.4); } .toast.success i { color: var(--operational); }
.toast.error { border-color: rgba(239,68,68,.4); } .toast.error i { color: var(--major); }
.toast.info i { color: var(--primary-2); }

/* ----- Auth page ---------------------------------------------------------- */
body.auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background-image:
    radial-gradient(900px 460px at 50% -10%, rgba(99,102,241,.16), transparent 60%),
    radial-gradient(700px 380px at 80% 110%, rgba(217,70,239,.1), transparent 55%);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px; box-shadow: var(--shadow);
}
.auth-brand { position: relative; font-family: var(--sans); font-weight: 700; font-size: 19px;
  padding-left: 14px; margin-bottom: 22px; }
.auth-brand small { display: block; font-family: var(--ui); font-weight: 400; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-top: 3px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .muted { margin: 0 0 20px; }
.auth-foot { color: var(--faint); font-size: 12px; margin-top: 22px; }

/* ----- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .main { margin-left: 0; }
  .only-mobile { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30;
    opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .content { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .test-inline { margin-left: 0; width: 100%; }
  .test-inline input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }

/* ============================================================================
   Phase 4 — lists, forms, incident timeline, detail layout
   ============================================================================ */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters input[type="search"] { width: 260px; }
.filters select { width: auto; min-width: 150px; }

.btn.sm { padding: 7px 13px; font-size: 13px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.page-head-actions form { margin: 0; }
.back { color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.back:hover { color: var(--text); }

/* data tables */
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 600; padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
.dtable tbody td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable .strong { font-weight: 600; color: var(--text); }
.dtable a.row-title:hover { color: var(--primary-2); }
.dtable .sub { font-size: 12px; margin-top: 3px; }
.ta-right { text-align: right; }

/* pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.page { padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  font-size: 13px; color: var(--text); }
a.page:hover { background: var(--surface-2); }
.page.disabled { color: var(--faint); border-color: var(--border); pointer-events: none; }
.page-info { color: var(--muted); font-size: 13px; }

/* checkbox fields */
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text);
  margin: 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.check-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 16px; }
.field-help { display: block; font-size: 12px; color: var(--faint); margin-top: 5px; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px;
  padding: 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: #0c1226;
  max-height: 220px; overflow-y: auto; }

/* incident detail layout */
.grid-detail { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.grid-detail > div { display: flex; flex-direction: column; gap: 16px; }
.incident-head .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.incident-head h2 { font-size: 22px; margin: 0 0 4px; }
.incident-head .ref { margin: 0 0 12px; font-size: 12.5px; }
.incident-head .lead { font-size: 15px; color: var(--text); margin: 0 0 10px; }
.prose { color: var(--muted); font-size: 14px; line-height: 1.65; }

.side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint);
  margin: 16px 0 8px; }
.side h3:first-child { margin-top: 0; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; text-align: right; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 10px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-2); }
.chip.muted { color: var(--muted); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 20px 28px; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); border: 3px solid var(--bg); z-index: 1; }
.tl-dot.operational { background: var(--operational); } .tl-dot.major { background: var(--major); }
.tl-dot.partial { background: var(--partial); } .tl-dot.degraded { background: var(--degraded); }
.tl-dot.maintenance { background: var(--maintenance); }
.tl-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.tl-body p { margin: 4px 0 6px; color: var(--muted); }
.tl-flag { color: var(--primary-2); font-size: 12px; }

@media (max-width: 980px) { .grid-detail { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .filters input[type="search"] { width: 100%; }
  .filters { width: 100%; }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px 4px; }
  .dtable tbody td { border: 0; padding: 6px 12px; }
  .dtable .ta-right { text-align: left; }
}

/* ============================================================================
   Phase 5 — catalog, reports grouping, templates
   ============================================================================ */
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.danger-link { background: none; border: 0; color: #fca5a5; cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.danger-link:hover { text-decoration: underline; }
input[type="color"] { padding: 4px; cursor: pointer; }
input[type="number"] { width: 100%; }

.toolbar-h { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 10px; }
.count-pill { font-size: 12px; font-weight: 600; color: var(--primary-2); background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.3); padding: 3px 10px; border-radius: 999px; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.group-card { display: flex; flex-direction: column; gap: 14px; }
.group-top { display: flex; align-items: center; gap: 14px; }
.count-badge { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--sans); font-weight: 700; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent)); }
.group-top strong { display: block; line-height: 1.3; }
.group-actions { display: flex; gap: 8px; }
.group-actions form { margin: 0; flex: 1; }
.group-actions .btn { width: 100%; }

.ph-row { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ph-row code { background: #0c1226; border: 1px solid var(--border-2); color: var(--primary-2); }

/* ============================================================================
   Phase 6 — public status page
   ============================================================================ */
body.public {
  background-image:
    radial-gradient(1000px 460px at 50% -12%, rgba(99,102,241,.12), transparent 62%),
    radial-gradient(760px 380px at 88% 4%, rgba(217,70,239,.06), transparent 55%);
  background-attachment: fixed; display: block;
}
.pub-nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
  background: rgba(11,16,32,.72); border-bottom: 1px solid var(--border); }
.pub-nav-inner { max-width: 860px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.pub-brand { position: relative; font-family: var(--sans); font-weight: 700; font-size: 18px; padding-left: 14px; }
.pub-brand small { display: block; font-family: var(--ui); font-weight: 400; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-top: 2px; }
.pub-actions { margin-left: auto; display: flex; gap: 10px; }

.pub-wrap { max-width: 860px; margin: 0 auto; padding: 30px 20px 60px; }

.overall { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--radius);
  border: 1px solid var(--border-2); background: var(--surface); margin-bottom: 30px; }
.overall .o-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; flex: none; }
.overall h1 { font-size: 21px; margin: 0; }
.overall p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.overall.operational { border-color: rgba(34,197,94,.4); background: linear-gradient(180deg, rgba(34,197,94,.08), transparent); }
.overall.operational .o-icon { background: rgba(34,197,94,.16); color: var(--operational); }
.overall.degraded .o-icon { background: rgba(245,158,11,.16); color: var(--degraded); }
.overall.partial .o-icon { background: rgba(251,146,60,.16); color: var(--partial); }
.overall.major { border-color: rgba(239,68,68,.45); background: linear-gradient(180deg, rgba(239,68,68,.08), transparent); }
.overall.major .o-icon { background: rgba(239,68,68,.16); color: var(--major); }
.overall.maintenance .o-icon { background: rgba(56,189,248,.16); color: var(--maintenance); }

.pub-section { margin-bottom: 30px; }
.pub-section > h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint);
  margin: 0 0 12px; font-family: var(--ui); font-weight: 600; }

.svc-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.svc-cat { padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 9px; }
.svc-cat .cdot { width: 9px; height: 9px; }
.svc-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.svc-row:last-child { border-bottom: 0; }
.svc-name { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.svc-name i { color: var(--muted); }
.svc-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.svc-state .dot { width: 9px; height: 9px; border-radius: 50%; }
.s-operational { color: var(--operational); } .s-operational .dot { background: var(--operational); }
.s-degraded { color: var(--degraded); } .s-degraded .dot { background: var(--degraded); }
.s-partial { color: var(--partial); } .s-partial .dot { background: var(--partial); }
.s-major { color: var(--major); } .s-major .dot { background: var(--major); }
.s-maintenance { color: var(--maintenance); } .s-maintenance .dot { background: var(--maintenance); }

.pub-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 18px 20px; margin-bottom: 12px; }
.pub-card h3 { margin: 0 0 6px; font-size: 16px; }
.pub-card h3 a:hover { color: var(--primary-2); }
.pub-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pub-card .excerpt { color: var(--muted); font-size: 14px; }
.pub-card time { font-size: 12.5px; }

.resolved-item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.resolved-item:first-child { border-top: 0; }
.resolved-item a:hover { color: var(--primary-2); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
.stat-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.stat-box .big { font-family: var(--sans); font-size: 26px; font-weight: 700; }
.stat-box .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

.subscribe-bar { border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface);
  padding: 20px 22px; margin-bottom: 30px; }
.subscribe-bar h2 { font-size: 16px; margin: 0 0 4px; text-transform: none; letter-spacing: 0; color: var(--text); font-family: var(--sans); }
.subscribe-bar p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.subscribe-form { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-form input { flex: 1; min-width: 220px; }

.pub-footer { max-width: 860px; margin: 0 auto; padding: 26px 20px 40px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pub-footer a { color: var(--muted); } .pub-footer a:hover { color: var(--text); }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.notice.ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.32); color: #b7f7cd; }
.notice.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }
.form-narrow { max-width: 560px; margin: 0 auto; }

@media (max-width: 600px) {
  .overall { flex-direction: row; align-items: flex-start; }
  .pub-actions .btn span { display: none; }
}
