/* ==========================================================================
   PANDAGPS — VIBRANT WINDOWS 8 METRO + MODERN AGRO-TECH SUITE
   Diseño Creativo, Lleno de Vida, Mosaicos Dinámicos (Live Tiles) & Máxima Ergonomía
   ========================================================================== */

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

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

  /* Paleta Vibrante Metro Windows 8 */
  --metro-green: #00a300;        /* Verde Limón / Esmeralda */
  --metro-green-dark: #008a00;
  --metro-blue: #0078d7;         /* Azul Cobalt */
  --metro-blue-dark: #005a9e;
  --metro-orange: #fa6800;       /* Mango Naranja */
  --metro-orange-dark: #d85000;
  --metro-purple: #603cba;       /* Púrpura Imperial */
  --metro-purple-dark: #4b2d99;
  --metro-teal: #00aba9;         /* Turquesa Neón */
  --metro-red: #e51400;          /* Rojo Carmesí */
  --metro-dark: #1d1d1d;         /* Metro Charcoal */

  /* Fondos */
  --bg-app: #eef2f6;
  --bg-surface: #ffffff;
  --bg-sidebar: #181824;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 163, 0, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 120, 215, 0.06) 0px, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

a {
  text-decoration: none !important;
  color: inherit;
}

/* ========================================================
   SIDEBAR METRO CHARM (DARK SLATE CON ACENTOS VIBRANTES)
   ======================================================== */
.metro-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  z-index: 1050;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
}

.metro-brand {
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1f1f30, #13131c);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.metro-brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--metro-green), var(--metro-teal));
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 15px rgba(0, 163, 0, 0.4);
}

.metro-brand-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.metro-brand-subtitle {
  font-size: 11px;
  color: #00aba9;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metro-nav-list {
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.metro-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.15s ease;
  position: relative;
}

.metro-nav-item i {
  font-size: 16px;
  width: 22px;
  text-align: center;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
}

.metro-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}
.metro-nav-item:hover i {
  color: #00aba9;
}

.metro-nav-item.active {
  background: linear-gradient(90deg, rgba(0, 120, 215, 0.35), rgba(0, 120, 215, 0.1));
  color: #ffffff;
  font-weight: 700;
  border-left: 4px solid var(--metro-blue);
}
.metro-nav-item.active i {
  color: #38bdf8;
}

.metro-sidebar-footer {
  margin: 12px;
  padding: 12px 14px;
  background: #13131c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

/* ========================================================
   MAIN CANVAS & TOPBAR
   ======================================================== */
.metro-main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metro-topbar {
  height: 66px;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.metro-page-body {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================================
   WINDOWS 8 LIVE TILES (MOSAICOS VIBRANTES)
   ======================================================== */
.metro-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metro-live-tile {
  border-radius: 6px;
  padding: 20px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
}
.metro-live-tile:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.metro-live-tile.green {
  background: linear-gradient(135deg, #00a300, #008a00);
}
.metro-live-tile.blue {
  background: linear-gradient(135deg, #0078d7, #005a9e);
}
.metro-live-tile.orange {
  background: linear-gradient(135deg, #fa6800, #d85000);
}
.metro-live-tile.purple {
  background: linear-gradient(135deg, #603cba, #4b2d99);
}
.metro-live-tile.teal {
  background: linear-gradient(135deg, #00aba9, #008280);
}

.metro-tile-icon {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 32px;
  opacity: 0.35;
  transition: all 0.2s ease;
}
.metro-live-tile:hover .metro-tile-icon {
  opacity: 0.65;
  transform: scale(1.1);
}

.metro-tile-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.metro-tile-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.92;
}

.metro-tile-sub {
  font-size: 11.5px;
  opacity: 0.8;
  margin-top: 2px;
}

/* ========================================================
   MODERN PANELS & METRO CARDS
   ======================================================== */
.metro-panel {
  background: var(--bg-surface);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.metro-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1.5px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.metro-panel-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================================================
   TRUCK TELEMETRY CARDS (VIBRANT METRO)
   ======================================================== */
.metro-truck-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  position: relative;
  border-left: 5px solid var(--metro-blue);
}
.metro-truck-card:hover {
  border-color: #0078d7;
  box-shadow: 0 10px 25px rgba(0, 120, 215, 0.12);
}

.metro-plate-badge {
  background: #1e293b;
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.metro-speed-badge {
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
  color: #2e7d32;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13.5px;
  padding: 5px 14px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metro-route-track {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 14px 0;
}

.metro-progress-line {
  height: 9px;
  background: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
  margin: 8px 0;
}

.metro-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--metro-green), var(--metro-blue));
  border-radius: 50px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================================
   TACTILE METRO BUTTONS
   ======================================================== */
.metro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.metro-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.metro-btn:active {
  transform: translateY(0);
}

.metro-btn.blue {
  background: var(--metro-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 120, 215, 0.3);
}
.metro-btn.green {
  background: var(--metro-green);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 163, 0, 0.3);
}
.metro-btn.orange {
  background: var(--metro-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(250, 104, 0, 0.3);
}
.metro-btn.purple {
  background: var(--metro-purple);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(96, 60, 186, 0.3);
}
.metro-btn.secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.metro-btn.secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}
.metro-btn.danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.metro-btn.danger:hover {
  background: #fee2e2;
}

.metro-btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
}
.metro-btn.lg {
  padding: 14px 24px;
  font-size: 15.5px;
}

/* ========================================================
   FORM INPUTS
   ======================================================== */
.metro-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.metro-input {
  width: 100%;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  padding: 9px 12px;
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: all 0.15s ease;
}
.metro-input:focus {
  border-color: var(--metro-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
}

/* ========================================================
   DATA TABLES
   ======================================================== */
.metro-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.metro-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid #e2e8f0;
}

.metro-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.metro-table tr:hover td {
  background-color: #f0f7ff;
}

/* Pulse Beacon */
.metro-beacon {
  width: 10px;
  height: 10px;
  background-color: var(--metro-green);
  border-radius: 50%;
  display: inline-block;
  animation: metro-pulse 2s infinite;
}

@keyframes metro-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 163, 0, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 163, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 163, 0, 0); }
}

/* ========================================================
   ESTILOS NATIVOS ANDROID (MATERIAL 3 & MOBILE UX)
   ======================================================== */

/* Android Bottom Navigation Bar */
.android-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  z-index: 1040;
  box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.08);
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.android-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s ease;
  padding: 4px 0;
}

