/* TrafficFlow Dossier: Unified Movement Intelligence
   Direction: High-reliability traffic operations center & industrial mobility grid.
   Color motif: Obsidian/Slate ground, signal emerald (#059669 / #10B981), cyan telemetry (#0284C7 / #06B6D4),
   amber caution (#D97706 / #F59E0B), and crimson enforcement (#DC2626 / #EF4444). */

:root {
  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #E2E8F0;
  --ink: #0F172A;
  --ink-2: #334155;
  --ink-3: #64748B;
  --line: #CBD5E1;
  --line-2: #E2E8F0;
  
  --brand: #059669;
  --brand-light: #10B981;
  --brand-soft: #ECFDF5;
  --brand-glow: rgba(16, 185, 129, 0.25);
  
  --cyan: #0284C7;
  --cyan-soft: #F0F9FF;
  --amber: #D97706;
  --amber-soft: #FFFBEB;
  --crimson: #DC2626;
  --crimson-soft: #FEF2F2;
  
  --monitor: #090E17;
  --monitor-panel: #111C2B;
  --monitor-ink: #E2E8F0;
  
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-full: 9999px;
  
  --wrap: 1280px;
  --gutter: clamp(16px, 3.5vw, 36px);
  --f: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --f-bn: 'Noto Sans Bengali', 'Inter', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #090E17;
  --surface: #101B2B;
  --surface-2: #162438;
  --surface-3: #22344D;
  --ink: #F1F5F9;
  --ink-2: #94A3B8;
  --ink-3: #64748B;
  --line: #22344D;
  --line-2: #19273C;
  
  --brand: #10B981;
  --brand-light: #34D399;
  --brand-soft: #064E3B;
  --brand-glow: rgba(16, 185, 129, 0.35);
  
  --cyan: #38BDF8;
  --cyan-soft: #082F49;
  --amber: #FBBF24;
  --amber-soft: #451A03;
  --crimson: #F87171;
  --crimson-soft: #450A0A;
  
  --monitor: #04070C;
  --monitor-panel: #0C1523;
  --monitor-ink: #F1F5F9;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f); font-size: 15px; line-height: 1.55;
  overflow-x: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
:lang(bn), .bn { font-family: var(--f-bn); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-light); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { margin-top: clamp(48px, 6vw, 80px); }

/* Typography */
.display {
  font-size: clamp(32px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.025em;
  font-weight: 800; margin: 12px 0 20px; text-wrap: balance;
}
.h1 { font-size: clamp(26px, 3.6vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
.h2 { font-size: clamp(20px, 2.4vw, 30px); line-height: 1.2; font-weight: 750; letter-spacing: -0.015em; margin: 0 0 12px; }
.h3 { font-size: 17px; line-height: 1.3; font-weight: 700; margin: 0 0 6px; }
.sub { color: var(--ink-2); max-width: 72ch; margin: 0 0 24px; font-size: 16px; line-height: 1.55; }
.lede { font-size: clamp(16px, 1.35vw, 19px); color: var(--ink-2); max-width: 65ch; margin: 0 0 24px; line-height: 1.55; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 8px;
}
.kicker::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
}

/* Badges & Tags */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-emerald { background: var(--brand-soft); color: var(--brand); border-color: rgba(16,185,129,0.3); }
.badge-cyan { background: var(--cyan-soft); color: var(--cyan); border-color: rgba(2,132,199,0.3); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(217,119,6,0.3); }
.badge-crimson { background: var(--crimson-soft); color: var(--crimson); border-color: rgba(220,38,38,0.3); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-full); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-solid { background: var(--brand); color: #FFFFFF; box-shadow: 0 2px 8px var(--brand-glow); }
.btn-solid:hover { background: var(--brand-light); color: #FFFFFF; transform: translateY(-1px); }
.btn-cyan { background: var(--cyan); color: #FFFFFF; }
.btn-cyan:hover { filter: brightness(1.1); color: #FFFFFF; }
.btn-line { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-2); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-2); }

/* Top Navigation Bar - 2-Row Responsive Layout to fit all tabs */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; flex-direction: column; gap: 8px;
  padding: 10px var(--gutter) 8px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.topbar-main {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 195px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}
.brand:hover .brand-logo-img {
  transform: scale(1.02);
}

.hero-brand-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.hero-brand-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.hero-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}
.hero-brand-pill {
  font-size: 11.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.footer-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Theme-aware logo toggling */
.logo-dark { display: none !important; }
.logo-light { display: block !important; }

:root[data-theme="dark"] .logo-light {
  display: none !important;
}
:root[data-theme="dark"] .logo-dark {
  display: block !important;
}

.tabs-nav, .tabs {
  width: 100%; display: flex; align-items: center; justify-content: center;
}
.tabs-track {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 5px; width: 100%; padding: 1px 0;
}
.tab {
  flex: none; padding: 5.5px 13px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: all 0.15s;
  border: 1px solid transparent; background: transparent;
}
.tab:hover {
  color: var(--ink); background: var(--surface-2); border-color: var(--line);
}
.tab.active {
  background: var(--brand); color: #FFFFFF; box-shadow: 0 2px 8px var(--brand-glow);
  border-color: transparent;
}

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

/* Dropdown */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 60; display: flex; flex-direction: column; gap: 4px;
}
.dropdown-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding: 6px 10px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; transition: background 0.15s;
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-icon { font-size: 18px; flex: none; width: 28px; text-align: center; }
.dropdown-text b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.dropdown-text small { font-size: 11.5px; color: var(--ink-2); display: block; line-height: 1.25; }

/* Hero section */
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 48px);
  align-items: center; padding: clamp(24px, 4vw, 48px) 0 20px;
}
.hero-copy { max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); margin-top: 10px;
}
.stat-box { display: flex; flex-direction: column; }
.stat-box .val { font-size: clamp(22px, 2.5vw, 30px); font-weight: 800; color: var(--ink); font-family: var(--f-mono); line-height: 1.1; }
.stat-box .lbl { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-top: 3px; }

/* Camera Wall & Simulated Pipeline */
.cam-wall {
  background: var(--monitor); border-radius: var(--r-lg); border: 1px solid #1E293B;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,0.4); overflow: hidden; display: flex; flex-direction: column;
}
.cam-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--monitor-panel); border-bottom: 1px solid #1E293B; color: #94A3B8; font-size: 12.5px; font-family: var(--f-mono);
}
.cam-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #34D399; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; box-shadow: 0 0 10px #10B981; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }

