
/* ==========================================================================
   Matrix OSINT — Social Media Profile Monitoring (ContentTracker)
   Design System & Premium Production Stylesheet
   Version: 7.0 Tactical Intelligence Console Edition
   ========================================================================== */

/* --- 1. CSS VARIABLES & DESIGN TOKENS --- */
:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;

  /* Primary Theme: Enterprise Intelligence Portal (Palantir / Linear / SOC) */
  --bg-app: #080D14;         /* Application background */
  --bg-sidebar: #0D1520;     /* Secondary / Navigation surface */
  --bg-card: #121C29;        /* Primary surface */
  --bg-elevated: #172333;    /* Elevated surface (modals, dropdowns, hovered items) */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text-primary: #E8EDF5;   /* Crisp primary text */
  --text-secondary: #91A0B5; /* Readable secondary text */
  --text-muted: #6C7D96;     /* Subdued muted text */
  --text-inverse: #080D14;

  --accent-primary: #4F83F1; /* Primary accent */
  --accent-hover: #6494F6;   /* Accent hover */
  --accent-secondary: #19B5D8;/* Secondary accent */

  --status-success: #16C784; /* Success */
  --status-warning: #E8B45A; /* Warning */
  --status-danger: #F16B72;  /* Error / Critical Alert */
  --status-info: #4F83F1;    /* Information */

  /* Backward Compatibility Mappings */
  --bg-canvas: var(--bg-app);
  --bg-surface: var(--bg-sidebar);
  --bg-card-solid: var(--bg-card);
  --bg-card-hover: var(--bg-elevated);
  --bg-subtle: #0D1520;
  --bg-subtle-hover: #172333;
  --bg-input: #080D14;
  --bg-panel: var(--bg-card);

  --border-focus: var(--accent-primary);
  --border-glow: rgba(79, 131, 241, 0.22);

  --accent-cyan: var(--accent-secondary);
  --accent-cyan-glow: rgba(25, 181, 216, 0.16);
  --accent-blue: var(--accent-primary);
  --accent-indigo: #4F83F1;
  --accent-purple: #8B7CF6;
  --accent-violet: #8B7CF6;
  --accent-emerald: var(--status-success);
  --accent-emerald-glow: rgba(22, 199, 132, 0.14);
  --accent-amber: var(--status-warning);
  --accent-amber-glow: rgba(232, 180, 90, 0.14);
  --accent-rose: var(--status-danger);
  --accent-rose-glow: rgba(241, 107, 114, 0.16);

  --success: var(--status-success);
  --warning: var(--status-warning);
  --danger: var(--status-danger);
  --info: var(--status-info);

  /* Platform Brands (Clean Subtle Alpha Overlays) */
  --twitter-blue: #1D9BF0;
  --twitter-bg: rgba(29, 155, 240, 0.08);
  --twitter-border: rgba(29, 155, 240, 0.22);

  --instagram-pink: #E1306C;
  --instagram-bg: rgba(225, 48, 108, 0.08);
  --instagram-border: rgba(225, 48, 108, 0.22);

  --facebook-blue: #1877F2;
  --facebook-bg: rgba(24, 119, 242, 0.08);
  --facebook-border: rgba(24, 119, 242, 0.22);

  /* Geometry & Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Depth & Restrained Professional Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px -6px rgba(0, 0, 0, 0.60);
  --shadow-glow: 0 0 16px -2px rgba(100, 136, 255, 0.16);
  --shadow-rose-glow: 0 0 16px -2px rgba(241, 109, 120, 0.18);

  /* Micro-Motion & Transitions (120ms - 220ms Purposeful) */
  --transition-micro: 120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-modal: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- LIGHT THEME TOKENS --- */
body.light-theme {
  background-color: #F6F7F9 !important;
  color: #111827 !important;
  --bg-app: #F6F7F9;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --border-subtle: #E1E5EC;
  --border-medium: #D9DEE7;
  --border-strong: #94A3B8;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-inverse: #FFFFFF;

  --accent-primary: #2F6FED;
  --accent-hover: #1E50BA;
  --accent-secondary: #0D9488;

  --status-success: #16A34A;
  --status-warning: #D97706;
  --status-danger: #DC2626;
  --status-info: #2F6FED;

  --bg-canvas: var(--bg-app);
  --bg-surface: var(--bg-sidebar);
  --bg-card-solid: var(--bg-card);
  --bg-card-hover: #F8FAFC;
  --bg-subtle: #F1F5F9;
  --bg-subtle-hover: #E2E8F0;
  --bg-input: #FFFFFF;
  --bg-panel: var(--bg-card);

  --border-focus: var(--accent-primary);
  --border-glow: rgba(59, 130, 246, 0.20);

  --accent-cyan: var(--accent-secondary);
  --accent-cyan-glow: rgba(13, 148, 136, 0.12);
  --accent-blue: var(--accent-primary);
  --accent-indigo: #4F46E5;
  --accent-purple: #7C3AED;
  --accent-emerald: var(--status-success);
  --accent-amber: var(--status-warning);
  --accent-rose: var(--status-danger);

  --success: var(--status-success);
  --warning: var(--status-warning);
  --danger: var(--status-danger);
  --info: var(--status-info);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 20px -3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 16px -2px rgba(59, 130, 246, 0.12);
}

/* --- MOTION KEYFRAMES --- */
@keyframes viewFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes pulseNeon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- 2. GLOBAL RESET & BASE STYLES --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Modern Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Base Form Elements */
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  user-select: none;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Accessibility Focus Rings */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Tactile Micro-Interactions */
button:not(:disabled):active,
.btn-primary:not(:disabled):active,
.btn-tactical:not(:disabled):active,
.btn-secondary:not(:disabled):active {
  transform: scale(0.98);
}

/* Smooth Workspace View Entrance Transitions */
.tactical-workspace:not(.hidden),
.workflow-view:not(.hidden),
.monitor-view:not(.hidden),
.admin-view:not(.hidden),
#view-search:not(.hidden) {
  animation: viewFadeSlideIn var(--transition-normal) var(--ease-out-expo) forwards;
}

/* Skeleton Loading Shimmer Utility */
.skeleton-box, .col-loader {
  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: skeletonShimmer 1.8s infinite;
  border-radius: var(--radius-sm);
}

.col-loader {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

body.light-theme .skeleton-box,
body.light-theme .col-loader {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- 3. TOAST NOTIFICATION SYSTEM --- */
.toast-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  top: auto !important;
  left: auto !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 10px !important;
  max-width: min(420px, calc(100vw - 32px)) !important;
  width: auto !important;
  pointer-events: none !important;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg), 0 8px 30px rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  animation: toastSlideIn 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 180ms ease, transform 180ms ease;
  position: relative;
  overflow: hidden;
}

.toast.toast-hiding {
  opacity: 0 !important;
  transform: translateY(12px) scale(0.96) !important;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.toast-message {
  color: var(--text-secondary);
  font-size: 12px;
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--accent-cyan);
  transform-origin: left;
  animation: toastProgress linear forwards;
}

/* Accessibility Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Keyboard Badges */
kbd.kbd-key, .kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  line-height: 1;
}

body.light-theme kbd.kbd-key,
body.light-theme .kbd-key {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Global Command Palette */
.cmd-palette-category {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 12px 2px;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-micro), color var(--transition-micro);
  font-size: 13px;
  user-select: none;
}

.cmd-palette-item:hover, .cmd-palette-item.selected {
  background: var(--bg-subtle-hover);
  color: var(--accent-cyan);
}

.cmd-palette-item-icon {
  font-size: 16px;
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cmd-palette-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Active Filter Chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(100, 136, 255, 0.10);
  border: 1px solid rgba(100, 136, 255, 0.20);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.filter-chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  opacity: 0.8;
  transition: all var(--transition-fast);
}

.filter-chip .chip-remove:hover {
  opacity: 1;
  background: rgba(251, 113, 133, 0.2);
  color: var(--accent-rose);
}

.btn-clear-all-chips {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 6px;
}

.btn-clear-all-chips:hover {
  color: var(--accent-rose);
}

