@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=JetBrains+Mono:wght@400;500;600&family=Sora:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS — Argus Command Center
═══════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds — deep OLED void */
  --bg-base:  #020406;
  --bg-1:     #06090d;
  --bg-2:     #0b1018;
  --bg-3:     #111820;
  --bg-4:     #18212e;
  --bg-5:     #202b3a;

  /* Borders */
  --border-0: rgba(100, 180, 255, 0.06);
  --border-1: rgba(100, 180, 255, 0.12);
  --border-2: rgba(100, 180, 255, 0.22);
  --border-3: rgba(100, 180, 255, 0.38);

  /* Text */
  --text-main:  #dceeff;
  --text-muted: #5a7a94;
  --text-dim:   #304050;

  /* ── Status palette — vivid, high-contrast ── */
  --cyan:         #00d4ff;
  --cyan-soft:    rgba(0, 212, 255, 0.12);
  --cyan-border:  rgba(0, 212, 255, 0.30);
  --cyan-text:    #6ee8ff;
  --cyan-glow:    0 0 10px rgba(0, 212, 255, 0.55), 0 0 32px rgba(0, 212, 255, 0.18);

  --red:          #ff3355;
  --red-soft:     rgba(255, 51, 85, 0.13);
  --red-border:   rgba(255, 51, 85, 0.38);
  --red-text:     #ff8099;
  --red-glow:     0 0 10px rgba(255, 51, 85, 0.55), 0 0 32px rgba(255, 51, 85, 0.18);

  --violet:       #9d6bff;
  --violet-soft:  rgba(157, 107, 255, 0.12);
  --violet-border:rgba(157, 107, 255, 0.32);
  --violet-text:  #c4a4ff;

  --amber:        #ffb340;
  --amber-soft:   rgba(255, 179, 64, 0.12);

  /* Radius */
  --r-xs:   2px;
  --r-sm:   4px;
  --r-md:   6px;
  --r-lg:   10px;
  --r-pill: 100px;

  /* Shadows */
  --shadow-card:    0 1px 3px rgba(0,0,0,0.8), 0 8px 24px -12px rgba(0,0,0,0.9);
  --shadow-overlay: 0 16px 48px -8px rgba(0,0,0,0.98), 0 2px 8px rgba(0,0,0,0.9);

  /* Layout */
  --sidebar-w: 240px;

  /* Z-index */
  --z-dropdown: 20;
  --z-overlay:  100;
}

/* ═══════════════════════════════════════════════════════════
   RESET
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════
   BODY
═══════════════════════════════════════════════════════════ */
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric radial gradient */
.page-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 0% 0%,   rgba(157, 107, 255, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 5%,  rgba(0, 212, 255, 0.07)  0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(0, 212, 255, 0.04)  0%, transparent 60%);
}

/* Scanline overlay — subtle HUD texture */
.page-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.app-sidebar {
  background: linear-gradient(180deg, rgba(6,9,14,0.98) 0%, rgba(3,5,8,0.99) 100%);
  border-right: 1px solid var(--border-1);
  padding: 20px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  /* Subtle cyan glow on the right edge */
  box-shadow: 1px 0 0 0 var(--border-1), 4px 0 24px -8px rgba(0, 212, 255, 0.06);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan-text);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: var(--r-md);
  transition: color 150ms ease, text-shadow 150ms ease;
  text-shadow: var(--cyan-glow);
}

.brand:hover {
  color: #fff;
  text-shadow: var(--cyan-glow), 0 0 60px rgba(0, 212, 255, 0.3);
}

.brand-mark-wrap { display: inline-flex; }

.brand-mark {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.6));
}

.subtitle {
  margin: 0 0 6px;
  padding: 0 8px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  font-size: 0.65rem;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-1);
  margin: 6px 4px;
  flex-shrink: 0;
}

/* Nav */
.sidebar-nav {
  display: grid;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  cursor: pointer;
}

.sidebar-link svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: opacity 150ms ease;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: rgba(0, 212, 255, 0.05);
  border-color: var(--border-1);
  border-left-color: var(--border-2);
}

.sidebar-link:hover svg { opacity: 0.85; }

.sidebar-link.active {
  color: var(--cyan-text);
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--cyan-border);
  border-left-color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-logout {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-1);
}