.cam-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #000; padding: 3px;
}
.cam-cell {
  position: relative; aspect-ratio: 16/9; background: #0F172A; overflow: hidden;
}
.cam-cell img { width: 100%; height: 100%; object-fit: cover; }
.cam-overlay {
  position: absolute; inset: 0; padding: 8px 10px; display: flex; flex-direction: column;
  justify-content: space-between; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 40%, rgba(0,0,0,0.7) 100%);
}
.cam-meta { font-family: var(--f-mono); font-size: 10.5px; color: #E2E8F0; text-shadow: 0 1px 2px #000; }
.cam-tag {
  align-self: flex-start; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700;
  font-family: var(--f-mono); background: rgba(16, 185, 129, 0.25); color: #34D399; border: 1px solid rgba(16,185,129,0.4);
}
.cam-bbox {
  position: absolute; border: 1.5px solid var(--brand-light); border-radius: 2px;
  box-shadow: 0 0 8px rgba(16,185,129,0.5); pointer-events: none;
}
.cam-bbox-lbl {
  position: absolute; top: -16px; left: -1px; background: var(--brand); color: #FFF;
  font-family: var(--f-mono); font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 2px; white-space: nowrap;
}

.cam-pipeline-rail {
  background: var(--monitor-panel); padding: 10px 16px; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; border-top: 1px solid #1E293B; font-family: var(--f-mono); font-size: 11.5px;
}
.rail-step { display: flex; flex-direction: column; gap: 2px; }
.rail-k { color: #64748B; font-size: 10px; text-transform: uppercase; font-weight: 700; }
.rail-v { color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Standard Section Cards */
.card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--line); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Interactive Simulator Boxes */
.sim-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.sim-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.sim-output {
  background: var(--monitor); border-radius: var(--r-md); padding: 16px; color: var(--monitor-ink);
  font-family: var(--f-mono); font-size: 13px; line-height: 1.5; border: 1px solid #1E293B;
}

/* Chat Assistant Panel */
.chat-container {
  display: grid; grid-template-columns: 280px 1fr; gap: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 540px;
}
.chat-sidebar {
  background: var(--surface-2); border-right: 1px solid var(--line-2); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-sidebar h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 6px; }
.prompt-chip {
  padding: 8px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-align: left; transition: all 0.15s; line-height: 1.35;
}
.prompt-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.chat-main { display: flex; flex-direction: column; height: 100%; }
.chat-log { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.chat-msg.user { align-self: flex-end; }
.chat-msg.agent { align-self: flex-start; }
.chat-bubble {
  padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5;
}
.chat-msg.user .chat-bubble { background: var(--brand); color: #FFF; border-bottom-right-radius: 4px; }
.chat-msg.agent .chat-bubble { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.chat-meta { font-size: 11px; color: var(--ink-3); font-family: var(--f-mono); }
.chat-input-bar {
  padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; background: var(--surface);
}
.chat-input {
  flex: 1; padding: 10px 16px; border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 14px; color: var(--ink);
}
.chat-input:focus { border-color: var(--brand); background: var(--surface); }

/* Chat Attachments Grid */
.chat-attachments-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px;
}
.chat-attach-card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  overflow: hidden; cursor: pointer; transition: all 0.16s ease; display: flex; flex-direction: column;
}
.chat-attach-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); }
.chat-attach-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.chat-attach-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.chat-attach-info .title { font-size: 11.5px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.chat-attach-info .meta { font-size: 10.5px; color: var(--ink-3); font-family: var(--f-mono); display: flex; justify-content: space-between; }
.chat-attach-info .tag { font-size: 10px; color: var(--brand); font-weight: 600; text-transform: uppercase; }

/* Prosecution Notice Replica */
.prosecution-notice {
  background: #FFFFFF; color: #1E293B; border: 2px solid #0F172A; border-radius: var(--r-md);
  padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow-lg); max-width: 840px; margin: 0 auto;
  font-family: 'Inter', sans-serif;
}
.notice-header {
  text-align: center; border-bottom: 2px solid #0F172A; padding-bottom: 16px; margin-bottom: 20px;
}
.gov-emblem { width: 54px; height: 54px; margin: 0 auto 8px; }
.notice-title { font-size: 18px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; margin: 0; color: #0F172A; }
.notice-sub { font-size: 12px; color: #475569; margin: 2px 0 0; }
.notice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.notice-item { font-size: 13px; line-height: 1.4; }
.notice-item b { color: #0F172A; display: block; font-size: 11px; text-transform: uppercase; color: #64748B; }
.evidence-photo-box {
  background: #0F172A; border-radius: 6px; overflow: hidden; position: relative; aspect-ratio: 16/9;
}
.evidence-photo-box img { width: 100%; height: 100%; object-fit: cover; }

/* Filter Table */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; font-family: var(--f-mono); }
.data-table th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); white-space: nowrap; }
.data-table tr:hover td { background: var(--surface-2); cursor: pointer; }

/* Fullscreen Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 18, 0.82);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-dialog {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  max-width: 1040px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
}
.modal-body { padding: 22px; }

/* ROI Calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.slider-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.slider-header { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.slider-header span:last-child { color: var(--brand); font-family: var(--f-mono); }
input[type=range] { width: 100%; accent-color: var(--brand); }

/* Scientific Paper Callout */
.science-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r-lg);
  padding: 24px; display: flex; gap: 20px; align-items: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .chat-container { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .cam-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
}

