/* ═══════════════════════════════════════════════════════════════════════════
   AI MONITOR — ORBITAL MISSION CONTROL THEME
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Deep space palette */
  --void:         #060a14;
  --space:        #0a0f1e;
  --hull:         #0e1529;
  --panel:        #111a30;
  --panel-hover:  #162040;
  --bulkhead:     #1a2548;
  --frame:        #1e2d55;

  /* Signal colors */
  --phosphor:     #00ff9f;
  --phosphor-dim: rgba(0, 255, 159, 0.08);
  --phosphor-mid: rgba(0, 255, 159, 0.2);
  --phosphor-glow:rgba(0, 255, 159, 0.4);
  --amber:        #ffb800;
  --amber-dim:    rgba(255, 184, 0, 0.08);
  --amber-mid:    rgba(255, 184, 0, 0.2);
  --coral:        #ff3d5a;
  --coral-dim:    rgba(255, 61, 90, 0.08);
  --coral-mid:    rgba(255, 61, 90, 0.2);
  --cyan:         #00d4ff;
  --cyan-dim:     rgba(0, 212, 255, 0.06);
  --cyan-mid:     rgba(0, 212, 255, 0.15);

  /* Text */
  --text-bright:  #e8ecf4;
  --text-normal:  #9aa5be;
  --text-dim:     #4d5a78;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Geometry */
  --radius:       4px;
  --radius-lg:    6px;
  --corner-size:  8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--void);
  color: var(--text-bright);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ ATMOSPHERIC LAYERS ═══════════════════════════════════════════════════ */

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bulkhead) 1px, transparent 1px),
    linear-gradient(90deg, var(--bulkhead) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 70%);
}

.scanline-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.008) 2px,
    rgba(0, 212, 255, 0.008) 4px
  );
  animation: scanDrift 8s linear infinite;
}

@keyframes scanDrift {
  from { transform: translateY(0); }
  to   { transform: translateY(4px); }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, transparent 30%, var(--void) 100%);
}

/* ═══ TOP BAR ══════════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: linear-gradient(180deg, rgba(10, 15, 30, 0.95) 0%, rgba(10, 15, 30, 0.88) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bulkhead);
  box-shadow: 0 1px 0 rgba(0, 212, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-radar {
  width: 36px;
  height: 36px;
  color: var(--cyan);
  position: relative;
}

.radar-svg {
  width: 100%;
  height: 100%;
}

.radar-sweep {
  transform-origin: 20px 20px;
  animation: radarSpin 3s linear infinite;
}

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-bright);
}

.logo-subtitle {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Connection Indicator */
.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--bulkhead);
  background: var(--hull);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 6px var(--coral);
  transition: all 0.5s ease;
}

.conn-dot.connected {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor-glow);
  animation: connPulse 2s ease infinite;
}

@keyframes connPulse {
  0%, 100% { box-shadow: 0 0 6px var(--phosphor-glow); }
  50%      { box-shadow: 0 0 14px var(--phosphor-glow), 0 0 3px var(--phosphor); }
}

.conn-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  transition: color 0.5s;
}

.conn-dot.connected + .conn-label {
  color: var(--phosphor);
}

/* Clock */
.clock-display {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  min-width: 75px;
  text-align: right;
}

/* Search */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 7px 12px 7px 32px;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 200px;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 12px rgba(0, 212, 255, 0.08);
  width: 260px;
}

.search-input::placeholder {
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ═══ BUTTONS ══════════════════════════════════════════════════════════════ */

.btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.05));
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--cyan);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 212, 255, 0.1));
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
}

.btn-secondary {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  color: var(--text-normal);
}

.btn-secondary:hover {
  background: var(--panel);
  border-color: var(--frame);
  color: var(--text-bright);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 10px;
}

.btn-danger {
  background: var(--coral-dim);
  border-color: rgba(255, 61, 90, 0.2);
  color: var(--coral);
}

.btn-danger:hover {
  background: var(--coral-mid);
  border-color: var(--coral);
  box-shadow: 0 0 12px rgba(255, 61, 90, 0.15);
}

/* ═══ SUMMARY INSTRUMENTS ══════════════════════════════════════════════════ */