.sidebar-note {
  margin: 4px 0;
  padding: 0 8px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── MAIN CONTENT ─────────────────────────────────────── */
.app-main {
  padding: 20px 22px 28px 18px;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

.content-wrap { width: 100%; }

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════ */
.site-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 13px 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(14,20,30,0.97) 0%, rgba(8,12,18,0.97) 100%);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(0,212,255,0.06);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   FLASH MESSAGES
═══════════════════════════════════════════════════════════ */
.flash {
  border-radius: var(--r-md);
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  color: var(--text-main);
  font-size: 0.85rem;
}

.flash.error {
  border-color: var(--red-border);
  background: rgba(255, 51, 85, 0.1);
  color: var(--red-text);
}

.flash.success {
  border-color: var(--cyan-border);
  background: rgba(0, 212, 255, 0.08);
  color: var(--cyan-text);
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════════════════ */
h1, h2 {
  margin: 0 0 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

h1 { font-size: 1.1rem; }
h2 { font-size: 0.9rem;  color: var(--text-muted); }

.empty {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.79rem;
  color: var(--cyan-text);
  background: var(--cyan-soft);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--cyan-border);
}

a { color: var(--cyan-text); text-decoration: none; transition: color 140ms ease; }
a:hover { color: #a5f3ff; }

/* ═══════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════ */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px 12px;
  background: linear-gradient(145deg, var(--bg-3) 0%, var(--bg-2) 100%);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* Neon corner accent */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--border-2);
  border-radius: 0 0 2px 0;
  transition: background 200ms ease, width 200ms ease;
}

.stat-card h2 {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 500;
}

.stat-card p {
  margin: 8px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-main);
}

/* Colored variants */
.stat-card.up {
  border-color: var(--cyan-border);
  box-shadow: var(--shadow-card), 0 0 20px -6px rgba(0, 212, 255, 0.2);
}
.stat-card.up::before { background: var(--cyan); width: 60px; }
.stat-card.up p { color: var(--cyan-text); text-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }

.stat-card.down {
  border-color: var(--red-border);
  box-shadow: var(--shadow-card), 0 0 20px -6px rgba(255, 51, 85, 0.2);
}
.stat-card.down::before { background: var(--red); width: 60px; }
.stat-card.down p { color: var(--red-text); text-shadow: 0 0 20px rgba(255, 51, 85, 0.4); }

.stat-card.unknown {
  border-color: var(--violet-border);
  box-shadow: var(--shadow-card), 0 0 20px -6px rgba(157, 107, 255, 0.15);
}
.stat-card.unknown::before { background: var(--violet); width: 60px; }
.stat-card.unknown p { color: var(--violet-text); }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
  border: 1px solid var(--border-1);
  background: linear-gradient(180deg, rgba(14,20,28,0.97) 0%, rgba(8,12,18,0.97) 100%);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  position: relative;
}

.narrow {
  width: min(520px, 100%);
  margin: 7vh auto 0;
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════════════ */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.group-title {
  margin: 16px 0 8px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.group-head { margin-top: 14px; margin-bottom: 6px; }
.group-head .group-title { margin: 0; }
.group-title span { color: var(--text-dim); font-size: 0.75rem; }

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════════════════════ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px 3px 7px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status.up {
  background: var(--cyan-soft);
  color: var(--cyan-text);
  border-color: var(--cyan-border);
  box-shadow: 0 0 8px -2px rgba(0, 212, 255, 0.25);
}
.status.up::before {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.8);
}

.status.down {
  background: var(--red-soft);
  color: var(--red-text);
  border-color: var(--red-border);
  box-shadow: 0 0 8px -2px rgba(255, 51, 85, 0.3);
}
.status.down::before {
  background: var(--red);
  box-shadow: 0 0 6px rgba(255, 51, 85, 0.8);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.status.unknown {
  background: var(--violet-soft);
  color: var(--violet-text);
  border-color: var(--violet-border);
}
.status.unknown::before { background: var(--violet); }

.status.paused {
  background: rgba(90, 122, 148, 0.1);
  color: var(--text-muted);
  border-color: var(--border-2);
}
.status.paused::before { background: var(--text-dim); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(255, 51, 85, 0.8); }
  50%       { opacity: 0.4; box-shadow: 0 0 2px rgba(255, 51, 85, 0.3); }
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--cyan-border);
  background: rgba(0, 212, 255, 0.08);
  color: var(--cyan-text);
  text-decoration: none;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
  white-space: nowrap;
}

