/* GAO Engine v6.3 — Green Light Theme with Sidebar Layout */

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

:root {
  --green-50: #f0fdf4; --green-100: #dcfce7; --green-200: #bbf7d0;
  --green-300: #86efac; --green-400: #4ade80; --green-500: #22c55e;
  --green-600: #16a34a; --green-700: #006C35; --green-800: #005a2b;
  --green-900: #14532d; --green-950: #052e16;

  --primary: #006C35; --primary-light: #00843D; --primary-lighter: #16a34a;
  --primary-pale: #dcfce7; --primary-bg: #f0fdf4;

  --bg-body: #ffffff; --bg-sidebar: #fafbfc; --bg-card: #ffffff;
  --bg-muted: #f8fafc; --bg-hover: #f1f5f9;

  --border-light: #e2e8f0; --border-medium: #cbd5e1;
  --border-green: rgba(0, 108, 53, 0.15);

  --text-primary: #0f172a; --text-secondary: #334155;
  --text-muted: #64748b; --text-light: #94a3b8; --text-on-green: #ffffff;

  --accent-amber: #d97706; --accent-red: #dc2626;
  --accent-blue: #2563eb; --accent-purple: #7c3aed;

  --sidebar-width: 260px; --sidebar-collapsed: 0px; --header-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body); color: var(--text-primary);
  min-height: 100vh; overflow-x: hidden; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

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

/* ═══ Sidebar ═══ */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light); position: fixed;
  top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 40;
  transition: transform 0.3s ease; display: flex; flex-direction: column;
}
.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.sidebar-brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px; box-shadow: 0 4px 12px rgba(0, 108, 53, 0.25);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-section { padding: 0 12px; margin-bottom: 4px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-light); padding: 16px 12px 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s ease; text-decoration: none;
  border: 1px solid transparent; position: relative;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active {
  background: var(--primary-pale); color: var(--primary);
  font-weight: 600; border-color: var(--border-green);
}
.sidebar-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%); width: 3px; height: 20px;
  background: var(--primary); border-radius: 0 4px 4px 0;
}
.sidebar-item i { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto; background: var(--primary-pale); color: var(--primary);
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); flex-shrink: 0; }

/* ═══ Content Area ═══ */
.content-area { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; }

.top-bar {
  height: var(--header-height); border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 30; display: flex;
  align-items: center; justify-content: space-between; padding: 0 28px;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb-active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--border-medium); font-size: 10px; }

.page-content { padding: 28px; max-width: 1280px; }

