:root {
  --bg-primary: #07090e;
  --bg-secondary: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  --accent-amber: #f59e0b;
  --accent-rose: #fb7185;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.medubaris-logo-icon {
  width: 26px;
  height: 26px;
}

.app-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title .divider {
  color: var(--text-muted);
  font-weight: 300;
}

.app-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.btn-nav-link {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-nav-link:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
}

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.hero-section {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(11, 15, 25, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.hero-tag {
  display: inline-block;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-description {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.6;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.stat-sub {
  font-size: 10.5px;
  color: var(--accent-cyan);
  margin-top: 2px;
}

.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 90px;
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.filter-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.reports-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  outline: none;
}

.report-card:hover, .report-card:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

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

.card-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-sensor {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge-sensor-tvci {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-sensor-lisi {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-timeframe {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.obs-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 500;
}

.badge-status-ratified {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-status-unratified {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.report-headline {
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 12px;
}

.report-prose {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 18px;
}

.card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.metric-cell-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-cell-val {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.provenance-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #64748b;
}

.btn-open-report {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn-open-report:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.report-card:hover .btn-open-report {
  border-color: var(--accent-cyan);
  color: #fff;
  background: rgba(56, 189, 248, 0.2);
}

.empty-state-box {
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
}

/* ============================================================================
   Full-Screen Read-Only Report Reader Modal
   ============================================================================ */
.reader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.reader-dialog {
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  width: 100%;
  max-width: 1040px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.reader-action-bar {
  background: #111827;
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.reader-breadcrumbs {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.reader-crumb-dim {
  color: var(--text-muted);
}

.reader-crumb-sep {
  color: #475569;
}

.reader-crumb-active {
  color: #fff;
  font-weight: 700;
}

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

.btn-reader-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-reader-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-reader-primary {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

.btn-reader-primary:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
}

.btn-reader-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reader-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.reader-body {
  padding: 32px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.reader-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.reader-meta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reader-headline {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
}

.reader-prose-body {
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.7;
}

.reader-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.reader-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 16px;
}

.reader-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.reader-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  margin: 4px 0 2px;
}

.reader-stat-sub {
  font-size: 10px;
  color: #64748b;
}

.reader-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.reader-attachment-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 16px;
}

.reader-att-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.reader-att-val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.reader-att-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.reader-att-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.reader-spatial-table-wrap {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow-x: auto;
}

.reader-spatial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.reader-spatial-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 16px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.reader-spatial-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
}

.reader-assertion-box {
  background: rgba(56, 189, 248, 0.04);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
}

.reader-assertion-claim {
  font-size: 13.5px;
  color: #e0f2fe;
  line-height: 1.6;
  margin-bottom: 8px;
}

.reader-assertion-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.reader-prov-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reader-prov-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.reader-prov-label {
  color: var(--text-muted);
}

.reader-prov-val {
  color: #cbd5e1;
  word-break: break-all;
}

/* ============================================================================
   Print Stylesheet
   ============================================================================ */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .filter-bar, .stats-strip, .hero-tag, .reader-action-bar, .open-reader-prompt {
    display: none !important;
  }
  .reader-overlay {
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
  }
  .reader-dialog {
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    color: #000 !important;
  }
  .reader-headline, .reader-stat-val, .reader-att-name {
    color: #000 !important;
  }
  .reader-prose-body, .reader-stat-label, .reader-att-meta {
    color: #333 !important;
  }
  .reader-stat-box, .reader-attachment-card, .reader-prov-box {
    border: 1px solid #ccc !important;
    background: #f9fafb !important;
  }
}