/* ============================================================
   MAIA Admin Panel - Production Styles
   Dark theme: bg #0a0a0f, cards #111118, borders #1e1e2e
   Accents: blue #3b82f6, cyan #06b6d4, green #10b981, red #ef4444
   ============================================================ */

/* ---------- Reset & Base ---------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #0a0a0f;
  color: #e2e8f0;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: #60a5fa;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

table {
  border-collapse: collapse;
}

/* ---------- Animations ---------- */

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

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

/* ---------- Layout: App Shell ---------- */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  background-color: #111118;
  border-right: 1px solid #1e1e2e;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  transition: transform 300ms ease;
  overflow: hidden;
}

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #1e1e2e;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo-version {
  font-size: 0.625rem;
  color: #64748b;
  margin-left: auto;
  padding: 0.125rem 0.375rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 0.75rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a3e transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #2a2a3e;
  border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #3b3b5e;
}

.sidebar-section-label {
  padding: 0.75rem 1.5rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
  text-decoration: none;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: #e2e8f0;
  background-color: rgba(59, 130, 246, 0.05);
}

.sidebar-link--active {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
}

.sidebar-link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #1e1e2e;
  font-size: 0.75rem;
  color: #64748b;
  flex-shrink: 0;
}

.sidebar-footer a {
  color: #64748b;
}

.sidebar-footer a:hover {
  color: #94a3b8;
}

/* ---------- Main Content Area ---------- */

.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */

.header {
  height: 4rem;
  background-color: #111118;
  border-bottom: 1px solid #1e1e2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
}

.header-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  margin-left: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: box-shadow 150ms ease;
}

.header-avatar:hover {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.header-user-name {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.header-logout-btn {
  font-size: 0.8125rem;
  color: #64748b;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 150ms ease;
}

.header-logout-btn:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  color: #94a3b8;
  border-radius: 0.375rem;
}

.mobile-menu-btn:hover {
  color: #e2e8f0;
  background-color: #1e1e2e;
}

.mobile-menu-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Page Content ---------- */

.page-content {
  flex: 1;
  padding: 1.5rem;
  animation: fadeIn 300ms ease;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ---------- Cards ---------- */

.card {
  background-color: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  animation: fadeIn 300ms ease;
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.2);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.card-link {
  font-size: 0.8125rem;
  color: #3b82f6;
}

.card-link:hover {
  color: #60a5fa;
}

/* ---------- Metric Cards ---------- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 200ms ease;
  animation: fadeIn 300ms ease;
}

.metric-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.05);
}

.metric-card[title] {
  cursor: help;
}

.metric-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.metric-card-icon--blue {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.metric-card-icon--green {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.metric-card-icon--cyan {
  background-color: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.metric-card-icon--yellow {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.metric-card-icon--red {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.metric-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
}

.metric-card-label {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.metric-card-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.metric-card-trend svg {
  width: 0.75rem;
  height: 0.75rem;
}

.metric-card-trend--up {
  color: #10b981;
}

.metric-card-trend--down {
  color: #ef4444;
}

.metric-card-trend--neutral {
  color: #64748b;
}

/* ---------- Tables ---------- */

.table-container {
  overflow-x: auto;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  background-color: #111118;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background-color: rgba(30, 30, 46, 0.5);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 1px solid #1e1e2e;
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  border-bottom: 1px solid #1e1e2e;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background-color 150ms ease;
}

.data-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.03);
}

.data-table tbody tr.expandable-row {
  cursor: pointer;
}

.data-table tbody tr.expandable-row:hover {
  background-color: rgba(59, 130, 246, 0.06);
}

.table-empty {
  padding: 3rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

.table-cell-primary {
  font-weight: 500;
  color: #e2e8f0;
}

.table-cell-secondary {
  color: #94a3b8;
  font-size: 0.8125rem;
}

.table-cell-dim {
  color: #64748b;
  font-size: 0.8125rem;
}

.table-cell-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
}

/* ---------- Expanded Row Detail ---------- */

.expanded-detail {
  background-color: #0a0a0f;
  padding: 1.5rem;
  animation: fadeIn 200ms ease;
}

.expanded-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.expanded-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.expanded-detail-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.expanded-detail-value {
  font-size: 0.875rem;
  color: #e2e8f0;
}

.expanded-detail-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