/* ═══ Cards ═══ */
.card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 12px; transition: all 0.2s ease;
}
.card:hover { border-color: var(--border-medium); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); }
.card-green { border-color: var(--border-green); background: linear-gradient(135deg, var(--green-50), #ffffff); }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }
.card-body-compact { padding: 16px; }

/* Legacy glass class — map to card for backward compat */
.glass { background: var(--bg-card); border: 1px solid var(--border-light); backdrop-filter: none; }
.glass-strong { background: var(--bg-muted); border: 1px solid var(--border-medium); backdrop-filter: none; }

/* ═══ Stat Cards ═══ */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 20px; transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(0, 108, 53, 0.04) 0%, transparent 70%);
}
.stat-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0, 108, 53, 0.08); }
.stat-card-green { background: linear-gradient(135deg, var(--green-50), #ffffff); border-color: var(--border-green); }
.stat-number { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* ═══ Badges ═══ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-tier-a { background: var(--green-100); color: var(--green-700); }
.badge-tier-b { background: #dbeafe; color: #1e40af; }
.badge-tier-c { background: #fef3c7; color: #92400e; }
.badge-tier-d { background: #fee2e2; color: #991b1b; }
.badge-new { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; font-size: 9px; padding: 2px 6px; border-radius: 999px; font-weight: 700; letter-spacing: 0.5px; }
.badge-enhanced { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; font-size: 9px; padding: 2px 6px; border-radius: 999px; font-weight: 700; letter-spacing: 0.5px; }

/* ═══ Data Tables ═══ */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table thead th {
  text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  border-bottom: 2px solid var(--border-light); background: var(--bg-muted);
  position: sticky; top: 0; z-index: 5;
}
.data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--green-50); }
.data-table tbody tr.row-highlight { background: var(--green-50); font-weight: 600; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline { background: white; color: var(--text-secondary); border-color: var(--border-medium); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--green-50); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ═══ Page Headers ═══ */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ═══ Scores ═══ */
.score-excellent { color: var(--green-700); }
.score-good { color: var(--accent-blue); }
.score-fair { color: var(--accent-amber); }
.score-poor { color: var(--accent-red); }

/* ═══ Progress Bars ═══ */
.progress-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.22, 1, 0.36, 1); }
.progress-fill-green { background: linear-gradient(90deg, var(--green-500), var(--green-600)); }
.progress-fill-blue { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.progress-fill-amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-fill-red { background: linear-gradient(90deg, #ef4444, #dc2626); }
.risk-bar { transition: width 1.2s ease-out; }

/* Mandate borders */
.mandate-civil { border-left: 3px solid var(--green-600); }
.mandate-defense { border-left: 3px solid var(--accent-red); }
.mandate-hybrid { border-left: 3px solid var(--accent-purple); }
.mandate-security { border-left: 3px solid var(--accent-amber); }

/* ═══ Search Input ═══ */
.search-input {
  background: var(--bg-muted); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 8px 12px 8px 36px; color: var(--text-primary);
  font-size: 13px; width: 100%; transition: all 0.2s ease;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.1); background: white; }
.search-input::placeholder { color: var(--text-light); }
.search-glow:focus { box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.15); border-color: var(--primary); }
.search-input-lg { transition: all 0.3s ease; border: 2px solid var(--border-light); }
.search-input-lg:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1), 0 4px 20px rgba(0, 0, 0, 0.05); transform: translateY(-1px); }

/* ═══ Modal ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: white; border: 1px solid var(--border-light); border-radius: 16px;
  max-width: 900px; width: 95%; max-height: 90vh; overflow-y: auto;
  animation: scaleIn 0.25s ease-out; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ═══ Timeline ═══ */
.timeline-line {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--green-400), var(--green-600), var(--green-800));
}
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid; background: white; position: relative; z-index: 2; }

/* ═══ Range Slider ═══ */
input[type="range"], .savings-slider { -webkit-appearance: none; width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb, .savings-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  cursor: pointer; box-shadow: 0 2px 8px rgba(0, 108, 53, 0.3); transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb, .savings-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  cursor: pointer; border: none;
}