/* Quick Copy Buttons */
.btn-copy-quick {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-copy-quick:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* Inline Form Validation */
.form-validation-msg {
  font-size: 11.5px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-validation-msg.error {
  color: var(--accent-rose);
}

.form-validation-msg.success {
  color: var(--accent-emerald);
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-success .toast-progress { background: var(--accent-emerald); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.5); }
.toast.toast-error .toast-progress { background: var(--accent-rose); }
.toast.toast-threat, .toast.toast-critical { border-color: rgba(244, 63, 94, 0.7); box-shadow: 0 4px 18px rgba(244, 63, 94, 0.25); }
.toast.toast-threat .toast-progress, .toast.toast-critical .toast-progress { background: var(--accent-rose); }
.toast.toast-warning { border-color: rgba(245, 158, 11, 0.4); }
.toast.toast-warning .toast-progress { background: var(--accent-amber); }
.toast.toast-info { border-color: rgba(100, 136, 255, 0.25); }
.toast.toast-info .toast-progress { background: var(--accent-cyan); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* --- 4. TOP APP HEADER & NAVIGATION --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  max-width: 100vw;
  box-sizing: border-box;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(100, 136, 255, 0.12);
  border: 1px solid rgba(100, 136, 255, 0.25);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.brand-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-secondary);
  background: rgba(53, 198, 180, 0.10);
  border: 1px solid rgba(53, 198, 180, 0.25);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Nav Switch Tabs (Desktop) */
.nav-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  flex-shrink: 1;
}

.switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.switch-btn:hover {
  color: var(--text-primary);
  background: rgba(25, 37, 59, 0.5);
  border-color: rgba(41, 54, 77, 0.5);
}

.switch-btn.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

body.light-theme .switch-btn.active {
  color: var(--accent-primary);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

@media (max-width: 1380px) {
  .switch-btn {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .btn-nav-simple {
    padding: 5px 10px;
    font-size: 11px;
  }
}

@media (max-width: 1180px) {
  .switch-btn span:not(.nav-icon) {
    display: none;
  }
  .switch-btn {
    padding: 6px 10px;
  }
  .btn-nav-simple span:not(.nav-icon) {
    display: none;
  }
}

.nav-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* External Simple UI Button */
.btn-nav-simple {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(100, 136, 255, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(100, 136, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-nav-simple:hover {
  background: rgba(100, 136, 255, 0.16);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  text-decoration: none;
}

/* Header Right Utility Controls */
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.system-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 0 2px rgba(53, 201, 139, 0.2);
}

/* Header Tactical Triggers (Cmd+K Jump & Shortcuts ?) */
.btn-header-cmd, .btn-header-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-header-cmd:hover, .btn-header-help:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

/* Theme & Audio Toggle Buttons */
.theme-toggle-btn, .audio-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover, .audio-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.audio-toggle-btn.muted {
  opacity: 0.6;
  color: var(--text-muted);
}

/* User Badge & Logout */
.user-profile-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.role-pill {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(100, 136, 255, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(100, 136, 255, 0.25);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-logout svg {
  stroke: currentColor;
  stroke-width: 2;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(241, 109, 120, 0.10);
  color: var(--status-danger);
  border-color: rgba(241, 109, 120, 0.35);
}
}

.btn-logout:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(225, 29, 72, 0.3);
}

/* Mobile Hamburger Menu Toggle */
.btn-mobile-menu {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Mobile Navigation Drawer */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 290px;
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border-subtle);
  z-index: 9999;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.mob-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(100, 136, 255, 0.12);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mob-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mob-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-user-role {
  font-size: 10.5px;
  color: var(--text-muted);
}

.mob-drawer-link, .mob-drawer-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.mob-drawer-link:hover, .mob-drawer-action:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.mob-drawer-logout {
  color: var(--threat-critical);
}

.mob-drawer-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* --- MOBILE BOTTOM APP BAR --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: color-mix(in srgb, var(--bg-card-solid) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
}

.mob-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  min-width: 56px;
  -webkit-tap-highlight-color: transparent;
}

.mob-nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(100, 136, 255, 0.08);
}

.mob-nav-btn:hover {
  color: var(--text-primary);
}

/* --- 5. LOGIN SCREEN (TWO-PART ENTERPRISE INTELLIGENCE PORTAL) --- */
body:has(#view-login:not(.hidden)) .app-header,
body.is-login-screen .app-header,
.app-header.hidden {
  display: none !important;
}

body.is-login-screen {
  overflow-y: auto;
}

.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 25% 20%, rgba(79, 131, 241, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 60% 45% at 80% 80%, rgba(25, 181, 216, 0.05) 0%, transparent 65%);
}

/* Floating minimalist theme control on login screen */
.login-floating-top {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 50;
}

.login-theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.login-theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-shell {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScaleUp 200ms var(--ease-out-expo);
}

/* Left Section: Intelligence Platform Identity */
.login-identity-pane {
  padding: 36px 38px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.login-identity-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-gc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(79, 131, 241, 0.10);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.login-gc-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-secondary);
}

.login-wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.login-tagline {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-ops-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.login-platform-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.login-network-panel {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.login-network-panel:hover {
  border-color: var(--border-medium);
  box-shadow: 0 4px 20px -4px rgba(79, 131, 241, 0.12);
}

.login-network-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.login-network-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-network-label,
.login-network-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.topo-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--status-success);
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.28);
  padding: 1.5px 6px;
  border-radius: 999px;
  line-height: 1;
}

.topo-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 5px rgba(22, 199, 132, 0.8);
  animation: topoDotBlink 1.4s ease-in-out infinite;
}

@keyframes topoDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.login-network-svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--text-primary);
  overflow: visible;
}

/* Sweeping Radar Scan Beam */
.topo-scan-beam {
  animation: topoScanBeam 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes topoScanBeam {
  0% { transform: translateX(-10px); opacity: 0; }
  12% { opacity: 0.85; }
  88% { opacity: 0.85; }
  100% { transform: translateX(430px); opacity: 0; }
}

/* High-frequency animated signal streams */
.topo-stream {
  stroke-dasharray: 6 22;
  animation: topoStreamMove 2.2s linear infinite;
}

@keyframes topoStreamMove {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}

.stream-x-hub { animation-delay: 0s; }
.stream-ig-hub { animation-delay: 0.35s; }
.stream-hub-rule { animation-delay: 0.7s; }
.stream-hub-audit { animation-delay: 0.95s; }
.stream-rule-graph { animation-delay: 1.35s; }
.stream-audit-graph { animation-delay: 1.55s; }
.stream-rule-audit { animation-delay: 1.1s; stroke-dasharray: 4 16; }

/* Sonar concentric radar waves */
.topo-sonar-ping {
  transform-box: fill-box;
  transform-origin: center;
  animation: topoSonarWave 2.8s cubic-bezier(0.1, 0.5, 0.5, 1) infinite;
}

.topo-sonar-1 { animation-delay: 0s; }
.topo-sonar-2 { animation-delay: 1.4s; }

@keyframes topoSonarWave {
  0% { transform: scale(1); stroke-width: 1.8px; opacity: 0.85; }
  50% { opacity: 0.35; }
  100% { transform: scale(3.5); stroke-width: 0.5px; opacity: 0; }
}

.topo-sonar-cyan {
  transform-box: fill-box;
  transform-origin: center;
  animation: topoSonarCyanWave 2.8s cubic-bezier(0.1, 0.5, 0.5, 1) infinite 0.7s;
}

@keyframes topoSonarCyanWave {
  0% { transform: scale(1); stroke-width: 1.8px; opacity: 0.85; }
  50% { opacity: 0.35; }
  100% { transform: scale(3.2); stroke-width: 0.5px; opacity: 0; }
}

/* Rotating outer orbit rings */
.topo-orbit-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: topoRotateOrbit 26s linear infinite;
}

.topo-orbit-ring-reverse {
  transform-box: fill-box;
  transform-origin: center;
  animation: topoRotateOrbitReverse 22s linear infinite;
}

@keyframes topoRotateOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes topoRotateOrbitReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Photon traveling data particles */
.topo-photon {
  filter: drop-shadow(0 0 4px currentColor);
}

/* Hub breathing glow */
.topo-hub-center {
  animation: topoHubBreathe 3s ease-in-out infinite alternate;
  transform-origin: 178px 88px;
}

.topo-graph-center {
  animation: topoGraphBreathe 3.5s ease-in-out infinite alternate 0.6s;
  transform-origin: 358px 86px;
}

@keyframes topoHubBreathe {
  0% { filter: drop-shadow(0 0 3px rgba(79, 131, 241, 0.5)); transform: scale(1); }
  100% { filter: drop-shadow(0 0 10px rgba(79, 131, 241, 0.95)); transform: scale(1.15); }
}

@keyframes topoGraphBreathe {
  0% { filter: drop-shadow(0 0 3px rgba(25, 181, 216, 0.5)); transform: scale(1); }
  100% { filter: drop-shadow(0 0 10px rgba(25, 181, 216, 0.95)); transform: scale(1.15); }
}

/* Structural node rings and technical labels */
.topo-node-ring {
  fill: var(--bg-card);
  transition: fill var(--transition-fast), stroke var(--transition-fast);
}

.topo-label {
  fill: var(--text-muted);
  transition: fill var(--transition-fast);
}

.topo-label-hub {
  fill: var(--accent-primary);
  font-weight: 700;
}

.topo-label-graph {
  fill: var(--accent-secondary);
  font-weight: 700;
}

.login-network-panel:hover .topo-label {
  fill: var(--text-secondary);
}

.login-capabilities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.login-capabilities li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

/* Right Section: Authentication Panel */
.login-auth-pane {
  padding: 36px 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.login-box {
  width: 100%;
  max-width: 370px;
  position: relative;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: 24px;
}

.login-auth-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  background: rgba(79, 131, 241, 0.10);
  border: 1px solid rgba(79, 131, 241, 0.24);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.login-brand h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.login-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input-with-icon {
  padding-left: 38px;
}

.form-input-with-toggle {
  padding-right: 40px;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 131, 241, 0.20);
}

.btn-password-toggle {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-password-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-password-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 12px;
}

.login-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.login-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.login-session-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.login-error {
  background: rgba(241, 107, 114, 0.12);
  border: 1px solid rgba(241, 107, 114, 0.35);
  color: var(--status-danger);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 14px;
  animation: shake 260ms ease;
}

.login-success {
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.35);
  color: var(--status-success);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.login-submit {
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--accent-primary);
  color: #ffffff;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
}

.login-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.login-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.login-submit:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

.login-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* Header Neo4j & Status Restraint */
.system-health-graph {
  border-color: var(--border-subtle);
}

.status-dot-graph {
  background: var(--accent-secondary);
}

