/* Signal Hub - Main Stylesheet */

:root { 
  color-scheme: dark; 
  --primary-blue: #4a9eff;
  --primary-red: #ff4a4a;
  --primary-green: #3cd23c;
  --primary-yellow: #ffd700;
  --primary-orange: #ff8c00;
  --bg-dark: #0e0f12;
  --bg-panel: #1a1b1f;
  --bg-secondary: #151619;
  --bg-header: #2a2c33;
  --bg-input: #2a2c33;
  --border-color: #3a3c43;
  --text-primary: #e6e6e6;
  --text-secondary: #a0a0a0;
  --text-muted: #6a6a6a;
  --shadow-light: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-medium: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-heavy: 0 8px 32px rgba(0,0,0,0.4);
  --top-bar-height: 48px;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --success: #28a745;
  --light: #f8f9fa;
  --dark: #343a40;
  
  /* Standardized spacing scale */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --spacing-xxl: 32px;
  
  /* Standardized border radius */
  --border-radius-sm: 4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
  --border-radius-xl: 12px;
}

/* Light Mode Variables */
[data-theme="light"] {
  color-scheme: light;
  --primary-blue: #4a9eff;
  --primary-red: #ff4a4a;
  --primary-green: #3cd23c;
  --primary-yellow: #ffd700;
  --primary-orange: #ff8c00;
  --bg-dark: #f8f9fa;
  --bg-panel: #ffffff;
  --bg-secondary: #f1f3f4;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --border-color: #e1e5e9;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 16px rgba(0,0,0,0.15);
  --shadow-heavy: 0 8px 32px rgba(0,0,0,0.2);
  --top-bar-height: 48px;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --success: #28a745;
  --light: #f8f9fa;
  --dark: #343a40;
  
  /* Standardized spacing scale */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --spacing-xxl: 32px;
  
  /* Standardized border radius */
  --border-radius-sm: 4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
  --border-radius-xl: 12px;
}

/* Light mode specific adjustments */
[data-theme="light"] .loading-spinner {
  background: var(--bg-dark);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(74, 158, 255, 0.08);
}

[data-theme="light"] .nav-item.active {
  background: rgba(74, 158, 255, 0.12);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus {
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.15);
}

[data-theme="light"] .btn:hover {
  background: var(--bg-secondary);
}

[data-theme="light"] .entity-card:hover {
  background: var(--bg-secondary);
  box-shadow: var(--shadow-light);
}

[data-theme="light"] .intel-window {
  box-shadow: var(--shadow-heavy);
}

[data-theme="light"] .search-panel {
  box-shadow: var(--shadow-medium);
}

[data-theme="light"] .mobile-menu {
  box-shadow: var(--shadow-medium);
}

/* Theme Toggle Button Styles */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 13px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: 32px;
  min-width: 36px;
}

.theme-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.theme-toggle i {
  font-size: 14px;
}

.theme-toggle-mobile {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-md);
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  min-height: 44px;
  width: 100%;
  text-align: left;
}

.theme-toggle-mobile:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-spinner.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-text {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Base Styles */
* {
  box-sizing: border-box;
}

/* Standardized Component Classes */
.card-standard {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

/* Entity Details */
.entity-content-hidden {
  display: none;
}

.entity-badge-hidden {
  display: none;
}

/* Intelligence Report Details */
.report-content-hidden {
  display: none;
}

.report-badge-hidden {
  display: none;
}

/* Report Header Section */
.report-header-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.report-title h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.report-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-start;
}

/* Report Tabs */
.report-tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.report-tab {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-tab:hover {
  background: var(--bg-header);
  color: var(--text-primary);
}

.report-tab.active {
  background: var(--bg-header);
  color: var(--text-primary);
  border-color: var(--primary-blue);
}

.report-tab i {
  font-size: 12px;
}

/* Report Overview */
.report-overview {
  width: 100%;
}

/* Content Section */
.content-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
}

.content-section h3 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.content-section h3 i {
  color: var(--primary-blue);
}

.content-container {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  min-height: 100px;
}

/* Entity Section */
.entity-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
}

.entity-section h3 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.entity-section h3 i {
  color: var(--primary-blue);
}

/* Loading and Text States */
.loading-text {
  color: var(--text-muted);
  font-style: italic;
}

.text-muted {
  color: var(--text-muted);
}

/* Table Container */
.table-container {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  min-height: 100px;
}

/* Entity Link */
.entity-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.entity-link:hover {
  color: var(--primary-orange);
  text-decoration: underline;
}

