/* ==========================================================================
   SISTEMA DE GESTIÓN FRUVER & LOGÍSTICA GPS (PANDAGPS)
   Diseño Corporativo Agro-Logístico Premium | 5 Pilares de Navegación
   ========================================================================== */

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

:root {
  /* Tipografías */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta Corporativa Fruver & GPS */
  --primary: #059669;          /* Verde Esmeralda / Agro */
  --primary-dark: #047857;
  --primary-light: #10b981;
  --primary-subtle: #ecfdf5;
  
  --secondary: #0284c7;        /* Azul Logística / GPS */
  --secondary-dark: #0369a1;
  --secondary-light: #38bdf8;
  --secondary-subtle: #f0f9ff;

  --accent-amber: #d97706;     /* Alertas / Tránsito */
  --accent-purple: #7c3aed;    /* Cosecha / Control */
  --accent-rose: #e11d48;      /* Incidencias / Alerta crítica */

  /* Fondos y Superficies */
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-sidebar: #0f172a;       /* Slate Dark 900 */
  --bg-sidebar-active: #1e293b;
  --bg-topbar: #ffffff;
  
  /* Textos y Bordes */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-dark: #334155;

  /* Estados Visuales (Slide 27) */
  --status-pendiente: #f59e0b;
  --status-proceso: #3b82f6;
  --status-listo: #10b981;
  --status-transito: #8b5cf6;
  --status-entregado: #059669;
  --status-devuelto: #ea580c;
  --status-cerrado: #64748b;
  --status-incidencia: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   SIDEBAR CORPORATIVO (5 PILARES & ROL DINÁMICO)
   ========================================================================== */
.fruver-sidebar {
  width: 275px;
  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.07);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px 18px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.sidebar-brand-text h1 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.sidebar-brand-text span {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Selector de Rol en Sidebar */
.sidebar-role-badge {
  margin: 12px 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-role-badge .role-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}

.sidebar-role-badge .role-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-role-badge select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  max-width: 130px;
}

/* Lista de Navegación */
.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px 14px;
}

.sidebar-nav-container::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-pillar-group {
  margin-bottom: 16px;
}

.nav-pillar-header {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
}

.nav-item i {
  font-size: 15px;
  width: 20px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item:hover i {
  color: var(--secondary-light);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.25) 0%, rgba(2, 132, 199, 0.15) 100%);
  color: #ffffff;
  border-left: 3px solid var(--primary-light);
  font-weight: 700;
}

.nav-item.active i {
  color: var(--primary-light);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.nav-badge.alert {
  background: var(--accent-rose);
  color: #ffffff;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.sidebar-footer {
  padding: 14px 16px;
  background: #090e1a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gps-beacon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==========================================================================
   CANVAS PRINCIPAL & TOPBAR
   ========================================================================== */
.fruver-main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  min-width: 0;
}

.fruver-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-btn-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #334155;
  cursor: pointer;
  padding: 6px;
}

.topbar-search-box {
  position: relative;
  width: 360px;
}

.topbar-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

.topbar-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.topbar-search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.topbar-search-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

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

.topbar-notification-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-notification-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-rose);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.topbar-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-user-profile:hover {
  background: #f1f5f9;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.user-info-text {
  line-height: 1.2;
}