/* ═══ Animations ═══ */
.fade-in, .animate-fade { animation: fadeIn 0.4s ease-out forwards; }
.fade-in-up, .animate-slide { animation: fadeInUp 0.5s ease-out forwards; }
.scale-in, .animate-scale { animation: scaleIn 0.3s ease-out forwards; }
.animate-glow { animation: glowPulse 2s infinite; }
.animate-bounce-in { animation: bounceIn 0.6s cubic-bezier(.36,.07,.19,.97); }
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }
.stagger-6 { animation-delay: 0.3s; opacity: 0; }
.stagger-7 { animation-delay: 0.35s; opacity: 0; }
.stagger-8 { animation-delay: 0.4s; opacity: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 5px rgba(0, 108, 53, 0.3); } 50% { box-shadow: 0 0 20px rgba(0, 108, 53, 0.5); } }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideRight { from { width: 0; } to { width: var(--target-width); } }
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.pulse-ring { animation: pulseRing 2s ease-out infinite; }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(0, 108, 53, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(0, 108, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 108, 53, 0); }
}
.pulse-dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ═══ Grade Badges ═══ */
.grade-a { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.grade-b { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.grade-c { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.grade-d { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.grade-f { background: linear-gradient(135deg, #7f1d1d, #991b1b); color: white; }

/* ═══ Trends ═══ */
.trend-improved { color: var(--green-600); }
.trend-regressed { color: var(--accent-red); }
.trend-unchanged { color: var(--accent-amber); }
.trend-new { color: var(--accent-purple); }

/* ═══ Utility ═══ */
.count-up { font-variant-numeric: tabular-nums; }
.counter { display: inline-block; min-width: 2ch; }
.gradient-text { background: linear-gradient(135deg, var(--green-700), var(--green-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.gradient-text-gold { background: linear-gradient(135deg, #d97706, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.scrollbar-hide, .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar, .hide-scrollbar::-webkit-scrollbar { display: none; }
.highlight-num { background: linear-gradient(135deg, rgba(0, 108, 53, 0.08), rgba(0, 108, 53, 0.03)); border: 1px solid var(--border-green); border-radius: 12px; padding: 3px 8px; }
select option { background: white; color: var(--text-primary); }
canvas { max-width: 100%; }

/* ═══ Accessibility ═══ */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; padding: 8px 16px; background: var(--primary); color: white; font-size: 13px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ═══ Tab Buttons (top-bar inline) ═══ */
.tab-active { background: var(--primary); color: white !important; box-shadow: 0 2px 8px rgba(0, 108, 53, 0.2); }
.tab-btn { transition: all 0.15s ease; border: 1px solid transparent; }
.tab-btn:hover:not(.tab-active) { background: var(--green-50); color: var(--primary); border-color: var(--border-green); }
.tab-btn.active { border-bottom-color: var(--primary); color: var(--primary); }
.tab-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }

/* ═══ Finding Cards ═══ */
.finding-card { transition: all 0.3s ease; border-left: 4px solid transparent; }
.finding-card:hover { border-left-color: var(--primary); background: var(--green-50); }
.card-hover { transition: all 0.3s cubic-bezier(.4,0,.2,1); }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08); border-color: var(--border-medium); }

/* ═══ Country / Comparison Cards ═══ */
.country-card { transition: all 0.2s ease; cursor: pointer; }
.country-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); border-color: var(--primary); }
.flag-item { font-size: 0.75rem; }
.flag-item:hover { transform: scale(1.05); z-index: 5; }
.funnel-stage { transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

/* ═══ Progress Ring ═══ */
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle { transition: stroke-dashoffset 1.2s ease-out; }
.compare-bar { transition: width 0.8s ease-out; min-width: 2px; }

/* ═══ Tooltip ═══ */
.tooltip-trigger { position: relative; }
.tooltip-trigger:hover .tooltip-box { display: block; }
.tooltip-box {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  padding: 6px 10px; background: var(--text-primary); border: 1px solid var(--border-light);
  border-radius: 8px; font-size: 11px; white-space: nowrap; z-index: 20; margin-bottom: 6px;
  color: white; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ═══ Interactive Rows ═══ */
.table-row-hover { transition: all 0.2s; }
.table-row-hover:hover { background: var(--green-50); transform: translateX(2px); }

/* ═══ Accordion ═══ */
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.accordion-content.open { max-height: 500px; }

/* ═══ GAO Intro / Hero Sections ═══ */
.gao-intro { background: linear-gradient(135deg, var(--green-50), white, rgba(0, 108, 53, 0.03)); border: 1px solid var(--border-green); }
.gao-intro:hover { border-color: rgba(0, 108, 53, 0.25); }

/* ═══ Document Search ═══ */
.search-hero { background: linear-gradient(135deg, var(--green-50), white, rgba(0, 108, 53, 0.05)); border: 1px solid var(--border-green); }
.search-hero:hover { border-color: rgba(0, 108, 53, 0.3); }
.search-highlight { background: rgba(0, 108, 53, 0.12); color: var(--primary); border-radius: 2px; padding: 0 2px; }
.filter-chip { transition: all 0.2s ease; cursor: pointer; user-select: none; }
.filter-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.filter-chip.active { ring: 2px; ring-offset: 1px; }
.doc-card { transition: all 0.25s cubic-bezier(.4,0,.2,1); border: 1px solid var(--border-light); }
.doc-card:hover { border-color: var(--primary); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06); transform: translateY(-2px); }
.doc-card-priority { border-left: 3px solid var(--primary); }
.sort-btn { transition: all 0.2s ease; }
.sort-btn:hover { background: var(--green-50); }
.sort-btn.active { background: rgba(0, 108, 53, 0.1); color: var(--primary); }
.search-empty-state { animation: fadeIn 0.4s ease-out; }
.filter-drawer { transition: max-height 0.4s ease-out, opacity 0.3s ease; max-height: 0; overflow: hidden; opacity: 0; }
.filter-drawer.open { max-height: 600px; opacity: 1; }
.tag-clickable { cursor: pointer; transition: all 0.15s ease; }
.tag-clickable:hover { background: var(--green-100); transform: scale(1.05); }
.result-count-badge { background: linear-gradient(135deg, rgba(0, 108, 53, 0.15), rgba(0, 108, 53, 0.05)); border: 1px solid var(--border-green); border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 600; }
.kbd { background: var(--bg-muted); border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 5px; font-family: monospace; font-size: 10px; color: var(--text-muted); }
.active-filter-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.active-filter-pill:hover { filter: brightness(0.9); transform: scale(1.02); }

/* ═══ Analytics & Export ═══ */
.analytics-bar { background: linear-gradient(90deg, rgba(0, 108, 53, 0.06), rgba(0, 108, 53, 0.02)); border: 1px solid var(--border-green); border-radius: 12px; padding: 12px 16px; }
.analytics-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 600; border: 1px solid var(--border-light); background: var(--bg-muted); }
.analytics-pill i { font-size: 9px; }
.export-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; border: 1px solid var(--border-light); background: white; }
.export-btn:hover { background: var(--green-50); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); border-color: var(--primary); color: var(--primary); }
.export-btn:active { transform: translateY(0); }

/* ═══ Toast Notifications ═══ */
.toast { padding: 12px 20px; border-radius: 12px; font-size: 12px; font-weight: 500; animation: toastIn 0.3s ease-out; display: flex; align-items: center; gap: 8px; min-width: 250px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); }
.toast-success { background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95)); color: white; border: 1px solid rgba(74, 222, 128, 0.3); }
.toast-info { background: linear-gradient(135deg, rgba(0, 108, 53, 0.95), rgba(0, 132, 61, 0.95)); color: white; border: 1px solid rgba(0, 108, 53, 0.3); }
.toast-error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95)); color: white; border: 1px solid rgba(248, 113, 113, 0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ═══ Relevance & Score ═══ */
.relevance-meter { display: inline-flex; align-items: center; gap: 4px; }
.relevance-dot { width: 6px; height: 6px; border-radius: 50%; transition: background 0.3s; }
.relevance-dot.active { background: var(--primary); box-shadow: 0 0 6px rgba(0, 108, 53, 0.5); }
.relevance-dot.inactive { background: var(--border-light); }
.score-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 6px; font-size: 9px; font-weight: 700; letter-spacing: 0.3px; }
.score-badge-high { background: rgba(0, 108, 53, 0.12); color: var(--primary); border: 1px solid var(--border-green); }
.score-badge-medium { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.score-badge-low { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border-light); }