/* Entity Info */
.entity-info h4 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.entity-info p {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Entity Actions */
.entity-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

/* Surveillance Actions */
.surveillance-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

/* Report Actions */
.report-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

/* Responsive adjustments for report details */
@media (max-width: 768px) {
  .report-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .report-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .report-tabs {
    flex-wrap: wrap;
  }
  
  .report-tab {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  
  .report-title h1 {
    font-size: 20px;
  }
  
  .entity-actions {
    flex-direction: column;
  }
  
  .entity-actions .btn {
    width: 100%;
  }
}

/* Utility Classes */
.no-data-message {
  color: var(--text-secondary);
  text-align: center;
  padding: var(--spacing-lg);
}

.content-grid-spaced {
  margin-top: var(--spacing-md);
}

.json-display {
  white-space: pre-wrap;
}

.card-standard:hover {
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-blue);
}

.panel-standard {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
}

.form-standard {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.button-standard {
  padding: 10px var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.button-standard:hover {
  background: var(--bg-header);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

a {
  color: var(--primary-blue);
  text-decoration: none;
}

html, body { 
  height: 100%; 
  margin: 0; 
  background: var(--bg-dark);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  font-size: 13px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout Components */
.app-container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

/* Add transitions to all elements that use theme variables */
.sidebar-header,
.sidebar-nav,
.sidebar-footer,
.top-bar,
.content-area,
.nav-item,
.form-input,
.form-select,
.btn,
.card,
.table,
.badge,
.intel-window,
.search-panel,
.mobile-menu {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .help-text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar.collapsed .nav-item {
  padding: 8px;
  justify-content: center;
}

.sidebar.collapsed .nav-icon {
  margin: 0;
}

.sidebar-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 36px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header {
  padding: var(--spacing-sm);
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 36px;
}

.sidebar.collapsed .logo {
  gap: 0;
}

.sidebar.collapsed .logo-svg {
  width: 24px;
  height: 24px;
}

.logo-icon {
  width: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  position: absolute;
  right: var(--spacing-xs);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  min-height: 36px;
  min-width: 36px;
}

.sidebar-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle {
  right: auto;
  position: relative;
  transform: none;
  top: auto;
  margin-top: 6px;
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar-toggle-mobile {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  margin-right: var(--spacing-md);
  min-height: 36px;
  min-width: 36px;
}

.sidebar-toggle-mobile:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.sidebar-toggle-persistent {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-sm) var(--spacing-xs);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  transition: all 0.2s ease;
  z-index: 2000;
  display: none;
  box-shadow: var(--shadow-medium);
  min-height: 36px;
  min-width: 36px;
}

.sidebar-toggle-persistent:hover {
  background: var(--bg-header);
  color: var(--text-primary);
  border-color: var(--primary-blue);
}

.sidebar-toggle-persistent.visible {
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nav-section-title {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 8px;
}

/* Custom scrollbar for webkit browsers */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
  min-height: 36px;
}

.sidebar.collapsed .nav-item {
  padding: 8px;
  justify-content: center;
  gap: 0;
}

.nav-item:hover {
  background: rgba(74, 158, 255, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(74, 158, 255, 0.15);
  color: var(--primary-blue);
  border-left-color: var(--primary-blue);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item span {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 6px;
}

.help-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
  margin-left: 0;
}

.top-bar {
  height: var(--top-bar-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.map-content-area {
  padding: 0px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0px 12px;
  background: var(--bg-panel);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  min-height: 36px;
}

.user-info span {
  color: var(--text-primary);
  font-weight: 500;
}

.user-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.user-link:hover {
  background: var(--primary-blue);
  color: white;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--primary-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Search Components */
.search-header {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.search-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
}

.search-input-group {
  display: flex;
  flex: 1;
  max-width: 500px;
}

.search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px 0 0 6px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  border-right: none;
  -webkit-appearance: none;
  min-height: 44px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.search-btn {
  background: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  border-radius: 0 6px 6px 0;
  padding: 10px 16px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #3a8eef;
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.search-options {
  display: flex;
  gap: 6px;
}

.advanced-search-panel {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
}

.advanced-search-panel.hidden {
  display: none;
}

.advanced-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.advanced-search-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* Advanced Search Form Elements */
.advanced-search-panel .form-group {
  margin-bottom: 0;
}

.advanced-search-panel .form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.advanced-search-panel .form-input,
.advanced-search-panel .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  min-height: 44px;
  width: 100%;
}

.advanced-search-panel .form-input:focus,
.advanced-search-panel .form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Results Header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.results-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 14px;
  color: var(--text-secondary);
}

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

.results-controls {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md) 0;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: center;
  font-weight: 500;
}

/* Form Components */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  min-height: 44px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.form-range {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  margin: 8px 0;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-blue);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-panel);
  box-shadow: var(--shadow-light);
}

.form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-blue);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-panel);
  box-shadow: var(--shadow-light);
}

.date-range {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.date-range input[type="date"] {
  flex: 1;
  min-width: 120px;
  max-width: 180px;
}

.date-range span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  padding: 10px var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-header);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.btn-primary {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background: #3a8eef;
  border-color: #3a8eef;
}

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

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

.btn-danger {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: white;
}

.btn-danger:hover {
  background: #e63939;
  border-color: #e63939;
}

.btn-success {
  background: var(--primary-green);
  border-color: var(--primary-green);
  color: white;
}

.btn-success:hover {
  background: #3ae639;
  border-color: #3ae639;
}

.btn-warning {
  background: var(--primary-yellow);
  border-color: var(--primary-yellow);
  color: var(--text-primary);
}

.btn-warning:hover {
  background: #e6c200;
  border-color: #e6c200;
}

.btn-group {
  display: flex;
  gap: 1px;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* Map Components */
.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  touch-action: manipulation;
  z-index: 5;
}

.leaflet-control-zoom {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-color) !important;
  position: absolute !important;
  bottom: 16px !important;
  left: 16px !important;
  top: auto !important;
  right: auto !important;
  z-index: 1000 !important;
  display: block !important;
  visibility: visible !important;
}

.leaflet-control-zoom a {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  text-align: center !important;
  font-weight: bold !important;
  font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-header) !important;
  border-color: var(--text-secondary) !important;
}

.leaflet-control-zoom-in {
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: 4px 4px 0 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 4px 4px !important;
}

.leaflet-control-attribution {
  background: var(--bg-panel) !important;
  color: var(--text-secondary) !important;
}

/* Search Panel */
.search-toggle-buttons {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  gap: 6px;
}

.search-toggle-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
  min-width: 36px;
}