.android-nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;
  border-radius: 50px;
  margin-bottom: 2px;
  transition: all 0.2s ease;
}

.android-nav-item i {
  font-size: 17px;
  transition: transform 0.15s ease;
}

.android-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.android-nav-item.active .android-nav-icon-wrapper {
  background-color: #e0f2fe;
  color: #0078d7;
}
.android-nav-item.active {
  color: #0078d7;
}
.android-nav-item.active i {
  color: #0078d7;
  transform: scale(1.1);
}

/* Android Drawer (Menú lateral deslizable) */
.android-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1060;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.android-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #181824;
  color: #ffffff;
  z-index: 1070;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.android-drawer.open {
  left: 0;
}
.android-drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* Android Mobile Breakpoints */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    padding-bottom: 68px !important; /* Espacio para barra inferior */
  }

  /* Ocultar barra lateral en móvil */
  .metro-sidebar {
    display: none !important;
  }

  /* Mostrar barra inferior de Android */
  .android-bottom-nav {
    display: flex !important;
  }

  /* Ajustar Canvas */
  .metro-main-canvas {
    width: 100% !important;
    min-width: 100% !important;
  }

  .metro-topbar {
    height: 58px;
    padding: 0 14px;
  }

  .metro-page-body {
    padding: 14px 12px;
  }

  /* Grillas responsivas */
  .metro-tile-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .metro-live-tile {
    min-height: 90px !important;
    padding: 14px 16px !important;
  }
  .metro-tile-value {
    font-size: 22px !important;
  }

  /* Tarjetas de camiones a ancho completo */
  .metro-truck-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  /* Formularios en una sola columna */
  div[style*="grid-template-columns: 1.25fr 1fr"],
  div[style*="grid-template-columns:1.25fr 1fr"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(290px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
  }
}

/* ========================================================
   ESTILOS DE IMPRESIÓN OFICIAL TAMAÑO CARTA (LETTER 8.5x11)
   ======================================================== */
@media print {
  @page {
    size: letter portrait;
    margin: 10mm 12mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Ocultar absolutamente todo en la página */
  body * {
    visibility: hidden !important;
  }

  /* Mostrar únicamente el contenedor oficial de impresión */
  #podPrintArea, 
  #podPrintArea * {
    visibility: visible !important;
  }

  #podPrintArea {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    background: #ffffff !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
