/* ============================================================
   P&C Claims AI Agent — Design System & Styles
   ============================================================ */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-indigo: #6366f1;
  --accent-indigo-light: #818cf8;
  --accent-violet: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-cyan: #06b6d4;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 60%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-glow-indigo: 0 0 20px rgba(99,102,241,0.2);
  --shadow-glow-emerald: 0 0 20px rgba(16,185,129,0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --nav-height: 64px;
  --page-padding: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 500px;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: flex;
  align-items: center;
  transition: transform 0.3s var(--ease-spring);
}
.brand-icon:hover { transform: rotate(-8deg) scale(1.1); }

.brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.brand-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--gradient-brand);
  color: white;
  vertical-align: middle;
  margin-left: 4px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}
.nav-btn:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}
.nav-btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent-emerald-bg);
}

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

.live-dot-small {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 2s infinite;
  display: inline-block;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: box-shadow 0.3s;
}
.nav-avatar:hover {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}

/* ---- Main Content ---- */
.main-content {
  padding-top: calc(var(--nav-height) + 24px);
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
  padding-bottom: 60px;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ---- Views ---- */
.view { display: none; }
.view.active {
  display: block;
  animation: fadeIn 0.4s var(--ease-out);
}

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

/* ---- Section Headers ---- */
.section-header {
  margin-bottom: 28px;
}
.section-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ---- KPI Grid ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
  backdrop-filter: blur(12px);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity 0.3s;
}
.kpi-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-card:hover::before { opacity: 1; }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon-blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.kpi-icon-green { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.kpi-icon-amber { background: var(--accent-amber-bg); color: var(--accent-amber); }
.kpi-icon-red { background: var(--accent-red-bg); color: var(--accent-red); }

.kpi-data {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
}
.kpi-trend-up { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.kpi-trend-down { background: var(--accent-red-bg); color: var(--accent-red); }
.kpi-trend-neutral { background: var(--bg-glass); color: var(--text-muted); }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-glass);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.card-badge-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
  border-color: transparent;
}

/* ---- Dashboard Grid ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container {
  padding: 20px 24px;
  height: 260px;
  position: relative;
}

/* ---- Activity Feed ---- */
.activity-feed {
  padding: 0;
  max-height: 310px;
  overflow-y: auto;
}
.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-track { background: transparent; }
.activity-feed::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s;
  animation: slideIn 0.3s var(--ease-out);
}
.activity-item:hover { background: var(--bg-glass); }
.activity-item:last-child { border-bottom: none; }

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

.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.activity-icon.approve { background: var(--accent-emerald-bg); }
.activity-icon.review { background: var(--accent-amber-bg); }
.activity-icon.fraud { background: var(--accent-red-bg); }
.activity-icon.new { background: var(--accent-blue-bg); }

.activity-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---- Metrics Grid ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.metric-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* ---- Pipeline View ---- */
.pipeline-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  align-items: center;
}

.pipeline-select {
  flex: 1;
  max-width: 400px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.pipeline-select:focus { border-color: var(--accent-indigo); }
.pipeline-select option { background: var(--bg-secondary); }

.pipeline-wrapper {
  overflow-x: auto;
  padding: 20px 0;
  margin-bottom: 28px;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  min-width: 130px;
  transition: all 0.4s var(--ease-out);
  position: relative;
}
.pipeline-node.active {
  border-color: var(--accent-indigo);
  box-shadow: var(--shadow-glow-indigo);
  background: rgba(99,102,241,0.08);
}
.pipeline-node.active .pn-icon {
  animation: nodePulse 1s infinite;
}
.pipeline-node.done {
  border-color: var(--accent-emerald);
  background: rgba(16,185,129,0.06);
}
.pipeline-node.error {
  border-color: var(--accent-red);
  background: rgba(239,68,68,0.06);
}

@keyframes nodePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.pn-icon {
  color: var(--text-muted);
  transition: color 0.3s;
}
.pipeline-node.active .pn-icon { color: var(--accent-indigo-light); }
.pipeline-node.done .pn-icon { color: var(--accent-emerald); }

.pn-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: -0.01em;
}
.pn-status {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-glass);
}
.pipeline-node.active .pn-status { color: var(--accent-indigo-light); background: rgba(99,102,241,0.15); }
.pipeline-node.done .pn-status { color: var(--accent-emerald); background: var(--accent-emerald-bg); }