.button:hover {
  background: rgba(0, 212, 255, 0.16);
  border-color: var(--cyan);
  box-shadow: var(--cyan-glow);
  color: #fff;
  transform: translateY(-1px);
}

.button:active { transform: translateY(0); box-shadow: none; }

.button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.button.muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-2);
  color: var(--text-muted);
}
.button.muted:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-3);
  color: var(--text-main);
  box-shadow: none;
}

.button.danger {
  background: rgba(255, 51, 85, 0.1);
  border-color: var(--red-border);
  color: var(--red-text);
}
.button.danger:hover {
  background: rgba(255, 51, 85, 0.2);
  border-color: var(--red);
  box-shadow: var(--red-glow);
  color: #fff;
}

.button.small {
  padding: 5px 10px;
  font-size: 0.7rem;
  border-radius: var(--r-xs);
}

/* ═══════════════════════════════════════════════════════════
   ROW ACTIONS
═══════════════════════════════════════════════════════════ */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th {
  padding: 7px 10px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border-1);
  white-space: nowrap;
}

td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-0);
  vertical-align: middle;
  font-size: 0.84rem;
}

tr:last-child td { border-bottom: 0; }

.target { max-width: 280px; word-break: break-word; }

.cell-title {
  font-weight: 600;
  font-size: 0.84rem;
  transition: color 140ms ease;
}

.cell-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════
   ACTIVE OUTAGES
═══════════════════════════════════════════════════════════ */
.active-outage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.active-outage-item {
  border: 1px solid var(--red-border);
  background: linear-gradient(145deg, rgba(255,51,85,0.09) 0%, rgba(140,10,30,0.12) 100%);
  border-radius: var(--r-md);
  padding: 13px 15px;
  position: relative;
  overflow: hidden;
  animation: outage-border-pulse 2.5s ease-in-out infinite;
}

/* Animated red left bar */
.active-outage-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--red);
  box-shadow: var(--red-glow);
  animation: outage-bar-pulse 2.5s ease-in-out infinite;
}

@keyframes outage-border-pulse {
  0%, 100% { border-color: var(--red-border); box-shadow: none; }
  50% { border-color: rgba(255,51,85,0.6); box-shadow: 0 0 16px -4px rgba(255,51,85,0.3); }
}

@keyframes outage-bar-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.active-outage-clear {
  border: 1px solid var(--cyan-border);
  background: linear-gradient(145deg, rgba(0,212,255,0.06) 0%, rgba(0,80,110,0.1) 100%);
  border-radius: var(--r-md);
  padding: 13px 15px;
}

.active-outage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════════
   MONITOR TABLE
═══════════════════════════════════════════════════════════ */
.monitor-table {
  min-width: 1200px;
  table-layout: fixed;
}

.monitor-table th,
.monitor-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-table .target { word-break: normal; }
.monitor-table .host-cell { font-weight: 600; max-width: 280px; }
.monitor-table .status-cell { width: 120px; }
.monitor-table .actions-cell { overflow: visible; width: 120px; }
.outage-cell { min-width: 200px; }
.outage-cell .cell-sub { margin-top: 3px; }

.monitor-row {
  cursor: pointer;
  transition: background 120ms ease;
  border-left: 2px solid transparent;
}

.monitor-row td:first-child { padding-left: 8px; }

.monitor-row:hover { background: rgba(0, 212, 255, 0.04); }
.monitor-row:hover .cell-title { color: var(--cyan-text); }

.monitor-row.down {
  background: rgba(255, 51, 85, 0.05);
  border-left-color: rgba(255, 51, 85, 0.5);
}
.monitor-row.down:hover {
  background: rgba(255, 51, 85, 0.09);
}

.monitor-row.up { border-left-color: transparent; }
.monitor-row.up:hover { border-left-color: rgba(0, 212, 255, 0.3); }

.monitor-row.paused { opacity: 0.55; }

.monitor-row[data-expanded='true'] {
  background: rgba(0, 212, 255, 0.04);
  border-left-color: var(--cyan);
  outline: 1px solid var(--cyan-border);
  outline-offset: -1px;
}

/* Expand caret */
.monitor-expand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.monitor-expand::before {
  content: '›';
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-dim);
  transition: color 140ms ease, transform 200ms ease;
  flex-shrink: 0;
}

