/**
 * SurplusFinder Master Stylesheet (Baseline-UI Anti-AI Slop Standards)
 * Sovereign royal blue dark theme: Obsidian navy (#060e22), royal blue (#2563eb / #3b82f6), crisp slate borders.
 */

:root {
  --bg-app: #050b1a;
  --bg-surface: #0b152d;
  --bg-card: #0f1c3b;
  --bg-card-hover: #132349;
  --bg-sidebar: #060e24;
  --border-color: #1d2d54;
  --border-subtle: #162242;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-royal: #2563eb;
  --accent-royal-bright: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #a855f7;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-mono { font-family: var(--font-mono); }
.text-royal { color: var(--accent-royal-bright) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-crimson { color: var(--accent-crimson) !important; }
.font-bold { font-weight: 700; }

.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.app-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.brand-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-royal-bright);
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 2px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 12px;
  margin-bottom: 6px;
  padding-left: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-tab.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

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

.nav-text {
  flex: 1;
}

.nav-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Sidebar Sponsor Placement */
.sidebar-sponsor-box {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-top: auto;
  margin-bottom: 12px;
}

.sponsor-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 4px;
}

.sidebar-sponsor-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.sidebar-sponsor-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.btn-sponsor {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-royal-bright);
  text-decoration: none;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-royal-bright);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

/* Main Workspace */
.app-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--bg-app);
  overflow: hidden;
}

.top-telemetry-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.telemetry-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.telemetry-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
}

.telemetry-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tab Switcher in Main Area */
.view-switcher-bar {
  background: #081126;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.view-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.view-btn.active {
  background: var(--bg-card);
  border-color: var(--accent-royal-bright);
  color: #ffffff;
}

.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Search Card */
.search-bar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #060e22;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 14px;
}

.search-icon {
  font-size: 16px;
  color: var(--text-dim);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.search-filters-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-select, .form-input {
  background: #060e22;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
}

.form-input {
  width: 100%;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-royal-bright);
}

/* Table Container */
.table-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

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

.table-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.table-sub-note {
  font-size: 11px;
  color: var(--text-dim);
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background: #081126;
  color: var(--text-muted);
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.blurred-owner {
  filter: blur(4px);
  user-select: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Badges & Chips */
.badge-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-lead { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid #475569; }
.badge-contacted { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid #3b82f6; }
.badge-contract { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid #f59e0b; }
.badge-filed { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid #a855f7; }
.badge-disbursed { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid #10b981; }

.dnc-badge-clean {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 9px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
}

.btn-action-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Buttons */
.btn-royal {
  background: var(--accent-royal);
  color: #ffffff;
  border: 1px solid #1d4ed8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-royal:hover {
  background: var(--accent-royal-bright);
}

.btn-emerald {
  background: #059669;
  color: #ffffff;
  border: 1px solid #10b981;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-emerald:hover { background: #10b981; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #334155;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 10.5px;
}

/* =========================================================================
   KANBAN PIPELINE BOARD
   ========================================================================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.kanban-column-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #081126;
  border-radius: 8px 8px 0 0;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-col-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.kanban-cards-wrap {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kanban-card:hover {
  border-color: var(--accent-royal-bright);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kanban-card-claimant {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.kanban-card-county {
  font-size: 11px;
  color: var(--text-dim);
}

.kanban-card-metrics {
  background: #060e22;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-metric-label {
  font-size: 10px;
  color: var(--text-dim);
}

.kanban-metric-val {
  font-size: 11px;
  font-weight: 700;
}

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

/* =========================================================================
   CONTACT CARD & SKIP TRACE DOSSIER
   ========================================================================= */
.contact-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.contact-card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.contact-card-section.full-width {
  grid-column: 1 / -1;
}

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-item, .email-item {
  background: #060e22;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.heir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.heir-table th {
  background: #060e22;
  padding: 6px 8px;
  color: var(--text-dim);
  text-align: left;
}

.heir-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

/* =========================================================================
   MODALS
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.modal-card.wide {
  max-width: 820px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #081126;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.timeline-item {
  background: #060e22;
  border-left: 3px solid var(--accent-royal-bright);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  font-size: 11px;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 10px;
  margin-bottom: 2px;
}

/* =========================================================================
 * DOCUMENTATION & INTERACTIVE FAQ ACCORDION STYLES
 * ========================================================================= */
.doc-section { display: flex; flex-direction: column; gap: 20px; }
.doc-search-bar { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; }
.doc-search-input { flex: 1; background: #060e22; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px 14px; color: #ffffff; font-size: 13px; outline: none; }
.doc-search-input:focus { border-color: var(--accent-royal-bright); }
.doc-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.doc-card-header { background: #0a1636; padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.doc-card-header h3 { font-size: 14px; font-weight: 800; color: #ffffff; display: flex; align-items: center; gap: 8px; }
.doc-card-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; line-height: 1.6; font-size: 13px; color: #e5e5e5; }
.widget-guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 8px; }
.widget-guide-card { background: #060e22; border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.widget-guide-title { font-size: 13px; font-weight: 700; color: var(--accent-royal-bright); display: flex; align-items: center; gap: 6px; }
.widget-guide-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.widget-guide-action { font-family: var(--font-mono); font-size: 11px; background: rgba(255, 255, 255, 0.04); padding: 6px 10px; border-radius: 4px; border-left: 3px solid var(--accent-royal); color: #93c5fd; }

/* FAQ Accordion Styles */
.faq-accordion-group { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #060e22; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; transition: border-color 0.15s ease; }
.faq-item:hover { border-color: #1d4ed8; }
.faq-summary { padding: 14px 18px; font-size: 13.5px; font-weight: 700; color: #ffffff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; list-style: none; }
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "＋"; font-size: 16px; color: var(--accent-royal-bright); font-weight: bold; }
details[open] .faq-summary::after { content: "－"; color: var(--accent-amber); }
details[open] .faq-summary { background: #0c1c44; border-bottom: 1px solid var(--border-color); }
.faq-content { padding: 16px 18px; font-size: 12.5px; line-height: 1.6; color: #cbd5e1; background: #040917; }
.faq-content strong { color: #ffffff; }
.faq-content code { font-family: var(--font-mono); font-size: 11.5px; background: rgba(37, 99, 235, 0.2); color: var(--accent-royal-bright); padding: 2px 6px; border-radius: 4px; }