.pipeline-connector {
  display: flex;
  align-items: center;
  width: 40px;
  position: relative;
}
.connector-line {
  height: 2px;
  flex: 1;
  background: var(--border-subtle);
  transition: background 0.5s;
}
.connector-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: background 0.5s;
  position: absolute;
  right: 0;
}
.pipeline-connector.active .connector-line {
  background: var(--accent-indigo);
}
.pipeline-connector.active .connector-dot {
  background: var(--accent-indigo);
}
.pipeline-connector.done .connector-line {
  background: var(--accent-emerald);
}
.pipeline-connector.done .connector-dot {
  background: var(--accent-emerald);
}

.pipeline-detail {
  margin-top: 8px;
}
.pipeline-output {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* ---- Claims Table ---- */
.table-card {
  margin-top: 0;
}
.table-responsive {
  overflow-x: auto;
}
.claims-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.claims-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.claims-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s;
}
.claims-table tbody tr:hover { background: var(--bg-glass); }
.claims-table tbody tr:last-child { border-bottom: none; }
.claims-table td {
  padding: 14px 16px;
  vertical-align: middle;
  white-space: nowrap;
}
.claims-table .col-id {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent-indigo-light);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-approve { background: var(--accent-emerald-bg); color: var(--accent-emerald); }
.badge-review { background: var(--accent-amber-bg); color: var(--accent-amber); }
.badge-fraud { background: var(--accent-red-bg); color: var(--accent-red); }

.severity-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.severity-bar-track {
  width: 60px; height: 6px;
  border-radius: 3px;
  background: var(--bg-glass);
  overflow: hidden;
}
.severity-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}
.severity-low { background: var(--accent-emerald); }
.severity-med { background: var(--accent-amber); }
.severity-high { background: var(--accent-red); }

.btn-details {
  padding: 6px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-details:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--accent-indigo);
}

/* ---- Filters ---- */
.filters-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.filter-select,
.filter-input {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  min-width: 160px;
  transition: border-color 0.2s;
}
.filter-select:focus,
.filter-input:focus {
  border-color: var(--accent-indigo);
}
.filter-select option { background: var(--bg-secondary); }

/* ---- Submit Claim View ---- */
.submit-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.submit-form-card {
  padding: 32px;
}

.claim-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-indigo);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group select option { background: var(--bg-secondary); }
.form-group textarea { resize: vertical; }

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-indigo);
}
.btn-primary:active { transform: translateY(0); }

.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}
.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* ---- Processing Feed ---- */
.submit-live-card {
  display: flex;
  flex-direction: column;
}
.processing-feed {
  padding: 0;
  flex: 1;
  max-height: 460px;
  overflow-y: auto;
}
.processing-feed::-webkit-scrollbar { width: 4px; }
.processing-feed::-webkit-scrollbar-track { background: transparent; }
.processing-feed::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

.feed-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 16px;
}
.feed-placeholder p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
  animation: slideIn 0.3s var(--ease-out);
}
.feed-item:last-child { border-bottom: none; }

.feed-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.feed-dot.info { background: var(--accent-blue); }
.feed-dot.success { background: var(--accent-emerald); }
.feed-dot.warning { background: var(--accent-amber); }
.feed-dot.error { background: var(--accent-red); }
.feed-dot.ai { background: var(--accent-violet); }

.feed-content {
  flex: 1;
}
.feed-msg {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.feed-msg strong { color: var(--text-primary); }
.feed-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s var(--ease-spring);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-indigo-light);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--accent-red-bg); color: var(--accent-red); }

.modal-body {
  padding: 28px;
}

.modal-section {
  margin-bottom: 24px;
}
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.modal-info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-info-value.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.modal-summary {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Toasts ---- */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  animation: toastIn 0.4s var(--ease-spring);
  font-size: 0.85rem;
}
.toast.removing {
  animation: toastOut 0.3s var(--ease-out) forwards;
}
.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.toast-text {
  flex: 1;
  color: var(--text-secondary);
}
.toast-text strong { color: var(--text-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ---- Canvas Charts (simple built‑in) ---- */
canvas { display: block; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .submit-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --page-padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .pipeline-controls { flex-direction: column; }
  .claim-form .form-row { grid-template-columns: 1fr; }
  .modal-info-grid { grid-template-columns: 1fr; }
}

/* ---- Scrollbar global ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