/* =========================================================================
   SEMANTIC SEARCH STYLES
   ========================================================================= */
.search-console {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.search-input-group {
  display: flex; gap: 12px; margin-bottom: 16px; align-items: stretch;
}
.search-main-input {
  flex: 1; padding: 12px 18px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface-2); font-size: 15px; color: var(--ink); font-weight: 500;
  transition: all 0.15s;
}
.search-main-input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-glow); }

.search-filters-row {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13px;
}
.seg-btn-group {
  display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: var(--r-md);
  border: 1px solid var(--line-2);
}
.seg-btn {
  padding: 6px 14px; border-radius: calc(var(--r-md) - 3px); font-size: 12.5px; font-weight: 600;
  border: none; background: transparent; color: var(--ink-2); cursor: pointer; transition: all 0.15s;
}
.seg-btn.active {
  background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 700;
}

.search-results-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px;
}
.search-card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column;
}
.search-card:hover {
  transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow);
}
.search-card-img {
  position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden;
}
.search-card-img img { width: 100%; height: 100%; object-fit: cover; }
.search-match-badge {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 800; font-family: var(--f-mono);
  background: rgba(16, 185, 129, 0.9); color: #FFF; backdrop-filter: blur(4px);
}
.search-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* =========================================================================
   ENHANCED REPORTS & DOCUMENT VIEWER STYLES
   ========================================================================= */