/* ═══ Skeleton Loader ═══ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%; animation: skeletonPulse 1.5s ease-in-out infinite; border-radius: 8px;
}
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-muted) 25%, #e2e8f0 50%, var(--bg-muted) 75%);
  background-size: 200% 100%; animation: skeletonPulse 1.5s infinite;
}
@keyframes skeletonPulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══ Containment ═══ */
.tab-content { contain: layout style; }
#dsResults { contain: layout; }

/* ═══ Bio/CBRN Domain ═══ */
.biocbrn-hero { background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), white, rgba(0, 108, 53, 0.03)); border: 1px solid rgba(239, 68, 68, 0.15); }
.biocbrn-domain-card { transition: all 0.3s ease; }
.biocbrn-domain-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
#bioCbrnResults .doc-card { border-left: 3px solid rgba(239, 68, 68, 0.3); }
#bioCbrnResults .doc-card-priority { border-left: 3px solid rgba(239, 68, 68, 0.7); }

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1); }
  .content-area { margin-left: 0; }
  .mobile-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 35; }
}
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .top-bar { padding: 0 16px; }
  .stat-number { font-size: 22px; }
  .page-title { font-size: 18px; }
  .modal-content { width: 98%; max-height: 95vh; border-radius: 12px; }
  .country-card:hover { transform: none; }
  .data-table { font-size: 11px; }
  canvas { max-height: 280px !important; }
}
@media (max-width: 480px) {
  .page-content { padding: 12px; }
  .sidebar-item { padding: 7px 10px; font-size: 12px; }
}

