/* style.css — EvilCrusher Dark Ops Theme */

/* ─── DESIGN TOKENS ─── */
:root {
  /* Font families */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-display: 'Inter', system-ui, sans-serif;

  /* Type scale — fluid */
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.775rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-lg:   clamp(1rem, 0.95rem + 0.3vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl:  clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);

  /* 4px spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radius — sharp/tactical */
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 300ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ─── DARK OPS COLOR PALETTE ─── */
[data-theme="dark"], :root {
  /* Surfaces — deep charcoal layers */
  --color-bg:               #0d0f11;
  --color-surface:          #141619;
  --color-surface-2:        #1a1d21;
  --color-surface-3:        #20242a;
  --color-surface-offset:   #181b1f;
  --color-border:           rgba(255, 255, 255, 0.08);
  --color-border-strong:    rgba(255, 255, 255, 0.14);
  --color-divider:          rgba(255, 255, 255, 0.06);

  /* Text */
  --color-text:             #e0e2e6;
  --color-text-muted:       #8b8f96;
  --color-text-faint:       #555961;
  --color-text-inverse:     #0d0f11;

  /* Status colors — the core of this dashboard */
  --color-critical:         #e53935;
  --color-critical-dim:     rgba(229, 57, 53, 0.15);
  --color-critical-glow:    rgba(229, 57, 53, 0.4);
  --color-warning:          #ffb300;
  --color-warning-dim:      rgba(255, 179, 0, 0.15);
  --color-healthy:          #43a047;
  --color-healthy-dim:      rgba(67, 160, 71, 0.15);
  --color-healthy-glow:     rgba(67, 160, 71, 0.4);
  --color-unknown:          #555961;
  --color-unknown-dim:      rgba(85, 89, 97, 0.15);

  /* Interactive — cyan/teal */
  --color-primary:          #00bcd4;
  --color-primary-hover:    #00acc1;
  --color-primary-active:   #0097a7;
  --color-primary-dim:      rgba(0, 188, 212, 0.12);
  --color-primary-highlight: rgba(0, 188, 212, 0.2);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ─── LAYOUT SHELL ─── */
html, body { height: 100%; overflow: hidden; margin: 0; }

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100dvh;
  background: var(--color-bg);
}

.app-shell.no-chrome {
  display: block;
  overflow: auto;
}

/* ─── SIDEBAR ─── */
.sidebar {
  grid-row: 1 / -1;
  grid-column: 1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 20;
}

.sidebar-logo {
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-logo svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sidebar-logo-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.sidebar-logo-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 40px;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.sidebar-nav-item:active {
  background: var(--color-surface-3);
}

.sidebar-nav-item.active {
  color: var(--color-primary);
  background: var(--color-primary-dim);
  border-color: rgba(0, 188, 212, 0.15);
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* ─── HEADER / TOP BAR ─── */
.top-bar {
  grid-column: 2;
  grid-row: 1;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 10;
}

.top-bar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.top-bar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-muted);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
  background: var(--color-bg);
}

#main-content { outline: none; }

/* ─── LOGIN PAGE ─── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--color-bg);
  padding: var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-logo svg {
  width: 56px;
  height: 56px;
}

.login-logo-title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.login-logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-form { display: flex; flex-direction: column; gap: var(--space-4); }

.login-error {
  padding: var(--space-3);
  background: var(--color-critical-dim);
  border: 1px solid rgba(229, 57, 53, 0.3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-critical);
  display: none;
}

.login-error.visible { display: block; }

/* ─── FORM FIELDS ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input, .form-select, .form-textarea {
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  outline: none;
  width: 100%;
}

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--color-text-faint);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-dim);
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8f96' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--space-8);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 36px;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); }

.btn-danger {
  background: var(--color-critical);
  color: #fff;
  border-color: var(--color-critical);
}
.btn-danger:hover { background: #c62828; border-color: #c62828; }
.btn-danger:active { background: #b71c1c; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
}
.btn-ghost:hover { background: var(--color-surface-2); color: var(--color-text); }
.btn-ghost:active { background: var(--color-surface-3); }

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  min-height: 28px;
}

.btn-full { width: 100%; }

/* ─── CARDS ─── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card:hover {
  border-color: var(--color-border-strong);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.badge-ping {
  background: var(--color-primary-dim);
  color: var(--color-primary);
  border: 1px solid rgba(0, 188, 212, 0.2);
}

.badge-push {
  background: rgba(255, 179, 0, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 179, 0, 0.2);
}

/* ─── STATUS INDICATORS ─── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-full);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.status-dot.healthy {
  background: var(--color-healthy);
  box-shadow: 0 0 6px var(--color-healthy-glow);
}
.status-dot.healthy::after {
  background: var(--color-healthy);
  opacity: 0.25;
  animation: status-pulse 2s ease-in-out infinite;
}

.status-dot.failing {
  background: var(--color-critical);
  box-shadow: 0 0 6px var(--color-critical-glow);
}
.status-dot.failing::after {
  background: var(--color-critical);
  opacity: 0.3;
  animation: status-pulse 1.5s ease-in-out infinite;
}

.status-dot.warning {
  background: var(--color-warning);
}

.status-dot.unknown {
  background: var(--color-unknown);
}

@keyframes status-pulse {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.6); opacity: 0; }
}

/* ─── UPTIME BAR ─── */
.uptime-bar {
  display: flex;
  gap: 2px;
  align-items: flex-end;
}

.uptime-bar .day {
  flex: 1;
  min-width: 0;
  height: 20px;
  border-radius: 1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  position: relative;
}

.uptime-bar .day:hover {
  transform: scaleY(1.3);
  opacity: 0.85;
}

.uptime-bar .day.good { background: var(--color-healthy); }
.uptime-bar .day.bad { background: var(--color-critical); }
.uptime-bar .day.warn { background: var(--color-warning); }
.uptime-bar .day.none { background: var(--color-surface-3); }

/* Uptime bar tooltip */
.uptime-bar .day[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.15s ease;
}

.uptime-bar .day[data-tooltip]:hover::before { opacity: 1; }

/* ─── TEST CARDS GRID ─── */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.test-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.test-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.test-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.test-card-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.test-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.test-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

.test-card-stats {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.test-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.test-card-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.test-card-stat-value {
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
}

.test-card-stat-value.good { color: var(--color-healthy); }
.test-card-stat-value.warn { color: var(--color-warning); }
.test-card-stat-value.bad { color: var(--color-critical); }

/* ─── PAGE HEADERS ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

/* ─── TABLES ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  background: var(--color-surface-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
  font-variant-numeric: tabular-nums lining-nums;
}

.data-table tr:hover td {
  background: var(--color-surface-offset);
}

.data-table .mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ─── DETAIL PAGE ─── */
.detail-section {
  margin-bottom: var(--space-8);
}

.detail-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-field-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-field-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* ─── TIMELINE BAR ─── */
.timeline-bar {
  display: flex;
  gap: 1px;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.timeline-bar .segment {
  flex: 1;
  min-width: 0;
  position: relative;
  transition: opacity 0.15s ease;
}

.timeline-bar .segment:hover { opacity: 0.75; }
.timeline-bar .segment.good { background: var(--color-healthy); }
.timeline-bar .segment.bad { background: var(--color-critical); }
.timeline-bar .segment.warn { background: var(--color-warning); }
.timeline-bar .segment.none { background: var(--color-surface-3); }

/* ─── FORM PAGE ─── */
.form-page {
  max-width: 640px;
}

.form-page .form-section {
  margin-bottom: var(--space-6);
}

.form-section-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Push endpoint display */
.push-endpoint {
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  word-break: break-all;
  user-select: all;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-4);
  animation: fade-in 0.15s ease;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 420px;
  width: 100%;
  animation: slide-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.modal-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── SETTINGS PAGE ─── */
.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.settings-section-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.settings-row-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.masked-value {
  letter-spacing: 0.15em;
  color: var(--color-text-faint);
}

/* ─── FOOTER ─── */
.app-footer {
  padding: var(--space-8) 0 var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.app-footer a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--color-primary);
}

/* ─── STATUS TEXT ─── */
.text-healthy { color: var(--color-healthy); }
.text-warning { color: var(--color-warning); }
.text-critical { color: var(--color-critical); }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-primary { color: var(--color-primary); }

/* ─── MISC UTILITIES ─── */
.font-mono { font-family: var(--font-mono); }
.tabular-nums { font-variant-numeric: tabular-nums lining-nums; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ─── EMPTY STATE ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  text-align: center;
  color: var(--color-text-faint);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: var(--space-4); opacity: 0.4; }
.empty-state p { font-size: var(--text-sm); max-width: 280px; }

/* ─── MOBILE OVERLAY ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 19;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr;
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 30;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar.open + .sidebar-overlay {
    display: block;
  }

  .top-bar { grid-column: 1; }
  .main-content {
    grid-column: 1;
    padding: var(--space-4);
  }

  .mobile-menu-btn { display: flex; }

  .test-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .test-card-stats {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
}

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  animation: slide-in-right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 200px;
  max-width: 360px;
}

.toast.success { border-left: 3px solid var(--color-healthy); }
.toast.error { border-left: 3px solid var(--color-critical); }
.toast.info { border-left: 3px solid var(--color-primary); }

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── INLINE STATUS ─── */
.inline-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.status-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.status-code.s2xx { background: var(--color-healthy-dim); color: var(--color-healthy); }
.status-code.s4xx { background: var(--color-warning-dim); color: var(--color-warning); }
.status-code.s5xx { background: var(--color-critical-dim); color: var(--color-critical); }
.status-code.timeout { background: var(--color-unknown-dim); color: var(--color-unknown); }
