/* ============================================================
   FCase Forensic Intelligence Suite — Institutional Theme
   Paleta institucional: azul profundo, rojo, dorado, gris
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* FCase Institutional Palette */
  --fc-blue-900: #0a1628;
  --fc-blue-800: #0d2240;
  --fc-blue-700: #143566;
  --fc-blue-600: #1a4d8f;
  --fc-blue-500: #2563a8;
  --fc-blue-400: #3b82f6;
  --fc-blue-300: #60a5fa;
  --fc-gold: #c9a227;
  --fc-gold-light: #e6c84a;
  --fc-red: #c62828;
  --fc-red-light: #ef5350;
  --fc-green: #2e7d32;
  --fc-green-light: #4caf50;
  --fc-white: #f8fafc;
  --fc-gray-50: #f1f5f9;
  --fc-gray-100: #e2e8f0;
  --fc-gray-200: #cbd5e1;
  --fc-gray-300: #94a3b8;
  --fc-gray-400: #64748b;
  --fc-gray-600: #475569;
  --fc-gray-700: #334155;
  --fc-gray-800: #1e293b;

  /* Surfaces */
  --surface-bg: #0b1a2e;
  --surface-card: #0f2138;
  --surface-card-hover: #142d4a;
  --surface-sidebar: #081426;
  --surface-header: #0a1830;
  --border-color: rgba(59, 130, 246, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px rgba(37, 99, 168, 0.2);
  --shadow-glow-red: 0 0 20px rgba(198, 40, 40, 0.2);
}

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

html { font-size: 14px; }

body {
  background: var(--surface-bg);
  color: var(--fc-white);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

code, .mono {
  font-family: var(--font-mono);
  background: rgba(59, 130, 246, 0.08);
  color: var(--fc-blue-300);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}

a { color: var(--fc-blue-400); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Sidebar ---- */
.sidebar {
  width: 272px;
  background: rgba(8, 20, 38, 0.65);
  backdrop-filter: blur(16px);
  border-right: 2px solid var(--fc-gold);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fc-blue-500), var(--fc-gold), var(--fc-red));
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.institution-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fc-gold);
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.25);
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

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

.logo-shield {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--fc-blue-500), var(--fc-blue-700));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-glow-blue);
}

.logo-text h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--fc-white);
}

.logo-sub {
  font-size: 10px;
  color: var(--fc-gray-300);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Case mini card */
.case-card-mini {
  margin: 16px 20px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  border-radius: 8px;
}

.case-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.case-status-badge.active { color: var(--fc-green-light); }

.pulse-dot {
  width: 6px; height: 6px;
  background: var(--fc-green-light);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--fc-green-light);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.case-card-mini h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-white);
}

.case-card-mini p {
  font-size: 11px;
  color: var(--fc-gray-300);
  margin-top: 2px;
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--fc-gray-300);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--fc-gray-100);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--fc-blue-300);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--fc-blue-400);
  border-radius: 0 2px 2px 0;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--fc-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--fc-gray-400);
}

.api-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.status-dot.online { background: var(--fc-green-light); box-shadow: 0 0 6px var(--fc-green-light); }
.status-dot.offline { background: var(--fc-red-light); }

/* ---- Main Content ---- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Light Theme Overrides for main panel */
  background: var(--fc-gray-50);
  color: var(--fc-gray-800);
  --surface-card: #ffffff;
  --surface-header: rgba(248, 250, 252, 0.85);
  --fc-white: #0f172a; 
  --fc-gray-100: #1e293b;
  --fc-gray-200: #334155;
  --fc-gray-300: #475569;
  --fc-gray-400: #64748b;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--surface-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.case-header-info h1 {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.header-sub {
  font-size: 12px;
  color: var(--fc-gray-300);
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-select {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  color: var(--fc-gray-100);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}
.header-select:focus {
  border-color: var(--fc-blue-500);
}

.utc-clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fc-gold);
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 6px;
  width: 300px;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--fc-blue-400); }

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fc-white);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-left: 8px;
  width: 100%;
}

.search-bar input::placeholder { color: var(--fc-gray-400); }

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--fc-blue-500);
  color: #fff;
}
.btn-primary:hover {
  background: var(--fc-blue-400);
  box-shadow: var(--shadow-glow-blue);
}