.monitor-row[data-expanded='true'] .monitor-expand::before {
  transform: rotate(90deg);
  color: var(--cyan);
}

.monitor-row:not([data-expanded='true']):hover .monitor-expand::before {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   MONITOR INCIDENTS PANEL
═══════════════════════════════════════════════════════════ */
.monitor-incidents-row td { padding: 4px 10px 16px; }

.monitor-incidents-panel {
  border: 1px solid var(--border-1);
  background: rgba(0,0,0,0.35);
  border-radius: var(--r-md);
  padding: 14px;
}

.monitor-incidents-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.monitor-panel-actions { margin-bottom: 12px; }
.monitor-incidents-wrap table { min-width: 600px; }
.monitor-incidents-table th,
.monitor-incidents-table td { font-size: 0.78rem; }

/* ═══════════════════════════════════════════════════════════
   ACTION MENU
═══════════════════════════════════════════════════════════ */
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }

.action-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: var(--z-dropdown);
  min-width: 160px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: rgba(6, 10, 16, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-overlay), 0 0 24px -8px rgba(0, 212, 255, 0.1);
  padding: 4px;
  display: grid;
  gap: 2px;
}

.action-menu-list form { margin: 0; }

.action-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-xs);
  padding: 7px 10px;
  font: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}

.action-menu-item:hover {
  background: rgba(0, 212, 255, 0.07);
  color: var(--text-main);
}

.action-menu-item.danger { color: var(--red-text); }
.action-menu-item.danger:hover {
  background: rgba(255, 51, 85, 0.1);
  color: var(--red-text);
}

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

input, select, button, textarea { font: inherit; }

input, select, textarea {
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  background: rgba(0,0,0,0.5);
  color: var(--text-main);
  font-family: 'Sora', sans-serif;
  font-size: 0.875rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }
select option { background: #0a0e16; color: var(--text-main); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 12px -4px rgba(0, 212, 255, 0.2);
}

.full { grid-column: 1 / -1; }

.inline-check { display: flex; align-items: center; gap: 10px; }
.inline-check input {
  width: 16px; height: 16px; margin: 0; cursor: pointer;
  accent-color: var(--cyan);
}

.group-inline-form { min-width: 400px; }

