/* ============================================
   GEMINI 3.0 PRO DESIGN SYSTEM - GLOBAL CSS
   Sistema de diseño unificado para toda la aplicación
   ============================================ */

:root {
  /* === COLORES BASE === */
  --bg-deep: #020203;
  --bg-panel: #0c0d12;
  --bg-card: #13151a;
  --bg-surface: #1a1c22;
  
  /* === COLORES DE ACENTO === */
  --accent-primary: #FF9F1C;
  --accent-primary-hover: #FFB844;
  --accent-primary-light: rgba(255, 159, 28, 0.1);
  --accent-primary-dark: #E6830F;
  --accent-glow: rgba(255, 159, 28, 0.25);
  
  --accent-secondary: #3B82F6;
  --accent-secondary-hover: #5B9EF6;
  --accent-secondary-light: rgba(59, 130, 246, 0.1);
  
  /* === ESTADOS DEL SISTEMA === */
  --status-online: #10B981;
  --status-busy: #F59E0B;
  --status-offline: #EF4444;
  --status-warning: #F59E0B;
  --status-success: #10B981;
  --status-error: #EF4444;
  --status-info: #3B82F6;
  
  /* === GLASSMORPHISM === */
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-light: rgba(255, 255, 255, 0.08);
  --glass-surface: rgba(20, 22, 30, 0.7);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --glass-overlay: rgba(0, 0, 0, 0.8);
  
  /* === TIPOGRAFÍA === */
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-dim: #4B5563;
  --text-muted: #6B7280;
  --text-accent: var(--accent-primary);
  
  /* === DIMENSIONES === */
  --sidebar-width: 260px;
  --header-height: 70px;
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-2xl: 20px;
  
  /* === SOMBRAS === */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* === TRANSICIONES === */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* === ESPACIADO === */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
}

/* === RESET Y BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  display: flex;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 159, 28, 0.03), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.03), transparent 25%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform var(--transition-slow);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.brand-area {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-xl);
  border-bottom: 1px solid var(--glass-border);
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-title span {
  color: var(--accent-primary);
}

.nav-menu {
  padding: var(--spacing-xl) var(--spacing-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: var(--spacing-lg) var(--spacing-md) var(--spacing-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 10px var(--spacing-md);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item {
  transition: all var(--transition-base);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-primary-light), transparent);
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
  font-weight: 600;
  box-shadow: inset 0 0 20px rgba(255, 159, 28, 0.1);
}

.nav-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}

/* === USER PROFILE EN SIDEBAR === */
.user-profile {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
  margin-top: auto;
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  transition: border-color var(--transition-slow);
}

.user-card.authenticated {
  border-color: rgba(255, 159, 28, 0.3);
  box-shadow: 0 0 20px rgba(255, 159, 28, 0.1);
}

.user-card:hover {
  border-color: rgba(255, 159, 28, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 159, 28, 0.15);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-primary);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* === MAIN WRAPPER === */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

/* === TOP HEADER === */
.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-2xl);
  background: rgba(2, 2, 3, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10;
  flex-shrink: 0;
  border-left: 1px solid var(--glass-border);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-md);
  transition: background var(--transition-base);
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: var(--glass-highlight);
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--text-primary);
}

.header-title i {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

/* === RELOJ ZULU === */
.zulu-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent-primary);
  background: rgba(255, 159, 28, 0.1);
  padding: 6px var(--spacing-md);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 159, 28, 0.2);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.zulu-label {
  font-weight: 700;
  font-size: 0.75rem;
}

/* === BOTONES === */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--glass-highlight);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: inherit;
}

.action-btn:hover {
  background: var(--glass-highlight);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 159, 28, 0.2);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.action-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #000;
  font-weight: 600;
}

.action-btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
}

.action-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 159, 28, 0.3);
}

/* === CONTENT SCROLL === */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  background: transparent;
}

/* Scrollbar personalizado */
.content-scroll::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar {
  width: 8px;
}

.content-scroll::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track {
  background: transparent;
}

.content-scroll::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
  transition: background var(--transition-base);
}

.content-scroll::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
  overflow: visible;
  flex-shrink: 0;
  min-height: fit-content;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(255, 159, 28, 0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 159, 28, 0.2);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--glass-border);
}

.card-head h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.title-accent {
  color: var(--status-online) !important;
  font-weight: 700;
}

/* === FORMULARIOS === */
.form-grid {
  display: grid;
  gap: var(--spacing-md);
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid label span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  transition: all var(--transition-base);
  font-family: inherit;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-primary-light);
  transform: translateY(-1px);
}

.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

/* === SWITCH === */
.switch {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch .track {
  width: 44px;
  height: 24px;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  position: relative;
  transition: all var(--transition-base);
}

.switch input:checked + .track {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.switch .thumb {
  width: 18px;
  height: 18px;
  background: var(--text-primary);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .track .thumb {
  transform: translateX(20px);
  box-shadow: 0 0 12px var(--accent-glow);
}

.switch .track {
  transition: all var(--transition-base);
}

.switch:hover .track {
  border-color: var(--accent-primary);
}

.switch-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
}

/* === DROPDOWN MENU === */
.dropdown-wrapper {
  position: relative;
  z-index: 10001;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--spacing-sm));
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-sm);
  min-width: 200px;
  box-shadow: var(--shadow-xl);
  z-index: 10001;
  display: none;
  animation: dropdownFadeIn var(--transition-base);
  backdrop-filter: blur(10px);
}

.dropdown-menu.active {
  animation: dropdownFadeIn var(--transition-base) ease-out;
}