.summary-strip {
  display: flex;
  gap: 14px;
  padding: 22px 28px;
  position: relative;
  z-index: 1;
}

.instrument {
  flex: 1;
  min-width: 150px;
  background: linear-gradient(170deg, var(--panel) 0%, var(--hull) 100%);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-lg);
  padding: 18px 20px 14px;
  position: relative;
  overflow: hidden;
  animation: instrumentIn 0.6s ease both;
}

.instrument[data-delay="0"] { animation-delay: 0.05s; }
.instrument[data-delay="1"] { animation-delay: 0.12s; }
.instrument[data-delay="2"] { animation-delay: 0.19s; }
.instrument[data-delay="3"] { animation-delay: 0.26s; }
.instrument[data-delay="4"] { animation-delay: 0.33s; }

@keyframes instrumentIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Corner decorations */
.instrument-corner {
  position: absolute;
  width: var(--corner-size);
  height: var(--corner-size);
}

.instrument-corner::before,
.instrument-corner::after {
  content: '';
  position: absolute;
  background: var(--frame);
}

.instrument-corner.tl { top: 4px; left: 4px; }
.instrument-corner.tl::before { top: 0; left: 0; width: var(--corner-size); height: 1px; }
.instrument-corner.tl::after  { top: 0; left: 0; width: 1px; height: var(--corner-size); }

.instrument-corner.tr { top: 4px; right: 4px; }
.instrument-corner.tr::before { top: 0; right: 0; width: var(--corner-size); height: 1px; }
.instrument-corner.tr::after  { top: 0; right: 0; width: 1px; height: var(--corner-size); }

.instrument-corner.bl { bottom: 4px; left: 4px; }
.instrument-corner.bl::before { bottom: 0; left: 0; width: var(--corner-size); height: 1px; }
.instrument-corner.bl::after  { bottom: 0; left: 0; width: 1px; height: var(--corner-size); }

.instrument-corner.br { bottom: 4px; right: 4px; }
.instrument-corner.br::before { bottom: 0; right: 0; width: var(--corner-size); height: 1px; }
.instrument-corner.br::after  { bottom: 0; right: 0; width: 1px; height: var(--corner-size); }

.instrument-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.instrument-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-bright);
  transition: color 0.4s;
}

.instrument-healthy .instrument-value { color: var(--phosphor); text-shadow: 0 0 20px var(--phosphor-glow); }
.instrument-degraded .instrument-value { color: var(--amber); text-shadow: 0 0 20px var(--amber-mid); }
.instrument-critical .instrument-value { color: var(--coral); text-shadow: 0 0 20px var(--coral-mid); }
.instrument-alerts .instrument-value { color: var(--amber); text-shadow: 0 0 20px var(--amber-mid); }

/* Micro bar under instrument */
.instrument-bar {
  margin-top: 12px;
  height: 2px;
  background: var(--bulkhead);
  border-radius: 1px;
  overflow: hidden;
}

.instrument-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

.instrument-bar-fill.total    { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.instrument-bar-fill.healthy  { background: var(--phosphor); box-shadow: 0 0 6px var(--phosphor); }
.instrument-bar-fill.degraded { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.instrument-bar-fill.critical { background: var(--coral); box-shadow: 0 0 6px var(--coral); }
.instrument-bar-fill.alerts   { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* ═══ MAIN LAYOUT ══════════════════════════════════════════════════════════ */

.main-content {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  padding: 0 28px 28px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1100px) {
  .main-content { grid-template-columns: 1fr; }
  .summary-strip { flex-wrap: wrap; }
  .instrument { min-width: calc(50% - 14px); }
}

@media (max-width: 600px) {
  .summary-strip { padding: 14px; gap: 10px; }
  .main-content { padding: 0 14px 14px; }
  .topbar { padding: 0 14px; }
  .instrument { min-width: 100%; }
}

/* ═══ PANELS ═══════════════════════════════════════════════════════════════ */

.panel {
  background: linear-gradient(175deg, rgba(14, 21, 41, 0.9), rgba(10, 15, 30, 0.95));
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bulkhead);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.02), transparent);
}

.panel-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-normal);
}

