/* ==========================================================================
   BARBU INTEL (BI) - OBSIDIAN EXECUTIVE DESIGN SYSTEM
   Ultra-High Performance & Instant Load CSS Architecture
   ========================================================================== */

:root {
  /* Obsidian Dark Palette */
  --bg-color: #08090d;
  --bg-subtle: #0d0f17;
  --surface-card: #0f121b;
  --surface-card-hover: #141824;
  --surface-glass: rgba(15, 18, 27, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(0, 240, 255, 0.35);

  /* Executive Accents */
  --primary: #0070f3;
  --primary-hover: #0056b3;
  --primary-glow: #00f0ff;
  --accent-cyan: #00f0ff;
  --accent-emerald: #00df8f;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #a855f7;

  /* Typography */
  --text-main: #f0f3f6;
  --text-sub: #8b949e;
  --text-muted: #6e7681;

  /* Dimensions */
  --sidebar-width: 250px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* Executive Crisp Light Mode - High Legibility & Professional Contrast */
html.light-mode {
  --bg-color: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface-card: #ffffff;
  --surface-card-hover: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.96);
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-hover: rgba(2, 132, 199, 0.4);

  /* Professional Light Mode Accents (No harsh neon glare) */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.25);
  --accent-cyan: #0284c7;        /* Crisp, deep sky blue instead of neon cyan */
  --accent-emerald: #059669;     /* Deep readable emerald */
  --accent-amber: #d97706;       /* Warm readable amber */
  --accent-crimson: #dc2626;     /* Deep ruby red */
  --accent-purple: #7c3aed;      /* Balanced royal violet */

  /* Balanced Executive Typography (Soft on the eyes, avoids harsh stark black) */
  --text-main: #1e293b;
  --text-sub: #475569;
  --text-muted: #64748b;
}

html.light-mode .mesh-bg {
  opacity: 0.08;
}

html.light-mode .sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
}

html.light-mode .sidebar-header {
  border-bottom: 1px solid #e2e8f0;
}

html.light-mode .card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

html.light-mode .table-modern th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

