/* ==========================================================================
   FEDINTEL - Advanced Government Contracting & Spendings Intelligence System
   Executive Design System (Ultra-High Contrast Light & Deep Cyber Slate Dark)
   ========================================================================== */

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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Executive Light Palette */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-hairline: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  /* FedIntelli Official Presidential Brand Palette */
  --fed-navy: #0B1F3A;
  --fed-navy-dark: #061120;
  --fed-navy-light: #16365f;
  --fed-navy-subtle: #f0f4f9;
  --fed-navy-border: #bcd0e4;
  --liberty-red: #B22234;
  --liberty-red-hover: #911a28;
  --liberty-red-subtle: #fef2f3;
  --liberty-red-border: #fbcacf;
  --capitol-white: #FFFFFF;

  /* Theme Accents */
  --tether-primary: #0B1F3A;
  --tether-teal: #16365f;
  --tether-dark: #061120;
  --tether-subtle: #f0f4f9;
  --tether-border: #bcd0e4;
  --fed-blue: #0B1F3A;
  --fed-indigo: #0B1F3A;
  --accent-primary: #0B1F3A;
  --accent-emerald: #10b981;
  --accent-amber: #d97706;
  --accent-purple: #7c3aed;
  --accent-rose: #B22234;
  --accent-cyan: #0284c7;
  --brand-gradient: linear-gradient(135deg, #0B1F3A 0%, #16365f 60%, #B22234 100%);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   EXECUTIVE HEADER & NAVIGATION
   ========================================================================== */
.fed-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.nav-tab-btn {
  position: relative;
  transition: all 0.15s ease;
  font-weight: 600;
  color: #64748b;
}

.nav-tab-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.nav-tab-btn.active {
  color: #0B1F3A;
  background-color: #f0f4f9;
  border-color: #bcd0e4;
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 2.5px;
  background-color: #B22234;
  border-radius: 9999px;
}

/* ==========================================================================
   INTELLIGENCE KPI CARDS
   ========================================================================== */
.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0B1F3A 0%, #16365f 60%, #B22234 100%);
  opacity: 0.95;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  border-color: #bcd0e4;
  box-shadow: 0 10px 25px -5px rgba(11, 31, 58, 0.12), 0 8px 10px -6px rgba(178, 34, 52, 0.05);
  transform: translateY(-2px);
}