.report-builder-layout {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: start;
}
@media (max-width: 1024px) {
  .report-builder-layout { grid-template-columns: 1fr; }
}

.report-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
}
@media (max-width: 640px) {
  .report-type-grid { grid-template-columns: 1fr; }
}
.report-type-card {
  border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 12px 14px;
  background: var(--surface); cursor: pointer; transition: all 0.15s; display: flex;
  flex-direction: column; gap: 4px; position: relative;
}
.report-type-card:hover { border-color: var(--brand); background: var(--surface-2); }
.report-type-card.active {
  border-color: var(--brand); background: var(--brand-soft);
}
.report-type-card input[type="radio"] { position: absolute; opacity: 0; }
.report-type-card .title { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.report-type-card .meta { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }
.report-type-card .badge-mini {
  align-self: flex-start; font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; text-transform: uppercase; margin-top: 4px;
}

.report-gallery-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px;
}
@media (max-width: 1024px) {
  .report-gallery-row { grid-template-columns: repeat(2, 1fr); }
}
.report-doc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all 0.18s; cursor: pointer;
  display: flex; flex-direction: column;
}
.report-doc-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-lg); }
.report-doc-thumbnail {
  aspect-ratio: 1/1.28; background: #E2E8F0; overflow: hidden; position: relative; border-bottom: 1px solid var(--line-2);
}
.report-doc-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.report-doc-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.report-doc-info b { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.report-doc-info small { font-size: 11.5px; color: var(--ink-2); }

/* Document Modal Paper Style & Interactive Document Renderer */
.doc-modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.doc-view-tabs {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  padding: 3px; border-radius: var(--r-md);
}
.doc-view-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: all 0.15s;
}
.doc-view-btn.active {
  background: var(--brand); color: #FFF; box-shadow: 0 1px 4px var(--brand-glow);
}
.doc-actions-group {
  display: flex; align-items: center; gap: 8px;
}