.panel-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.filter-select {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:hover {
  border-color: var(--frame);
}

/* ═══ SITES GRID ═══════════════════════════════════════════════════════════ */

.sites-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  min-height: 200px;
}

/* Group headers */
.group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--bulkhead), transparent);
}

.group-header:first-child { padding-top: 0; }

/* Site card */
.site-card {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  animation: cardIn 0.4s ease both;
}

.site-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bulkhead);
  transition: background 0.3s, box-shadow 0.3s;
}

.site-card:hover {
  border-color: var(--frame);
  background: var(--panel);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.site-card:hover::before {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-dim);
}

/* Card status top-bar glow */
.site-card[data-status="healthy"]::before  { background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor-dim); }
.site-card[data-status="degraded"]::before { background: var(--amber); box-shadow: 0 0 8px var(--amber-dim); }
.site-card[data-status="unhealthy"]::before,
.site-card[data-status="offline"]::before  { background: var(--coral); box-shadow: 0 0 8px var(--coral-dim); animation: criticalPulse 2s ease infinite; }

@keyframes criticalPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.site-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.3px;
}

.site-group {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Status badge */
.status-badge {
  padding: 3px 10px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid transparent;
}

.status-healthy {
  background: var(--phosphor-dim);
  color: var(--phosphor);
  border-color: rgba(0, 255, 159, 0.15);
}

.status-degraded {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(255, 184, 0, 0.15);
}

.status-unhealthy,
.status-offline {
  background: var(--coral-dim);
  color: var(--coral);
  border-color: rgba(255, 61, 90, 0.15);
}

.status-unknown {
  background: rgba(77, 90, 120, 0.15);
  color: var(--text-dim);
  border-color: rgba(77, 90, 120, 0.2);
}

/* Site metadata */
.site-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.site-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.site-meta-value {
  color: var(--text-normal);
  font-weight: 500;
}

.site-url {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 45, 85, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  opacity: 0.7;
}

/* Card pulse on update */
.site-card.updating {
  animation: cardPulse 0.8s ease;
}

@keyframes cardPulse {
  0%   { box-shadow: inset 0 0 0 0 var(--cyan-dim); }
  30%  { box-shadow: inset 0 0 30px var(--cyan-dim); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* ═══ ALERTS LIST ══════════════════════════════════════════════════════════ */

.alerts-list {
  max-height: 600px;
  overflow-y: auto;
}

.alert-item {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(30, 45, 85, 0.3);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.2s;
}

.alert-item:hover {
  background: var(--hull);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.alert-dot.down      { background: var(--coral); box-shadow: 0 0 6px var(--coral); }
.alert-dot.degraded  { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.alert-dot.recovered { background: var(--phosphor); box-shadow: 0 0 6px var(--phosphor); }

.alert-body { flex: 1; min-width: 0; }

.alert-message {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-bright);
  letter-spacing: 0.2px;
}

.alert-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.alert-actions { flex-shrink: 0; }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

.empty-radar {
  opacity: 0.4;
  animation: emptyPulse 3s ease infinite;
}

@keyframes emptyPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.05); }
}

.loading {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

/* ═══ MODALS ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn 0.25s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: linear-gradient(175deg, var(--panel), var(--space));
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-lg);
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 212, 255, 0.1);
  animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-wide {
  width: 760px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bulkhead);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.03), transparent);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-normal);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
  border-radius: var(--radius);
}

.btn-close:hover {
  color: var(--coral);
  background: var(--coral-dim);
}

/* ═══ FORMS ════════════════════════════════════════════════════════════════ */

.form-group {
  padding: 0 22px;
  margin-top: 18px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: all 0.25s;
}

.form-group input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 16px rgba(0, 212, 255, 0.06);
}

.form-group input::placeholder {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 22px;
  margin-top: 18px;
}

.form-row .form-group {
  padding: 0;
  margin-top: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px;
}

/* ═══ DETAIL MODAL ═════════════════════════════════════════════════════════ */

.detail-content {
  padding: 22px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.detail-stat {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  position: relative;
}

.detail-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.detail-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
}

.detail-section {
  margin-top: 22px;
}

.detail-section h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-section h4::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--bulkhead), transparent);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  align-items: center;
}

/* Check history rows */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(30, 45, 85, 0.3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-normal);
}

