/* ==========================================================================
   TRUST AVIATION - DESIGN SYSTEM (AEROSPACE & MODERN CLOUD ERP)
   Paleta: Cockpit Navy, Titanium Slate, Cyan HUD Glow, Amber Warning, Emerald Cert
   ========================================================================== */

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

:root {
  /* Colores Principales */
  --bg-primary: #060913;
  --bg-secondary: #0b1120;
  --bg-card: rgba(16, 24, 44, 0.85);
  --bg-card-hover: rgba(22, 33, 62, 0.95);
  --bg-glass: rgba(15, 23, 42, 0.7);
  --border-glass: rgba(56, 189, 248, 0.15);
  --border-glass-hover: rgba(56, 189, 248, 0.4);
  
  /* Acentos Aeronáuticos */
  --cyan-hud: #00e5ff;
  --cyan-hud-dim: rgba(0, 229, 255, 0.12);
  --cyan-hud-glow: 0 0 20px rgba(0, 229, 255, 0.35);
  --blue-aero: #0284c7;
  --blue-deep: #0369a1;
  --titanium: #94a3b8;
  --titanium-light: #e2e8f0;
  
  /* Estados Operativos */
  --cert-emerald: #10b981;
  --cert-emerald-dim: rgba(16, 185, 129, 0.15);
  --warning-amber: #f59e0b;
  --warning-amber-dim: rgba(245, 158, 11, 0.15);
  --danger-crimson: #ef4444;
  --danger-crimson-dim: rgba(239, 68, 68, 0.15);
  --info-purple: #a855f7;

  /* Tipografía */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevaciones */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
  --shadow-hud: 0 0 30px rgba(0, 229, 255, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--titanium-light);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  min-height: 100vh;
}

/* Tipografías */
h1, h2, h3, h4, .brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.mono-spec {
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: 0.05em;
}

/* Barra Superior Aeronáutica / AOG Alert */
.aog-ticker-bar {
  background: linear-gradient(90deg, #1e1b4b 0%, #0f172a 50%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(14, 165, 233, 0.25);
  padding: 6px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  position: relative;
  z-index: 100;
}

.aog-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Header & Barra de Navegación */
.navbar-aerospace {
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #00e5ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
  color: #000;
  font-weight: 800;
  font-size: 20px;
}

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

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--cyan-hud);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Switcher de Modos (Portal Comercial vs ERP Interno) */
.mode-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--titanium);
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.mode-tab-btn:hover {
  color: #ffffff;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* Nav Actions & Currency Switch */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.currency-toggle {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 2px;
  display: flex;
}

.currency-btn {
  background: transparent;
  border: none;
  color: var(--titanium);
  padding: 4px 10px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.currency-btn.active {
  background: var(--cyan-hud);
  color: #040914;
  font-weight: 700;
}

.cart-btn {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cart-btn:hover {
  background: rgba(14, 165, 233, 0.25);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.cart-count-badge {
  background: #0284c7;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Sub-Barra de Navegación del ERP */
.erp-subnav-bar {
  background: #090e1c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.erp-module-link {
  background: transparent;
  border: none;
  color: var(--titanium);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.erp-module-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.erp-module-link.active {
  color: var(--cyan-hud);
  background: rgba(0, 229, 255, 0.1);
  font-weight: 600;
  border-bottom: 2px solid var(--cyan-hud);
}

/* Contenedor Principal */
.app-viewport {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

/* Tarjetas y Paneles Glassmorphism */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-glass-hover);
}

/* Botones Aeronáuticos */
.btn-aero-primary {
  background: linear-gradient(135deg, #0284c7 0%, #00e5ff 100%);
  color: #030a16;
  border: none;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
  transition: var(--transition-fast);
}

.btn-aero-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.45);
}

.btn-aero-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #ffffff;
  border: 1px solid var(--border-glass);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-aero-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-aero-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #1c1002;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-aero-warning:hover {
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Badges Aeronáuticos */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.badge-tag.cert-fn {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-tag.cert-oh {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.badge-tag.cert-sv {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-tag.cert-ns {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-tag.location-hangar {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tablas HUD Aeronáuticas */
.aero-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(11, 17, 32, 0.6);
}

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

.aero-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aero-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.aero-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

/* Modales y Popups */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #0c1324;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.15);
  border-radius: var(--radius-xl);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-body {
  padding: 24px;
}

/* Toast Notificaciones */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #0f172a;
  border-left: 4px solid var(--cyan-hud);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
  max-width: 380px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