/* ---------- Status Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: currentColor;
}

.badge--green,
.badge--completed,
.badge--approved,
.badge--active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge--blue,
.badge--running,
.badge--detected {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge--yellow,
.badge--pending,
.badge--needs_review {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge--red,
.badge--failed,
.badge--rejected,
.badge--error,
.badge--critical {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge--gray,
.badge--cancelled,
.badge--disabled,
.badge--deprecated {
  background-color: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.badge--cyan,
.badge--info {
  background-color: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.badge--purple,
.badge--warning {
  background-color: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.badge-type {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.btn-primary:hover:not(:disabled) {
  background-color: #2563eb;
  border-color: #2563eb;
}

.btn-secondary {
  background-color: transparent;
  color: #94a3b8;
  border-color: #1e1e2e;
}

.btn-secondary:hover:not(:disabled) {
  color: #e2e8f0;
  background-color: #1e1e2e;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.2);
}

.btn-ghost {
  background-color: transparent;
  color: #94a3b8;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.btn-ghost:hover:not(:disabled) {
  color: #e2e8f0;
  background-color: rgba(148, 163, 184, 0.1);
}

.btn-ghost--danger {
  color: #ef4444;
}

.btn-ghost--danger:hover:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 0.5rem;
}

/* ---------- Forms ---------- */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #e2e8f0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.form-input::placeholder {
  color: #4a4a5e;
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-select {
  width: 100%;
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.5rem;
  padding: 0.625rem 2rem 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #e2e8f0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.form-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-textarea {
  width: 100%;
  min-height: 6rem;
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.form-textarea::placeholder {
  color: #4a4a5e;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* 3-column form row */
.form-row--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* Section title divider inside forms */
.form-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  padding: 0.75rem 0 0.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border, #1e1e2e);
}
.form-section-title:first-child {
  border-top: none;
  padding-top: 0;
}

/* Grid of checkboxes */
.form-checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Inline help hint (?) tooltip trigger */
.form-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface-2, #1a1a2e);
  color: var(--text-muted, #6b7280);
  font-size: 0.6rem;
  font-weight: 700;
  cursor: help;
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* ---------- Toggle Switch ---------- */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  border-radius: 9999px;
  transition: background-color 200ms ease;
}

.toggle-switch-slider::before {
  content: '';
  position: absolute;
  height: 1rem;
  width: 1rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background-color: #e2e8f0;
  border-radius: 50%;
  transition: transform 200ms ease;
}

.toggle-switch input:checked + .toggle-switch-slider {
  background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-switch-slider::before {
  transform: translateX(1.125rem);
}

.toggle-switch input:disabled + .toggle-switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Crawler Control Card ---------- */

.crawler-ctrl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.crawler-ctrl-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crawler-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crawler-toggle-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  min-width: 3rem;
}

.crawler-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.crawler-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.crawler-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6b7280);
}

.crawler-stat-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #e2e8f0;
}

/* ---------- Filter Bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.filter-select {
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.5rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e2e8f0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.filter-input {
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e2e8f0;
  transition: border-color 150ms ease;
}

.filter-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.filter-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 150ms ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel {
  background-color: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 32rem;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 200ms ease;
}

.modal-panel--wide {
  max-width: 48rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #1e1e2e;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  color: #94a3b8;
  transition: all 150ms ease;
}

.modal-close:hover {
  color: #e2e8f0;
  background-color: #1e1e2e;
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #1e1e2e;
}

/* ---------- Toast Notifications ---------- */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 200ms ease;
  pointer-events: auto;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast--removing {
  animation: toastOut 200ms ease forwards;
}