.search-toggle-btn:hover {
  background: var(--bg-header);
  border-color: var(--text-secondary);
}

/* Entity Type Filter Dropdown - Main Search Header */
.search-toggle-buttons #entity-type-filter {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  min-height: 32px;
  margin-left: var(--spacing-sm);
  -webkit-appearance: none;
}

#entity-type-filter:hover {
  background: var(--bg-header);
  border-color: var(--text-secondary);
}

#entity-type-filter:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.search-panel {
  position: fixed;
  top: var(--spacing-md);
  left: var(--spacing-md);
  width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 2000;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  transition: all 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.search-panel.hidden {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.search-panel.dragging {
  cursor: grabbing;
  user-select: none;
  transition: none;
}

.search-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  cursor: grab;
  user-select: none;
  background: var(--bg-panel);
  border-radius: var(--border-radius-md);
}

.search-header:active {
  cursor: grabbing;
}

.search-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 3px;
  border-radius: 3px;
  transition: all 0.2s ease;
  min-height: 36px;
  min-width: 36px;
}

.search-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.search-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-icon {
  font-size: 14px;
  color: var(--primary-blue);
}

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

.search-content {
  padding: 16px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Search Results */
.search-results {
  margin-top: var(--spacing-md);
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.result-item {
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-input);
}

.result-item:hover {
  background: var(--bg-header);
  border-color: var(--primary-blue);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs);
}

.result-name {
  font-weight: 600;
  color: var(--text-primary);
}

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