/* ═══ Print ═══ */
@media print {
  body { background: white !important; color: black !important; font-size: 10pt !important; }
  .sidebar { display: none !important; }
  .content-area { margin-left: 0 !important; }
  .top-bar { display: none !important; }
  .no-print { display: none !important; }
  .card { border: 1px solid #e2e8f0 !important; box-shadow: none !important; break-inside: avoid; }
  .page-content { padding: 0 !important; max-width: 100% !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 7pt; color: var(--primary); word-break: break-all; }
  a[href^="javascript:"]::after, a[href^="#"]::after { content: ""; }
  .fade-in, .fade-in-up, .scale-in { animation: none !important; opacity: 1 !important; }
  .stagger-1,.stagger-2,.stagger-3,.stagger-4,.stagger-5,.stagger-6 { animation: none !important; opacity: 1 !important; }
  @page { margin: 1.5cm; size: A4; }
  h2, h3 { page-break-after: avoid; }
}

/* ═══ Reduced Motion ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .animate-slide, .animate-fade, .animate-scale, .animate-glow, .animate-bounce-in { animation: none !important; }
}

/* ═══ High Contrast ═══ */
@media (prefers-contrast: more) {
  .card { border: 2px solid var(--border-medium); }
  .glass, .glass-strong { border: 2px solid var(--border-medium); }
}

/* ═══ Light Theme Overrides: Remap Tailwind dark-mode utility classes ═══ */
/* Using body.light-theme prefix for higher specificity than Tailwind CDN */

/* Text colors: white/opacity -> dark equivalents */
body.light-theme .text-white\/10 { color: #94a3b8 !important; }
body.light-theme .text-white\/15 { color: #94a3b8 !important; }
body.light-theme .text-white\/20 { color: var(--text-light) !important; }
body.light-theme .text-white\/25 { color: var(--text-light) !important; }
body.light-theme .text-white\/30 { color: var(--text-light) !important; }
body.light-theme .text-white\/40 { color: var(--text-muted) !important; }
body.light-theme .text-white\/50 { color: var(--text-muted) !important; }
body.light-theme .text-white\/60 { color: var(--text-secondary) !important; }
body.light-theme .text-white\/70 { color: var(--text-secondary) !important; }
body.light-theme .text-white\/80 { color: var(--text-primary) !important; }
body.light-theme .text-white { color: var(--text-primary) !important; }

/* Preserve real white text inside elements with dark/colored backgrounds */
body.light-theme .toast-success, body.light-theme .toast-info, body.light-theme .toast-error,
body.light-theme .badge-new, body.light-theme .badge-enhanced,
body.light-theme .grade-a, body.light-theme .grade-b, body.light-theme .grade-c,
body.light-theme .grade-d, body.light-theme .grade-f,
body.light-theme .tab-active, body.light-theme .btn-primary { color: white !important; }

/* Background: white/opacity -> dark-on-light equivalents */
body.light-theme .bg-white\/5 { background-color: var(--bg-muted) !important; }
body.light-theme .bg-white\/10 { background-color: var(--bg-hover) !important; }
body.light-theme .bg-white\/15 { background-color: #e2e8f0 !important; }
body.light-theme .bg-white\/20 { background-color: #e2e8f0 !important; }

/* Hover backgrounds */
body.light-theme .hover\:bg-white\/5:hover { background-color: var(--bg-hover) !important; }
body.light-theme .hover\:bg-white\/10:hover { background-color: var(--green-50) !important; }
body.light-theme .hover\:bg-white\/20:hover { background-color: #e2e8f0 !important; }

/* Hover text */
body.light-theme .hover\:text-white\/50:hover { color: var(--text-secondary) !important; }
body.light-theme .hover\:text-white\/60:hover { color: var(--text-secondary) !important; }
body.light-theme .hover\:text-white\/70:hover { color: var(--text-primary) !important; }

/* Borders: white/opacity -> dark-on-light equivalents */
body.light-theme .border-white\/5 { border-color: var(--border-light) !important; }
body.light-theme .border-white\/10 { border-color: var(--border-light) !important; }
body.light-theme .border-white\/15 { border-color: var(--border-medium) !important; }
body.light-theme .border-white\/20 { border-color: var(--border-medium) !important; }

/* Placeholder text */
body.light-theme .placeholder-white\/30::placeholder { color: var(--text-light) !important; }
body.light-theme .placeholder-white\/40::placeholder { color: var(--text-muted) !important; }

/* GAO Engine specific accent colors */
body.light-theme .text-gaoeng-400 { color: var(--primary) !important; }
body.light-theme .text-gaoeng-500 { color: var(--primary-light) !important; }
body.light-theme .bg-gaoeng-500 { background-color: var(--primary) !important; }
body.light-theme .bg-gaoeng-500\/10 { background-color: rgba(0, 108, 53, 0.08) !important; }
body.light-theme .bg-gaoeng-500\/20 { background-color: rgba(0, 108, 53, 0.12) !important; }
body.light-theme .bg-gaoeng-500\/30 { background-color: rgba(0, 108, 53, 0.18) !important; }
body.light-theme .hover\:bg-gaoeng-400:hover { background-color: var(--primary-lighter) !important; }
body.light-theme .hover\:bg-gaoeng-500\/20:hover { background-color: rgba(0, 108, 53, 0.16) !important; }
body.light-theme .hover\:bg-gaoeng-500\/30:hover { background-color: rgba(0, 108, 53, 0.22) !important; }
body.light-theme .text-gao-navy { color: white !important; }

/* Accent color opacity backgrounds */
body.light-theme .bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.08) !important; }
body.light-theme .bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.12) !important; }
body.light-theme .bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.08) !important; }
body.light-theme .bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.12) !important; }
body.light-theme .bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.08) !important; }
body.light-theme .bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.12) !important; }
body.light-theme .bg-green-500\/10 { background-color: rgba(34, 197, 94, 0.08) !important; }
body.light-theme .bg-green-500\/20 { background-color: rgba(34, 197, 94, 0.12) !important; }
body.light-theme .bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.08) !important; }
body.light-theme .bg-purple-500\/20 { background-color: rgba(168, 85, 247, 0.12) !important; }
body.light-theme .bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.08) !important; }
body.light-theme .bg-indigo-500\/20 { background-color: rgba(99, 102, 241, 0.12) !important; }
body.light-theme .bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.08) !important; }
body.light-theme .bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.12) !important; }
body.light-theme .bg-slate-500\/10 { background-color: rgba(100, 116, 139, 0.08) !important; }
body.light-theme .bg-slate-500\/20 { background-color: rgba(100, 116, 139, 0.12) !important; }
body.light-theme .bg-violet-500\/10 { background-color: rgba(139, 92, 246, 0.08) !important; }
body.light-theme .bg-violet-500\/20 { background-color: rgba(139, 92, 246, 0.12) !important; }
body.light-theme .bg-teal-500\/20 { background-color: rgba(20, 184, 166, 0.12) !important; }
body.light-theme .bg-cyan-500\/20 { background-color: rgba(6, 182, 212, 0.12) !important; }
body.light-theme .bg-orange-500\/20 { background-color: rgba(249, 115, 22, 0.12) !important; }
body.light-theme .bg-pink-500\/20 { background-color: rgba(236, 72, 153, 0.12) !important; }