.doc-sheet {
  background: #FFF; color: #0F172A; padding: clamp(24px, 4vw, 44px); border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 960px; margin: 0 auto; line-height: 1.55;
}
.doc-sheet[lang="bn"] {
  font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Inter', sans-serif;
}
.doc-sheet h1, .doc-sheet h2, .doc-sheet h3 { color: #0F172A; }
.doc-sheet-header {
  border-bottom: 2px solid #0F172A; padding-bottom: 16px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
}
.doc-logo-emblem {
  width: 48px; height: 48px; object-fit: contain; flex: none;
}
.doc-authority {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: #64748B; margin-bottom: 4px;
}
.doc-title {
  font-size: 21px; font-weight: 800; color: #0F172A; margin: 0 0 4px; line-height: 1.25;
}
.doc-subtitle {
  font-size: 13px; font-weight: 500; color: #475569;
}
.doc-meta-strip {
  display: flex; flex-wrap: wrap; gap: 14px; background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 6px; padding: 10px 14px; font-size: 12px; color: #334155; margin-bottom: 20px;
}
.doc-meta-strip span b { color: #0F172A; }
.doc-section-h2 {
  font-size: 14px; font-weight: 800; color: #0F172A; text-transform: uppercase;
  letter-spacing: 0.04em; margin: 22px 0 10px; padding-bottom: 5px;
  border-bottom: 1.5px solid #CBD5E1; display: flex; align-items: center; justify-content: space-between;
}
.doc-prose {
  font-size: 13.5px; color: #334155; line-height: 1.65; margin: 0 0 14px;
}
.doc-kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0;
}
.doc-kpi-card {
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 6px; padding: 12px;
  display: flex; flex-direction: column;
}
.doc-kpi-card .lbl {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: #64748B; letter-spacing: 0.04em;
}
.doc-kpi-card .num {
  font-size: 21px; font-weight: 800; color: #0F172A; font-family: var(--f-mono); margin-top: 4px;
}
.doc-kpi-card .sub {
  font-size: 11px; color: #059669; font-weight: 600; margin-top: 2px;
}
.doc-chart-container {
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 6px; padding: 16px; margin: 16px 0;
}
.doc-chart-caption {
  font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 10px;
  display: flex; justify-content: space-between;
}
.doc-evidence-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin: 16px 0;
}
.doc-evidence-figure {
  margin: 0; border: 1px solid #CBD5E1; border-radius: 6px; overflow: hidden; background: #0F172A;
}
.doc-evidence-figure img {
  width: 100%; height: auto; display: block;
}
.doc-evidence-caption {
  background: #F1F5F9; color: #334155; padding: 8px 10px; font-size: 11.5px;
  border-top: 1px solid #E2E8F0; display: flex; justify-content: space-between; align-items: center;
}
.doc-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin: 14px 0; border: 1px solid #CBD5E1;
}
.doc-table th {
  background: #F1F5F9; color: #1E293B; font-weight: 700; text-align: left; padding: 8px 10px;
  border-bottom: 2px solid #CBD5E1;
}
.doc-table td {
  padding: 7px 10px; border-bottom: 1px solid #E2E8F0; color: #334155;
}
.doc-table tr:nth-child(even) td { background: #F8FAFC; }
.doc-plate-pill {
  display: inline-block; background: #0F172A; color: #38BDF8; font-family: var(--f-mono);
  font-weight: 700; padding: 2px 7px; border-radius: 4px; font-size: 11px;
}
.doc-actions-list {
  padding-left: 20px; margin: 12px 0; font-size: 13px; color: #334155; line-height: 1.6;
}
.doc-actions-list li { margin-bottom: 6px; }
.doc-seal-block {
  display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid #CBD5E1;
  padding-top: 16px; margin-top: 26px; font-size: 11.5px; color: #64748B;
}
.doc-seal-badge { display: flex; align-items: center; gap: 10px; }
.doc-seal-qr { width: 56px; height: 56px; border: 1px solid #CBD5E1; padding: 2px; background: #FFF; }

@media (max-width: 768px) {
  .doc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-evidence-grid { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden !important; }
  .modal-backdrop, .modal-dialog, .doc-sheet, .doc-sheet * { visibility: visible !important; }
  .modal-backdrop { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; padding: 0 !important; background: #FFF !important; }
  .modal-header, .doc-modal-bar { display: none !important; }
  .doc-sheet { box-shadow: none !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
}

/* Phone Mockup & Dispatch Matrix */
.report-side { display: flex; flex-direction: column; gap: 20px; }
.route-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.route-tbl th, .route-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: center; }
.route-tbl th:first-child, .route-tbl td:first-child { text-align: left; }
.on-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 8px var(--brand-glow); vertical-align: middle; }
.off-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; vertical-align: middle; }
.route-btn { border: 0; background: none; padding: 4px; cursor: pointer; }
.phone-mockup { width: 280px; margin: 0 auto; border-radius: 36px; padding: 12px; background: #0F172A; box-shadow: var(--shadow-lg); border: 2px solid #334155; }
.phone-notch { width: 96px; height: 18px; background: #000; border-radius: 0 0 12px 12px; margin: -12px auto 6px; }
.phone-screen { height: 390px; border-radius: 26px; background: linear-gradient(165deg, #064E3B, #0F172A 70%); padding: 16px 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.phone-time { color: #FFF; text-align: center; font-size: 36px; font-weight: 300; margin-bottom: 2px; font-family: var(--f-mono); }
.phone-date { color: #A7F3D0; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.05em; }
.push-card { background: rgba(255, 255, 255, 0.92); color: #0F172A; border-radius: 12px; padding: 10px; font-size: 11.5px; display: grid; grid-template-columns: 1fr 52px; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.push-card b { display: block; font-size: 12px; color: #0F172A; }
.push-card small { color: #64748B; display: block; margin-bottom: 2px; font-size: 10px; }
.push-card img { width: 52px; height: 42px; object-fit: cover; border-radius: 6px; }
.progress-bar { height: 6px; background: var(--line-2); border-radius: 3px; margin-top: 14px; overflow: hidden; }
.progress-bar div { height: 100%; width: 0%; background: var(--brand); transition: width 0.2s ease; }