.check-row:last-child { border-bottom: none; }

.check-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.check-status-dot.healthy  { background: var(--phosphor); box-shadow: 0 0 4px var(--phosphor); }
.check-status-dot.degraded { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.check-status-dot.unhealthy,
.check-status-dot.offline  { background: var(--coral); box-shadow: 0 0 4px var(--coral); }

.check-time {
  color: var(--text-dim);
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* ═══ RESPONSE TIME CHART ══════════════════════════════════════════════════ */

.chart-container {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
}

.chart-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 1px 1px 0 0;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.85;
}

.chart-bar:hover {
  opacity: 1;
  filter: brightness(1.3);
}

.chart-bar.healthy  { background: var(--phosphor); box-shadow: 0 0 4px var(--phosphor-dim); }
.chart-bar.degraded { background: var(--amber); box-shadow: 0 0 4px var(--amber-dim); }
.chart-bar.unhealthy,
.chart-bar.offline  { background: var(--coral); box-shadow: 0 0 4px var(--coral-dim); }

/* ═══ PAYLOAD VIEWER ═══════════════════════════════════════════════════════ */

.payload-viewer {
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

/* ═══ TOAST NOTIFICATIONS ══════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 68px;
  right: 28px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: linear-gradient(135deg, var(--panel), var(--hull));
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-bright);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 380px;
  letter-spacing: 0.3px;
  border-left: 2px solid transparent;
}

.toast.alert-down      { border-left-color: var(--coral); }
.toast.alert-degraded  { border-left-color: var(--amber); }
.toast.alert-recovered { border-left-color: var(--phosphor); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ═══ SCROLLBAR ════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bulkhead); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--frame); }

/* ═══ SELECTION ════════════════════════════════════════════════════════════ */

::selection {
  background: rgba(0, 212, 255, 0.2);
  color: var(--text-bright);
}

/* ═══ IMPORT/EXPORT MODAL ═════════════════════════════════════════════════ */

/* ═══ TYPE TOGGLE ══════════════════════════════════════════════════════════ */

.type-toggle {
  display: flex;
  gap: 6px;
}

.type-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.type-btn:hover {
  border-color: var(--frame);
  color: var(--text-normal);
}

.type-btn.active {
  background: var(--cyan-dim);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--cyan);
}

/* Site card type indicator */
.site-type-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  opacity: 0.7;
}

.site-type-badge.db {
  color: var(--amber);
  opacity: 1;
}

/* ═══ IMPORT/EXPORT MODAL ═════════════════════════════════════════════════ */

.import-content {
  padding: 0;
}

.import-tabs {
  display: flex;
  border-bottom: 1px solid var(--bulkhead);
}

.import-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.import-tab:hover {
  color: var(--text-normal);
  background: var(--hull);
}

.import-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.import-tab-content {
  padding: 20px 22px;
}

.import-format-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.import-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-normal);
  cursor: pointer;
  letter-spacing: 0.5px;
}

.import-radio input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--bulkhead);
  border-radius: 50%;
  background: var(--hull);
  cursor: pointer;
  position: relative;
}

.import-radio input[type="radio"]:checked {
  border-color: var(--cyan);
}

.import-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.import-textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.import-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-dim);
}

.import-textarea::placeholder {
  color: var(--text-dim);
}

.import-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 0.3px;
  line-height: 1.6;
}

.import-hint code {
  background: var(--hull);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--text-normal);
  border: 1px solid var(--bulkhead);
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* File drop zone */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  border: 1px dashed var(--bulkhead);
  border-radius: var(--radius);
  background: var(--hull);
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-normal);
  letter-spacing: 0.3px;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.03);
}

.import-file-info {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--hull);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-normal);
}

/* Import results */
.import-results {
  margin-top: 18px;
  padding: 16px 22px;
  border-top: 1px solid var(--bulkhead);
}

.import-results-header {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.import-results-header.success { color: var(--phosphor); }
.import-results-header.partial { color: var(--amber); }
.import-results-header.error   { color: var(--coral); }

.import-results-errors {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.8;
}

.import-results-errors .err-row {
  padding: 4px 0;
  border-bottom: 1px solid rgba(30, 45, 85, 0.3);
}