.btn-danger {
  background: var(--fc-red);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--fc-gold), #b8941f);
  color: #0a1628;
  font-weight: 700;
}
.btn-gold:hover {
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--fc-gray-200);
}
.btn-outline:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--fc-blue-500);
  color: var(--fc-blue-300);
}

/* ---- View Panels ---- */
.view-scroll-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.view-panel { display: none; opacity: 0; transform: translateY(10px); }
.view-panel.active { display: block; animation: fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

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

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

.panel-header h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
}

.panel-header .subtitle {
  font-size: 12px;
  color: var(--fc-gray-300);
}

/* ---- Metrics KPI Grid ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fc-blue-400), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover { 
  border-color: var(--fc-blue-400); 
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-blue);
}

.metric-card:hover::after {
  opacity: 1;
}

.metric-card.alert {
  border-color: rgba(198, 40, 40, 0.4);
  background: linear-gradient(145deg, rgba(198, 40, 40, 0.05) 0%, #ffffff 100%);
}

.metric-card.alert:hover {
  border-color: var(--fc-red-light);
  box-shadow: var(--shadow-glow-red);
}

.metric-card.alert::after {
  background: linear-gradient(90deg, transparent, var(--fc-red-light), transparent);
}

.metric-card .metric-icon {
  font-size: 20px;
  margin-bottom: 10px;
  display: block;
}

.metric-card .metric-value {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  line-height: 1;
}

.metric-card.alert .metric-value {
  background: linear-gradient(135deg, #ffffff 0%, #ef5350 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-card .metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-gray-300);
  margin-top: 4px;
  display: block;
}

.metric-card .metric-sub {
  font-size: 10px;
  color: var(--fc-gray-400);
  margin-top: 6px;
}

/* ---- Cards ---- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.card-body { padding: 18px; }

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dashboard-grid .card-full {
  grid-column: 1 / -1;
}

/* ---- Badges ---- */
.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
  letter-spacing: 0.3px;
}

.badge-default { background: rgba(255,255,255,0.06); color: var(--fc-gray-200); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--fc-blue-300); border: 1px solid rgba(59,130,246,0.25); }
.badge-gold { background: rgba(201,162,39,0.12); color: var(--fc-gold-light); border: 1px solid rgba(201,162,39,0.25); }
.badge-red { background: rgba(198,40,40,0.12); color: var(--fc-red-light); border: 1px solid rgba(198,40,40,0.25); }
.badge-green { background: rgba(46,125,50,0.12); color: var(--fc-green-light); border: 1px solid rgba(46,125,50,0.25); }

/* ---- Filters Bar ---- */
.filters-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  color: var(--fc-gray-300);
  padding: 6px 14px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  background: rgba(59, 130, 246, 0.06);
  color: var(--fc-gray-100);
}

.filter-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--fc-blue-500);
  color: var(--fc-blue-300);
  font-weight: 600;
}

/* ---- Device items ---- */
.device-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.device-item:hover { border-color: var(--fc-blue-500); }

.device-icon { font-size: 22px; }

.device-info h4 { font-size: 13px; font-weight: 600; color: var(--fc-white); }
.device-info p { font-size: 11px; color: var(--fc-gray-300); margin-top: 2px; }

/* ---- High Risk items ---- */
.high-risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.high-risk-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(198, 40, 40, 0.04);
  border-left: 3px solid var(--fc-red);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
}

.high-risk-item strong { color: var(--fc-white); }

/* ---- AI Tags Cloud ---- */
.ai-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-tag-chip {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fc-gray-100);
}
.ai-tag-chip.high {
  border-color: rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.08);
  color: var(--fc-red-light);
}
.ai-tag-chip.medium {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
  color: var(--fc-gold-light);
}

.tag-count { font-family: var(--font-mono); font-size: 10px; opacity: 0.7; }

/* Chart container */
.chart-container {
  position: relative;
  height: 220px;
  width: 100%;
}

/* ---- Timeline ---- */
.timeline-container {
  position: relative;
  padding-left: 28px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--fc-blue-500), var(--fc-blue-700), transparent);
}

.timeline-node {
  position: relative;
  margin-bottom: 16px;
}

.timeline-node::before {
  content: '';
  position: absolute;
  left: -24px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fc-blue-500);
  border: 2px solid var(--surface-bg);
  z-index: 1;
}