/* Hover accent backgrounds */
body.light-theme .hover\:bg-amber-500\/20:hover { background-color: rgba(245, 158, 11, 0.18) !important; }
body.light-theme .hover\:bg-blue-500\/20:hover { background-color: rgba(59, 130, 246, 0.18) !important; }
body.light-theme .hover\:bg-blue-500\/30:hover { background-color: rgba(59, 130, 246, 0.22) !important; }
body.light-theme .hover\:bg-red-500\/20:hover { background-color: rgba(239, 68, 68, 0.18) !important; }
body.light-theme .hover\:bg-green-500\/20:hover { background-color: rgba(34, 197, 94, 0.18) !important; }
body.light-theme .hover\:bg-green-500\/30:hover { background-color: rgba(34, 197, 94, 0.22) !important; }
body.light-theme .hover\:bg-purple-500\/20:hover { background-color: rgba(168, 85, 247, 0.18) !important; }
body.light-theme .hover\:bg-purple-500\/30:hover { background-color: rgba(168, 85, 247, 0.22) !important; }
body.light-theme .hover\:bg-indigo-500\/20:hover { background-color: rgba(99, 102, 241, 0.18) !important; }
body.light-theme .hover\:bg-rose-500\/20:hover { background-color: rgba(244, 63, 94, 0.18) !important; }
body.light-theme .hover\:bg-slate-500\/20:hover { background-color: rgba(100, 116, 139, 0.18) !important; }
body.light-theme .hover\:bg-violet-500\/20:hover { background-color: rgba(139, 92, 246, 0.18) !important; }
body.light-theme .hover\:bg-teal-500\/30:hover { background-color: rgba(20, 184, 166, 0.22) !important; }
body.light-theme .hover\:bg-cyan-500\/30:hover { background-color: rgba(6, 182, 212, 0.22) !important; }

/* Select inputs, form controls on light theme */
body.light-theme select,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme input[type="month"] {
  background: var(--bg-muted) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-primary) !important;
}
body.light-theme select:focus,
body.light-theme input[type="text"]:focus,
body.light-theme input[type="number"]:focus,
body.light-theme input[type="month"]:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.1) !important;
}