.result-details {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.result-actions {
  display: flex;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  justify-content: flex-end;
}

.result-actions .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-threat-critical {
  background: rgba(220, 53, 69, 0.3);
  color: var(--primary-red);
  border-color: var(--primary-red);
  font-weight: 700;
}

.badge-threat-high {
  background: rgba(255, 74, 74, 0.2);
  color: var(--primary-red);
  border-color: var(--primary-red);
}

.badge-threat-medium {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border-color: var(--primary-yellow);
}

.badge-threat-low {
  background: rgba(74, 255, 74, 0.2);
  color: var(--primary-green);
  border-color: var(--primary-green);
}

.badge-type {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.badge-priority-high {
  background: rgba(255, 74, 74, 0.2);
  color: var(--primary-red);
  border-color: var(--primary-red);
}

.badge-priority-medium {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border-color: var(--primary-yellow);
}

.badge-priority-low {
  background: rgba(74, 255, 74, 0.2);
  color: var(--primary-green);
  border-color: var(--primary-green);
}

.badge-status-active {
  background: rgba(74, 255, 74, 0.2);
  color: var(--primary-green);
  border-color: var(--primary-green);
}

.badge-status-pending {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border-color: var(--primary-yellow);
}

.badge-status-completed {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

/* Legend */
.legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  box-shadow: var(--shadow-medium);
  z-index: 1000;
  min-width: 160px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.legend h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-person { background: var(--primary-blue); }
.dot-vehicle { background: var(--primary-green); }
.dot-building { background: var(--primary-yellow); }
.dot-device { background: var(--primary-red); }
.dot-organization { background: var(--primary-orange); }
.dot-location { background: #9c27b0; }
.dot-event { background: #00bcd4; }
.dot-other { background: var(--text-muted); }

/* Viewport Circle Tooltip */
.viewport-circle-tooltip {
    background: rgba(40, 167, 69, 0.9);
    border: 1px solid #28a745;
    border-radius: 3px;
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.viewport-circle-tooltip::before {
    border-top-color: #28a745;
}

/* Entity Popup Styles */
.entity-popup {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-medium);
    padding: 0;
    margin: 0;
    min-width: 280px;
    max-width: 320px;
}

.entity-popup .leaflet-popup-content-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-medium);
    padding: 0;
    margin: 0;
}

.entity-popup .leaflet-popup-content {
    margin: 0;
    padding: 16px;
    background: var(--bg-panel);
    border-radius: 6px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.entity-popup .leaflet-popup-tip {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: none;
    border-left: none;
}

.entity-popup .leaflet-popup-close-button {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.entity-popup .leaflet-popup-close-button:hover {
    background: var(--bg-header);
    color: var(--text-primary);
    border-color: var(--primary-blue);
}

.entity-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.entity-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
    flex: 1;
    padding-right: 32px;
}

.entity-popup-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.entity-popup-info {
    margin-bottom: 12px;
}

.entity-popup-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.entity-popup-info-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.entity-popup-info-value {
    color: var(--text-primary);
    font-size: 12px;
}

.entity-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entity-popup-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.entity-popup-btn-primary {
    background: var(--primary-blue);
    color: white;
}

.entity-popup-btn-primary:hover {
    background: #3a8eef;
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.entity-popup-btn-success {
    background: var(--primary-green);
    color: white;
}

.entity-popup-btn-success:hover {
    background: #3ae639;
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* Mobile adjustments for entity popup */
@media (max-width: 768px) {
    .entity-popup {
        min-width: 300px;
        max-width: 350px;
    }
    
    .entity-popup .leaflet-popup-content {
        padding: 16px;
        font-size: 14px;
    }
    
    .entity-popup-title {
        font-size: 18px;
    }
    
    .entity-popup-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .entity-popup-info-item {
        font-size: 13px;
    }
    
    .entity-popup-info-label {
        font-size: 12px;
    }
    
    .entity-popup-info-value {
        font-size: 13px;
    }
}

/* Intelligence Window */
.intel-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-heavy);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  min-width: 350px;
  min-height: 250px;
  -webkit-overflow-scrolling: touch;
}

.intel-window::-webkit-resizer {
  background: var(--border-color);
  border-radius: 0 0 6px 0;
  border: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
  width: 14px;
  height: 14px;
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
  cursor: nw-resize;
  z-index: 1000;
  border-radius: 0 0 6px 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  pointer-events: all;
}

.resize-handle:hover {
  opacity: 1;
}

/* Ensure the modal content doesn't interfere with the resize handle */
.intel-window .intel-content {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 16px;
  padding-bottom: 16px;
}

.intel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-header);
}

.intel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.intel-type-icon {
  font-size: 16px;
  color: var(--primary-blue);
}

.intel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 3px;
  border-radius: 3px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
}

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

.intel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.intel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.intel-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.intel-tab.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

.intel-tab:hover {
  color: var(--text-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.intel-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.intel-table th,
.intel-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.intel-table th {
  background: var(--bg-header);
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.intel-table tr:hover {
  background: var(--bg-input);
}

.intel-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intel-form label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.intel-form input:not([type="checkbox"]):not([type="radio"]),
.intel-form textarea,
.intel-form select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  -webkit-appearance: none;
}

.intel-form input:not([type="checkbox"]):not([type="radio"]):focus,
.intel-form textarea:focus,
.intel-form select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.json-display {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 240px;
  overflow-y: auto;
}

/* Location Display */
.location-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 6px;
}

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

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

.location-coords {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--primary-blue);
  background: rgba(74, 158, 255, 0.1);
  padding: 3px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 3px;
}

.location-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Sidebar adjustments */
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    z-index: 2000;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .sidebar-toggle-mobile {
    display: block;
  }
  
  .sidebar-toggle {
    display: none;
  }
  
  .sidebar-toggle-persistent {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .main-content.sidebar-collapsed {
    margin-left: 0;
  }
  
  /* Top bar mobile adjustments */
  .top-bar {
    padding: 0 12px;
    height: 48px;
  }
  
  .top-bar-left {
    gap: 8px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .user-info {
    padding: 6px 12px;
    gap: 8px;
    font-size: 12px;
  }
  
  .user-link {
    font-size: 11px;
    padding: 2px 6px;
  }
  
  .status-indicator {
    font-size: 11px;
    gap: 4px;
  }
  
  .status-text {
    display: none;
  }
  
  .current-time {
    font-size: 11px;
  }
  
  .top-bar-right {
    gap: 8px;
  }
  
  /* Search panel mobile adjustments */
  .search-panel {
    width: calc(100vw - 24px);
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 96px);
    top: 60px;
  }
  
  .search-header {
    padding: 0px 16px;
  }
  
  .search-content {
    padding: 16px;
  }
  
  .search-form {
    gap: 12px;
  }
  
  .form-group {
    gap: 4px;
  }
  
  .form-input,
  .form-select {
    padding: 8px 10px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Search header mobile adjustments */
  .search-main {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
  }
  
  .search-input-group {
    max-width: none;
    width: 100%;
  }
  
  /* Special handling for pages that use search-input-group for titles */
  .search-input-group h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
  }
  
  .search-options {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }
  
  .search-options .btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 32px;
    white-space: nowrap;
  }
  
  /* Special case: Keep horizontal layout for pages with titles (like Data Feeds) */
  .search-main.title-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .search-main.title-layout .search-input-group {
    flex: 1;
  }
  
  .search-main.title-layout .search-options {
    flex-shrink: 0;
  }
  
  /* Results header mobile adjustments */
  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
  }
  
  .results-controls {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }
  
  .results-controls .form-select {
    font-size: 12px;
    padding: 4px 8px;
    min-height: 28px;
  }
  
  /* Search toggle buttons mobile */
  .search-toggle-buttons {
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    z-index: 10;
  }
  
  .search-toggle-btn {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  
  .search-btn-text {
    display: inline;
  }
  
  #entity-type-filter {
    min-width: 100px;
    font-size: 11px;
    padding: 6px 8px;
  }
  
  /* Hide entity type filter and legend on mobile by default */
  #entity-type-filter {
    display: none;
  }
  
  .legend {
    display: none;
  }
  
  /* Mobile toggle button for legend and entity filter */
.mobile-toggle-btn {
  position: fixed;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: none; /* Hidden by default, shown via JavaScript on mobile */
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-medium);
  transition: all 0.2s ease;
}