html.light-mode .table-modern td {
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

html.light-mode .table-modern tr:hover td {
  background: #f1f5f9;
}

html.light-mode .form-control,
html.light-mode input,
html.light-mode select,
html.light-mode textarea {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

html.light-mode input::placeholder {
  color: #94a3b8 !important;
}

html.light-mode .nav-link {
  color: #475569;
}

html.light-mode .nav-link:hover {
  background: #f1f5f9;
  color: #0284c7;
}

html.light-mode .nav-link.active {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

html.light-mode .top-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
}

html.light-mode .top-pill:hover {
  background: #f1f5f9;
  color: #0284c7;
}

html.light-mode .top-pill.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

html.light-mode .btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

html.light-mode .btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Light Mode Badges - High Legibility Pastel Badges */
html.light-mode .badge {
  font-weight: 600;
}

html.light-mode .badge-success {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

html.light-mode .badge-danger {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

html.light-mode .badge-warning {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

html.light-mode .badge-info {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

/* Fix harsh contrast on elements with translucent white inline backgrounds in light mode */
html.light-mode [style*="background:rgba(255,255,255"],
html.light-mode [style*="background: rgba(255,255,255"],
html.light-mode [style*="background:rgba(255, 255, 255"],
html.light-mode [style*="background: rgba(255, 255, 255"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.light-mode [style*="background:rgba(0,240,255,0.08)"],
html.light-mode [style*="background: rgba(0,240,255,0.08)"],
html.light-mode [style*="background:rgba(0, 240, 255, 0.08)"] {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

html.light-mode [style*="background:rgba(0,223,143,0.06)"],
html.light-mode [style*="background: rgba(0,223,143,0.06)"] {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

/* Zero Latency Native Typography Stack */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, button, input, select, textarea, optgroup {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Explicit FontAwesome Icon Protection */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, [class^="fa-"], [class*=" fa-"] {
  font-family: var(--fa-style-family, "Font Awesome 6 Free") !important;
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  text-rendering: auto;
}
.fa-brands, .fab {
  font-family: "Font Awesome 6 Brands" !important;
}
.fa-solid, .fas {
  font-weight: 900 !important;
}
.fa-regular, .far {
  font-weight: 400 !important;
}
.fa::before, .fas::before, .far::before, .fab::before,
.fa-solid::before, .fa-regular::before, .fa-brands::before,
[class^="fa-"]::before, [class*=" fa-"]::before {
  font-family: inherit !important;
}

html, body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.012em;
}

body {
  display: flex;
}

/* Custom Minimalist Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #21262d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #30363d;
}

/* Ambient Radial Glow Background */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 112, 243, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 223, 143, 0.06) 0px, transparent 50%);
  pointer-events: none;
}

.noise-overlay {
  display: none;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(8, 9, 13, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.hamburger {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: rgba(13, 15, 23, 0.88);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 90;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  transition: transform 0.15s ease;
}

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

.nav-link:hover i {
  transform: translateX(2px);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(0, 112, 243, 0.14);
  border: 1px solid rgba(0, 112, 243, 0.3);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--accent-cyan);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 40px;
  max-width: 1600px;
  min-height: 100vh;
}

/* Cards & Surfaces */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Page Typography */
.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* Buttons */
.btn-primary, button.btn-primary {
  background: linear-gradient(135deg, #0056b3, #0070f3);
  color: #ffffff;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 112, 243, 0.3);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0060c8, #0080ff);
  box-shadow: 0 6px 20px rgba(0, 112, 243, 0.45);
  transform: translateY(-1px);
}

.btn-secondary, button.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: rgba(0, 223, 143, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 223, 143, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-crimson);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-info {
  background: rgba(0, 112, 243, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 112, 243, 0.25);
}

/* Tables */
.table-modern {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-modern th {
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 23, 0.5);
}

.table-modern td {
  padding: 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: background 0.12s ease;
}

.table-modern tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Skeleton Loading Shimmer */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==============================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS (MOBILE-FIRST POLISH)
   ============================================================== */

/* Backdrop for Mobile Sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

html.light-mode .sidebar-close-btn {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile Bottom Navigation Bar (iOS / Android Native App Experience) */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13, 15, 23, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 95;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

html.light-mode .mobile-bottom-bar {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: #e2e8f0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.mob-tab i {
  font-size: 17px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.mob-tab:hover, .mob-tab:active {
  color: var(--text-main);
}

.mob-tab.active {
  color: var(--accent-cyan);
}

html.light-mode .mob-tab.active {
  color: var(--primary);
}

.mob-tab.active i {
  transform: translateY(-1px);
}

/* Mobile Responsive Breakpoints */
@media (max-width: 900px) {
  .mobile-header {
    display: flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
    z-index: 90;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  }

  .main-content {
    margin-left: 0 !important;
    padding: 72px 14px calc(80px + env(safe-area-inset-bottom, 0px)) 14px !important;
    max-width: 100% !important;
  }

  .executive-topbar {
    display: none !important;
  }

  .card {
    padding: 16px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }

  .page-title {
    font-size: 20px !important;
  }

  .page-subtitle {
    font-size: 12px !important;
  }

  /* Search bar full-width on mobile */
  #unifiedSearchForm {
    flex-direction: column !important;
    gap: 10px !important;
  }

  #unifiedSearchForm > div {
    width: 100% !important;
    min-width: 0 !important;
  }

  #unifiedSearchForm button[type="submit"] {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px !important;
    font-size: 15px !important;
  }

  /* Quick corporate chips horizontal scroll bar */
  .quick-chips-wrapper, #unifiedSearchForm + div {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    gap: 6px !important;
    scrollbar-width: none;
  }
  .quick-chips-wrapper::-webkit-scrollbar, #unifiedSearchForm + div::-webkit-scrollbar {
    display: none;
  }
  .quick-chips-wrapper button, #unifiedSearchForm + div button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Executive widgets stack vertically on mobile */
  #executiveWidgetsBar {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Tables horizontal smooth scroll */
  div[style*="overflow-x:auto"], .table-modern-wrapper {
    margin: 0 -14px;
    padding: 0 14px;
    width: calc(100% + 28px);
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .table-modern {
    min-width: 580px;
  }

  /* Modals full responsive on mobile */
  #personNetworkModal, #addressHubModal {
    padding: 10px !important;
  }

  #personNetworkModal .card, #addressHubModal .card {
    padding: 16px 14px !important;
    max-height: 92vh !important;
    width: 100% !important;
    border-radius: 16px !important;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 68px 10px calc(80px + env(safe-area-inset-bottom, 0px)) 10px !important;
  }

  .card {
    padding: 14px 12px !important;
  }

  /* KPI Cards: 2 per row on smaller phones */
  div[style*="grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  div[style*="grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))"] .card {
    padding: 12px 10px !important;
  }

  div[style*="grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))"] .card div[style*="font-size:20px"],
  div[style*="grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))"] .card div[style*="font-size:26px"] {
    font-size: 16px !important;
  }
}


/* Address Hub Interactive Styles */
.company-address-link {
  transition: all 0.15s ease;
  border-radius: 6px;
  padding: 2px 4px;
}
.company-address-link:hover {
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan) !important;
}
.company-address-link:hover .addr-hub-badge {
  background: rgba(0, 240, 255, 0.25) !important;
  border-color: var(--accent-cyan) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}
