@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-base: #030712;
  --bg-surface: rgba(17, 24, 39, 0.45);
  --bg-surface-hover: rgba(31, 41, 55, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.18);

  --accent-blue: #3b82f6;
  --accent-violet: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;

  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.font-mono { font-family: var(--font-mono); }

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Typography & Colors ── */
.text-blue { color: var(--accent-blue); }
.text-violet { color: var(--accent-violet); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }

.bg-blue { background: var(--accent-blue); }
.bg-violet { background: var(--accent-violet); }
.bg-cyan { background: var(--accent-cyan); }
.bg-green { background: var(--accent-green); }
.bg-red { background: var(--accent-red); }
.bg-yellow { background: var(--accent-yellow); }

/* ── Animated Aurora Background ── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-base);
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out alternate;
  border-radius: 50%;
}

.aurora-1 {
  top: -10%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(59,130,246,0.25) 0%, transparent 70%);
  animation-delay: 0s;
}

.aurora-2 {
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%);
  animation-delay: -5s;
}

.aurora-3 {
  top: 40%; left: 30%;
  width: 45vw; height: 45vw;
  background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
  animation-delay: -10s;
}

.aurora-4 {
  top: 10%; right: 20%;
  width: 35vw; height: 35vw;
  background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 70%);
  animation-delay: -15s;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, 5%) scale(0.9); }
}

/* ── Glassmorphism Core ── */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(24px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-blue);
  filter: drop-shadow(0 0 12px rgba(59,130,246,0.6));
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-stats { display: flex; gap: 12px; align-items: center; }

/* ── Workspace Selector ── */
.workspace-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.workspace-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  height: 38px;
  line-height: 38px;
  padding: 0 34px 0 16px !important;
  min-width: 160px;
  max-width: 260px;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}
.workspace-select option {
  background: #111827;
  color: #f9fafb;
}
.workspace-select:hover {
  border-color: var(--border-bright);
  background-color: rgba(255, 255, 255, 0.08);
}
.workspace-select:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon-only:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #fff;
  transform: rotate(90deg);
}
.btn-icon-only svg {
  width: 18px;
  height: 18px;
}

/* ── User Pill & Logout ── */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 14px;
}

.btn-logout {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  margin-left: 4px;
}
.btn-logout svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  transition: transform 0.2s;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--accent-red);
}
.btn-logout:hover svg {
  transform: translateX(2px);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}

.pill-icon {
  width: 16px; height: 16px;
  color: var(--text-muted);
}

.countdown-ring {
  position: relative;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-ring svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 3;
}

.countdown-ring-circle {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
  filter: drop-shadow(0 0 4px var(--accent-green));
}

.countdown-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
  z-index: 1;
}

/* ── Nav Tabs ── */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-tab svg { width: 18px; height: 18px; transition: color 0.3s; }

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-tab.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 8px rgba(0,0,0,0.2);
}
.nav-tab.active svg { color: var(--accent-blue); }

.tab-view { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Main Layout ── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 960px) { .main { grid-template-columns: 1fr; } }

/* ── Panels ── */
.panel {
  border-radius: var(--radius-xl);
  padding: 2.2rem;
}

.panel-header { margin-bottom: 2rem; }
.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.panel-icon { width: 22px; height: 22px; color: var(--text-secondary); }
.panel-subtitle {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.flex-between { display: flex; align-items: flex-start; justify-content: space-between; }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus, .form-select:focus {
  border-color: var(--accent-blue);
  background: rgba(0,0,0,0.5);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15), inset 0 2px 4px rgba(0,0,0,0.1);
}

.select-wrapper { position: relative; }
.form-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; }
.select-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-icon { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  color: #fff;
  box-shadow: 0 4px 15px rgba(59,130,246,0.4);
  width: 100%;
  margin-top: 0.8rem;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59,130,246,0.5);
}
.btn-primary:active { transform: translateY(0); }