.mobile-bottom-nav.hidden {
  display: none !important;
}

/* Responsive Login Layout */
@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .login-identity-pane {
    padding: 22px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
  }
  .login-network-panel,
  .login-capabilities {
    display: none;
  }
  .login-auth-pane {
    padding: 28px 24px;
  }
  .login-box {
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  .login-screen {
    padding: 16px 12px;
    align-items: flex-start;
  }
  .login-identity-pane {
    padding: 18px 18px;
  }
  .login-auth-pane {
    padding: 22px 18px;
  }
  .form-input {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS auto-zoom */
  }
  .login-submit {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-error,
  .login-spinner,
  .pulse-emerald,
  .topo-live-dot,
  .topo-scan-beam,
  .topo-stream,
  .topo-sonar-ping,
  .topo-sonar-cyan,
  .topo-orbit-ring,
  .topo-orbit-ring-reverse,
  .topo-photon,
  .topo-hub-center,
  .topo-graph-center {
    animation: none !important;
    transition: none !important;
  }
}

/* --- 6. KPI INTELLIGENCE METRIC STRIP --- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1360px) {
  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #kpi-card-pulse {
    grid-column: span 1;
  }
  #kpi-card-neo4j {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #kpi-card-neo4j {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }
  #kpi-card-neo4j {
    grid-column: span 1;
  }
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(100, 136, 255, 0.22);
  box-shadow: var(--shadow-md);
}

/* Color Accent Bars on top of KPI cards */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}

#kpi-card-posts::before {
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
}

#kpi-card-threats::before {
  background: linear-gradient(90deg, var(--accent-rose), var(--accent-amber));
}

#kpi-card-pulse::before {
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
}

#kpi-card-neo4j::before {
  background: linear-gradient(90deg, #A78BFA, #6366F1);
}

.kpi-watermark-icon {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 48px;
  height: 48px;
  opacity: 0.05;
  color: var(--text-primary);
  pointer-events: none;
}

.kpi-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-value.threat-stat {
  color: var(--accent-rose);
}

.kpi-value.pulse-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-emerald);
  font-size: 20px;
}

.kpi-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulseNeon 1.8s infinite ease-in-out;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --- 7. COMMAND CONTROL BAR (Search Page) --- */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  max-width: 1600px;
  margin: 0 auto;
}

.control-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-add-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
}

.btn-add-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

/* Active Target User Badges Container */
.active-targets-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.target-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.target-badge.twitter {
  background: var(--twitter-bg);
  border-color: var(--twitter-border);
  color: var(--twitter-blue);
}

.target-badge.instagram {
  background: var(--instagram-bg);
  border-color: var(--instagram-border);
  color: var(--instagram-pink);
}

.target-badge.facebook {
  background: var(--facebook-bg);
  border-color: var(--facebook-border);
  color: var(--facebook-blue);
}

.target-badge.youtube {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.target-badge-btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.target-badge-btn-del:hover {
  opacity: 1;
  transform: scale(1.15);
}

.btn-clear-all-targets {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px dashed var(--border-subtle);
  transition: all var(--transition-fast);
}

.btn-clear-all-targets:hover {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

/* Platform Segmented Toggles */
.platform-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-label:hover {
  color: var(--text-primary);
}

.toggle-label:has(input:checked) {
  color: var(--text-primary);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-xs);
}

.toggle-label.twitter:has(input:checked) { color: var(--twitter-blue); }
.toggle-label.instagram:has(input:checked) { color: var(--instagram-pink); }
.toggle-label.facebook:has(input:checked) { color: var(--facebook-blue); }
.toggle-label.youtube:has(input:checked) { color: #ef4444; }

/* Auto Scroll Multi-Speed Button */
.btn-autoscroll {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-autoscroll:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.autoscroll-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.btn-autoscroll.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.btn-autoscroll.active .autoscroll-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Search Box & Keyword Tags */
.search-box-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 340px;
}

.search-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 60px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.search-shortcut-hint {
  position: absolute;
  right: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  pointer-events: none;
}

.btn-search {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-search:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-medium);
}

.keyword-tags-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(100, 136, 255, 0.10);
  border: 1px solid rgba(100, 136, 255, 0.20);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 600;
}

.kw-del {
  cursor: pointer;
  font-size: 11px;
  opacity: 0.7;
}

.kw-del:hover { opacity: 1; }

.btn-clear-all-keywords {
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
}

/* --- 8. MULTI-COLUMN FORENSIC BOARD --- */
.board-container {
  flex: 1;
  --column-width: 350px;
  --column-gap: 16px;
  padding: 14px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100% !important;
  width: 100%;
}

.board-columns {
  display: flex;
  gap: var(--column-gap);
  min-height: calc(100vh - 280px);
  align-items: stretch;
}

.platform-column {
  width: var(--column-width);
  min-width: var(--column-width);
  max-width: var(--column-width);
  flex-shrink: 0;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.platform-column:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.platform-column.collapsed {
  width: 70px;
  min-width: 70px;
}

.platform-column.collapsed .col-feed,
.platform-column.collapsed .col-header-actions,
.platform-column.collapsed .col-title-group,
.platform-column.collapsed .col-count-badge {
  display: none !important;
}

/* Column Header */
.col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
}

.col-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.col-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.col-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 14px;
  user-select: none;
}

.col-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--bg-subtle);
}

.col-title-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.col-link-arrow {
  font-size: 11px;
  color: var(--text-muted);
}

