﻿/* ============================================================
   FinScan AI — Global Design System
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Base Colors */
  --bg-primary:     #080C18;
  --bg-secondary:   #0D1225;
  --bg-card:        #111827;
  --bg-card-hover:  #162035;
  --bg-glass:       rgba(17, 24, 39, 0.7);

  /* Accent Colors */
  --blue:           #4F8EF7;
  --blue-dark:      #2563EB;
  --blue-glow:      rgba(79, 142, 247, 0.25);
  --purple:         #7C3AED;
  --purple-glow:    rgba(124, 58, 237, 0.2);
  --cyan:           #06B6D4;

  /* Status Colors */
  --green:          #10B981;
  --green-glow:     rgba(16, 185, 129, 0.2);
  --amber:          #F59E0B;
  --amber-glow:     rgba(245, 158, 11, 0.2);
  --orange:         #F97316;
  --orange-glow:    rgba(249, 115, 22, 0.2);
  --red:            #EF4444;
  --red-glow:       rgba(239, 68, 68, 0.2);
  --red-dark:       #DC2626;

  /* Text */
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;
  --text-accent:    #4F8EF7;

  /* Borders */
  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(79,142,247,0.3);
  --border-glow:    rgba(79,142,247,0.5);

  /* Gradients */
  --grad-blue:      linear-gradient(135deg, #4F8EF7, #7C3AED);
  --grad-danger:    linear-gradient(135deg, #EF4444, #F97316);
  --grad-safe:      linear-gradient(135deg, #10B981, #06B6D4);
  --grad-amber:     linear-gradient(135deg, #F59E0B, #F97316);
  --grad-hero:      linear-gradient(135deg, #080C18 0%, #0D1225 50%, #111827 100%);

  /* Spacing */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-blue:    0 0 30px rgba(79,142,247,0.15);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 60px rgba(79,142,247,0.08);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 3px; }

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: 'Inter', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
p  { color: var(--text-secondary); }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrapper { display: flex; min-height: 100vh; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8,12,24,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.2rem;
}
.nav-brand .logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-card); color: var(--text-primary);
}
.nav-cta {
  background: var(--grad-blue); border: none;
  padding: 9px 20px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 600; color: #fff;
  transition: all 0.2s;
}
.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── Sidebar (Dashboard Layout) ─────────────────────────── */
.sidebar {
  width: 240px; min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed; top: 64px; left: 0; bottom: 0;
  padding: 24px 12px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.sidebar-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 16px 12px 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s; cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
}
.sidebar-item:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-item.active { background: var(--blue-glow); color: var(--blue); }
.sidebar-item .icon { font-size: 1rem; width: 20px; text-align: center; }

.main-content {
  margin-left: 240px;
  margin-top: 64px;
  padding: 32px;
  flex: 1;
  min-height: calc(100vh - 64px);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
}
.card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-blue); }
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-full);
  font-size: 0.95rem; font-weight: 600; border: none;
  transition: all 0.25s; cursor: pointer;
}
.btn-primary {
  background: var(--grad-blue); color: #fff;
  box-shadow: 0 4px 20px rgba(79,142,247,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79,142,247,0.4); }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-accent); background: var(--bg-card); }