/* Viewport Info Styles */
.viewport-info-section {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.viewport-info-title {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 14px;
}

.viewport-info-content {
  font-size: 12px;
  color: var(--text-secondary);
}

.viewport-control-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.viewport-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.viewport-control-label {
  font-size: 12px;
  font-weight: 500;
}

.reset-radius-btn {
  font-size: 10px;
  padding: 2px var(--spacing-xs);
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.radius-slider {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  outline: none;
  border-radius: 2px;
  -webkit-appearance: none;
}

.radius-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
}

.view-toggle-container {
  display: flex;
  gap: var(--spacing-xs);
}

.view-toggle-btn {
  flex: 1;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 11px;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background: var(--primary-blue);
  color: white;
}

.view-toggle-btn:not(.active) {
  background: var(--border-color);
  color: var(--text-secondary);
}
  
  .mobile-toggle-btn:hover {
    background: var(--bg-header);
    border-color: var(--primary-blue);
  }
  
  .mobile-toggle-btn i {
    font-size: 18px;
  }
  
  /* Show legend when toggled */
  .legend.mobile-visible {
    display: block;
    position: fixed;
    bottom: 80px;
    right: 16px;
    padding: 12px;
    min-width: 160px;
    max-width: 200px;
    z-index: 1000;
  }
  
  .legend.mobile-visible h4 {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .legend.mobile-visible .legend-item {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  /* Show entity type filter when toggled */
  #entity-type-filter.mobile-visible {
    display: block;
    position: fixed;
    bottom: 80px;
    right: 80px;
    z-index: 1000;
    min-width: 120px;
    font-size: 11px;
    padding: 6px 8px;
  }
  
  /* Intel window mobile adjustments */
  .intel-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
    max-width: none;
    max-height: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 300px;
    min-height: 400px;
  }
  
  .intel-header {
    padding: 12px 16px;
  }
  
  .intel-title {
    font-size: 14px;
  }
  
  .intel-content {
    padding: 16px;
  }
  
  .intel-tabs {
    flex-wrap: wrap;
    gap: 2px;
  }
  
  .intel-tab {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
  
  /* Form adjustments for mobile */
  .advanced-search-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .date-range {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .date-range input[type="date"] {
    min-width: 100%;
    max-width: 100%;
  }

  .date-range span {
    text-align: center;
    padding: 4px 0;
  }
  
  /* Content area adjustments */
  .content-area {
    padding: 16px;
  }
  
  /* Button adjustments */
  .btn {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  /* Table adjustments */
  .intel-table {
    font-size: 12px;
  }
  
  .intel-table th,
  .intel-table td {
    padding: 8px 6px;
  }
  
  /* Stats grid adjustments */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  /* Map controls adjustments */
  .leaflet-control-zoom {
    bottom: 12px !important;
    left: 12px !important;
  }
  
  .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 260px;
  }
  
  .search-panel {
    width: calc(100vw - 16px);
    left: 8px;
    right: 8px;
  }
  
  .search-toggle-buttons {
    z-index: 10;
  }
  
  .search-btn-text {
    display: none;
  }
  
  .search-toggle-btn {
    padding: 8px;
    min-width: 44px;
    text-align: center;
  }
  
  /* Adjust mobile toggle button position for smaller screens */
  .mobile-toggle-btn {
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
  
  .mobile-toggle-btn i {
    font-size: 16px;
  }
  
  /* Adjust legend position when visible */
  .legend.mobile-visible {
    bottom: 72px;
    right: 12px;
    padding: 10px;
    min-width: 140px;
  }
  
  /* Adjust entity filter position when visible */
  #entity-type-filter.mobile-visible {
    bottom: 72px;
    right: 72px;
  }
  
  .intel-window {
    width: calc(100vw - 16px);
    left: 8px;
    right: 8px;
    transform: none;
    top: 60px;
    height: calc(100vh - 80px);
  }
  
  .top-bar {
    padding: 0 8px;
  }
  
  .content-area {
    padding: 12px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .intel-tabs {
    flex-direction: column;
  }
  
  .intel-tab {
    flex: none;
    width: 100%;
    text-align: left;
  }
  
  /* Search header small mobile adjustments */
  .search-main {
    padding: 8px;
    gap: 6px;
  }
  
  .search-options {
    gap: 3px;
  }
  
  .search-options .btn {
    font-size: 11px;
    padding: 4px 8px;
    min-height: 28px;
  }
  
  .results-controls .form-select {
    font-size: 11px;
    padding: 3px 6px;
    min-height: 26px;
  }
}

@media (max-width: 360px) {
  .sidebar {
    width: 240px;
  }
  
  .search-panel {
    width: calc(100vw - 12px);
    left: 6px;
    right: 6px;
  }
  
  .intel-window {
    width: calc(100vw - 12px);
    left: 6px;
    right: 6px;
  }
  
  /* Adjust mobile toggle button for smallest screens */
  .mobile-toggle-btn {
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
  
  .mobile-toggle-btn i {
    font-size: 14px;
  }
  
  /* Adjust legend position when visible */
  .legend.mobile-visible {
    bottom: 56px;
    right: 8px;
    padding: 8px;
    min-width: 120px;
  }
  
  .legend.mobile-visible .legend-item {
    font-size: 10px;
  }
  
  /* Adjust entity filter position when visible */
  #entity-type-filter.mobile-visible {
    bottom: 56px;
    right: 56px;
  }
  
  .search-toggle-btn {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
  /* Improve touch targets */
  .nav-item {
    min-height: 44px;
    padding: 12px 16px;
  }
  
  .btn {
    min-width: 44px;
  }
  
  .intel-close,
  .search-close {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  
  /* Better mobile scrolling */
  .intel-content {
    -webkit-overflow-scrolling: touch;
  }
  
  .search-results {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile-friendly popups (generic) */
  .leaflet-popup-content:not(.entity-popup .leaflet-popup-content) {
    margin: 8px;
    font-size: 14px;
  }
  
  .leaflet-popup-content button:not(.entity-popup-btn) {
    min-height: 44px;
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  /* Mobile overlay for sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
  }
  
  .sidebar-overlay.visible {
    display: block;
  }
  
  /* Mobile-friendly form inputs */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    border-radius: 6px;
  }
  
  /* Mobile-friendly dropdowns */
  select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
  }
  
  /* Mobile-friendly checkboxes and radios */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
  }
  
  /* Better mobile spacing */
  .form-group + .form-group {
    margin-top: 16px;
  }
  
  /* Mobile-friendly tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile-friendly cards */
  .card {
    margin-bottom: 16px;
  }
  
  .card-header {
    padding: 12px 16px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  /* Mobile-friendly badges */
  .badge {
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.2;
  }
  
  /* Mobile-friendly buttons */
  .btn-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-group .btn {
    border-radius: 6px;
    width: 100%;
  }
  
  /* Mobile-friendly search results */
  .result-item {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  .result-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .result-actions .btn {
    width: 100%;
  }
  
  /* Mobile-friendly location items */
  .location-item {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  /* Mobile-friendly surveillance items */
  .surveillance-item {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  /* Mobile-friendly report items */
  .report-item {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  /* Mobile-friendly entity cards */
  .entity-card {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  /* Mobile-friendly entity actions */
  .entity-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .entity-actions .btn {
    width: 100%;
  }
  
  /* Mobile-friendly surveillance actions */
  .surveillance-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .surveillance-actions .btn {
    width: 100%;
  }
  
  /* Mobile-friendly report actions */
  .report-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .report-actions .btn {
    width: 100%;
  }
  
  /* Mobile-friendly entity info */
  .entity-info {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Mobile-friendly surveillance info */
  .surveillance-info {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Mobile-friendly report info */
  .report-info {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Mobile-friendly entity tags */
  .entity-tags {
    gap: 4px;
  }
  
  /* Mobile-friendly entity meta */
  .entity-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Mobile-friendly entity header */
  .entity-header {
    flex-direction: column;
    gap: 12px;
  }
  
  /* Mobile-friendly entity title */
  .entity-title h1 {
    font-size: 24px;
  }
  
  /* Mobile-friendly entity tabs */
  .entity-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .entity-tab {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
  }
  
  /* Mobile-friendly overview grid */
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Mobile-friendly overview card */
  .overview-card {
    padding: 16px;
  }
  
  /* Mobile-friendly entity table */
  .entity-table {
    font-size: 12px;
  }
  
  .entity-table th,
  .entity-table td {
    padding: 8px 6px;
  }
  
  /* Mobile-friendly json display */
  .json-display {
    font-size: 11px;
    padding: 12px;
    max-height: 200px;
  }
  
  /* Mobile-friendly attribute item */
  .attribute-item {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  /* Mobile-friendly notes container */
  .notes-container {
    font-size: 14px;
    line-height: 1.4;
  }
  
  /* Mobile-friendly tags container */
  .tags-container {
    gap: 4px;
  }
  
  /* Mobile-friendly table container */
  .table-container {
    margin: 0 -16px;
    padding: 0 16px;
  }
  
  /* Mobile-friendly json container */
  .json-container {
    margin: 0 -16px;
    padding: 0 16px;
  }
}

/* Desktop/Mobile Visibility */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block;
  }
  
  .mobile-menu-container {
    position: relative;
  }
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.mobile-menu-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.mobile-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 20;
}

.mobile-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
  border-radius: 8px 8px 0 0;
}

.mobile-menu-header span {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.mobile-menu-items {
  padding: 8px 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px;
}

.mobile-menu-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.mobile-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--primary-blue);
}

.mobile-menu-item span {
  font-size: 14px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* Container Styles */
.search-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-light);
}

.search-section {
  margin-bottom: 20px;
}

.search-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.entities-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
}

.entities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.entities-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.entities-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.entities-filters .form-select {
  min-width: 140px;
}

.entities-filters .btn {
  white-space: nowrap;
}

.entities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entity-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.entity-card:hover {
  background: var(--bg-header);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

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

.entity-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.entity-type {
  display: flex;
  gap: 8px;
}

.entity-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-info {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.entity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.entity-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.surveillance-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
}

.surveillance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.surveillance-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.surveillance-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.surveillance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.surveillance-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
}

.surveillance-card:hover {
  background: var(--bg-header);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.surveillance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.target-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.target-priority {
  display: flex;
  gap: 8px;
}

.surveillance-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.surveillance-info {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.surveillance-notes {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
  background: var(--bg-dark);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-blue);
  margin-bottom: 12px;
}

.surveillance-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.reports-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
}

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.reports-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.reports-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
  overflow: hidden;
  word-wrap: break-word;
}

.report-card:hover {
  background: var(--bg-header);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.report-meta {
  display: flex;
  gap: 8px;
}

.report-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-info {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.report-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  background: var(--bg-dark);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-blue);
  max-height: 80px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  word-break: break-word;
  margin-bottom: 12px;
}

.report-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  min-height: 36px;
  min-width: 36px;
}

/* Error States */
.error {
  background: rgba(255, 74, 74, 0.1);
  border: 1px solid var(--primary-red);
  border-radius: 8px;
  padding: 20px;
  color: var(--primary-red);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  margin: 20px 0;
}

/* Form Styles */
.intel-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Ensure checkboxes and radios remain clickable and use native appearance */
.form-check-input,
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  background: initial;
  border: initial;
  padding: 0;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
}

.form-group input[readonly] {
  background: var(--bg-dark);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Location Display */
.location-display {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.location-coords {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary-blue);
  background: rgba(74, 158, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.location-display small {
  color: var(--text-muted);
  font-size: 11px;
}

/* Search Close Button */
.search-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

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

/* Font Awesome Icon Styling */
.fas, .fa {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.nav-icon .fas,
.nav-icon .fa {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.logo-icon .fas,
.logo-icon .fa {
  font-size: 24px;
}

.search-icon .fas,
.search-icon .fa {
  font-size: 16px;
}

/* Entity Details Page Styles */
.entity-header-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.entity-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.entity-title h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.entity-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.entity-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.entity-tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.entity-tab {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.entity-tab:hover {
  background: var(--bg-header);
  color: var(--text-primary);
}

.entity-tab.active {
  background: var(--bg-header);
  color: var(--text-primary);
  border-color: var(--primary-blue);
}

.entity-tab i {
  font-size: 12px;
}

.tab-content {
  display: none;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 0 4px 4px 4px;
  padding: 16px;
}

.tab-content.active {
  display: block;
}

.entity-overview {
  width: 100%;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.overview-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
}

.overview-card h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.overview-card h3 i {
  color: var(--primary-blue);
}

.entity-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.entity-table th,
.entity-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.entity-table th {
  background: var(--bg-dark);
  font-weight: 600;
  color: var(--text-primary);
}

.entity-table td {
  color: var(--text-secondary);
}

.entity-table tr:hover {
  background: var(--bg-dark);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.notes-container {
  color: var(--text-secondary);
  line-height: 1.5;
}

.attributes-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attribute-item {
  padding: 6px 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  word-break: break-word;
}

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

.attribute-item code {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  display: block;
  margin-top: 4px;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

.json-container {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
}

.json-display {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.loading-text {
  color: var(--text-muted);
  font-style: italic;
}

.text-muted {
  color: var(--text-muted);
}

/* Location Path Styles */
.arrow-icon {
  background: transparent !important;
  border: none !important;
}

.arrow-icon div {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  font-weight: bold;
}

.leaflet-control-location-path {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  padding: 8px !important;
  margin: 10px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  color: var(--text-primary) !important;
}

.leaflet-control-location-path button {
  background: #dc3545 !important;
  border: none !important;
  border-radius: 4px !important;
  color: white !important;
  padding: 4px 8px !important;
  cursor: pointer !important;
  font-size: 11px !important;
  transition: background-color 0.2s ease !important;
}

.leaflet-control-location-path button:hover {
  background: #c82333 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .entity-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .entity-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .overview-grid {
    grid-template-columns: 1fr;
  }
  
  .entity-tabs {
    flex-wrap: wrap;
  }
  
  .entity-tab {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

/* Card Styles */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-light);
  overflow: hidden;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
}

.card-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-header);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table td {
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:hover {
  background: var(--bg-input);
}

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

/* Badge Styles */
.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-info {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.badge-success {
  background: rgba(74, 255, 74, 0.2);
  color: var(--primary-green);
  border: 1px solid var(--primary-green);
}

.badge-secondary {
  background: rgba(160, 160, 160, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--text-secondary);
}

.badge-danger {
  background: rgba(220, 53, 69, 0.2);
  color: var(--primary-red);
  border: 1px solid var(--primary-red);
}

.badge-warning {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border: 1px solid var(--primary-yellow);
}

.badge-primary {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

/* Button Group Styles */
.btn-group {
  display: flex;
  gap: 4px;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
  background: var(--primary-blue);
  color: white;
}

.btn-outline-info {
  background: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-outline-info:hover {
  background: var(--primary-blue);
  color: white;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  min-height: 36px;
  min-width: 36px;
}

/* Text Utilities */
.text-muted {
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-decoration-none {
  text-decoration: none;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  margin-bottom: 20px;
  opacity: 0.5;
  font-size: 48px;
  color: var(--text-muted);
}

.empty-state h4 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Radius Slider Styles */
#radius-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border-color);
  outline: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin: 8px 0;
}

#radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-blue);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-panel);
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

#radius-slider::-webkit-slider-thumb:hover {
  background: var(--primary-blue);
  transform: scale(1.1);
  box-shadow: var(--shadow-medium);
}

#radius-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-blue);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-panel);
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

#radius-slider::-moz-range-thumb:hover {
  background: var(--primary-blue);
  transform: scale(1.1);
  box-shadow: var(--shadow-medium);
}

#radius-slider::-moz-range-track {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  border: none;
}

#reset-radius-btn {
  transition: all 0.2s ease;
}

#reset-radius-btn:hover {
  background: var(--primary-blue) !important;
  transform: scale(1.05);
}

/* View Toggle Button Styles */
.view-toggle-btn {
  transition: all 0.2s ease;
  font-weight: 500;
}

.view-toggle-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-light);
}

.view-toggle-btn.active {
  background: var(--primary-blue) !important;
  color: white !important;
}

.view-toggle-btn:not(.active) {
  background: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

.view-toggle-btn:not(.active):hover {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

/* Footer Styles */
.app-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md) 0;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.app-footer .footer-content {
  padding: 0 var(--spacing-md);
  text-align: center;
}

.app-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

/* Auth Footer Styles */
.auth-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md) 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.auth-footer .footer-content {
  padding: 0 var(--spacing-md);
  text-align: center;
}

.auth-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.3;
}

/* Ensure auth page has bottom padding to account for fixed footer */
.auth-page {
  padding-bottom: 80px;
}

/* Hide footer on mobile devices to save space */
@media (max-width: 768px) {
  .app-footer,
  .auth-footer {
    display: none;
  }
  
  /* Remove bottom padding from auth page when footer is hidden */
  .auth-page {
    padding-bottom: 20px;
  }
}

/* Mention Styles */
.mention {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9em;
  transition: all 0.2s ease;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

.mention-entity {
  background: rgba(74, 158, 255, 0.1);
  color: var(--primary-blue);
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.mention-entity:hover {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
}

.mention-surveillance {
  background: rgba(255, 140, 0, 0.1);
  color: var(--primary-orange);
  border: 1px solid rgba(255, 140, 0, 0.3);
}

.mention-surveillance:hover {
  background: rgba(255, 140, 0, 0.2);
  color: var(--primary-orange);
}

.mention-report {
  background: rgba(60, 210, 60, 0.1);
  color: var(--primary-green);
  border: 1px solid rgba(60, 210, 60, 0.3);
}

.mention-report:hover {
  background: rgba(60, 210, 60, 0.2);
  color: var(--primary-green);
}

.mention-intelligence {
  background: rgba(255, 215, 0, 0.1);
  color: var(--primary-yellow);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.mention-intelligence:hover {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
}

.mention-task {
  background: rgba(138, 43, 226, 0.1);
  color: #8a2be2;
  border: 1px solid rgba(138, 43, 226, 0.3);
}

.mention-task:hover {
  background: rgba(138, 43, 226, 0.2);
  color: #8a2be2;
}

.mention-user {
  background: rgba(255, 105, 180, 0.1);
  color: #ff69b4;
  border: 1px solid rgba(255, 105, 180, 0.3);
}

.mention-user:hover {
  background: rgba(255, 105, 180, 0.2);
  color: #ff69b4;
}

/* Mention suggestions dropdown */
.mention-suggestions {
  position: absolute;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-medium);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 250px;
}

.mention-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mention-suggestion-item:last-child {
  border-bottom: none;
}

.mention-suggestion-item:hover {
  background: var(--bg-secondary);
}

.mention-suggestion-item.selected {
  background: var(--primary-blue);
  color: white;
}

.mention-suggestion-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.mention-suggestion-text {
  flex: 1;
}

.mention-suggestion-type {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
}


/* ===== AUDIT TRAIL STYLES ===== */

.audit-trail-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
}

/* Audit Trail Cards */
.audit-trail-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.audit-entry-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

.audit-entry-card:hover {
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-blue);
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.audit-action {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.audit-timestamp {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.audit-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.audit-description {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.audit-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.9em;
}

.audit-info span {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.audit-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

/* Action Badges */
.badge-action-create {
  background: rgba(60, 210, 60, 0.2);
  color: var(--primary-green);
  border: 1px solid rgba(60, 210, 60, 0.4);
}

.badge-action-update {
  background: rgba(74, 158, 255, 0.2);
  color: var(--primary-blue);
  border: 1px solid rgba(74, 158, 255, 0.4);
}

.badge-action-delete {
  background: rgba(255, 74, 74, 0.2);
  color: var(--primary-red);
  border: 1px solid rgba(255, 74, 74, 0.4);
}

.badge-action-login {
  background: rgba(60, 210, 60, 0.2);
  color: var(--primary-green);
  border: 1px solid rgba(60, 210, 60, 0.4);
}

.badge-action-logout {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.badge-action-export {
  background: rgba(138, 43, 226, 0.2);
  color: #8a2be2;
  border: 1px solid rgba(138, 43, 226, 0.4);
}

.badge-action-import {
  background: rgba(255, 140, 0, 0.2);
  color: var(--primary-orange);
  border: 1px solid rgba(255, 140, 0, 0.4);
}

.badge-action-share {
  background: rgba(255, 105, 180, 0.2);
  color: #ff69b4;
  border: 1px solid rgba(255, 105, 180, 0.4);
}

.badge-action-assign {
  background: rgba(0, 191, 255, 0.2);
  color: #00bfff;
  border: 1px solid rgba(0, 191, 255, 0.4);
}

.badge-action-status_change {
  background: rgba(255, 165, 0, 0.2);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.4);
}

.badge-table {
  background: rgba(160, 160, 160, 0.2);
  color: var(--text-secondary);
  border: 1px solid rgba(160, 160, 160, 0.4);
}

.badge-changed {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-panel);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-heavy);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
}

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

.modal-body {
  padding: var(--spacing-lg);
}

/* Audit Detail Grid */
.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.detail-section {
  background: var(--bg-secondary);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.detail-section h4 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-primary);
  font-size: 1.1em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid rgba(160, 160, 160, 0.1);
}

.detail-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  color: var(--text-primary);
  text-align: right;
  flex: 1;
  word-break: break-word;
}

/* Changes Section */
.changes-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.changed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.values-json {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-md);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.metadata-json {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-md);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
  .audit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .audit-info {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .audit-actions {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
    margin: var(--spacing-md);
  }
  
  .audit-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .detail-value {
    text-align: left;
  }
}

/* Loading and Error States */
.audit-trail-list .loading {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--text-secondary);
}

.audit-trail-list .error {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--primary-red);
  background: rgba(255, 74, 74, 0.1);
  border: 1px solid rgba(255, 74, 74, 0.3);
  border-radius: var(--border-radius-md);
}

/* Export Button Enhancement */
.btn-primary .fas {
  margin-right: var(--spacing-xs);
}

/* Search Time Display */
.search-time {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-left: var(--spacing-sm);
}

/* MFA Setup Link Styling */
.mfa-setup-link {
  color: var(--warning) !important;
  font-weight: 600;
  position: relative;
  animation: pulse-warning 2s infinite;
}

.mfa-setup-link:hover {
  color: var(--primary-yellow) !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* MFA Status Indicator */
.mfa-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.mfa-status.enabled {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.mfa-status.disabled {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Security Notice */
.security-notice {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 215, 0, 0.05));
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  margin: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow-light);
  animation: slideDown 0.3s ease-out;
}

.security-notice-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.security-notice-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(255, 193, 7, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  font-size: 1.5rem;
}

.security-notice-text {
  flex: 1;
}

.security-notice-text h4 {
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}

.security-notice-text p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.security-notice-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .security-notice-content {
    flex-direction: column;
    text-align: center;
  }
  
  .security-notice-actions {
    width: 100%;
    justify-content: center;
  }
}