.addr-hub-badge {
  transition: all 0.2s ease;
}

/* 3-State Executive Theme Switcher (Dark / Light / Auto) */
.theme-switcher-container {
  display: flex;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 10px;
}

.theme-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html.light-mode .theme-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.theme-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 112, 243, 0.4);
}

/* Server Status Card / Dashboard Button */
.server-status-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.server-status-card:hover {
  border-color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.08) !important;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.15);
  transform: translateY(-1px);
}

.server-status-card.active {
  border-color: var(--primary) !important;
  background: rgba(0, 112, 243, 0.12) !important;
  box-shadow: 0 0 15px rgba(0, 112, 243, 0.25);
}

/* Executive Top Navigation Bar (Floating Pills) */
.executive-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 10px 18px;
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  flex-wrap: wrap;
  gap: 12px;
}

.top-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.top-pill.active {
  background: linear-gradient(135deg, rgba(0, 112, 243, 0.2), rgba(0, 240, 255, 0.15));
  border-color: var(--accent-cyan);
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

html.light-mode .top-pill {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

html.light-mode .top-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

html.light-mode .top-pill.active {
  background: #0070f3;
  color: #ffffff !important;
  border-color: #0070f3;
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.3);
}

/* ==============================================================
   COMMAND PALETTE (CTRL + K / CMD + K) STYLES
   ============================================================== */
/* ==============================================================
   COMMAND PALETTE (CTRL + K / CMD + K) - EXECUTIVE REDESIGN
   ============================================================== */
.btn-cmd-palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: 22px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(0, 112, 243, 0.05));
  border: 1px solid rgba(0, 240, 255, 0.28);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 12px rgba(0, 240, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cmd-palette-trigger:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(0, 112, 243, 0.12));
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.25);
  transform: translateY(-1.5px);
}

.btn-cmd-palette-trigger kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(4, 7, 14, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: cmdFadeIn 0.16s ease-out;
}

.cmd-palette-modal {
  width: 92%;
  max-width: 720px;
  background: linear-gradient(180deg, #0d131f 0%, #080c14 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 240, 255, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cmdSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.cmd-palette-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 112, 243, 0.2));
  border: 1px solid rgba(0, 240, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 17px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  flex-shrink: 0;
}

.cmd-palette-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  padding: 4px 0;
  letter-spacing: -0.2px;
}

.cmd-palette-header input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.cmd-palette-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

/* Quick Filter Pills Under Header */
.cmd-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.cmd-filter-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cmd-filter-pill:hover,
.cmd-filter-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.cmd-palette-results {
  max-height: 460px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmd-palette-placeholder {
  padding: 40px 24px;
  text-align: center;
}

/* Individual Result Row */
.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.12) 0%, rgba(0, 112, 243, 0.06) 100%);
  border-color: rgba(0, 240, 255, 0.4);
  border-left: 4px solid var(--accent-cyan);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.12);
  transform: translateX(3px);
}

.cmd-palette-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.cmd-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 112, 243, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.cmd-palette-item.active .cmd-item-avatar {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(0, 112, 243, 0.35));
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.cmd-palette-item-content {
  min-width: 0;
  flex: 1;
}

.cmd-palette-item-name {
  font-weight: 800;
  font-size: 14.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
  margin-bottom: 5px;
}

.cmd-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cmd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 6px;
}

.cmd-chip-cui {
  font-family: monospace;
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.cmd-chip-reg {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.28);
}

.cmd-chip-loc {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.cmd-chip-caen {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.cmd-chip-status.active {
  background: rgba(0, 223, 143, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 223, 143, 0.3);
}

.cmd-chip-status.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-crimson);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cmd-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  display: inline-block;
  animation: dotPulse 1.8s infinite;
}

@keyframes dotPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Right Side Metrics */
.cmd-palette-item-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: 14px;
}

.cmd-metric-box {
  text-align: right;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cmd-metric-ca {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-emerald);
  line-height: 1.2;
}

.cmd-metric-emp {
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  margin-top: 2px;
}

.cmd-action-enter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  opacity: 0.7;
  transition: all 0.15s ease;
}