.glow-effect::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.glow-effect:hover::before { opacity: 1; }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.btn-ghost svg { width: 16px; height: 16px; }

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Advanced API Form Options */
.advanced-options {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  transition: all var(--transition);
}
.advanced-options[open] {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--border-bright);
}
.advanced-summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--accent-blue);
  font-size: 0.9rem;
}
.advanced-options[open] .advanced-summary::before {
  transform: rotate(90deg);
}
.advanced-content {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.preset-chip {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.preset-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: #fff;
}

/* Feedback */
.feedback {
  margin-top: 1rem; padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 500;
}
.feedback.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--accent-green); }
.feedback.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--accent-red); }
.hidden { display: none !important; }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 2rem; color: var(--text-muted); text-align: center; gap: 12px;
}
.empty-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.empty-icon { width: 32px; height: 32px; color: var(--text-muted); opacity: 0.5; }
.glow-pulse { animation: glowPulse 3s infinite alternate; }
@keyframes glowPulse { from { box-shadow: 0 0 10px rgba(255,255,255,0.02); } to { box-shadow: 0 0 25px rgba(255,255,255,0.08); } }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); }
.empty-sub { font-size: 0.9rem; }

/* ── API List ── */
.api-list {
  display: flex; flex-direction: column; gap: 1rem;
  max-height: 65vh; overflow-y: auto; padding-right: 8px;
}
.api-list::-webkit-scrollbar { width: 6px; }
.api-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
.api-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.api-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── API Card ── */
.api-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
  transition: all var(--transition);
  animation: slideIn 0.3s ease-out;
  position: relative;
}
.api-card:hover {
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.03);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.card-top { display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem 1.5rem; }