.btn-danger { background: var(--grad-danger); color: #fff; }
.btn-success { background: var(--grad-safe); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

@keyframes pulseGlow {
  0%,100% { box-shadow: 0 4px 20px rgba(79,142,247,0.3); }
  50%      { box-shadow: 0 6px 32px rgba(79,142,247,0.6), 0 0 16px rgba(79,142,247,0.4); }
}
.animate-pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }
.animate-pulse-glow:disabled { animation: none; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green  { background: var(--green-glow);  color: var(--green);  }
.badge-amber  { background: var(--amber-glow);  color: var(--amber);  }
.badge-orange { background: var(--orange-glow); color: var(--orange); }
.badge-red    { background: var(--red-glow);    color: var(--red);    }
.badge-blue   { background: var(--blue-glow);   color: var(--blue);   }
.badge-purple { background: var(--purple-glow); color: var(--purple); }

/* ── Risk Meter ─────────────────────────────────────────── */
.risk-meter-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.risk-meter-svg { width: 100%; height: 100%; }
.risk-label { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); text-align: center; }
.risk-score-text { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 800; }
.risk-level-text { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-wrap { margin-bottom: 16px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.progress-bar {
  height: 8px; background: var(--border);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
  background: var(--grad-blue);
}

/* ── Alert / Trap Cards ─────────────────────────────────── */
.trap-card {
  border-radius: var(--radius-md); padding: 18px;
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(239,68,68,0.06) 0%, var(--bg-card) 100%);
  margin-bottom: 12px; transition: all 0.25s;
}
.trap-card:hover { transform: translateX(4px); }
.trap-card.severity-critical { border-left-color: var(--red); }
.trap-card.severity-high     { border-left-color: var(--orange); background: linear-gradient(90deg, rgba(249,115,22,0.06) 0%, var(--bg-card) 100%); }
.trap-card.severity-medium   { border-left-color: var(--amber); background: linear-gradient(90deg, rgba(245,158,11,0.06) 0%, var(--bg-card) 100%); }
.trap-card.severity-low      { border-left-color: var(--green); background: linear-gradient(90deg, rgba(16,185,129,0.06) 0%, var(--bg-card) 100%); }
.trap-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.trap-legal { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-muted); background: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: var(--radius-sm); margin: 8px 0; }
.trap-plain { font-size: 0.9rem; color: var(--text-secondary); }
.trap-impact { font-size: 0.85rem; color: var(--amber); margin-top: 6px; }
.trap-advice { font-size: 0.85rem; color: var(--green); margin-top: 4px; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  text-align: center;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue);
  background: rgba(79,142,247,0.05);
  box-shadow: 0 0 40px rgba(79,142,247,0.15);
}
.upload-icon { font-size: 3rem; margin-bottom: 16px; }
.upload-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.3rem; margin-bottom: 8px; }
.upload-subtitle { color: var(--text-muted); font-size: 0.9rem; }
.upload-formats { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.upload-format-tag {
  padding: 4px 12px; border-radius: var(--radius-full);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Stat Card ───────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  position: relative; overflow: hidden;
  transition: all 0.3s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-blue);
}
.stat-card.danger::before { background: var(--grad-danger); }
.stat-card.safe::before { background: var(--grad-safe); }
.stat-card.amber::before { background: var(--grad-amber); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-family: 'Inter', sans-serif; font-size: 1.6rem; font-weight: 800; }
.stat-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Section Header ─────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ── Toggle / Switch ─────────────────────────────────────── */
.mode-toggle {
  display: flex; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-full); padding: 4px;
}
.mode-btn {
  padding: 8px 16px; border-radius: var(--radius-full); border: none;
  background: none; color: var(--text-muted); font-size: 0.85rem; font-weight: 600;
  transition: all 0.2s; cursor: pointer;
}
.mode-btn.active { background: var(--blue); color: #fff; }

/* ── Chat Bubble ─────────────────────────────────────────── */
.chat-bubble { max-width: 80%; padding: 14px 18px; border-radius: 16px; margin-bottom: 12px; }
.chat-bubble.user { background: var(--blue); margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.ai { background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-bubble p { color: var(--text-primary); font-size: 0.9rem; margin: 0; }

/* ── Grid Layouts ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* ── Loading States ─────────────────────────────────────── */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(79,142,247,0.2); }
  50%       { box-shadow: 0 0 40px rgba(79,142,247,0.4); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes counter { from { opacity: 0; } to { opacity: 1; } }

.animate-fade-up   { animation: fadeInUp 0.6s ease forwards; }
.animate-fade-in   { animation: fadeIn 0.4s ease forwards; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-float     { animation: float 4s ease-in-out infinite; }

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .main-content { padding: 16px; }
  .card { padding: 16px; }
  .btn { padding: 10px 18px; }
}

/* ── Toast Notification ─────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 280px; padding: 14px 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 10px;
  animation: fadeInUp 0.3s ease forwards;
  font-size: 0.9rem;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ── Gradient Text ───────────────────────────────────────── */
.grad-text {
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-text-danger {
  background: var(--grad-danger);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Google Translate Custom Styling ─────────────────────── */
#google_translate_element {
  display: flex;
  align-items: center;
}

.goog-te-gadget {
  font-family: 'Inter', sans-serif !important;
  color: transparent !important;
  font-size: 0 !important;
}

.goog-te-gadget .goog-te-combo {
  font-family: 'Inter', sans-serif !important;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
}

.goog-te-gadget .goog-te-combo:hover, .goog-te-gadget .goog-te-combo:focus {
  border-color: var(--blue);
  background: var(--bg-card);
}

/* Hide the annoying Google Translate banner */
body { top: 0 !important; }
.skiptranslate iframe { display: none !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ============================================================
   FinScan AI — Interactive Reader & Highlighting Styles
   ============================================================ */

/* Document Reader Split Pane Layout */
.reader-container {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  margin-top: 16px;
  align-items: start;
}

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

.reader-doc-pane {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-height: 700px;
  overflow-y: auto;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  position: relative;
}

.reader-sidebar-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Beautiful Interactive Mark Highlights */
.highlight-mark {
  background-color: var(--highlight-bg, rgba(79, 142, 247, 0.2));
  color: var(--text-primary);
  border-bottom: 2px solid var(--highlight-border, var(--blue));
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.highlight-mark:hover {
  background-color: var(--highlight-bg-hover, rgba(79, 142, 247, 0.3));
  box-shadow: 0 0 12px var(--highlight-glow, rgba(79, 142, 247, 0.25));
}

/* Severity Theme Variables */
.highlight-mark.severity-critical {
  --highlight-bg: rgba(239, 68, 68, 0.18);
  --highlight-bg-hover: rgba(239, 68, 68, 0.28);
  --highlight-border: var(--red);
  --highlight-glow: rgba(239, 68, 68, 0.35);
}

.highlight-mark.severity-high {
  --highlight-bg: rgba(249, 115, 22, 0.18);
  --highlight-bg-hover: rgba(249, 115, 22, 0.28);
  --highlight-border: var(--orange);
  --highlight-glow: rgba(249, 115, 22, 0.35);
}

.highlight-mark.severity-medium {
  --highlight-bg: rgba(245, 158, 11, 0.18);
  --highlight-bg-hover: rgba(245, 158, 11, 0.28);
  --highlight-border: var(--amber);
  --highlight-glow: rgba(245, 158, 11, 0.35);
}

.highlight-mark.severity-low {
  --highlight-bg: rgba(16, 185, 129, 0.18);
  --highlight-bg-hover: rgba(16, 185, 129, 0.28);
  --highlight-border: var(--green);
  --highlight-glow: rgba(16, 185, 129, 0.35);
}

/* Glassmorphic Live Details Card on Sidebar */
.reader-detail-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  min-height: 220px;
}

.reader-detail-card.active {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-blue);
}

/* PDF Export Print Template Styling */
.pdf-print-container {
  padding: 40px;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
  max-width: 800px;
  margin: 0 auto;
}

.pdf-header {
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-title-brand {
  font-size: 24px;
  font-weight: 800;
  color: #1e3a8a;
}

.pdf-section {
  margin-bottom: 30px;
}

.pdf-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e3a8a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdf-grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.pdf-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.pdf-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.pdf-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.pdf-doc-body {
  font-size: 12px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
}

.pdf-highlight {
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
}

.pdf-highlight.severity-critical { background: #fee2e2; border-bottom: 2px solid #ef4444; color: #991b1b; }
.pdf-highlight.severity-high     { background: #ffedd5; border-bottom: 2px solid #f97316; color: #9a3412; }
.pdf-highlight.severity-medium   { background: #fef3c7; border-bottom: 2px solid #f59e0b; color: #92400e; }
.pdf-highlight.severity-low      { background: #d1fae5; border-bottom: 2px solid #10b981; color: #065f46; }

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 11px;
}

.pdf-table th, .pdf-table td {
  border: 1px solid #e2e8f0;
  padding: 10px;
  text-align: left;
}

.pdf-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

.pdf-footer {
  text-align: center;
  font-size: 10px;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  padding-top: 15px;
  margin-top: 40px;
}

/* ============================================================
   FinScan AI — Premium Light Theme & Input Overrides
   ============================================================ */
[data-theme="light"] {
  --bg-primary:     #F8FAFC;
  --bg-secondary:   #F1F5F9;
  --bg-card:        #FFFFFF;
  --bg-card-hover:  #E2E8F0;
  --bg-glass:       rgba(255, 255, 255, 0.85);

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #64748B;
  --text-accent:    #2563EB;

  --border:         rgba(15, 23, 42, 0.08);
  --border-accent:  rgba(37, 99, 235, 0.2);
  --border-glow:    rgba(37, 99, 235, 0.4);

  --grad-hero:      linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 50%, #E2E8F0 100%);
  --shadow-card:    0 10px 30px rgba(15, 23, 42, 0.05);
  --shadow-blue:    0 0 20px rgba(37, 99, 235, 0.1);
  --blue-glow:      rgba(37, 99, 235, 0.1);
}

[data-theme="light"] input, 
[data-theme="light"] select, 
[data-theme="light"] textarea {
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
}

[data-theme="light"] input::placeholder {
  color: #94A3B8 !important;
}

/* Specific component fixes for light mode */
[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .sidebar {
  background: #F1F5F9 !important;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .sidebar-item.active {
  background: #FFFFFF !important;
  border-color: var(--blue) !important;
}

[data-theme="light"] .month-box {
  background: #FFFFFF !important;
}

[data-theme="light"] .stat-card {
  background: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .trap-card {
  background: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.theme-toggle-btn:hover {
  border-color: var(--blue);
  background: var(--bg-card-hover);
  transform: rotate(15deg) scale(1.05);
  box-shadow: var(--shadow-blue);
}