.timeline-node[data-kind="AI_CATEGORIZED"]::before,
.timeline-node[data-kind="AI_ENTITY_EXTRACTED"]::before { background: var(--fc-gold); }
.timeline-node[data-kind="EVIDENCE_BOOKMARKED"]::before { background: var(--fc-red); }
.timeline-node[data-kind="LINK_DISCOVERED"]::before { background: var(--fc-green-light); }
.timeline-node[data-kind="EVIDENCE_VERIFIED"]::before { background: #26c6da; }

.timeline-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color 0.2s;
}
.timeline-card:hover { border-color: var(--fc-blue-500); }

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fc-gray-400);
  margin-bottom: 6px;
  gap: 12px;
}

.timeline-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fc-white);
}

.timeline-body {
  font-size: 12px;
  color: var(--fc-gray-200);
  line-height: 1.5;
}

.chat-bubble {
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid var(--fc-blue-400);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-top: 6px;
  font-size: 12px;
  color: var(--fc-gray-100);
}

.coord-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--fc-green-light);
  background: rgba(46, 125, 50, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
  margin-top: 6px;
}

/* ---- Media Gallery ---- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-card:hover {
  transform: translateY(-3px);
  border-color: var(--fc-blue-500);
  box-shadow: var(--shadow-md);
}

.media-preview-wrap {
  position: relative;
  height: 170px;
  overflow: hidden;
}

.media-preview {
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--fc-blue-800);
}

.media-overlay {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.media-content { padding: 12px 14px; }
.media-title { font-size: 12px; font-weight: 600; color: var(--fc-white); margin-bottom: 4px; }
.media-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 18, 0.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-overlay.active { opacity: 1; pointer-events: all; }

.lightbox-content {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.lightbox-img { width: 100%; max-height: 400px; object-fit: contain; background: #000; }
.lightbox-body { padding: 20px; }
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Graph Container ---- */
.graph-container {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

#graph-canvas {
  width: 100%;
  height: 70vh;
}

.graph-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fc-gray-200);
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.legend-dot.red { background: var(--fc-red-light); }
.legend-dot.blue { background: var(--fc-blue-400); }
.legend-dot.gold { background: var(--fc-gold); }
.legend-dot.green { background: var(--fc-green-light); }
.legend-dot.gray { background: var(--fc-gray-400); }

/* ---- Relations Table ---- */
.relations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.relations-table th {
  background: rgba(59, 130, 246, 0.06);
  color: var(--fc-gray-300);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.relations-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fc-gray-100);
}

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

.confidence-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--fc-blue-500);
  min-width: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

/* ---- Map ---- */
#map-container {
  width: 100%;
  height: 500px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Leaflet dark tiles override */
.leaflet-tile-pane { filter: saturate(0.8) brightness(0.85); }

/* ---- Audit / Custody Table ---- */
.audit-table-container {
  overflow-x: auto;
  margin-top: 14px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.audit-table th {
  background: rgba(59, 130, 246, 0.06);
  color: var(--fc-gray-300);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.audit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fc-gray-100);
}

.audit-table tbody tr:nth-child(even) {
  background: rgba(59, 130, 246, 0.02);
}

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

.custody-metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  padding: 12px 0;
  font-size: 12px;
}
.custody-metadata p { color: var(--fc-gray-200); }
.custody-metadata strong { color: var(--fc-gray-300); font-weight: 600; }

/* Select */
.select-input {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  color: var(--fc-white);
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  min-width: 260px;
  cursor: pointer;
}
.select-input option { background: var(--surface-card); }

/* ---- Report / Dictamen ---- */
.report-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 32px 40px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.7;
  color: #111827;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.report-content h1, .report-content h2, .report-content h3 {
  color: #000000;
  margin-top: 16px;
  margin-bottom: 8px;
}
.report-content h2 { font-size: 16px; border-bottom: 1px solid #e5e7eb; padding-bottom: 6px; }
.report-content h3 { font-size: 14px; }
.report-content ul, .report-content ol { padding-left: 20px; margin: 8px 0; }
.report-content li { margin: 4px 0; }
.report-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.report-content strong { color: #000000; }
.report-content code {
  background: #f3f4f6;
  color: #1f2937;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid #e5e7eb;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--fc-gray-400);
}

/* ---- Loading spinner ---- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--fc-gray-400);
  font-size: 13px;
  gap: 10px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--fc-blue-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Utility ---- */
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--fc-gray-300); }
.text-sm { font-size: 12px; }
.hidden { display: none !important; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--fc-gray-400);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; display: block; }