/* Checkbox accent */
body.light-theme input[type="checkbox"] { accent-color: var(--primary) !important; }

/* Disabled pagination buttons */
body.light-theme .cursor-not-allowed { opacity: 0.4; }

/* ═══ Doc Finder Enhanced Table ═══ */
.ds-table-wrap { border-radius: 12px; overflow: hidden; }
.ds-doc-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }

/* Column widths */
.ds-th-num, .ds-td-num   { width: 36px; }
.ds-th-date, .ds-td-date { width: 100px; }
.ds-th-id, .ds-td-id     { width: 130px; }
.ds-th-title, .ds-td-title { width: 22%; }
.ds-th-type, .ds-td-type { width: 80px; }
.ds-th-topics, .ds-td-topics { width: 18%; }
.ds-th-brief, .ds-td-brief { width: 20%; }
.ds-th-recs, .ds-td-recs { width: 50px; }
.ds-th-status, .ds-td-status { width: 70px; }
.ds-th-link, .ds-td-link { width: 44px; }

/* Header cells */
.ds-doc-table thead .ds-th {
  padding: 10px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-muted);
  border-bottom: 2px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
  user-select: none;
}
.ds-doc-table thead .ds-th[onclick] { cursor: pointer; }
.ds-doc-table thead .ds-th[onclick]:hover { color: var(--primary); background: var(--green-50); }
.ds-th-active { color: var(--primary) !important; background: var(--green-50) !important; }

/* Body cells */
.ds-td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); vertical-align: top; }

/* Row number */
.ds-td-num { color: var(--text-light); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }

/* Date column */
.ds-td-date { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }

/* GAO ID link */
.ds-gao-id-link {
  display: inline-block;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 108, 53, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid rgba(0, 108, 53, 0.12);
  transition: all 0.15s;
  white-space: nowrap;
}
.ds-gao-id-link:hover { background: rgba(0, 108, 53, 0.14); border-color: var(--primary); }

/* Title link */
.ds-title-link {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ds-title-link:hover { color: var(--primary); }

/* Type badge */
.ds-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Topic chips container */
.ds-topics-wrap { display: flex; flex-wrap: wrap; gap: 3px; }
.ds-topic-chip {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border-light);
  transition: all 0.15s;
}
.ds-topic-chip:hover { background: var(--green-50); border-color: var(--primary); color: var(--primary); }

/* Brief text */
.ds-brief-text {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Rec badges */
.ds-rec-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ds-rec-high { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.ds-rec-mid  { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.ds-rec-low  { background: rgba(59, 130, 246, 0.05); color: #60a5fa; }
.ds-rec-none { color: var(--text-light); font-size: 10px; }

/* Status badges */
.ds-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.ds-status-open { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.ds-status-closed { background: rgba(34, 197, 94, 0.1); color: #16a34a; }

/* Link button */
.ds-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
  border: 1px solid var(--border-light);
  transition: all 0.15s;
}
.ds-link-btn:hover { background: var(--green-50); border-color: var(--primary); transform: translateY(-1px); }

/* Row hover */
.ds-tr { transition: background-color 0.15s; }
.ds-tr:hover { background: var(--green-50); }
.ds-tr-priority { background: rgba(245, 158, 11, 0.03); }
.ds-tr-priority:hover { background: rgba(245, 158, 11, 0.07); }

/* Zebra striping */
.ds-doc-table tbody .ds-tr:nth-child(even) { background: rgba(0, 0, 0, 0.01); }
.ds-doc-table tbody .ds-tr:nth-child(even):hover { background: var(--green-50); }
.ds-doc-table tbody .ds-tr-priority:nth-child(even) { background: rgba(245, 158, 11, 0.04); }

/* Responsive: on smaller screens scroll horizontally, but keep a minimum readable size */
@media (max-width: 1200px) {
  .ds-doc-table { table-layout: auto; min-width: 900px; }
  .ds-th-brief, .ds-td-brief { display: none; }
}
@media (max-width: 768px) {
  .ds-doc-table { min-width: 700px; }
  .ds-th-topics, .ds-td-topics { display: none; }
}

/* ═══ Global Transitions ═══ */
* { transition-property: color, background-color, border-color, opacity; transition-duration: 0.1s; }
canvas, svg, .animate-spin, input[type="range"] { transition: none; }
a, button, input, select { transition: all 0.2s ease; }
input:focus, select:focus { border-color: var(--primary); outline: none; }