.dropdown-menu.active {
  display: block;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 10px var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 0.9rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

.dropdown-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* === MOBILE OVERLAY === */
#mobileOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 15;
  display: none;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-base) ease-out;
}

/* === TOOLTIPS === */
.tooltip-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

.tooltip {
  position: absolute;
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--glass-border);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: none;
  z-index: 10001;
  max-width: 250px;
  word-wrap: break-word;
  white-space: normal;
}

.tooltip.active {
  opacity: 1;
  transform: translateY(0);
}

.tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.tooltip-top::before {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--bg-panel);
}

.tooltip-bottom::before {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--bg-panel);
}

.tooltip-left::before {
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--bg-panel);
}

.tooltip-right::before {
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--bg-panel);
}

/* === RESPONSIVE MEJORADO === */
/* Tablet */
@media (max-width: 1024px) {
  .content-scroll {
    padding: var(--spacing-xl);
  }

  .card {
    padding: var(--spacing-md);
  }

  .form-grid {
    gap: var(--spacing-sm);
  }

  .navlog-layout {
    grid-template-columns: 1fr;
  }

  .right-panel {
    max-height: none;
    overflow-y: visible;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: calc(var(--sidebar-width) * -1);
    height: 100%;
    box-shadow: 50px 0 100px rgba(0, 0, 0, 0.5);
  }
  
  .sidebar.active {
    transform: translateX(100%);
    left: 0;
    animation: slideInLeft var(--transition-slow) ease-out;
  }
  
  .mobile-menu-btn {
    display: flex;
  }

  .top-header {
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
  }

  .header-title {
    font-size: 1rem;
  }

  .content-scroll {
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
  }

  .header-actions {
    gap: var(--spacing-sm);
    flex-wrap: wrap;
  }

  .zulu-clock .zulu-label {
    display: none;
  }

  .action-btn span {
    display: none;
  }

  .card {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
  }

  .card-head {
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .dropdown-menu {
    min-width: 180px;
    right: 0;
    left: auto;
  }

  .tooltip {
    max-width: 200px;
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .navlog-layout {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md);
  }

  .map-container {
    min-height: 400px;
  }

  .right-panel {
    max-height: none;
    overflow-y: visible;
  }

  .map-container {
    min-height: 400px;
  }

  .right-panel {
    max-height: none;
  }

  .tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ocultar tooltips en móvil para mejor rendimiento */
  .tooltip {
    display: none !important;
  }
}

/* Mobile pequeño */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 240px;
    --header-height: 60px;
  }

  .content-scroll {
    padding: var(--spacing-md);
  }

  .card {
    padding: var(--spacing-sm);
  }

  .header-title {
    font-size: 0.9rem;
  }

  .action-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.85rem;
  }

  .zulu-clock {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

/* Touch devices - áreas de click más grandes */
@media (hover: none) and (pointer: coarse) {
  .nav-item,
  .action-btn,
  .icon-btn,
  .dropdown-item {
    min-height: 44px;
    min-width: 44px;
  }

  .switch .track {
    min-width: 50px;
    min-height: 28px;
  }

  .card {
    padding: var(--spacing-md);
  }

  .form-grid input,
  .form-grid select {
    min-height: 44px;
    font-size: 16px; /* Evita zoom en iOS */
  }
}

/* === MEJORAS DE ACCESIBILIDAD === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === MEJORAS DE VISIBILIDAD === */
@media (prefers-contrast: high) {
  :root {
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.1);
  }

  .card {
    border-width: 2px;
  }
}

/* === TOASTS CONTAINER === */
.toasts-container {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  pointer-events: none;
}

/* === LOADING SPINNER === */
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* === STATS (Estadísticas) === */
.stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 159, 28, 0.2);
  border-color: rgba(255, 159, 28, 0.3);
}

.stat.highlight {
  color: var(--accent-primary);
  border-color: rgba(255, 159, 28, 0.3);
  box-shadow: 0 0 12px rgba(255, 159, 28, 0.2);
}

/* === NAVLOG LAYOUT === */
.navlog-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--spacing-xl);
  align-items: start;
  animation: fadeIn var(--transition-base) ease-out;
}

.map-container {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  position: relative;
  min-height: 500px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
}

.map-container:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 159, 28, 0.2);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 500px;
  position: relative;
  z-index: 1;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 500px;
  min-height: 0;
}

.right-panel::-webkit-scrollbar {
  width: 8px;
}

.right-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 159, 28, 0.3);
  border-radius: 4px;
  transition: background var(--transition-base);
}

.right-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 159, 28, 0.5);
}

.tableWrap {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  background: var(--bg-deep);
  animation: fadeIn var(--transition-base) ease-out;
}

#navlogTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}

#navlogTable thead {
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 5;
}

#navlogTable th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

#navlogTable td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.navlog-section {
  grid-column: 1 / -1;
}

.navlog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-lg);
}

.navlog-stats {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

/* === PILLS (Píldoras de ruta) === */
.pillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  min-height: 60px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all var(--transition-base);
  cursor: pointer;
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 159, 28, 0.2);
}

.pill.active {
  background: rgba(255, 159, 28, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(255, 159, 28, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

/* === UTILIDADES === */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent-primary);
}

.bg-card {
  background: var(--bg-card);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* === COMPATIBILIDAD CON INDEX.HTML (Topbar existente) === */
/* Para index.html que usa topbar en lugar de top-header */
body:has(.topbar) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body:has(.topbar) .main-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body:has(.topbar) .sidebar {
  flex-shrink: 0;
}

body:has(.topbar) .topbar {
  flex-shrink: 0;
  position: relative;
  top: auto;
  z-index: 10;
}

body:has(.topbar) .layout {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