/* ═══════════════════════════════════════════════════════════
   MUTED GROUP NOTE
═══════════════════════════════════════════════════════════ */
.muted-group-note {
  border: 1px solid var(--violet-border);
  background: rgba(157, 107, 255, 0.06);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.muted-group-note strong { display: block; margin-bottom: 4px; }
.muted-group-note p { margin: 2px 0; }

/* ═══════════════════════════════════════════════════════════
   STATUS PAGE MONITOR PICKER
═══════════════════════════════════════════════════════════ */
.status-page-monitor-pick {
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 12px;
  margin: 0;
  background: rgba(0,0,0,0.2);
}
.status-page-monitor-pick legend {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.status-page-monitor-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.status-page-monitor-groups { display: grid; gap: 10px; }
.status-page-monitor-group {
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  padding: 10px 12px 12px;
  background: rgba(255,255,255,0.01);
}
.status-page-monitor-group h3 {
  margin: 0 0 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}
.status-page-monitor-group h3 span { color: var(--text-dim); }
.status-page-monitor-option {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-main); font-size: 0.84rem; padding: 3px 0; cursor: pointer;
}
.status-page-monitor-option input {
  width: 15px; height: 15px; accent-color: var(--cyan);
}

/* ═══════════════════════════════════════════════════════════
   ADMIN LOG
═══════════════════════════════════════════════════════════ */
.admin-log {
  margin-top: 14px;
  border-top: 1px solid var(--border-1);
  padding-top: 12px;
}
.admin-log > summary {
  cursor: pointer;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  margin-bottom: 10px;
  user-select: none;
  transition: color 130ms ease;
}
.admin-log > summary:hover { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   QR BLOCK
═══════════════════════════════════════════════════════════ */
.qr-block { display: grid; justify-items: start; gap: 8px; margin-bottom: 16px; }
.qr-block img {
  width: 180px; height: 180px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: #f8fafc;
  padding: 6px;
  box-shadow: 0 0 20px -4px rgba(0, 212, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   PUBLIC STATUS PAGE
═══════════════════════════════════════════════════════════ */
.public-status-body { height: auto; min-height: 100dvh; overflow-y: auto; }

.public-status-shell {
  max-width: 1024px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  position: relative;
  z-index: 1;
}

.public-status-card { margin-top: 6px; }

.public-status-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.public-status-counter {
  border: 1px solid var(--border-1);
  background: linear-gradient(145deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border-radius: var(--r-md);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.public-status-counter::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 50px; height: 2px;
  background: var(--border-2);
}

.public-status-counter .label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.public-status-counter strong {
  display: block;
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
}

.public-status-counter.up::before { background: var(--cyan); }
.public-status-counter.up { border-color: var(--cyan-border); box-shadow: 0 0 20px -8px rgba(0,212,255,0.15); }
.public-status-counter.up strong { color: var(--cyan-text); text-shadow: 0 0 20px rgba(0,212,255,0.3); }

.public-status-counter.down::before { background: var(--red); }
.public-status-counter.down { border-color: var(--red-border); box-shadow: 0 0 20px -8px rgba(255,51,85,0.15); }
.public-status-counter.down strong { color: var(--red-text); text-shadow: 0 0 20px rgba(255,51,85,0.3); }

.public-status-counter.unknown::before { background: var(--violet); }
.public-status-counter.unknown { border-color: var(--violet-border); }
.public-status-counter.unknown strong { color: var(--violet-text); }

/* Live pill */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px 3px 7px;
  border-radius: var(--r-pill);
  background: var(--cyan-soft);
  color: var(--cyan-text);
  border: 1px solid var(--cyan-border);
  box-shadow: 0 0 8px -2px rgba(0,212,255,0.25);
}

.live-pill::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.9);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(0, 212, 255, 0.9); }
  50%       { opacity: 0.3; box-shadow: none; }
}

.status-live-meta { margin-bottom: 14px; align-items: center; gap: 10px; }

/* Public status table */
.public-status-table {
  min-width: 540px;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.public-status-table thead th { border-bottom: 1px solid var(--border-1); }
.public-status-table tbody td { border-bottom: 0; }
.public-status-table tbody td:first-child {
  border-top-left-radius: var(--r-sm);
  border-bottom-left-radius: var(--r-sm);
}
.public-status-table tbody td:last-child {
  border-top-right-radius: var(--r-sm);
  border-bottom-right-radius: var(--r-sm);
}

.public-status-table .uptime-cell { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.public-status-table .state-duration-cell {
  min-width: 160px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.public-status-table .public-status-row { transition: background-color 200ms ease; }

.public-status-table .public-status-row.uptime-gradient {
  background: linear-gradient(
    90deg,
    rgba(0,212,255,0.14) 0%,
    rgba(0,212,255,0.14) var(--uptime-fill, 0%),
    rgba(255,51,85,0.12) var(--uptime-fill, 0%),
    rgba(255,51,85,0.12) 100%
  );
}

.public-status-table .public-status-row.state-up:not(.uptime-gradient) { background: rgba(0,212,255,0.06); }
.public-status-table .public-status-row.state-down:not(.uptime-gradient) { background: rgba(255,51,85,0.1); }
.public-status-table .public-status-row.state-unknown:not(.uptime-gradient) { background: rgba(157,107,255,0.07); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — 900px
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body { height: auto; overflow: auto; }

  .app-shell { grid-template-columns: 1fr; }

  .app-sidebar {
    min-height: 0;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border-1);
    padding: 12px;
    gap: 4px;
    box-shadow: 0 1px 0 var(--border-1);
  }

  .sidebar-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }

  .sidebar-link {
    justify-content: center;
    padding: 8px 6px;
    font-size: 0.78rem;
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    border-radius: var(--r-sm);
  }
  .sidebar-link.active { border-color: var(--cyan-border); border-left-color: var(--cyan-border); }

  .sidebar-logout { margin-top: 0; padding-top: 0; border-top: 0; }

  .app-main { height: auto; overflow: visible; padding: 12px; }

  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.two-col { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — 560px
═══════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .sidebar-nav { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: 1fr; }
  .public-status-counters { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
  .site-header { flex-wrap: wrap; gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .live-pill::before,
  .status.down::before,
  .active-outage-item,
  .active-outage-item::before { animation: none; }

  .button, .sidebar-link, .monitor-row, .cell-title,
  .monitor-expand::before, input, select, textarea { transition: none; }
}