.cmd-palette-item:hover .cmd-action-enter,
.cmd-palette-item.active .cmd-action-enter {
  opacity: 1;
  background: var(--accent-cyan);
  color: #000000;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.cmd-palette-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==============================================================
   LIGHT MODE ADAPTATION FOR COMMAND PALETTE & MODALS
   ============================================================== */
html.light-mode .cmd-palette-backdrop {
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html.light-mode .cmd-palette-modal {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.2) !important;
}

html.light-mode .cmd-palette-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .cmd-palette-header input {
  background: transparent !important;
  border: none !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

html.light-mode .cmd-palette-header input::placeholder {
  color: #94a3b8 !important;
}

html.light-mode .cmd-palette-icon-wrapper {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(124, 58, 237, 0.12)) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.15) !important;
}

html.light-mode .cmd-palette-badge {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html.light-mode .cmd-placeholder-title {
  color: #0f172a !important;
}

html.light-mode .cmd-placeholder-sub {
  color: #64748b !important;
}

html.light-mode .cmd-suggestions-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html.light-mode .cmd-suggestion-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

html.light-mode .cmd-suggestion-chip:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

html.light-mode .cmd-kbd {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html.light-mode .cmd-palette-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html.light-mode .cmd-palette-item:hover,
html.light-mode .cmd-palette-item.active {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.08) 0%, rgba(2, 132, 199, 0.02) 100%) !important;
  border-color: #0284c7 !important;
  border-left: 4px solid #0284c7 !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12) !important;
}

html.light-mode .cmd-palette-item-name {
  color: #0f172a !important;
}

html.light-mode .cmd-item-avatar {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(124, 58, 237, 0.12)) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

html.light-mode .cmd-palette-item.active .cmd-item-avatar {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.35) !important;
  border-color: #0284c7 !important;
}

html.light-mode .cmd-metric-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html.light-mode .cmd-metric-ca {
  color: #059669 !important;
}

html.light-mode .cmd-metric-emp {
  color: #7c3aed !important;
}

html.light-mode .cmd-action-enter {
  background: rgba(2, 132, 199, 0.08) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

html.light-mode .cmd-action-enter:hover,
html.light-mode .cmd-palette-item.active .cmd-action-enter {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
}

html.light-mode .cmd-palette-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

html.light-mode .cmd-palette-footer kbd {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html.light-mode .cmd-chip-cui {
  background: rgba(2, 132, 199, 0.08) !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

html.light-mode .cmd-chip-reg {
  background: rgba(124, 58, 237, 0.08) !important;
  color: #7c3aed !important;
  border-color: rgba(124, 58, 237, 0.25) !important;
}

html.light-mode .cmd-chip-loc {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}

html.light-mode .cmd-chip-caen {
  background: rgba(217, 119, 6, 0.08) !important;
  color: #d97706 !important;
  border-color: rgba(217, 119, 6, 0.25) !important;
}

html.light-mode .cmd-chip-status.active {
  background: rgba(5, 150, 105, 0.08) !important;
  color: #059669 !important;
  border-color: rgba(5, 150, 105, 0.25) !important;
}

html.light-mode .cmd-chip-status.inactive {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}

/* Modals in Light Mode */
html.light-mode #addressHubModal,
html.light-mode #personNetworkModal {
  background: rgba(15, 23, 42, 0.5) !important;
}

html.light-mode #addressHubModal .card,
html.light-mode #personNetworkModal .card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2) !important;
}

/* ==============================================================
   1-CLICK COPY BUTTONS (COPY TO CLIPBOARD)
   ============================================================== */
.btn-copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.btn-copy-chip:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-copy-chip.copied {
  background: rgba(0, 223, 143, 0.18) !important;
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald) !important;
}

/* Toast container for copy feedback */
#biToastNotification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(12, 16, 23, 0.95);
  border: 1px solid var(--accent-emerald);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 223, 143, 0.3);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#biToastNotification.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==============================================================
   SALES CHEAT SHEET CARD STYLES
   ============================================================== */
.sales-cheat-sheet-card {
  margin-bottom: 24px;
  padding: 22px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1.5px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.sales-cheat-col {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sales-cheat-col.strengths {
  border-top: 4px solid var(--accent-emerald);
  background: rgba(0, 223, 143, 0.02);
}

.sales-cheat-col.weaknesses {
  border-top: 4px solid var(--accent-crimson);
  background: rgba(239, 68, 68, 0.02);
}

.sales-cheat-col.questions {
  border-top: 4px solid var(--accent-cyan);
  background: rgba(0, 240, 255, 0.02);
}

.sales-cheat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 10px;
}