.api-method-badge {
  flex-shrink: 0; width: 56px; text-align: center; padding: 6px 0;
  border-radius: 8px; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.5px; font-family: var(--font-mono);
}
.badge-GET    { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.badge-POST   { background: rgba(59,130,246,0.15); color: var(--accent-blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-PUT    { background: rgba(245,158,11,0.15); color: var(--accent-yellow); border: 1px solid rgba(245,158,11,0.3); }
.badge-PATCH  { background: rgba(139,92,246,0.15); color: var(--accent-violet); border: 1px solid rgba(139,92,246,0.3); }
.badge-DELETE { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }
.badge-HEAD   { background: rgba(6,182,212,0.15); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.3); }

.api-info { flex: 1; min-width: 0; }
.api-name { font-weight: 700; font-size: 1.05rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.api-url { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.api-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.api-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.card-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; transition: background 0.3s; }
.card-status-dot.pass { background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }
.card-status-dot.fail { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }

/* Buttons in Card */
.btn-test { background: rgba(6,182,212,0.1); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.2); font-size: 0.8rem; padding: 8px 16px; border-radius: 8px; font-weight: 600; }
.btn-test:hover { background: rgba(6,182,212,0.2); border-color: var(--accent-cyan); transform: translateY(-1px); }
.btn-delete { background: rgba(239,68,68,0.1); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.2); font-size: 0.8rem; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.btn-delete:hover { background: rgba(239,68,68,0.2); border-color: var(--accent-red); }

/* Card Result Strip */
.card-result-wrap { border-top: 1px solid var(--border); background: rgba(0,0,0,0.1); }
.card-result { display: flex; align-items: center; gap: 12px; padding: 10px 1.5rem; font-size: 0.8rem; flex-wrap: wrap; }
.card-result-pending { color: var(--text-muted); font-style: italic; }
.cr-badge { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: 999px; font-weight: 800; font-size: 0.75rem; letter-spacing: 1px; flex-shrink: 0; }
.cr-pass { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.cr-fail { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }
.cr-error-type {
  background: rgba(245, 158, 11, 0.18);
  color: #ffc84a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  padding: 2px 8px;
}
.cr-error-msg {
  color: #ff9f43;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.err-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.2);
  color: #ffc84a;
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-right: 6px;
  flex-shrink: 0;
}
.cr-stat { display: flex; align-items: center; gap: 6px; }
.cr-label { color: var(--text-muted); font-size: 0.75rem; }
.cr-value { font-family: var(--font-mono); font-weight: 700; color: var(--text-secondary); }
.cr-divider { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
.cr-ago { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }

/* ── Stats Row ── */
.chart-section { max-width: 1400px; margin: 0 auto; padding: 0 2rem 4rem; display: flex; flex-direction: column; gap: 2rem; }
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; }
@media (max-width: 1200px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }

.stat-card {
  padding: 1.8rem; display: flex; flex-direction: column; position: relative; overflow: hidden;
  border-radius: var(--radius-xl); transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card-pass:hover { border-color: rgba(16, 185, 129, 0.4); }
.stat-card-fail:hover { border-color: rgba(239, 68, 68, 0.4); }
.stat-card-error:hover { border-color: rgba(245, 158, 11, 0.4); }
.stat-card-time:hover { border-color: rgba(6, 182, 212, 0.4); }
.stat-card-icon { width: 28px; height: 28px; margin-bottom: 12px; }
.stat-card-content { display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.stat-card-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.stat-card-value { font-size: 2.4rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); letter-spacing: -1px; line-height: 1; }
.stat-card-bg { position: absolute; right: -20px; bottom: -20px; width: 100px; height: 100px; border-radius: 50%; opacity: 0.1; filter: blur(30px); }
.text-amber { color: #ffc84a; }
.bg-amber { background: #f59e0b; }

/* ── Chart Panel ── */
.chart-panel-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1.5rem; }
.chart-wrap { position: relative; height: 320px; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 220px; color: var(--text-muted); font-size: 0.95rem; font-style: italic; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }

/* ── Analytics Hero ── */
.analytics-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; max-width: 1400px; margin: 3rem auto 0; padding: 0 2rem; }
@media (max-width: 1000px) { .analytics-hero { grid-template-columns: repeat(2, 1fr); } }

.ah-card {
  padding: 2rem; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
  border-radius: var(--radius-xl); transition: transform var(--transition);
}
.ah-card:hover { transform: translateY(-3px); }
.ah-icon { width: 28px; height: 28px; margin-bottom: 8px; }
.ah-content { position: relative; z-index: 1; }
.ah-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.ah-value { font-size: 2.6rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); letter-spacing: -1px; line-height: 1.1; margin: 4px 0; }
.ah-sub { font-size: 0.8rem; color: var(--text-muted); }
.ah-sub-hl { color: var(--text-secondary); font-weight: 600; }
.ah-card-bg { position: absolute; right: -20px; bottom: -20px; width: 120px; height: 120px; border-radius: 50%; opacity: 0.08; filter: blur(40px); }

/* ── Analytics Toolbar ── */
.analytics-toolbar { max-width: 1400px; margin: 2rem auto 0; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.window-tabs { display: flex; gap: 6px; border-radius: 12px; padding: 6px; }
.win-btn { padding: 8px 20px; border-radius: 8px; border: none; background: transparent; color: var(--text-secondary); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.win-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.win-btn.active { background: rgba(59,130,246,0.15); color: var(--accent-blue); border: 1px solid rgba(59,130,246,0.3); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); }

/* ── Per-API Analytics Grid ── */
.per-api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 1.5rem; max-width: 1400px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.api-analytics-card { background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.8rem; box-shadow: var(--shadow-card); transition: transform var(--transition); position: relative; overflow: hidden; }
.api-analytics-card:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.aac-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 8px; }
.aac-name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aac-score { font-size: 1.6rem; font-weight: 800; font-family: var(--font-mono); flex-shrink: 0; }
.aac-score-unit { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.aac-url { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.streak-badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--accent-red); font-size: 0.8rem; font-weight: 600; margin-bottom: 1.2rem; }

/* Metrics Grid inside Analytics Card */
.aac-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 0.8rem; margin-bottom: 1.5rem; background: rgba(0,0,0,0.3); border-radius: var(--radius-md); padding: 1.2rem; border: 1px solid rgba(255,255,255,0.03); }
.aac-metric { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.aac-metric-val { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.aac-metric-lbl { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }

/* Uptime Ring Magic */
.uptime-ring-container {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--accent-blue)) var(--pct, 0%), rgba(255,255,255,0.05) 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.uptime-ring-container::before {
  content: ''; position: absolute; inset: 4px;
  background: #111827; border-radius: 50%; z-index: 1;
}
.uptime-ring-container .aac-metric-val, .uptime-ring-container .aac-metric-lbl { position: relative; z-index: 2; }
.uptime-ring-container .aac-metric-val { font-size: 0.95rem; margin-top: 6px; }
.uptime-ring-container .aac-metric-lbl { font-size: 0.55rem; }

.aac-section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.aac-errors { display: flex; flex-direction: column; gap: 6px; }
.err-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; padding: 6px 12px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.15); border-radius: 6px; }
.err-count { flex-shrink: 0; color: var(--accent-red); font-weight: 700; font-family: var(--font-mono); }
.err-msg { color: var(--text-secondary); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-none { font-size: 0.85rem; color: var(--accent-green); padding: 6px 12px; background: rgba(16,185,129,0.05); border-radius: 6px; border: 1px solid rgba(16,185,129,0.1); }
.analytics-empty { grid-column: 1 / -1; padding: 5rem 2rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: fadeIn 0.2s ease;
}
.modal {
  border-radius: var(--radius-xl);
  padding: 2.2rem 2.5rem;
  width: 100%;
  max-width: 580px;
  position: relative;
  margin: auto 0;
  max-height: calc(100vh - 4.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal::-webkit-scrollbar,
.modal-overlay::-webkit-scrollbar {
  width: 8px;
}
.modal::-webkit-scrollbar-track,
.modal-overlay::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.modal::-webkit-scrollbar-thumb,
.modal-overlay::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.modal::-webkit-scrollbar-thumb:hover,
.modal-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}
@keyframes modalSlide { from { transform: translateY(20px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-close {
  position: sticky;
  top: 0.5rem;
  float: right;
  margin-top: -1rem;
  margin-right: -1rem;
  margin-bottom: -36px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 50;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--accent-red); border-color: rgba(239,68,68,0.3); transform: rotate(90deg); }
.modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
.result-badge-wrap { display: flex; justify-content: center; margin: 1rem 0 2rem; }
.result-badge { padding: 8px 32px; border-radius: 999px; font-size: 1.2rem; font-weight: 800; letter-spacing: 1.5px; box-shadow: 0 0 30px currentColor; }
.badge-pass { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 2px solid rgba(16,185,129,0.4); }
.badge-fail { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 2px solid rgba(239,68,68,0.4); }
.badge-error { background: rgba(255,193,7,0.15); color: #ffc84a; border: 2px solid rgba(255,193,7,0.4); }
.cr-error { background: rgba(255,193,7,0.15); color: #ffc84a; border: 1px solid rgba(255,193,7,0.3); }
.card-result-error { border-color: rgba(255,193,7,0.3); background: rgba(255,193,7,0.05); }
.card-status-dot.error { background: #ffc84a; box-shadow: 0 0 10px #ffc84a; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 2rem; }
.result-item { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem; }
.result-item-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.result-item-value { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.result-item-value.value-green { color: var(--accent-green); }
.result-item-value.value-red { color: var(--accent-red); }
.result-item-value.value-cyan { color: var(--accent-cyan); }
.result-item-value.value-amber { color: #ffc84a; }
.assertions-container { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem; }
.assertions-list { display: flex; flex-direction: column; gap: 8px; }
.assertion-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.assertion-item.pass { border-color: rgba(61,255,160,0.25); background: rgba(61,255,160,0.04); }
.assertion-item.fail { border-color: rgba(255,92,119,0.3); background: rgba(255,92,119,0.05); }
.assertion-status { font-weight: 800; font-family: var(--font-mono); }
.assertion-item.pass .assertion-status { color: #3dffa0; }
.assertion-item.fail .assertion-status { color: #ff5c77; }
.assertion-details { flex: 1; }
.assertion-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 2px; }
.assertion-meta { font-size: 0.75rem; color: var(--text-secondary); font-family: var(--font-mono); }
.result-json-wrap { margin-top: 1.5rem; }
.json-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.result-json {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-size: 0.85rem;
  color: var(--accent-blue);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 280px;
  line-height: 1.6;
}

/* ── Toast ── */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); background: var(--bg-surface); backdrop-filter: blur(12px); border: 1px solid var(--border-bright); border-radius: var(--radius-md); padding: 14px 28px; font-size: 0.95rem; font-weight: 600; z-index: 300; box-shadow: var(--shadow-card); animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.toast-success { border-color: rgba(16,185,129,0.4); color: var(--accent-green); box-shadow: 0 8px 32px rgba(16,185,129,0.2); }
.toast.toast-error { border-color: rgba(239,68,68,0.4); color: var(--accent-red); box-shadow: 0 8px 32px rgba(239,68,68,0.2); }

/* ── Auth Modal ── */
.auth-modal {
  max-width: 440px;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}
.auth-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}
.auth-tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab-btn:hover {
  color: var(--text-primary);
}
.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.auth-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}


/* ═════════════════════════════════════════════════════════════════════════════
   Phase 5: Incidents & Notifications Styles
   ═════════════════════════════════════════════════════════════════════════════ */

.badge-incident-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

.incidents-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
}

.incidents-filter-group {
  display: flex;
  gap: 8px;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.filter-chip.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
}

.incidents-actions-group {
  display: flex;
  gap: 10px;
}

.notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-sm);
  color: #facc15;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.notice-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.incidents-list {
  min-height: 250px;
}

.incidents-loading,
.incidents-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
}

.incidents-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.incident-card {
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background: rgba(19, 27, 46, 0.65);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.incident-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.incident-card-open {
  border-left: 4px solid var(--accent-red);
}

.incident-card-resolved {
  border-left: 4px solid var(--accent-green);
}

.incident-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.incident-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.incident-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.incident-card-summary {
  font-size: 0.82rem;
  color: #fca5a5;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 2px solid rgba(239, 68, 68, 0.5);
  word-break: break-word;
}

.incident-modal {
  max-width: 720px;
  width: 95%;
}
.settings-modal {
  max-width: 600px;
  width: 92%;
}

.incident-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.incident-modal-meta {
  margin-bottom: 14px;
  gap: 10px;
}

.incident-modal-summary {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  color: #fca5a5;
  font-size: 0.88rem;
  margin-bottom: 18px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.incident-results-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.incident-results-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table-results th,
.table-results td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-results th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.settings-section {
  margin-bottom: 18px;
}

.settings-section-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.settings-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.recipients-list-container {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.recipient-checkbox-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.recipient-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipient-role-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PHASE 6: OPENAPI CONTRACTS STYLES
   ───────────────────────────────────────────────────────────────────────────── */
.contracts-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.contracts-title-group .section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.contracts-title-group .section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contracts-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contracts-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.contract-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(19, 27, 46, 0.65);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contract-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.contract-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.contract-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.contract-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.contract-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contracts-empty, .contracts-loading {
  text-align: center;
  padding: 48px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.operations-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
}

.operations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.operations-table th, .operations-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.operations-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.operations-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge-binding {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  cursor: pointer;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-binding:hover {
  background: rgba(6, 182, 212, 0.22);
}

.contract-findings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.finding-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-red);
}

.finding-item.finding-warning {
  border-left-color: var(--accent-yellow);
}

.finding-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.verdict-passed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.verdict-failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.verdict-partial {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.verdict-preflight-rejected {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* ─── Phase 7 AI Incident Investigation UI ─────────────────────────────── */
.ai-investigation-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.ai-investigation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-sparkle-icon {
  font-size: 1.25rem;
  animation: pulse 2s infinite ease-in-out;
}

.ai-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.ai-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.ai-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.ai-loading-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ai-error-card {
  padding: 1rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.ai-error-title {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  color: var(--accent-red);
}

.ai-error-msg {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-result-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-summary-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.ai-summary-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-bright);
}

.ai-meta-line {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ai-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.ai-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.85rem;
}

.ai-block h5 {
  margin: 0 0 0.6rem 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ai-facts-list, .ai-checks-list, .ai-unknowns-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.ai-hypotheses-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-hypothesis-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font-size: 0.84rem;
}

.ai-hypothesis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--text-bright);
}

.ai-hypothesis-rationale {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ai-evidence-pill {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #93c5fd;
  margin-right: 3px;
}

.ai-strength-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.strength-strong {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.strength-moderate {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.strength-weak, .strength-inconclusive {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.ai-confidence-box {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.8rem;
}