.kpi-card.kpi-blue:hover::before { background: linear-gradient(90deg, #0B1F3A, #264f80); }
.kpi-card.kpi-amber:hover::before { background: linear-gradient(90deg, #d97706, #B22234); }
.kpi-card.kpi-emerald:hover::before { background: linear-gradient(90deg, #0B1F3A, #10b981); }
.kpi-card.kpi-purple:hover::before { background: linear-gradient(90deg, #0B1F3A, #B22234); }

/* FedIntelli Theme Card Highlights */
.badge-expiry-urgent {
  background-color: #fef2f3;
  color: #B22234;
  border: 1px solid #fbcacf;
}
.badge-expiry-soon {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.badge-expiry-active {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.badge-incumbent-confirmed {
  background-color: #f0f4f9;
  color: #0B1F3A;
  border: 1px solid #bcd0e4;
}
.badge-incumbent-qualified {
  background-color: #f0f9ff;
  color: #1b3d65;
  border: 1px solid #bae6fd;
}
.badge-incumbent-none {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-viewed {
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.btn-tether-primary,
.btn-fedintelli-primary {
  background: linear-gradient(135deg, #0B1F3A 0%, #16365f 100%);
  color: #ffffff;
  box-shadow: 0 2px 4px 0 rgba(11, 31, 58, 0.25);
  transition: all 0.15s ease;
}
.btn-tether-primary:hover,
.btn-fedintelli-primary:hover {
  background: linear-gradient(135deg, #16365f 0%, #0B1F3A 100%);
  box-shadow: 0 4px 12px 0 rgba(11, 31, 58, 0.35);
}
.btn-fedintelli-red {
  background: linear-gradient(135deg, #B22234 0%, #911a28 100%);
  color: #ffffff;
  box-shadow: 0 2px 4px 0 rgba(178, 34, 52, 0.25);
  transition: all 0.15s ease;
}
.btn-fedintelli-red:hover {
  background: linear-gradient(135deg, #911a28 0%, #7a1b26 100%);
  box-shadow: 0 4px 12px 0 rgba(178, 34, 52, 0.35);
}

/* ==========================================================================
   SEGMENTED FILTER PILLS (HORIZONTAL SINGLE-LINE EXECUTIVE STANDARD)
   ========================================================================== */
.filter-preset-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.25rem;
  padding: 0.4rem 0.85rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid transparent;
  background-color: transparent;
  color: #475569;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  user-select: none;
  height: 2.125rem !important;
  box-sizing: border-box !important;
}

.filter-preset-pill i,
.filter-preset-pill svg {
  display: inline-block !important;
  width: 0.875rem !important;
  height: 0.875rem !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  color: #64748b;
  transition: color 0.15s ease;
}

.filter-preset-pill span {
  display: inline-block !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.filter-preset-pill:hover {
  background-color: #ffffff;
  color: #0B1F3A;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.08);
}

.filter-preset-pill:hover i,
.filter-preset-pill:hover svg {
  color: #0B1F3A;
}

.filter-preset-pill.active {
  background-color: #0B1F3A !important;
  border-color: #0B1F3A !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.25) !important;
}

.filter-preset-pill.active i,
.filter-preset-pill.active svg {
  color: #ffffff !important;
}

/* Urgent / Expiring Pill Special Active State (Liberty Red) */
.filter-preset-pill.active[data-preset="expiring"],
.filter-preset-pill.active.urgent-state {
  background-color: #B22234 !important;
  border-color: #B22234 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(178, 34, 52, 0.3) !important;
}

.filter-preset-pill.active[data-preset="expiring"] i,
.filter-preset-pill.active[data-preset="expiring"] svg,
.filter-preset-pill.active.urgent-state i,
.filter-preset-pill.active.urgent-state svg {
  color: #ffffff !important;
}

/* Dark Mode Support for Filter Preset Pills */
html.dark .filter-preset-pill {
  color: #94a3b8;
}

html.dark .filter-preset-pill:hover {
  background-color: #1e293b;
  color: #f8fafc;
}

html.dark .filter-preset-pill:hover i,
html.dark .filter-preset-pill:hover svg {
  color: #f8fafc;
}

html.dark .filter-preset-pill.active {
  background-color: #0B1F3A !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html.dark .filter-preset-pill.active i,
html.dark .filter-preset-pill.active svg {
  color: #38bdf8 !important;
}

html.dark .filter-preset-pill.active[data-preset="expiring"],
html.dark .filter-preset-pill.active.urgent-state {
  background-color: #B22234 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

html.dark .filter-preset-pill.active[data-preset="expiring"] i,
html.dark .filter-preset-pill.active[data-preset="expiring"] svg,
html.dark .filter-preset-pill.active.urgent-state i,
html.dark .filter-preset-pill.active.urgent-state svg {
  color: #ffffff !important;
}

/* ==========================================================================
   HIGH-DENSITY DATA TABLE
   ========================================================================== */
.fed-table-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
}

.fed-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.8125rem;
}

.fed-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.fed-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.fed-table tr:hover td {
  background-color: #f8fafc;
}

.fed-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   OPPORTUNITY CARDS
   ========================================================================== */
.opp-card,
.opp-horizontal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.opp-card:hover,
.opp-horizontal-card:hover {
  border-color: #6366f1 !important;
  box-shadow: 0 14px 28px -4px rgba(99, 102, 241, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.04) !important;
  transform: translateY(-2px);
}

.opp-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

html.dark .opp-meta-chip {
  background-color: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.opp-sol-id-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.025em;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

html.dark .opp-sol-id-badge {
  background-color: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

/* ==========================================================================
   PRECISION STATUS BADGES
   ========================================================================== */
.badge-active-live {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

.badge-urgent-clock {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
}

.badge-expired-archived {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.badge-awarded-trophy {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

.badge-setaside-sba {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 600;
}

.badge-setaside-8a {
  background-color: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  font-weight: 600;
}

.badge-setaside-sdvosb {
  background-color: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
  font-weight: 600;
}

.badge-setaside-wosb {
  background-color: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
  font-weight: 600;
}

.badge-setaside-hubzone {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 600;
}

.badge-setaside-none {
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

/* Pulsing Live Dot */
.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: #10b981;
  position: relative;
  display: inline-block;
}

.live-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background-color: #10b981;
  opacity: 0.6;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   SLIDE-OUT DOSSIER DRAWER
   ========================================================================== */
.drawer-transition {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   SPENDINGS INTELLIGENCE COMPONENTS
   ========================================================================== */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-1 { background-color: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.rank-2 { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.rank-3 { background-color: #fed7aa; color: #c2410c; border: 1px solid #fdba74; }
.rank-other { background-color: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* Progress bar fill animation */
.progress-bar-fill {
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   DARK THEME OVERRIDES (CYBER SLATE)
   ========================================================================== */
html.dark {
  --bg-page: #0b0f17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-subtle: #1e293b;
  --border-hairline: #1f2937;
  --border-strong: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --text-muted: #6b7280;
}

html.dark body {
  background-color: var(--bg-page) !important;
  color: var(--text-primary) !important;
}

html.dark .fed-header {
  background: rgba(17, 24, 39, 0.95) !important;
  border-bottom-color: #1f2937 !important;
}

html.dark .nav-tab-btn {
  color: #9ca3af !important;
}

html.dark .nav-tab-btn:hover {
  color: #f9fafb !important;
  background-color: #1f2937 !important;
}

html.dark .nav-tab-btn.active {
  color: #60a5fa !important;
  background-color: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

html.dark .kpi-card,
html.dark .opp-card,
html.dark .opp-horizontal-card,
html.dark .fed-table-container {
  background-color: #111827 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark .opp-card:hover,
html.dark .opp-horizontal-card:hover,
html.dark .kpi-card:hover {
  border-color: #374151 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6) !important;
}

html.dark .filter-preset-pill {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #94a3af !important;
}

html.dark .filter-preset-pill:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
  color: #f8fafc !important;
}

html.dark .filter-preset-pill.active {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #818cf8 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

html.dark .fed-table th {
  background-color: #111827 !important;
  color: #9ca3af !important;
  border-bottom-color: #1f2937 !important;
}

html.dark .fed-table td {
  border-bottom-color: #1f2937 !important;
  color: #d1d5db !important;
}

html.dark .fed-table tr:hover td {
  background-color: #1f2937 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #374151;
}

/* ==========================================================================
   LEFT SIDEBAR NAVIGATION & APP LAYOUT
   ========================================================================== */
.fed-app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.fed-sidebar {
  width: 76px;
  min-width: 76px;
  background-color: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex !important;
  flex-direction: column !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 45 !important;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
  overflow: hidden !important; /* Company logo header stays permanently fixed at top */
  overscroll-behavior: contain !important;
}

.sidebar-header-fixed {
  flex-shrink: 0 !important;
  width: 100% !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 60 !important;
  background: transparent !important;
}

.sidebar-nav-scroll {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  display: none;
}

.sidebar-footer-fixed {
  flex-shrink: 0 !important;
  width: 100% !important;
}

html.dark .fed-sidebar {
  background-color: #0b0f17;
  border-right-color: #1e293b;
}

.fed-sidebar:hover,
.fed-sidebar.pinned {
  width: 290px;
  min-width: 290px;
  box-shadow: 6px 0 24px -2px rgba(15, 23, 42, 0.12);
}

.fed-sidebar.pinned {
  box-shadow: none;
}

.sidebar-collapsed-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.fed-sidebar:hover .sidebar-collapsed-brand-icon,
.fed-sidebar.pinned .sidebar-collapsed-brand-icon {
  display: none !important;
}

.fed-sidebar .sidebar-label-text,
.fed-sidebar .sidebar-badge-item,
.fed-sidebar .sidebar-category-title,
.fed-sidebar .sidebar-footer-text {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  transition: opacity 0.18s ease, max-width 0.26s ease;
  pointer-events: none;
}

.fed-sidebar .sidebar-brand-text {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  display: none;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.fed-sidebar:hover .sidebar-label-text,
.fed-sidebar:hover .sidebar-badge-item,
.fed-sidebar:hover .sidebar-category-title,
.fed-sidebar:hover .sidebar-footer-text,
.fed-sidebar.pinned .sidebar-label-text,
.fed-sidebar.pinned .sidebar-badge-item,
.fed-sidebar.pinned .sidebar-category-title,
.fed-sidebar.pinned .sidebar-footer-text {
  opacity: 1;
  max-width: 260px;
  pointer-events: auto;
}

.fed-sidebar:hover .sidebar-brand-text,
.fed-sidebar.pinned .sidebar-brand-text {
  opacity: 1;
  max-width: 100%;
  width: 100%;
  display: block;
  pointer-events: auto;
}

/* Sidebar Brand Card Header - Always pure crisp white background as requested */
.sidebar-brand-container,
#sidebar-brand-container {
  background-color: #ffffff !important;
  border-radius: 0.75rem !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

html.dark .sidebar-brand-container,
html.dark #sidebar-brand-container,
html.theme-federal-navy .sidebar-brand-container,
html.theme-federal-navy #sidebar-brand-container,
html.theme-executive-charcoal .sidebar-brand-container,
html.theme-executive-charcoal #sidebar-brand-container {
  background-color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.sidebar-brand-container img {
  filter: none !important;
}

.sidebar-brand-container .sidebar-brand-text span {
  color: #0B1F3A !important;
}

.fed-sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.fed-sidebar-nav-item i,
.fed-sidebar-nav-item svg {
  flex-shrink: 0;
}

html.dark .fed-sidebar-nav-item {
  color: #94a3b8;
}

.fed-sidebar-nav-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

html.dark .fed-sidebar-nav-item:hover {
  background-color: #1e293b;
  color: #f8fafc;
}

.fed-sidebar-nav-item.active {
  background-color: #0B1F3A;
  color: #FFFFFF;
  border-color: #0B1F3A;
  border-left: 3px solid #B22234;
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.25);
}

.fed-sidebar-nav-item.active i,
.fed-sidebar-nav-item.active svg {
  color: #fca5a5 !important;
}

html.dark .fed-sidebar-nav-item.active {
  background-color: #0B1F3A;
  color: #FFFFFF;
  border-color: #1b3d65;
  border-left: 3px solid #B22234;
  box-shadow: 0 2px 8px rgba(178, 34, 52, 0.25);
}

/* ==========================================================================
   FEDINTELLI SPENDING SUB-NAVIGATION ITEMS (VISIBILITY FIX - SCREENSHOT 2)
   ========================================================================== */
.usp-sidebar-subitem {
  color: #475569;
  font-weight: 600;
  transition: all 0.15s ease;
}

.usp-sidebar-subitem:hover {
  color: #0f172a;
  background-color: rgba(15, 23, 42, 0.06);
}

.usp-sidebar-subitem.active {
  color: #0B2A55 !important;
  background-color: #e0e7ff !important;
  font-weight: 700 !important;
}

html.dark:not(.theme-minimal-flat) .usp-sidebar-subitem {
  color: #E2E8F0 !important;
}

html.dark:not(.theme-minimal-flat) .usp-sidebar-subitem:hover {
  color: #FFFFFF !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
}

/* ==========================================================================
   DOSSIER DRAWERS 25% WIDER & 4-TAB NAVIGATION SYSTEM (SCREENSHOT 1)
   ========================================================================== */
.fed-dossier-drawer,
#opportunity-drawer,
#gsa-drawer,
#grant-drawer,
#recompete-drawer {
  width: 100% !important;
  max-width: min(980px, 94vw) !important; /* 25%+ wider than 768px for expansive executive reading */
}

.fed-dossier-tabs-nav {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

html.dark .fed-dossier-tabs-nav {
  background-color: #0b0f17;
  border-bottom-color: #1e293b;
}

.fed-dossier-tab-btn {
  color: #64748b;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
}

html.dark .fed-dossier-tab-btn {
  color: #94a3b8;
  background-color: #1e293b;
  border-color: #334155;
}

.fed-dossier-tab-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

html.dark .fed-dossier-tab-btn:hover {
  color: #f8fafc;
  background-color: #334155;
}

.fed-dossier-tab-btn.active {
  color: #ffffff !important;
  background-color: #0B2A55 !important;
  border-color: #0B2A55 !important;
  box-shadow: 0 1px 3px 0 rgba(11, 42, 85, 0.35) !important;
}

html.theme-minimal-flat .fed-dossier-tab-btn.active {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
}

html.theme-executive-charcoal .fed-dossier-tab-btn.active {
  background-color: #1C1C1E !important;
  border-color: #D4AF37 !important;
  color: #D4AF37 !important;
}

/* Guarantee 100% of dossier data is captured during browser printing */
@media print {
  .fed-dossier-tab-pane {
    display: block !important;
  }
  .fed-dossier-tabs-nav {
    display: none !important;
  }
}

.fed-topbar {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #e2e8f0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

html.dark .fed-topbar {
  background-color: rgba(11, 15, 23, 0.98);
  border-bottom-color: #1e293b;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

html.theme-federal-navy .fed-topbar {
  background-color: #ffffff !important;
  border-bottom-color: #DCE3EC !important;
}

html.theme-minimal-flat .fed-topbar {
  background-color: #ffffff !important;
  border-bottom-color: #EBEBEB !important;
  box-shadow: none !important;
}

html.theme-executive-charcoal .fed-topbar {
  background-color: #ffffff !important;
  border-bottom-color: #E4E1DA !important;
}

/* ==========================================================================
   SMART SEARCH & RECENT SEARCHES DROPDOWN
   ========================================================================== */
.search-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  z-index: 50;
  max-height: 420px;
  overflow-y: auto;
}

html.dark .search-dropdown-menu {
  background-color: #0f172a;
  border-color: #334155;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   LINKEDIN-STYLE COMMUNITY NETWORK
   ========================================================================== */
.community-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

html.dark .community-card {
  background-color: #111827;
  border-color: #1f2937;
}

.community-post-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

html.dark .community-post-box {
  background-color: #111827;
  border-color: #1f2937;
}

.like-btn.liked {
  color: #2563eb !important;
  font-weight: 700;
}

html.dark .like-btn.liked {
  color: #60a5fa !important;
}

/* SSO Login Buttons */
.btn-sso-google {
  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  transition: all 0.15s ease;
}
.btn-sso-google:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

html.dark .btn-sso-google {
  background-color: #1f2937;
  color: #f3f4f6;
  border-color: #374151;
}
html.dark .btn-sso-google:hover {
  background-color: #283548;
}

.btn-sso-ms {
  background-color: #2f2f2f;
  color: #ffffff;
  transition: all 0.15s ease;
}
.btn-sso-ms:hover {
  background-color: #1f1f1f;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Category Pills (Federal Standard: Navy #0B1F3A) */
.category-pill {
  display: inline-flex !important;
  align-items: center !important;
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.625rem;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap !important;
  cursor: pointer;
  user-select: none;
}
.category-pill:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0B1F3A;
}
.category-pill.active {
  background-color: #0B1F3A !important;
  border-color: #0B1F3A !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.22) !important;
}
html.dark .category-pill {
  background-color: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
html.dark .category-pill:hover {
  background-color: #334155;
  color: #f8fafc;
}
html.dark .category-pill.active {
  background-color: #0B1F3A !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
   OFFICIAL FEDERAL AGENCY LOGOS & SEALS
   ========================================================================== */
.agency-logo-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9999px !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  padding: 1px !important;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease !important;
}
html.dark .agency-logo-badge {
  background-color: #1e293b !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}
.agency-logo-badge:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px 0 rgba(11, 31, 58, 0.25) !important;
}
.agency-logo-badge svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  pointer-events: none;
}
.agency-logo-badge img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 9999px !important;
}

/* ==========================================================================
   DATA SECURITY & CONTENT PROTECTION SUITE
   Restricts text selection, drag-and-drop, copying, and background recording.
   ========================================================================== */
.fed-protected-data,
.fed-data-card,
.opp-horizontal-card,
.recompete-row,
#recompete-drawer,
#opportunity-drawer,
#gsa-drawer,
#grant-drawer {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

#security-screen-shield {
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* ==========================================================================
   THEME 1: FEDERAL NAVY (Brand Match)
   Page bg: #F4F6FA, Card: #FFFFFF, Card/tab border: #DCE3EC,
   Dropdown/input border: #C9D3E0, Accent: #0B2A55, Radius: 10px.
   Navy sidebar #0B2A55, thin red line on top of KPI cards (#C8102E), segmented tabs.
   ========================================================================== */
html.theme-federal-navy,
body.theme-federal-navy {
  --bg-page: #F4F6FA;
  --theme-accent: #0B2A55;
  --theme-accent-hover: #071830;
  --theme-border: #DCE3EC;
  --theme-input-border: #C9D3E0;
  --theme-radius: 10px;
}

html.theme-federal-navy body {
  background-color: #F4F6FA !important;
}

html.theme-federal-navy .fed-sidebar {
  background-color: #0B2A55 !important;
  border-right-color: #16365f !important;
}

html.theme-federal-navy .fed-sidebar .sidebar-label-text,
html.theme-federal-navy .fed-sidebar .sidebar-category-title,
html.theme-federal-navy .fed-sidebar .sidebar-footer-text,
html.theme-federal-navy .fed-sidebar .fed-sidebar-nav-item {
  color: #dce5f1 !important;
}

html.theme-federal-navy .fed-sidebar .sidebar-category-title {
  color: #8eaecf !important;
}

html.theme-federal-navy .fed-sidebar-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html.theme-federal-navy .fed-sidebar-nav-item.active {
  background-color: #16365f !important;
  color: #ffffff !important;
  border-left: 3px solid #C8102E !important;
  border-color: #16365f !important;
  box-shadow: 0 2px 8px rgba(11, 42, 85, 0.4) !important;
}

html.theme-federal-navy .fed-sidebar-nav-item.active i,
html.theme-federal-navy .fed-sidebar-nav-item.active svg {
  color: #ffffff !important;
}

/* Federal Navy Sub-Navigation Items (Crystal-Clear Silver/White High Contrast) */
html.theme-federal-navy .usp-sidebar-subitem {
  color: #E2E8F0 !important;
  font-weight: 600 !important;
}

html.theme-federal-navy .usp-sidebar-subitem:hover {
  color: #FFFFFF !important;
  background-color: rgba(255, 255, 255, 0.14) !important;
}

html.theme-federal-navy .usp-sidebar-subitem.active {
  color: #0B2A55 !important;
  background-color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html.theme-federal-navy #usp-sidebar-subnav {
  border-left-color: rgba(255, 255, 255, 0.3) !important;
}

/* KPI Cards - Federal Navy: Thin red brand line (#C8102E) on top */
html.theme-federal-navy .kpi-card,
html.theme-federal-navy .news-kpi-card {
  border-color: #DCE3EC !important;
  border-radius: 10px !important;
  border-top: 3px solid #C8102E !important;
}
html.theme-federal-navy .kpi-card::before,
html.theme-federal-navy .news-kpi-card::before {
  display: none !important;
}

/* Tabs & Inputs - Federal Navy */
html.theme-federal-navy .nav-tab-btn.active,
html.theme-federal-navy .news-category-tab.active {
  background-color: #0B2A55 !important;
  color: #ffffff !important;
  border-color: #0B2A55 !important;
}

html.theme-federal-navy select,
html.theme-federal-navy input[type="text"],
html.theme-federal-navy input[type="search"] {
  border-color: #C9D3E0 !important;
}


/* ==========================================================================
   THEME 2: MINIMAL FLAT
   Page bg: #FAFAFA, Card: #FFFFFF, Card/tab border: #EBEBEB,
   Dropdown/input border: #E0E0E0, Accent: #2563EB, Radius: 8px.
   Hairline borders, no shadows, pill tabs, white sidebar #FFFFFF with #EBEBEB border.
   ========================================================================== */
html.theme-minimal-flat,
body.theme-minimal-flat {
  --bg-page: #FAFAFA;
  --theme-accent: #2563EB;
  --theme-accent-hover: #1d4ed8;
  --theme-border: #EBEBEB;
  --theme-input-border: #E0E0E0;
  --theme-radius: 8px;
}

html.theme-minimal-flat body {
  background-color: #FAFAFA !important;
}

html.theme-minimal-flat .fed-sidebar {
  background-color: #FFFFFF !important;
  border-right: 1px solid #EBEBEB !important;
  box-shadow: none !important;
}

html.theme-minimal-flat .fed-sidebar .sidebar-label-text,
html.theme-minimal-flat .fed-sidebar .sidebar-category-title,
html.theme-minimal-flat .fed-sidebar .sidebar-footer-text,
html.theme-minimal-flat .fed-sidebar .fed-sidebar-nav-item {
  color: #475569 !important;
}

html.theme-minimal-flat .fed-sidebar .sidebar-category-title {
  color: #94a3b8 !important;
}

html.theme-minimal-flat .fed-sidebar-nav-item:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.theme-minimal-flat .fed-sidebar-nav-item.active {
  background-color: #2563EB !important;
  color: #ffffff !important;
  border-left: 1px solid #2563EB !important;
  border-color: #2563EB !important;
  box-shadow: none !important;
  border-radius: 8px !important;
}

html.theme-minimal-flat .fed-sidebar-nav-item.active i,
html.theme-minimal-flat .fed-sidebar-nav-item.active svg {
  color: #ffffff !important;
}

/* KPI Cards & Containers - Minimal Flat: Hairline borders, NO top red/gold line, NO shadows */
html.theme-minimal-flat .kpi-card,
html.theme-minimal-flat .news-kpi-card,
html.theme-minimal-flat .opp-card,
html.theme-minimal-flat .opp-horizontal-card,
html.theme-minimal-flat .fed-table-container,
html.theme-minimal-flat .fed-card {
  border-color: #EBEBEB !important;
  border-radius: 8px !important;
  border-top-width: 1px !important;
  border-top-style: solid !important;
  border-top-color: #EBEBEB !important;
  box-shadow: none !important;
}
html.theme-minimal-flat .kpi-card::before,
html.theme-minimal-flat .news-kpi-card::before {
  display: none !important;
}
html.theme-minimal-flat .shadow-sm,
html.theme-minimal-flat .shadow-md,
html.theme-minimal-flat .shadow-lg,
html.theme-minimal-flat .shadow-xl {
  box-shadow: none !important;
}

/* Tabs - Minimal Flat: Pill tabs (rounded-full) */
html.theme-minimal-flat .nav-tab-btn,
html.theme-minimal-flat .news-category-tab {
  border-radius: 9999px !important;
}

html.theme-minimal-flat .nav-tab-btn.active,
html.theme-minimal-flat .news-category-tab.active {
  background-color: #2563EB !important;
  color: #ffffff !important;
  border-color: #2563EB !important;
}

html.theme-minimal-flat select,
html.theme-minimal-flat input[type="text"],
html.theme-minimal-flat input[type="search"] {
  border-color: #E0E0E0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}


/* ==========================================================================
   THEME 3: EXECUTIVE CHARCOAL + GOLD
   Page bg: #F6F5F2, Card: #FFFFFF, Card/tab border: #E4E1DA,
   Dropdown/input border: #D6D2C8, Accent: Charcoal #1C1C1E + gold line #D4AF37.
   Charcoal sidebar #1C1C1E, gold top line on KPI cards, dark segmented tabs.
   ========================================================================== */
html.theme-executive-charcoal,
body.theme-executive-charcoal {
  --bg-page: #F6F5F2;
  --theme-accent: #1C1C1E;
  --theme-accent-gold: #D4AF37;
  --theme-border: #E4E1DA;
  --theme-input-border: #D6D2C8;
  --theme-radius: 10px;
}

html.theme-executive-charcoal body {
  background-color: #F6F5F2 !important;
}

html.theme-executive-charcoal .fed-sidebar {
  background-color: #1C1C1E !important;
  border-right-color: #2C2C2E !important;
}

html.theme-executive-charcoal .fed-sidebar .sidebar-label-text,
html.theme-executive-charcoal .fed-sidebar .sidebar-category-title,
html.theme-executive-charcoal .fed-sidebar .sidebar-footer-text,
html.theme-executive-charcoal .fed-sidebar .fed-sidebar-nav-item {
  color: #E5E5EA !important;
}

html.theme-executive-charcoal .fed-sidebar .sidebar-category-title {
  color: #A1A1A6 !important;
}

html.theme-executive-charcoal .fed-sidebar-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html.theme-executive-charcoal .fed-sidebar-nav-item.active {
  background-color: #2C2C2E !important;
  color: #ffffff !important;
  border-left: 3px solid #D4AF37 !important;
  border-color: #2C2C2E !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

html.theme-executive-charcoal .fed-sidebar-nav-item.active i,
html.theme-executive-charcoal .fed-sidebar-nav-item.active svg {
  color: #D4AF37 !important;
}

/* Executive Charcoal Sub-Navigation Items (High-Contrast Pearl White & Gold) */
html.theme-executive-charcoal .usp-sidebar-subitem {
  color: #E5E5EA !important;
  font-weight: 600 !important;
}

html.theme-executive-charcoal .usp-sidebar-subitem:hover {
  color: #FFFFFF !important;
  background-color: rgba(255, 255, 255, 0.14) !important;
}

html.theme-executive-charcoal .usp-sidebar-subitem.active {
  color: #1C1C1E !important;
  background-color: #D4AF37 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html.theme-executive-charcoal #usp-sidebar-subnav {
  border-left-color: rgba(212, 175, 55, 0.4) !important;
}

/* KPI Cards - Executive Charcoal + Gold: Thin gold accent line (#D4AF37) on top */
html.theme-executive-charcoal .kpi-card,
html.theme-executive-charcoal .news-kpi-card {
  border-color: #E4E1DA !important;
  border-radius: 10px !important;
  border-top: 3px solid #D4AF37 !important;
}
html.theme-executive-charcoal .kpi-card::before,
html.theme-executive-charcoal .news-kpi-card::before {
  display: none !important;
}

/* Tabs & Inputs - Executive Charcoal + Gold: Dark segmented tabs */
html.theme-executive-charcoal .nav-tab-btn.active,
html.theme-executive-charcoal .news-category-tab.active {
  background-color: #1C1C1E !important;
  color: #ffffff !important;
  border-color: #1C1C1E !important;
}

html.theme-executive-charcoal select,
html.theme-executive-charcoal input[type="text"],
html.theme-executive-charcoal input[type="search"] {
  border-color: #D6D2C8 !important;
}

/* ==========================================================================
   NEWS & UPDATES - FULL PAGE NATURAL SCROLL
   Allows full-page scrolling across the entire news feed and widgets,
   with the right rail staying smoothly sticky alongside.
   ========================================================================== */
.news-top-deck {
  position: static;
  background-color: transparent;
  padding-bottom: 0.25rem;
}

.news-feed-scroll-column {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

@media (min-width: 1024px) {
  .news-rail-scroll-column {
    position: -webkit-sticky;
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  html.dark .news-rail-scroll-column {
    scrollbar-color: #334155 transparent;
  }

  .news-rail-scroll-column::-webkit-scrollbar {
    width: 5px;
  }

  .news-rail-scroll-column::-webkit-scrollbar-track {
    background: transparent;
  }

  .news-rail-scroll-column::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
  }

  html.dark .news-rail-scroll-column::-webkit-scrollbar-thumb {
    background-color: #334155;
  }
}