.col-platform-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.col-platform-pill.twitter { color: var(--twitter-blue); }
.col-platform-pill.instagram { color: var(--instagram-pink); }
.col-platform-pill.facebook { color: var(--facebook-blue); }
.col-platform-pill.youtube { color: #ef4444; }

.col-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.col-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.col-btn-collapse, .col-btn-close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.col-btn-collapse:hover, .col-btn-close:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.col-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-btn-scrape-live {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(100, 136, 255, 0.10);
  border: 1px solid rgba(100, 136, 255, 0.22);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.col-btn-scrape-live:hover {
  background: rgba(100, 136, 255, 0.16);
  border-color: var(--accent-cyan);
}

.col-btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.col-btn-nav:hover {
  background: var(--bg-subtle-hover);
  color: var(--accent-cyan);
  border-color: rgba(100, 136, 255, 0.25);
}

.col-btn-dossier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.col-btn-dossier:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

/* Column Feed Scroll Container */
.col-feed {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Post Cards */
.post-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.post-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.card-threat-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-threat-critical {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-threat-high {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-viral {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--accent-purple);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

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

.card-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-username {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.post-time {
  font-size: 11px;
  color: var(--text-muted);
}

.card-media {
  width: 100%;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
  margin-bottom: 8px;
}

.card-media img, .card-media video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.card-caption {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.card-caption.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.card-caption mark {
  background: rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
  padding: 0 3px;
  border-radius: 2px;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-open-post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-open-post:hover {
  background: var(--bg-subtle-hover);
  text-decoration: none;
}

.btn-export-dossier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-xs);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-indigo);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-export-dossier:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* Empty Screen State */
.empty-screen-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  max-width: 540px;
  margin: 40px auto;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-icon-halo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(100, 136, 255, 0.08);
  border: 1px solid rgba(100, 136, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
}

/* --- 9. MONITOR VIEW (Live Stream) --- */
.monitor-view {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.monitor-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

body.light-theme .monitor-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.monitor-section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.platform-readiness-note {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

/* Terminal Console Log Box */
.terminal-window {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-medium);
  background: #080c14;
  box-shadow: var(--shadow-md);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.monitor-log-box {
  background: #080c14;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- 10. ADMIN CONSOLE & USER MANAGEMENT --- */
.admin-view {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.platform-login-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: end;
}

.perm-checkboxes {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.perm-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.admin-create-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 14px;
}

.admin-error {
  color: var(--accent-rose);
  font-size: 12px;
  font-weight: 600;
}

/* Modern Data Tables */
.users-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
}

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

.users-table th {
  padding: 12px 16px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
}

.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.users-table tr:hover td {
  background: var(--bg-subtle-hover);
}

/* --- ADMIN VIEW & CONSOLE STYLING --- */
.admin-view {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
}

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

.admin-table th {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.admin-table tr:hover td {
  background: var(--bg-subtle-hover);
}

body.light-theme .admin-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* --- 11. WORKFLOW, ANALYTICS & HEALTH VIEW --- */
.workflow-view {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.health-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition-fast);
}

.health-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.health-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.health-info {
  display: flex;
  flex-direction: column;
}

.health-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.health-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.health-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.health-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.health-badge.status-ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

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

.health-badge.status-error {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.health-badge.status-pending {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Execution Workflow Pipeline */
.workflow-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 14px;
  position: relative;
}

.workflow-stage-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.workflow-stage-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(100, 136, 255, 0.12);
}

.workflow-stage-card.active-stage {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px -2px rgba(100, 136, 255, 0.22);
}

.wf-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wf-stage-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.wf-stage-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.wf-stage-pill.pill-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.wf-stage-pill.pill-running {
  background: rgba(100, 136, 255, 0.12);
  color: var(--accent-cyan);
  animation: pulseNeon 1.5s infinite ease-in-out;
}

.wf-stage-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wf-stage-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.workflow-detail-box {
  margin-top: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: fadeIn 200ms ease;
}

.workflow-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-close-detail {
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close-detail:hover { color: var(--text-primary); }

/* Volume Charts Grid */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.analytics-chart-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.chart-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bar-label {
  width: 120px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill.bar-twitter { background: var(--twitter-blue); }
.bar-fill.bar-instagram { background: var(--instagram-pink); }
.bar-fill.bar-facebook { background: var(--facebook-blue); }

.bar-count {
  width: 50px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.metrics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.metric-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.metric-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.metric-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- 12. ADD TARGET PROFILE MODAL --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open,
.modal-backdrop.active,
.modal-backdrop[style*="display: flex"] {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-plat-row {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-plat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.plat-badge-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.plat-badge-pill.twitter-pill {
  background: var(--twitter-bg);
  color: var(--twitter-blue);
  border: 1px solid var(--twitter-border);
}

.plat-badge-pill.instagram-pill {
  background: var(--instagram-bg);
  color: var(--instagram-pink);
  border: 1px solid var(--instagram-border);
}

.plat-badge-pill.facebook-pill {
  background: var(--facebook-bg);
  color: var(--facebook-blue);
  border: 1px solid var(--facebook-border);
}

.modal-active-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-plat-input {
  font-size: 13px;
  padding: 8px 12px;
}

.modal-footer {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
}

.btn-secondary {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.btn-primary {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- 13. RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1440px) {
  .brand-subtitle {
    display: none;
  }
  .app-header {
    padding: 8px 14px;
    gap: 8px;
  }
  .header-status .system-health-pill:not(#backend-health-pill) {
    display: none;
  }
  .nav-switch {
    gap: 2px;
    padding: 2px;
  }
  .switch-btn {
    padding: 5px 10px;
    font-size: 11.5px;
    gap: 4px;
  }
  .btn-nav-simple {
    padding: 5px 8px;
    font-size: 11px;
  }
  .btn-nav-simple span:last-child {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-status {
    gap: 6px;
  }
  .system-health-pill {
    padding: 4px 8px;
    font-size: 11px;
  }
  .system-health-pill span#api-status-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .theme-toggle-btn span:last-child,
  .audio-toggle-btn span:last-child {
    display: none; /* Icon-only compact pills on laptop screens */
  }
  .theme-toggle-btn, .audio-toggle-btn {
    padding: 5px 8px;
  }
  .user-badge {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  .btn-logout {
    padding: 6px 13px;
    font-size: 12px;
  }
}

@media (max-width: 1300px) {
  .switch-btn .nav-label,
  .switch-btn span:not(.nav-icon):not(.nav-tab-badge) {
    display: none;
  }
  .switch-btn {
    padding: 6px 10px;
  }
  .btn-nav-simple .nav-label,
  .btn-nav-simple span:not(.nav-icon) {
    display: none;
  }
}

@media (max-width: 1200px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow-pipeline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1100px) {
  .app-header {
    padding: 8px 12px;
  }
  .nav-switch {
    display: none; /* Collapses to mobile drawer & bottom nav on screens <= 1100px */
  }
  .btn-mobile-menu {
    display: flex;
  }
  .mobile-drawer-backdrop {
    display: block;
  }
  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box-group {
    min-width: 100%;
  }
  .admin-create-grid {
    grid-template-columns: 1fr;
  }
  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .app-header {
    padding: 8px 12px;
  }
  .header-sub {
    display: none;
  }
  .header-status {
    gap: 4px;
  }
  .header-status .theme-toggle-btn,
  .header-status .audio-toggle-btn,
  .header-status .user-profile-cluster,
  .header-status .btn-logout {
    display: none !important; /* Accessible in mobile drawer and bottom bar */
  }
  .system-health-pill {
    padding: 4px 8px;
    font-size: 11px;
  }
  .system-health-pill span:last-child {
    display: none;
  }
  .board-container {
    padding: 12px 14px;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 14px;
  }
  .platform-column {
    scroll-snap-align: center;
    width: calc(100vw - 32px);
    min-width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    flex-shrink: 0;
  }
  .col-feed {
    max-height: calc(100vh - 300px);
  }
  .filter-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
  .pill-filter {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .control-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .btn-add-profile, .btn-refresh-all {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    gap: 8px;
  }
  .health-grid {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }
  .workflow-pipeline {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }
  .monitor-grid {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }
  .admin-panel {
    padding: 12px 14px;
  }
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Modal Bottom Sheet on mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    border-bottom: none;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 14px 16px;
    max-height: calc(85vh - 120px);
  }
  .modal-footer {
    padding: 12px 16px;
  }
}

/* ==========================================================================
   TACTICAL DARK INTELLIGENCE OPERATIONS CENTER COMPONENTS
   ========================================================================== */

/* Main Unified Workspace */
.tactical-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px 32px;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

.tactical-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1200px) {
  .tactical-split {
    grid-template-columns: 1fr;
  }
}

/* Tactical Profile Card Grid */
.tactical-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tactical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.tactical-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(8, 13, 22, 0.6);
  transform: translateY(-1px);
}

.tactical-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tactical-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-cyan);
}

.tactical-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tactical-card-meta {
  flex: 1;
  min-width: 0;
}

.tactical-card-handle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tactical-card-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tactical-badge-posts {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(100, 136, 255, 0.10);
  color: var(--accent-cyan);
  border: 1px solid rgba(100, 136, 255, 0.18);
  margin-left: auto;
  white-space: nowrap;
}

.tactical-card-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.tactical-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

.tactical-status-pill.monitored {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.tactical-status-pill.scraping {
  background: rgba(100, 136, 255, 0.10);
  color: var(--accent-cyan);
  border: 1px solid rgba(100, 136, 255, 0.18);
}

.tactical-status-pill.idle {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.tactical-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.btn-tactical {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-tactical:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-tactical.primary {
  background: rgba(100, 136, 255, 0.10);
  color: var(--accent-cyan);
  border-color: rgba(100, 136, 255, 0.20);
}

.btn-tactical.primary:hover {
  background: rgba(100, 136, 255, 0.18);
  border-color: var(--accent-cyan);
}

.btn-tactical.danger {
  color: var(--accent-rose);
  padding: 6px 8px;
  flex: 0 0 auto;
}

.btn-tactical.danger:hover {
  background: rgba(251, 113, 133, 0.15);
  border-color: rgba(251, 113, 133, 0.35);
}

/* Real-Time Intelligence Stream & Threat Sidebar */
.intel-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intel-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.intel-panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.intel-stream-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.intel-event-item {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  transition: border-color var(--transition-fast);
}

.intel-event-item:hover {
  border-color: var(--border-medium);
}

.intel-event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.intel-event-msg {
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.intel-event-msg strong {
  color: var(--text-primary);
}

/* Threat Alert Card */
.threat-alert-card {
  padding: 12px 14px;
  background: rgba(251, 113, 133, 0.06);
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.threat-alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.threat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(251, 113, 133, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(251, 113, 133, 0.4);
}

/* Neo4j Graph Intelligence Styles */
.graph-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.graph-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.light-theme .graph-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.graph-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.graph-stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.graph-stat-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Dossier Modal */
.dossier-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dossier-banner {
  height: 120px;
  background: linear-gradient(135deg, #111b2b, #1e293b);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.dossier-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dossier-avatar-wrap {
  position: absolute;
  bottom: -24px;
  left: 20px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  overflow: hidden;
  background: var(--bg-surface);
}

.dossier-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dossier-meta {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dossier-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.dossier-stat-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dossier-stat-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.dossier-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   MOBILE VIEW & RESPONSIVE PERFECTION (< 768px and < 480px)
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Mobile Toasts: Dock to bottom above bottom app bar, avoiding header button collisions */
  .toast-container {
    top: auto !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    pointer-events: none !important;
  }
  .toast {
    pointer-events: auto;
    font-size: 12px;
    padding: 10px 14px;
  }

  /* Header adjustments */
  .app-header {
    padding: 8px 12px;
    height: 56px;
  }
  .brand-logo-wrap {
    width: 32px;
    height: 32px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  .brand-subtitle {
    display: none;
  }

  /* Status pills in header */
  #header-poller-pill, #header-graph-pill {
    display: none !important;
  }
  .system-health-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* Main Tactical Workspace on Mobile */
  .tactical-workspace {
    padding: 10px 10px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 12px;
  }

  /* KPI Strip - Sleek 2-column grid */
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 4px 0 8px !important;
  }
  .kpi-card {
    padding: 10px 12px;
  }
  .kpi-title {
    font-size: 11px;
  }
  .kpi-value {
    font-size: 19px;
  }
  .kpi-sub {
    font-size: 10px;
    margin-top: 2px;
  }
  #kpi-card-neo4j {
    grid-column: span 2;
  }

  /* Tactical Split - Stack Left & Right */
  .tactical-split {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Target Profiles Grid on Mobile */
  .tactical-profile-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .tactical-card {
    padding: 12px 14px;
  }
  .btn-tactical {
    min-height: 38px;
    font-size: 12px;
  }

  /* Filter pills horizontal scroll */
  .filter-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    padding: 2px 0 6px;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
  .pill-filter {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Mobile Drawer */
  .mobile-drawer {
    width: 290px;
    max-width: 85vw;
    background: var(--bg-card-solid);
    border-left: 1px solid var(--border-subtle);
  }
  .mobile-drawer-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Mobile Bottom App Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: color-mix(in srgb, var(--bg-card-solid) 96%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-subtle);
    z-index: 9990 !important;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
  }

  /* Bottom Clearance for all Main Views on Mobile */
  .workflow-view,
  .admin-view,
  .monitor-view,
  .tactical-workspace,
  .board-container {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mob-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
  }
  .mob-nav-btn.active {
    color: var(--accent-cyan);
  }
  .mob-nav-btn svg {
    stroke-width: 2.2;
  }

  /* Modals as Mobile Bottom Sheets */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 86vh !important;
    border-bottom: none !important;
    animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Dossier stats on mobile */
  .dossier-stats-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Neo4j stats on mobile */
  .graph-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .graph-stat-card {
    padding: 10px 12px !important;
  }
  .graph-stat-num {
    font-size: 18px !important;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 6px 10px;
  }
  .system-health-pill {
    display: none;
  }
  .btn-tactical {
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* --- Monitoring Alert Event Triage & Profile Highlights --- */
.tactical-card.highlight-active {
  border: 1.5px solid var(--accent-rose) !important;
  box-shadow: 0 4px 16px rgba(251, 113, 133, 0.18) !important;
  background: var(--bg-card) !important;
}

body.light-theme .tactical-card.highlight-active {
  border-color: #fb7185 !important;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.15) !important;
}

.pulse-rose {
  background-color: var(--accent-rose);
  box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7);
  animation: pulseRose 1.8s infinite;
}

@keyframes pulseRose {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(251, 113, 133, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(251, 113, 133, 0);
  }
}

.btn-filter-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-filter-pill:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.btn-filter-pill.active {
  background: var(--accent-blue);
  color: #ffffff !important;
  border-color: var(--accent-blue);
}

body.light-theme .btn-filter-pill.active {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #0284c7;
}

.btn-link {
  text-decoration: underline;
  cursor: pointer;
}
.btn-link:hover {
  opacity: 0.8;
}

/* ==============================================================================
   NEO4J INTERACTIVE LINK ANALYSIS NETWORK GRAPH
   ============================================================================== */
#neo4j-network-canvas {
  width: 100%;
  height: 520px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: #0b0f19;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  transition: background-color var(--transition-normal);
}

body.light-theme #neo4j-network-canvas {
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

div.vis-tooltip {
  position: absolute;
  visibility: hidden;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  color: #FFFFFF;
  background-color: rgba(15, 23, 42, 0.95);
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 1000;
  max-width: 320px;
}

body.light-theme div.vis-tooltip {
  color: #0F172A;
  background-color: rgba(255, 255, 255, 0.98);
  border: 1px solid #CBD5E1;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

#neo4j-node-inspector {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.graph-view-hidden {
  display: none !important;
}

/* ================= RULES WORD MULTI-SELECT & BULK DELETE ================= */
.rule-word-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.rule-word-tag:hover {
  border-color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.08);
}

.rule-word-tag.selected {
  background: rgba(251, 113, 133, 0.16) !important;
  border-color: var(--accent-rose) !important;
  color: var(--accent-rose) !important;
  font-weight: 600;
}

.rule-word-tag input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-rose);
  width: 13px;
  height: 13px;
  margin: 0;
}

.rule-word-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 3px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  opacity: 0.65;
  transition: all 0.15s ease;
}

.rule-word-tag:hover .rule-word-del-btn,
.rule-word-del-btn:hover {
  opacity: 1;
  color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.2);
}

.rule-bulk-check {
  cursor: pointer;
  accent-color: var(--accent-rose);
  width: 16px;
  height: 16px;
}

/* ================= PRODUCTION PAGINATION SYSTEM ================= */
.matrix-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(100, 136, 255, 0.08);
  color: var(--accent-cyan);
}

.btn-page.active {
  background: linear-gradient(135deg, #1877f2, #1558b0) !important;
  border-color: #1877f2 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

.btn-page:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.btn-page.dots {
  border: none;
  background: none;
  cursor: default;
  color: var(--text-muted);
}

.pagination-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-size-select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pagination-jump-input {
  width: 48px;
  padding: 4px 6px;
  text-align: center;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ================= DOSSIER POSTS & RULE MATCH TABS ================= */
.dossier-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dossier-tab-btn:hover {
  background: rgba(100, 136, 255, 0.06);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.dossier-tab-btn.active {
  background: linear-gradient(135deg, #1877f2, #1558b0) !important;
  border-color: #1877f2 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

.dossier-tab-btn.highlight-active {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
}

.rule-match-card {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  transition: border-color 0.15s ease;
}

.rule-match-card:hover {
  border-color: var(--accent-cyan);
}

/* ================= SURVEILLANCE DECKS & MULTI-SCREEN WORKSPACE BAR ================= */
.deck-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  margin: 0 16px 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.deck-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.deck-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.5px;
}

.deck-pills-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.deck-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.deck-pill:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.deck-pill.active {
  background: rgba(100, 136, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.deck-pill-add {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 14px;
  background: transparent;
  border: 1px dashed var(--border-medium);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.deck-pill-add:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.deck-pill-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.deck-pill-wrapper:hover {
  border-color: var(--border-medium);
}

.deck-pill-wrapper.active {
  background: rgba(100, 136, 255, 0.12);
  border-color: var(--accent-cyan);
}

.deck-pill-wrapper .deck-pill {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 4px 8px 4px 10px;
}

.deck-pill-wrapper.active .deck-pill {
  color: var(--accent-cyan);
  font-weight: 700;
}

.deck-pill-del {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 7px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.deck-pill-del:hover {
  background: rgba(239, 68, 68, 0.18);
  color: var(--accent-rose);
}

.deck-pill-manage {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.deck-pill-manage:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--bg-subtle-hover);
}

.deck-crud-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition-fast);
}

.deck-crud-card:hover {
  border-color: var(--border-medium);
}

.deck-crud-card.is-active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(100, 136, 255, 0.10);
}

.deck-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.deck-target-chip-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
}

.deck-target-chip-del:hover {
  color: var(--accent-rose);
}

.deck-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Density Buttons */
.density-group {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 2px;
}

.btn-density {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-density:hover {
  color: var(--text-primary);
}

.btn-density.active {
  background: var(--bg-surface);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* Zoom Stepper */
.zoom-stepper-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.btn-zoom-step {
  width: 26px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-zoom-step:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.zoom-val-display {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 6px;
  min-width: 42px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-mono);
}

.zoom-val-display:hover {
  color: var(--accent-cyan);
}

/* Popout Button */
.btn-popout-screen {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-popout-screen:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: #a78bfa;
  color: #fff;
}

.btn-refresh-board {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(100, 136, 255, 0.08);
  border: 1px solid rgba(100, 136, 255, 0.20);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-refresh-board:hover {
  background: rgba(100, 136, 255, 0.16);
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-refresh-deck {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: rgba(100, 136, 255, 0.10);
  border: 1px solid rgba(100, 136, 255, 0.22);
  color: var(--accent-cyan);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-refresh-deck:hover {
  background: rgba(100, 136, 255, 0.16);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Density: CCTV Compact Wall Mode (Fits 8-12 columns on screen!) */
.board-container.density-compact {
  --column-width: 245px;
  --column-gap: 10px;
  padding: 8px 12px;
}

.board-container.density-compact .col-header {
  padding: 8px 10px;
}

.board-container.density-compact .col-title {
  font-size: 12px;
}

.board-container.density-compact .col-header-actions button {
  padding: 3px 6px;
  font-size: 10px;
}

.board-container.density-compact .post-card {
  padding: 10px;
  margin-bottom: 8px;
}

.board-container.density-compact .post-caption {
  font-size: 11px;
  line-height: 1.4;
  -webkit-line-clamp: 3;
}

.board-container.density-compact .post-media-container {
  max-height: 140px;
}

/* Density: Comfortable / Wide Mode (2-3 columns per screen) */
.board-container.density-comfortable {
  --column-width: 440px;
  --column-gap: 20px;
}

/* Fullscreen Popout / Wall Mode */
body.wall-popout-mode #header,
body.wall-popout-mode .control-bar,
body.wall-popout-mode #mobile-bottom-nav,
body.wall-popout-mode .deck-workspace-bar {
  display: none !important;
}

body.wall-popout-mode .board-container {
  padding: 8px !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

body.wall-popout-mode .board-columns {
  min-height: calc(100vh - 20px) !important;
}



/* --- PLATFORM PROFILES SUMMARY BAR (Overview View) --- */
.platform-profiles-summary-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.plat-stat-pill {
  flex: 1 1 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.plat-stat-pill:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.plat-stat-pill.plat-twitter { border-left: 3px solid var(--accent-primary); }
.plat-stat-pill.plat-instagram { border-left: 3px solid #ec4899; }
.plat-stat-pill.plat-facebook { border-left: 3px solid #3b82f6; }
.plat-stat-pill.plat-youtube { border-left: 3px solid #ef4444; }

.plat-stat-icon {
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plat-stat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.plat-stat-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
}

.plat-stat-unit {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- MONITORED GROUPS & TARGET CARDS (Target Profiles View) --- */
.monitored-deck-pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.monitored-deck-pill:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.monitored-deck-pill.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(100, 136, 255, 0.22);
}

.monitored-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(100, 136, 255, 0.10);
  color: var(--accent-cyan);
  border: 1px solid rgba(100, 136, 255, 0.18);
}


/* --- SHOW MORE / SHOW LESS TARGET BADGES TOGGLE --- */
.btn-toggle-more-targets {
  background: rgba(100, 136, 255, 0.12);
  border: 1px solid rgba(100, 136, 255, 0.25);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-toggle-more-targets:hover {
  background: rgba(100, 136, 255, 0.20);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* ==========================================================================
   Matrix OSINT — World-Class UX & Interaction Design Extension (v8.0)
   ========================================================================== */

/* View Breadcrumb Bar */
.view-breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin-bottom: 12px;
  background: rgba(14, 22, 38, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
}
.view-breadcrumb-bar .bc-root { font-weight: 700; color: var(--accent-cyan); }
.view-breadcrumb-bar .bc-sep { opacity: 0.5; }
.view-breadcrumb-bar .bc-current { font-weight: 600; color: var(--text-primary); }
.view-breadcrumb-bar .bc-desc { color: var(--text-muted); font-size: 11px; margin-left: 4px; }

/* Actionable Operations Command Center Banner */
.overview-ops-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.ops-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.ops-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(100, 136, 255, 0.10);
  border: 1px solid rgba(100, 136, 255, 0.20);
}

.ops-banner-info {
  display: flex;
  flex-direction: column;
}

.ops-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.ops-banner-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ops-banner-middle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 280px;
}

.ops-banner-middle.has-urgent {
  background: rgba(241, 109, 120, 0.08);
  border-color: rgba(241, 109, 120, 0.30);
}

.attention-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.attention-content {
  flex: 1;
  min-width: 0;
}

.attention-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.attention-desc {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-ops-action {
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-ops-action:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

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

.ops-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-success);
}
.ops-quick-missions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.missions-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.btn-quick-mission {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.btn-quick-mission:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* Post Card Quick Actions Toolbar */
.card-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.card-quick-actions-left {
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-card-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}
.btn-card-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}
.btn-card-action.btn-action-primary {
  color: var(--accent-cyan);
  border-color: rgba(100, 136, 255, 0.20);
}
.btn-card-action.btn-action-primary:hover {
  background: rgba(100, 136, 255, 0.12);
  border-color: var(--accent-cyan);
}

/* Post Forensics Detail Drawer */
.post-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-medium);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1999;
}
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}
.drawer-plat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(100, 136, 255, 0.12);
  color: var(--accent-cyan);
}
.drawer-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.drawer-close:hover { color: var(--text-primary); }
.drawer-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.drawer-caption-text {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg-surface);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: pre-wrap;
  word-break: break-word;
}
.drawer-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawer-meta-item {
  background: var(--bg-surface);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-meta-item .meta-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; }
.drawer-meta-item .meta-val { font-size: 12.5px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.drawer-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.drawer-raw-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.drawer-raw-details summary { cursor: pointer; font-weight: 600; }
.drawer-json-pre {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-canvas);
  padding: 10px;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  color: var(--accent-cyan);
}

/* Helpful Empty State Card */
.matrix-empty-state-card {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 44px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 580px;
  margin: 30px auto;
}
.empty-state-icon { font-size: 40px; opacity: 0.8; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.empty-state-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin: 0; max-width: 440px; }
.empty-state-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* Custom Confirm Modal Callout */
.confirm-item-callout {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-amber);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Mobile Board Platform Segmented Switcher */
.mobile-board-platform-switcher {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin: 10px 16px;
  gap: 4px;
}
@media (max-width: 768px) {
  .mobile-board-platform-switcher {
    display: flex;
  }
}
.mob-plat-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}
.mob-plat-tab.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Live Navigation Tab Badges */
.nav-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  line-height: 1.3;
}
.nav-tab-badge.badge-threats {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.nav-tab-badge.badge-resolver {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* High Contrast Accessible Focus Rings */
:focus-visible {
  outline: 2px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

/* Tactile button loading spinner */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   STATUS HONESTY LAYER — states for live health pills and the new-post toast
   ========================================================================== */
.pill-dot.ok   { background: var(--status-success); }
.pill-dot.idle { background: var(--text-muted); }
.pill-dot.bad  { background: var(--status-danger); }

/* Live-post toasts dock safely to bottom-right, avoiding any collision with header controls */
.toast-container {
  top: auto !important;
  bottom: 24px !important;
  right: 24px !important;
  left: auto !important;
  flex-direction: column-reverse !important;
}
.toast.toast-live { border-color: var(--border-medium); }
.toast.toast-live .toast-icon { color: var(--accent-secondary); }
.toast.toast-live .toast-progress { background: var(--accent-secondary); }
.toast.toast-live .toast-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 768px) {
  .toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    left: 12px !important;
    top: auto !important;
    max-width: none !important;
  }
}

/* ==========================================================================
   HEADER FIT & OVERFLOW RESILIENCE —
   Tabs & header controls scale smoothly from ultra-wide down to mobile
   without clipping, collision, or overlapping each other.
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  height: 56px;
  max-height: 56px;
  box-sizing: border-box;
  flex-wrap: nowrap;
  overflow: visible;
}

.app-header .nav-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-header .nav-switch::-webkit-scrollbar {
  display: none;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

/* Breakpoint: Laptop / Compact Desktop (<= 1680px) */
@media (max-width: 1680px) {
  /* In nav switch: collapse inactive tabs to icon-only, active tab keeps label */
  .nav-switch .switch-btn:not(.active) .nav-label {
    display: none;
  }
  .nav-switch .switch-btn {
    padding: 6px 9px;
    gap: 0;
  }
  .nav-switch .switch-btn.active {
    padding: 6px 12px;
    gap: 6px;
  }
  .nav-switch .switch-btn.active .nav-label {
    display: inline;
  }
  .nav-switch .btn-nav-simple .nav-label {
    display: none;
  }
  .nav-switch .btn-nav-simple {
    padding: 6px 9px;
    gap: 0;
  }

  /* In header status: collapse labels to sleek icons with tooltip */
  #theme-text,
  #audio-text,
  .btn-label-cmd {
    display: none !important;
  }
  .theme-toggle-btn, .audio-toggle-btn {
    padding: 5px 8px;
    min-width: 32px;
    justify-content: center;
  }
  .btn-header-cmd {
    padding: 5px 7px;
  }
  #api-status-text {
    font-size: 0;
  }
  #api-status-text::after {
    content: "Live";
    font-size: 11px;
  }
}

/* Breakpoint: Mid-size Laptop (<= 1440px) */
@media (max-width: 1440px) {
  .brand-subtitle {
    display: none;
  }
  #header-graph-pill-wrap,
  .header-status .system-health-pill:not(#backend-health-pill) {
    display: none !important;
  }
  .btn-logout .btn-logout-text {
    display: none !important;
  }
  .btn-logout {
    padding: 5px 8px !important;
  }
}

/* Breakpoint: Small Screen / Split-Screen (<= 1250px) */
@media (max-width: 1250px) {
  #api-status-text {
    display: none !important;
  }
  .btn-header-help {
    display: none !important;
  }
  .nav-switch .switch-btn.active .nav-label {
    display: none;
  }
  .nav-switch .switch-btn.active {
    padding: 6px 9px;
    gap: 0;
  }
}

/* Breakpoint: Tablet / Mobile Drawer Mode (<= 1100px) */
@media (max-width: 1100px) {
  .nav-switch {
    display: none !important;
  }
  .btn-mobile-menu {
    display: flex !important;
  }
}

/* ==========================================================================
   DESIGN SYSTEM v2 — "Control room"
   For analysts working long shifts: low glare, tonal surfaces instead of
   outlines, one signal colour (amber/rose) reserved for "needs review".
   System font stack: no third-party font requests from an intranet tool.
   ========================================================================== */
:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg-app: #0A1017;
  --bg-sidebar: #0E151D;
  --bg-card: #121A24;
  --bg-elevated: #19232F;
  --border-subtle: #1F2A37;
  --border-medium: #2C3A4B;
  --border-strong: #425468;

  --text-primary: #E9EEF4;
  --text-secondary: #A6B3C3;
  --text-muted: #7A899C;

  --accent-primary: #5E8BF0;
  --accent-hover: #7399F3;
  --accent-secondary: #3DB8A4;

  --status-success: #3CB98A;
  --status-warning: #E9A93C;
  --status-danger: #EF6B73;

  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px -6px rgba(0, 0, 0, 0.5);
}

body {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* --- Header: tabs read as a navigation bar, not a boxed control --- */
.nav-switch { background: transparent; border-color: transparent; padding: 0; gap: 2px; }
.switch-btn { border-radius: var(--radius-md); }
.switch-btn:hover { background: var(--bg-elevated); }
.switch-btn.active {
  background: var(--bg-elevated);
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--accent-primary);
}

/* ==========================================================================
   TACTICAL OVERVIEW MISSION COMMAND — PALANTIR / LINEAR GRADE UI/UX
   ========================================================================== */

/* Breadcrumb & Telemetry Header */
.view-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.view-breadcrumb-bar .bc-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.view-breadcrumb-bar .crumb-root {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.view-breadcrumb-bar .crumb-separator {
  color: var(--text-muted);
}

.view-breadcrumb-bar .crumb-current {
  font-weight: 600;
  color: var(--text-secondary);
}

.view-breadcrumb-bar .crumb-details {
  font-size: 12px;
  color: var(--text-muted);
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.telemetry-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
}

/* Actionable Operations Command Center Banner */
.overview-ops-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ops-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
}

.ops-shield-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.20);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ops-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ops-banner-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.ops-banner-middle {
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.ops-banner-middle.has-urgent {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.10);
}

.attention-pulse-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attention-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.attention-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.btn-ops-action {
  background: var(--accent-primary);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-ops-action:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.ops-banner-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ops-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Operations Quick Missions Toolbar */
.ops-quick-missions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.missions-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-quick-mission {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-quick-mission:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-quick-mission.primary {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent-primary);
}

.btn-quick-mission.primary:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent-primary);
}

/* Master Intelligence Analytics KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card-cyan::before { background: #06B6D4; }
.kpi-card-blue::before { background: #3B82F6; }
.kpi-card-rose::before { background: #F43F5E; }
.kpi-card-emerald::before { background: #10B981; }
.kpi-card-purple::before { background: #8B5CF6; }

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}

.kpi-tag-cyan { background: rgba(6, 182, 212, 0.12); color: #0891B2; }
.kpi-tag-blue { background: rgba(59, 130, 246, 0.12); color: #2563EB; }
.kpi-tag-rose { background: rgba(244, 63, 94, 0.12); color: #E11D48; }
.kpi-tag-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.kpi-tag-purple { background: rgba(139, 92, 246, 0.12); color: #7C3AED; }

.kpi-value {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-bottom: 6px;
}

.kpi-value.threat-stat { color: var(--accent-rose); }
.kpi-value.pulse-stat {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--status-success);
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.kpi-watermark-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  opacity: 0.05;
  color: var(--text-primary);
  pointer-events: none;
}

@media (max-width: 1360px) { .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .kpi-strip { grid-template-columns: 1fr; } }

/* Platform Profiles Breakdown Bar */
.platform-profiles-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.plat-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-fast);
}

.plat-stat-pill:hover {
  transform: translateY(-1px);
  border-color: var(--border-medium);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.plat-stat-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plat-x-icon { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); }
body:not(.light-theme) .plat-x-icon { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.plat-ig-icon { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(244,63,94,0.15)); color: #EC4899; }
.plat-fb-icon { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.plat-yt-icon { background: rgba(239, 68, 68, 0.12); color: #EF4444; }

.plat-stat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.plat-stat-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.plat-stat-unit {
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .platform-profiles-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tactical Profile Card Grid & Components */
.tactical-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.tactical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tactical-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}

.tactical-card.card-has-match {
  border-color: var(--accent-rose);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.03) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.12);
}

.tactical-card.card-is-pinned {
  border-color: rgba(16, 185, 129, 0.40);
}

.tactical-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tactical-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.tactical-card-avatar:hover {
  transform: scale(1.05);
}

.plat-av-x { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.plat-av-ig { background: rgba(236, 72, 153, 0.12); color: #EC4899; }
.plat-av-fb { background: rgba(59, 130, 246, 0.12); color: #2563EB; }
.plat-av-yt { background: rgba(239, 68, 68, 0.12); color: #EF4444; }

.avatar-platform-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tactical-card-meta {
  flex: 1;
  min-width: 0;
}

.tactical-card-handle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tactical-card-handle:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.plat-tag-mini {
  font-size: 11.5px;
  color: var(--text-muted);
}

.tactical-badge-posts {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

.tactical-badge-posts:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.tactical-card-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.tactical-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2.5px 7px;
  border-radius: var(--radius-xs);
}

.tactical-status-pill.match-alert {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.30);
}

.tactical-status-pill.monitored {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tactical-id-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.card-threat-banner {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-threat-banner:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: var(--accent-rose);
}

.threat-banner-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-rose);
}

.threat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

.threat-click-hint {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.8;
}

.threat-term-snippet {
  font-size: 11px;
  color: var(--text-primary);
  margin-top: 2px;
}

.tactical-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.card-actions-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.card-actions-primary .btn-tactical {
  flex: 1;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-actions-primary .btn-tactical:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--accent-primary);
}

.card-actions-utility {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-tactical-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tactical-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-tactical-icon.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--accent-rose);
}

.btn-tactical-icon.is-active-pin {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.30);
  color: var(--status-success);
}

/* --- LIGHT THEME POLISH FOR TACTICAL OVERVIEW --- */
body.light-theme .kpi-card {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .kpi-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body.light-theme .tactical-card {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .tactical-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body.light-theme .tactical-card.card-has-match {
  background: #FFF1F2;
  border-color: #FDA4AF;
}

body.light-theme .card-threat-banner {
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(244, 63, 94, 0.25);
}

body.light-theme .card-actions-primary .btn-tactical {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #1E293B;
}

body.light-theme .card-actions-primary .btn-tactical:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #2563EB;
}

body.light-theme .btn-tactical-icon {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #475569;
}

body.light-theme .btn-tactical-icon:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}

body.light-theme .plat-stat-pill {
  background: #FFFFFF;
  border-color: #E2E8F0;
}

body.light-theme .plat-stat-pill:hover {
  border-color: #CBD5E1;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
}

body.light-theme .ops-quick-missions {
  background: #FFFFFF;
  border-color: #E2E8F0;
}

body.light-theme .btn-quick-mission {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #1E293B;
}

body.light-theme .btn-quick-mission:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}

body.light-theme .telemetry-pill {
  background: #FFFFFF;
  border-color: #E2E8F0;
  color: #475569;
}

/* ==========================================================================
   DESIGN SYSTEM v2 — shared components used by Targets, Posts, Threat intel,
   Graph, Scraper, Admin and Resolver screens
   ========================================================================== */
.view-breadcrumb-bar { background: transparent; border: 0; padding: 2px 0; margin-bottom: 8px; }

/* Panels: tonal surface, no blur, no lift */
.tactical-card, .intel-panel-card, .graph-stat-card, .monitor-card, .admin-panel {
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  box-shadow: none;
}
.tactical-card { border-radius: var(--radius-md); }
.tactical-card:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.monitor-card, .admin-panel { padding: 20px 22px; }

/* Headings: sentence case, no tracked all-caps */
.intel-panel-title { font-size: 14px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.monitor-section-title { font-size: 15px; font-weight: 650; }
.graph-stat-label { font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.graph-stat-num { font-family: var(--font-sans); font-size: 24px; font-weight: 650; color: var(--text-primary); letter-spacing: -0.01em; }
.tactical-status-pill { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.tactical-badge-posts { font-family: var(--font-sans); font-weight: 600; }

/* Controls: one primary style, calm secondary */
.btn-primary {
  background: var(--accent-primary);
  box-shadow: none;
  border-radius: var(--radius-md);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-tactical { border-radius: var(--radius-md); font-size: 12px; }
.deck-pill { border-radius: var(--radius-full); font-size: 12px; }
.form-input { border-radius: var(--radius-md); }
.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(94, 139, 240, 0.22);
}
.btn-primary:focus-visible, .btn-tactical:focus-visible, .deck-pill:focus-visible, .btn-filter-pill:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* --- Admin: account form and log header --- */
#admin-create-form { gap: 14px 16px !important; }
#admin-create-form label { display: block; font-size: 12px !important; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
#admin-create-form .form-input { width: 200px !important; padding: 8px 12px !important; font-size: 13px !important; }
#admin-create-form .admin-perms { display: flex; gap: 16px; align-items: center; padding-bottom: 8px; }
#admin-create-form .admin-perms label { display: flex; align-items: center; gap: 6px; margin: 0; }
#admin-create-submit { padding: 8px 16px !important; font-size: 13px !important; }
.admin-table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

/* Resolver stat numbers use the shared sans numerals instead of mono + status colours */
#resolver-stat-pending, #resolver-stat-resolved { font-family: var(--font-sans) !important; font-weight: 650 !important; }

/* ==========================================================================
   PART 1: LEFT SIDEBAR & TOPBAR APPLICATION LAYOUT
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-app, #F6F7F9);
}

.app-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: var(--bg-card, #FFFFFF);
  border-right: 1px solid var(--border-subtle, #E1E5EC);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  padding: 16px 12px;
  transition: margin-left 220ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
}

/* Desktop Collapsed Sidebar State */
.app-layout.sidebar-collapsed .app-sidebar {
  margin-left: -240px;
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 16px 8px;
  border-bottom: 1px solid var(--border-subtle, #E1E5EC);
  margin-bottom: 16px;
}

.sidebar-brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #E1E5EC);
  background: transparent;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 160ms ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--bg-hover, #F3F4F6);
  color: var(--text-primary, #111827);
  border-color: #CBD5E1;
}

.sidebar-brand-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2F6FED;
}

.sidebar-brand-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
}

.sidebar-group {
  margin-bottom: 18px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6B7280);
  padding: 4px 12px;
  margin-bottom: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary, #4B5563);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 180ms ease;
  position: relative;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: rgba(47, 111, 237, 0.06);
  color: var(--text-primary, #111827);
}

.sidebar-nav-item.active {
  background: #EBF2FE !important;
  color: #2F6FED !important;
  font-weight: 600;
}

body:not(.light-theme) .sidebar-nav-item.active {
  background: rgba(47, 111, 237, 0.20) !important;
  color: #6494F6 !important;
}

.sidebar-nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  margin-left: auto;
}

.sidebar-badge.badge-red {
  background: #FEE2E2;
  color: #DC2626;
}

/* App Main Content Area */
.app-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg-app, #F6F7F9);
}

/* Top Navigation Bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: var(--bg-card, #FFFFFF);
  border-bottom: 1px solid var(--border-subtle, #E1E5EC);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 580px;
}

.topbar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-app, #F6F7F9);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 8px;
  padding: 7px 14px;
  transition: all 180ms ease;
}

.topbar-search-box:focus-within {
  background: #FFFFFF;
  border-color: #2F6FED;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.topbar-search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary, #111827);
}

.topbar-search-box input::placeholder {
  color: var(--text-muted, #6B7280);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-topbar-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1F2937;
  color: #FFFFFF;
  border: 1px solid #1F2937;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}

.btn-topbar-primary:hover {
  background: #2F6FED;
  border-color: #2F6FED;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #E1E5EC);
  background: var(--bg-card, #FFFFFF);
  color: var(--text-secondary, #4B5563);
  cursor: pointer;
  position: relative;
  transition: all 180ms ease;
}

.topbar-icon-btn:hover {
  background: var(--bg-app, #F6F7F9);
  color: var(--text-primary, #111827);
}

.bell-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: #DC2626;
  border-radius: 50%;
  display: inline-block;
}

.topbar-user-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle, #E1E5EC);
}

.topbar-hamburger,
.topbar-sidebar-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.app-layout.sidebar-collapsed .topbar-sidebar-toggle {
  background: #EEF4FF;
  color: #2F6FED;
  border-color: #C7D9FA;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
}

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

.app-layout.sidebar-collapsed .ov-workspace {
  max-width: 1600px;
}

/* ==========================================================================
   PART 2: REDESIGNED OVERVIEW (DASHBOARD) STYLES
   ========================================================================== */
.ov-workspace {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.ov-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ov-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}

.ov-subtitle {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
}

.ov-timeframe-filter {
  display: inline-flex;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.ov-tf-btn {
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary, #4B5563);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 180ms ease;
}

.ov-tf-btn.active {
  background: var(--bg-app, #F6F7F9);
  color: #2F6FED;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Four KPI Summary Cards Row */
.ov-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.ov-kpi-card {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.ov-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ov-kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #4B5563);
}

.ov-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
}

.ov-kpi-subtext {
  font-size: 12px;
  font-weight: 500;
}

.ov-card-alerts-tint {
  border-color: #FECACA !important;
  background: #FFFDFD !important;
}

body:not(.light-theme) .ov-card-alerts-tint {
  border-color: rgba(220, 38, 38, 0.35) !important;
  background: rgba(220, 38, 38, 0.05) !important;
}

.ov-health-val {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px !important;
  font-weight: 650 !important;
}

.ov-pulse-dot {
  width: 8px;
  height: 8px;
  background: #16A34A;
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 2s infinite;
}

/* Middle Row (Two Column Grid) */
.ov-middle-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 16px;
}

.ov-panel-card {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ov-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ov-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
}

.ov-link-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: #2F6FED;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.ov-link-btn:hover {
  text-decoration: underline;
}

.ov-panel-tag {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
}

/* Critical Alerts List */
.ov-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-app, #F6F7F9);
  transition: all 180ms ease;
}

.ov-alert-item:hover {
  background: #EEF2F7;
}

.ov-alert-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.ov-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.ov-alert-dot.critical, .ov-alert-dot.dot-critical { background: #DC2626; }
.ov-alert-dot.alert, .ov-alert-dot.dot-alert { background: #D97706; }

.ov-alert-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ov-alert-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-alert-handle {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  cursor: pointer;
}

.ov-alert-handle:hover {
  color: #2F6FED;
  text-decoration: underline;
}

.ov-plat-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 4px;
  color: var(--text-secondary, #4B5563);
}

.ov-alert-quote {
  font-size: 13px;
  color: var(--text-secondary, #4B5563);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}

.kw-highlight {
  background: #FEE2E2;
  color: #DC2626;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.ov-alert-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ov-alert-time {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
}

.ov-btn-review {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 6px;
  color: #2F6FED;
  cursor: pointer;
  transition: all 180ms ease;
}

.ov-btn-review:hover {
  background: #2F6FED;
  color: #FFFFFF;
  border-color: #2F6FED;
}

/* Hourly Bar Chart */
.ov-hourly-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 10px;
  border-bottom: 1px solid var(--border-subtle, #E1E5EC);
  padding-bottom: 8px;
}

.ov-hourly-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.ov-hourly-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: #CBD5E1;
  min-height: 8px;
  transition: height 400ms ease-out, background 180ms ease;
  animation: barGrow 400ms ease-out forwards;
}

.ov-hourly-bar.peak {
  background: #2F6FED;
}

.ov-hourly-bar-col:hover .ov-hourly-bar {
  opacity: 0.85;
}

.ov-chart-footer {
  font-size: 12.5px;
  color: var(--text-muted, #6B7280);
  font-weight: 500;
}

/* Bottom Row (Three Column Grid) */
.ov-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Platform Stacked Bar */
.ov-stacked-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.ov-bar-segment.seg-x { background: #1E3A8A; }
.ov-bar-segment.seg-ig { background: #3B82F6; }
.ov-bar-segment.seg-yt { background: #60A5FA; }
.ov-bar-segment.seg-fb { background: #93C5FD; }

.ov-stacked-legend {
  font-size: 12.5px;
  color: var(--text-muted, #6B7280);
  line-height: 1.5;
}

/* Top Keywords Chips */
.ov-keywords-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ov-kw-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-app, #F6F7F9);
  border: 1px solid var(--border-subtle, #E1E5EC);
  color: var(--text-secondary, #4B5563);
}

.ov-kw-chip.chip-red {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

/* Most Flagged Profiles List */
.ov-flagged-profiles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-flagged-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 160ms ease;
}

.ov-flagged-item:hover {
  background: var(--bg-app, #F6F7F9);
}

.ov-flagged-item:hover .ov-flagged-name {
  color: #2F6FED;
  text-decoration: underline;
}

.ov-flagged-name {
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.ov-flagged-badge {
  font-size: 13px;
  font-weight: 700;
  color: #DC2626;
}

/* ==========================================================================
   PART 3: PROFILE DETAIL PAGE STYLES
   ========================================================================== */
.pd-workspace {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.pd-header-card {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.pd-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pd-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #DBEAFE;
  color: #2F6FED;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
}

.pd-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.pd-handle {
  font-size: 15px;
  color: var(--text-muted, #6B7280);
}

.pd-tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pd-tag-plat {
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-app, #F6F7F9);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 4px;
  color: var(--text-secondary, #4B5563);
}

.pd-tag-status {
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
}

.pd-tag-status.status-active {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #16A34A;
}

.pd-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  cursor: pointer;
  transition: all 180ms ease;
}

.pd-btn-outline:hover {
  background: var(--bg-app, #F6F7F9);
  border-color: #CBD5E1;
}

/* 4 Summary Cards Grid */
.pd-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pd-summary-card {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 200ms ease;
}

.pd-summary-card:hover {
  transform: translateY(-2px);
}

.pd-sum-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #4B5563);
}

.pd-sum-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
}

/* Two Column Body Grid */
.pd-body-grid {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 16px;
}

.pd-timeline-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pd-timeline-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.pd-filter-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
  padding: 2px 4px;
}

.pd-filter-btn.active {
  color: #2F6FED;
  font-weight: 600;
}

.pd-posts-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-post-item {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-left: 4px solid #CBD5E1;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: timelineSlideUp 300ms ease forwards;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pd-post-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03);
}

.pd-post-item.flagged {
  border-left: 4px solid #DC2626 !important;
  border-color: #FCA5A5 !important;
}

.pd-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.pd-post-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-rule-tag {
  color: #DC2626;
  font-weight: 600;
}

.pd-post-text {
  font-size: 13.5px;
  color: var(--text-primary, #111827);
  line-height: 1.5;
}

.pd-btn-load-more {
  width: 100%;
  padding: 10px;
  background: var(--bg-app, #F6F7F9);
  border: 1px solid var(--border-subtle, #E1E5EC);
  border-radius: 8px;
  color: #2F6FED;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 180ms ease;
}

.pd-btn-load-more:hover {
  background: #EBF2FE;
}

/* Side Column Cards */
.pd-side-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pd-activity-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  padding-top: 8px;
}

.pd-activity-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.pd-activity-bar {
  width: 100%;
  background: #CBD5E1;
  border-radius: 4px 4px 0 0;
  animation: barGrow 400ms ease-out forwards;
}

.pd-activity-bar.busiest {
  background: #2F6FED;
}

.pd-activity-day {
  font-size: 11px;
  color: var(--text-muted, #6B7280);
}

.pd-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-linked-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-linked-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-app, #F6F7F9);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #111827);
  text-decoration: none;
}

.pd-linked-account-item:hover {
  background: #EBF2FE;
  color: #2F6FED;
}

/* Utilities & Animations */
.text-red { color: #DC2626 !important; }
.text-emerald { color: #16A34A !important; }
.text-amber { color: #D97706 !important; }
.text-muted { color: #6B7280 !important; }

@keyframes barGrow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes timelineSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    transition: left 250ms ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  .app-sidebar.drawer-open {
    left: 0;
  }
  .topbar-hamburger {
    display: flex;
  }
  .ov-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ov-middle-grid, .pd-body-grid {
    grid-template-columns: 1fr;
  }
  .ov-bottom-grid {
    grid-template-columns: 1fr;
  }
  .pd-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ov-kpi-grid, .pd-summary-grid {
    grid-template-columns: 1fr;
  }
  .ov-workspace, .pd-workspace {
    padding: 16px 14px;
  }
  .app-topbar {
    padding: 10px 14px;
  }
}