.toast--success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.toast--error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.toast--info {
  background-color: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.toast--warning {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.toast svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ---------- Spinner / Loading ---------- */

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #1e1e2e;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

.spinner-text {
  font-size: 0.875rem;
  color: #94a3b8;
}

/* ---------- Empty States ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #3b82f6;
}

.empty-state-icon svg {
  width: 2rem;
  height: 2rem;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 24rem;
  line-height: 1.6;
}

/* ---------- Login Page ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0a0a0f;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background-color: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  padding: 2.5rem;
  animation: slideUp 300ms ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: #64748b;
}

.login-card .btn-primary {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  background-color: transparent;
  border: 1px solid #1e1e2e;
  transition: all 150ms ease;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  color: #e2e8f0;
  background-color: #1e1e2e;
}

.pagination-btn--active {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0.5rem;
}

.login-error {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-bottom: 1rem;
}

/* ---------- Grid Helpers ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.gap-1 { gap: 1rem; }
.gap-1-5 { gap: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-1-5 { margin-bottom: 1.5rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-1-5 { margin-top: 1.5rem; }

/* ---------- Pipeline Health Panel ---------- */

.health-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-item-label {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.health-item-value {
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #e2e8f0;
}

.health-item-value--danger {
  color: #ef4444;
}

.health-item-value--success {
  color: #10b981;
}

/* ---------- Section Headers ---------- */

.section-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

/* ---------- Action Bar (inline buttons in table) ---------- */

.action-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ---------- Docs Page ---------- */

.docs-container {
  width: 100%;
  min-height: calc(100vh - 4rem);
}

.docs-container iframe {
  width: 100%;
  border: none;
  min-height: calc(100vh - 4rem);
}

/* ---------- Swagger UI Override ---------- */

.swagger-ui-wrap {
  background-color: #0a0a0f;
  min-height: calc(100vh - 4rem);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .grid-2-1 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .page-content {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .header-subtitle {
    display: none;
  }

  .header-user-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-panel {
    margin: 0.5rem;
    max-height: 95vh;
  }
}

/* ---- Form Section Title (expanded source/modal forms) ---- */
.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #94a3b8);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  padding-bottom: 0.35rem;
  margin: 1.25rem 0 0.75rem;
}
.form-section-title:first-child { margin-top: 0; }

/* ---- Two Column Grid ---- */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Metric Card Subtitle ---- */
.metric-card-sub {
  font-size: 0.75rem;
  color: var(--text-dim, #64748b);
  margin-top: 0.25rem;
}

/* ---- Detail Grid (for failure detail modal) ---- */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.detail-row--full {
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-dim, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  color: var(--text-primary, #e2e8f0);
  font-size: 0.875rem;
  word-break: break-all;
}

.detail-pre {
  background: var(--bg-darkest, #0a0a0f);
  border: 1px solid var(--border, #1e1e2e);
  border-radius: 0.5rem;
  padding: 1rem;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.8rem;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
}

/* ---- Empty State ---- */
.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-dim, #64748b);
}

/* ---- Purple badge for agent1 ---- */
.metric-card-icon--purple {
  background: rgba(147, 51, 234, 0.15);
  color: #a78bfa;
}

.badge--purple {
  background: rgba(147, 51, 234, 0.15);
  color: #a78bfa;
}

.badge--purple .badge-dot {
  background: #a78bfa;
}

/* ---- Link style ---- */
.link {
  color: var(--accent-primary, #3b82f6);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ---- Recommendation Card ---- */
.recommendation-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.recommendation-title {
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 0.5rem;
}

.recommendation-desc {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ---- Green badge ---- */
.badge--green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge--green .badge-dot {
  background: #34d399;
}

.metric-card-icon--green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* ---- Auth Status Bar ---- */
.auth-status-bar {
  margin-bottom: 1.5rem;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.auth-status--green {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.auth-status--red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.auth-status--yellow {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.auth-status-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-status-right {
  display: flex;
  gap: 0.5rem;
}

.auth-status-label {
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
}

.auth-status-value {
  font-weight: 700;
}

.auth-status-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
}

/* ============================================================
   Event Detail & Impacts UI (Phase 5)
   ============================================================ */

/* ---------- Detail Grid ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.detail-value {
  font-size: 0.9375rem;
  color: #e2e8f0;
}

/* ---------- Impact Cards ---------- */

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

.impact-card {
  background: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: border-color 150ms ease;
}

.impact-card:hover {
  border-color: #3b82f6;
}

.impact-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #1e1e2e;
  background: rgba(59, 130, 246, 0.04);
}

.impact-card-metric {
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.impact-card-status {
  flex-shrink: 0;
}

.impact-card-body {
  padding: 0.875rem 1rem;
}

.impact-card-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.impact-stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.impact-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.impact-stat-value {
  font-size: 0.875rem;
  color: #e2e8f0;
}

.impact-explanation {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.impact-list {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.impact-list ul {
  margin: 0.25rem 0 0 1.25rem;
  padding: 0;
}

.impact-list li {
  margin-bottom: 0.125rem;
}

.impact-meta {
  font-size: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #1e1e2e;
  margin-top: 0.5rem;
}

.impact-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e1e2e;
}

/* ---------- Utility ---------- */

.text-red { color: #ef4444; }
.text-muted { color: #64748b; }
.text-sm { font-size: 0.8125rem; }
.header-back-link { font-size: 0.875rem; margin-right: 1rem; color: #3b82f6; }
.header-back-link:hover { color: #60a5fa; }

/* Button sizes */
.btn-xs {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 150ms ease;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 150ms ease;
}

.btn-green {
  background: #10b981;
  color: #fff;
}
.btn-green:hover { background: #059669; }

.btn-red {
  background: #ef4444;
  color: #fff;
}
.btn-red:hover { background: #dc2626; }

.btn-primary {
  background: #3b82f6;
  color: #fff;
}
.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { background: #1e40af; opacity: 0.5; cursor: not-allowed; }

/* Card components */
.card {
  background: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1e1e2e;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.card-body {
  padding: 1.25rem;
}

.loading-placeholder {
  color: #64748b;
  font-size: 0.875rem;
  padding: 1rem 0;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .impacts-grid {
    grid-template-columns: 1fr;
  }
  .impact-card-stats {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ---------- Insight Ops ---------- */

.ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .ops-grid {
    grid-template-columns: 1fr;
  }
}

.confidence-bar-container {
  width: 100%;
  height: 8px;
  background: #1e1e2e;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.confidence-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.timeline-chart {
  padding: 1rem;
  min-height: 120px;
}

.timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100px;
  width: 100%;
}

.timeline-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
}

.timeline-bar {
  width: 100%;
  background: #3b82f6;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.timeline-bar-wrapper:hover .timeline-bar {
  background: #60a5fa;
}

.timeline-label {
  font-size: 0.6rem;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

/* ---------- Stats Grid (Correlation / Inbox) ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #1a1a2e;
  border: 1px solid #2a2a3e;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 150ms;
}

.stat-card:hover {
  border-color: #3b3b5e;
}

.stat-card-value,
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.2;
}

.stat-card-label,
.stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.375rem;
  font-weight: 500;
}

.stat-card--red .stat-card-value { color: #ef4444; }
.stat-card--orange .stat-card-value { color: #f97316; }
.stat-card--yellow .stat-card-value { color: #f59e0b; }
.stat-card--green .stat-card-value { color: #10b981; }
.stat-card--blue .stat-card-value { color: #3b82f6; }
.stat-card--cyan .stat-card-value { color: #06b6d4; }
.stat-card--purple .stat-card-value { color: #8b5cf6; }

.stat-card--red { border-color: rgba(239, 68, 68, 0.2); }
.stat-card--orange { border-color: rgba(249, 115, 22, 0.2); }
.stat-card--yellow { border-color: rgba(245, 158, 11, 0.2); }
.stat-card--green { border-color: rgba(16, 185, 129, 0.2); }
.stat-card--blue { border-color: rgba(59, 130, 246, 0.2); }
.stat-card--cyan { border-color: rgba(6, 182, 212, 0.2); }
.stat-card--purple { border-color: rgba(139, 92, 246, 0.2); }

/* ---------- Filters Row ---------- */

.filters-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Table (basic for correlation/inbox) ---------- */

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

.table thead th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #1e1e2e;
}

.table tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #1a1a2e;
  color: #cbd5e1;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.table-responsive {
  overflow-x: auto;
}

/* ---------- Alert / Status Messages ---------- */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert--green,
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.alert--red,
.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.alert--yellow,
.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.alert--blue,
.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

/* ---------- Extra Button Colors ---------- */

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.3);
}

.btn-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-cyan:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.3);
}

.btn-green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-green:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.3);
}

/* ---------- Signal Items (Correlation detail) ---------- */

.signal-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e1e2e;
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* ---------- Spacing Helpers ---------- */

.mt-4 { margin-top: 1.5rem; }
.text-sm { font-size: 0.8rem; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.text-red { color: #ef4444; }

/* ---------- Utility Classes ---------- */

.card--spaced { margin-bottom: 1rem; }
.card--compact { padding: 0.75rem; }
.card--compact .card-header { padding: 0 0 0.5rem; }
.card--compact .card-body { padding: 0; }

.text-error { color: #ef4444; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-info { color: #3b82f6; }
.text-muted { color: var(--text-secondary, #94a3b8); }
.text-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.text-center { text-align: center; }

.detail-text {
  color: var(--text-primary, #e2e8f0);
  font-size: 0.9rem;
  line-height: 1.5;
}

.evidence-quote {
  border-left: 2px solid var(--accent, #635bff);
  padding-left: 0.5rem;
  margin: 0.25rem 0;
  font-style: italic;
}

/* ---------- Info Banner ---------- */

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #94a3b8;
  background: rgba(30, 30, 46, 0.6);
  border: 1px solid #1e1e2e;
}

.info-banner--blue {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.info-banner-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  opacity: 0.7;
}