.user-info-text .user-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.user-info-text .user-role {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* ==========================================================================
   CONTENIDO DE PÁGINAS & MODULOS
   ========================================================================== */
.fruver-content-body {
  padding: 24px;
  flex: 1;
}

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

.page-title-area h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-area p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.page-actions-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   KPIs & INDICADORES OPERATIVOS (SLIDE 5 & 6)
   ========================================================================== */
.kpi-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .kpi-grid-8 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpi-grid-8 { grid-template-columns: 1fr; }
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.kpi-card.kpi-amber::before { background: var(--status-pendiente); }
.kpi-card.kpi-blue::before { background: var(--status-proceso); }
.kpi-card.kpi-purple::before { background: var(--status-transito); }
.kpi-card.kpi-green::before { background: var(--status-entregado); }
.kpi-card.kpi-orange::before { background: var(--status-devuelto); }
.kpi-card.kpi-rose::before { background: var(--status-incidencia); }
.kpi-card.kpi-teal::before { background: #00aba9; }
.kpi-card.kpi-slate::before { background: #64748b; }

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-amber .kpi-icon-wrap { background: #fef3c7; color: #d97706; }
.kpi-blue .kpi-icon-wrap { background: #dbeafe; color: #2563eb; }
.kpi-purple .kpi-icon-wrap { background: #f3e8ff; color: #9333ea; }
.kpi-green .kpi-icon-wrap { background: #d1fae5; color: #059669; }
.kpi-orange .kpi-icon-wrap { background: #ffedd5; color: #ea580c; }
.kpi-rose .kpi-icon-wrap { background: #ffe4e6; color: #e11d48; }
.kpi-teal .kpi-icon-wrap { background: #ccfbf1; color: #0f766e; }
.kpi-slate .kpi-icon-wrap { background: #f1f5f9; color: #475569; }

/* ==========================================================================
   ESTADOS VISUALES / BADGES (SLIDE 27 & 28)
   ========================================================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-status i {
  font-size: 10px;
}

.status-pendiente { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-proceso { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-listo { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.status-transito { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.status-entregado { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.status-devuelto { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.status-cerrado { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.status-incidencia { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ==========================================================================
   BOTONES & ACCIONES
   ========================================================================== */
.fruver-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}
.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #334155;
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-danger {
  background: var(--accent-rose);
  color: #ffffff;
}
.btn-danger:hover {
  background: #be123c;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   TARJETAS & PANELES
   ========================================================================== */
.fruver-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* ==========================================================================
   TABLAS MODERNAS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.fruver-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.fruver-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.fruver-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
  vertical-align: middle;
}

.fruver-table tr:hover td {
  background: #f8fafc;
}

.mono-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
}

/* ==========================================================================
   MODAL 360° & TRAZABILIDAD INTEGRAL (SLIDE 28)
   ========================================================================== */
.traceability-360-pipeline {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 20px 10px;
  gap: 12px;
  background: #f8fafc;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.pipeline-node {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 120px;
  position: relative;
}

.pipeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #64748b;
  margin-bottom: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.pipeline-node.done .pipeline-icon {
  background: #ecfdf5;
  border-color: var(--primary);
  color: var(--primary);
}

.pipeline-node.active .pipeline-icon {
  background: #eff6ff;
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
  animation: pulseNode 2s infinite;
}

@keyframes pulseNode {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.pipeline-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
}

.pipeline-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  max-width: 110px;
  white-space: normal;
}

.pipeline-connector {
  flex-shrink: 0;
  width: 24px;
  height: 2px;
  background: #cbd5e1;
}

.pipeline-connector.active {
  background: var(--primary);
}

/* ==========================================================================
   MODAL GENERAL
   ========================================================================== */
.fruver-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.fruver-modal-backdrop.show {
  display: flex;
}

.fruver-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalEnter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
}
.modal-close-btn:hover { color: #0f172a; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfc;
}

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* ==========================================================================
   MAPA & TELEMETRÍA EN TIEMPO REAL
   ========================================================================== */
.map-container-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  min-height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

#fruverLiveMap,
#fruverLiveMapTracking {
  width: 100%;
  height: 100%;
  min-height: 480px;
  display: block;
}

.map-live-telemetry-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   CANASTAS & QR CODE VISUALIZER
   ========================================================================== */
.qr-preview-box {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border: 2px solid #334155;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   RESPONSIVIDAD & VISTA MÓVIL
   ========================================================================== */
@media (max-width: 992px) {
  .fruver-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }

  .fruver-sidebar.open {
    transform: translateX(0);
  }

  .topbar-btn-toggle {
    display: inline-block;
  }

  .topbar-search-box {
    width: 200px;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.sidebar-overlay.active {
  display: block;
}
