/* =========================================================
   FLEET IPLUS + WOX TELEMATICS DESIGN SYSTEM
   ========================================================= */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --status-en-ruta: #10b981;
  --status-ralenti: #f59e0b;
  --status-detenido: #64748b;
  --status-taller: #ef4444;
  --status-alerta: #dc2626;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* SIDEBAR MAINTAINX STYLE */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
  z-index: 20;
}

.brand {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.nav-item .icon {
  font-size: 1.15rem;
  width: 22px;
  display: flex;
  justify-content: center;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wox-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #94a3b8;
}

.live-pulse {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-cobranza-external {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 150, 105, 0.15);
  color: #34d399;
  border: 1px solid rgba(5, 150, 105, 0.3);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-cobranza-external:hover {
  background: rgba(5, 150, 105, 0.3);
  color: #fff;
}

/* MAIN CONTENT AREA */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-main);
}

.topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

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

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-outline {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background-color: #f1f5f9;
  border-color: var(--border-dark);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* VIEWS CONTAINER */
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* DASHBOARD GRID & CARDS */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.kpi-card.kpi-orange::before { background: var(--status-ralenti); }
.kpi-card.kpi-green::before { background: var(--status-en-ruta); }
.kpi-card.kpi-red::before { background: var(--status-taller); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 8px;
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* TELEMETRY & FUEL WIDGETS */
.dashboard-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* STATUS BADGES */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pill.EN_RUTA {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.RALENTI {
  background: #fef3c7;
  color: #b45309;
}

.status-pill.DETENIDO {
  background: #f1f5f9;
  color: #475569;
}

.status-pill.EN_TALLER {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill.FUERA_SERVICIO {
  background: #7f1d1d;
  color: #ffffff;
}

/* PRIORITY BADGES */
.priority-pill {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-CRITICAL { background: #fee2e2; color: #991b1b; }
.priority-HIGH { background: #ffedd5; color: #c2410c; }
.priority-MEDIUM { background: #e0f2fe; color: #0369a1; }
.priority-LOW { background: #f1f5f9; color: #475569; }

/* KANBAN BOARD FOR WORK ORDERS (MAINTAINX STYLE) */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
  min-height: calc(100vh - 220px);
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-color);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 2px solid #cbd5e1;
}

.column-counter {
  background: #e2e8f0;
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.wo-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.wo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wo-code {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.wo-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.wo-truck {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wo-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.wo-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.wo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

/* TRUCKS TABLE & GAUGES */
.fleet-table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

table.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  vertical-align: middle;
}

table.data-table tr:hover {
  background-color: #f8fafc;
}

.fuel-gauge-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.fuel-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.fuel-fill {
  height: 100%;
  background: #10b981;
  border-radius: 4px;
}

.fuel-fill.warning { background: #f59e0b; }
.fuel-fill.danger { background: #ef4444; }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

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

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

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* CHECKLIST TASK ITEMS IN DETAIL MODAL */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #ffffff;
}

.checklist-item.done {
  background: #f8fafc;
  text-decoration: line-through;
  color: var(--text-light);
}

.checklist-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* NOTIFICATION TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* =========================================================
   MÓDULO DE MANTENIMIENTO DE LLANTAS (TIRES) & CHASSIS VIEW
   ========================================================= */

.chassis-container {
  display: flex;
  justify-content: center;
  padding: 24px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.chassis-truck-body {
  width: 100%;
  max-width: 780px;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cab-indicator {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  background: #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  letter-spacing: 0.05em;
  border: 1px solid #cbd5e1;
}

.axle-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.axle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
}

.axle-tires-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.axle-beam {
  flex: 1;
  height: 8px;
  background: #94a3b8;
  border-radius: 4px;
  position: relative;
}

.axle-beam::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #64748b;
  border-radius: 50%;
}

.driveshaft-beam {
  width: 6px;
  height: 24px;
  background: #94a3b8;
  margin: 0 auto;
}

.dual-tires-cluster {
  display: flex;
  gap: 8px;
}

/* TIRE SLOT WIDGET */
.tire-slot {
  width: 130px;
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.tire-slot:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tire-slot.critical {
  border-color: #ef4444;
  background: #fff5f5;
  animation: pulse-border-red 2s infinite;
}

@keyframes pulse-border-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.tire-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tire-pos-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: 4px;
}

.tire-depth-badge {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.depth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.depth-green { background-color: #10b981; color: #065f46; }
.depth-yellow { background-color: #f59e0b; color: #92400e; }
.depth-red { background-color: #ef4444; color: #991b1b; }

.tire-info-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tire-pressure-val {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.tire-pressure-val.low-psi {
  color: #dc2626;
  font-weight: 700;
}

.tire-empty-slot {
  width: 130px;
  height: 80px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f8fafc;
}

/* ===================================================
   9. DASHBOARD TRANSPORTES (TORRE DE CONTROL & STATUS)
   =================================================== */
.transport-header-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 16px;
}

.transport-header-left {
  display: flex;
  flex-direction: column;
}

.transport-main-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #991b1b; /* Exact dark red from screenshot */
  letter-spacing: -0.5px;
}

.transport-date-subtitle {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 4px;
}

.transport-clock-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f9fafb;
  padding: 6px 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.clock-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.clock-digits {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.transport-kpi-group {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.transport-pill-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pill-label {
  font-size: 0.68rem;
  color: #4b5563;
  font-weight: 500;
  white-space: nowrap;
}

.pill-number-box {
  min-width: 54px;
  height: 38px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1f2937;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pill-number-box.pill-red {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.pill-number-box.pill-yellow {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.pill-subtext {
  font-size: 0.62rem;
  color: #9ca3af;
  font-weight: 600;
}

/* MAIN LAYOUT: SPLIT */
.transport-grid-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1200px) {
  .transport-grid-layout {
    grid-template-columns: 1fr;
  }
}

.transport-table-wrapper {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  overflow-x: auto;
}

.transport-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.transport-table th {
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.75rem;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.transport-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.vehicle-group-row td {
  background: #f1f5f9;
  font-weight: 800;
  font-size: 0.78rem;
  color: #334155;
  padding: 6px 10px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.3px;
}

.trip-no-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 4px;
}

/* STATUS CHIPS FROM SCREENSHOT */
.status-badge-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
  white-space: nowrap;
}

.status-chip-programado {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecdd3;
}

.status-chip-transito {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.status-chip-cotizacion {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-chip-finalizado {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* BITACORA TAGS */
.bitacora-event-tag {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
}

.bitacora-tag-incidencia {
  background: #fee2e2;
  color: #991b1b;
  border-left: 3px solid #dc2626;
}

.bitacora-tag-transito {
  background: #dcfce7;
  color: #166534;
  border-left: 3px solid #16a34a;
}

.bitacora-tag-operativo {
  background: #f1f5f9;
  color: #334155;
  border-left: 3px solid #64748b;
}

.bitacora-tag-descarga {
  background: #e0f2fe;
  color: #0369a1;
  border-left: 3px solid #0284c7;
}

/* SQUARE DARK GREEN ACTION BUTTONS (EXACTLY AS IN SCREENSHOT) */
.btn-action-square {
  width: 24px;
  height: 24px;
  background: #064e3b; /* Exact dark forest green */
  color: #ffffff;
  border: none;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.7rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.btn-action-square:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-action-square:active {
  transform: translateY(0);
}

/* RIGHT PANEL: SEGUIMIENTO TRANSPORTE */
.transport-tracking-panel {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tracking-title {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.2px;
}

.tracking-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.72rem;
  color: #4b5563;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-red {
  background-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.dot-green {
  background-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.tracking-trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

.tracking-trip-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #374151;
}

.tracking-trip-summary {
  background: #f8fafc;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
}

.tracking-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-entry {
  display: flex;
  gap: 10px;
  position: relative;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 14px;
  bottom: -14px;
  width: 1.5px;
  background: #e2e8f0;
}

.timeline-entry:last-child::before {
  display: none;
}

.timeline-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content {
  flex: 1;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.timeline-time {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-text {
  font-size: 0.78rem;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.3;
}

.timeline-author {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

/* ===================================================
   10. CÓDIGO QR IMPRIMIBLE & PASAPORTE DIGITAL
   =================================================== */
.qr-sticker-card {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 12px;
  padding: 18px;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  max-width: 580px;
  margin: 0 auto;
}

.qr-sticker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.qr-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-logo-icon {
  font-size: 1.8rem;
}

.qr-company-name {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.qr-company-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.3px;
}

.qr-tag-asset {
  background: #0f172a;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.qr-sticker-body {
  display: flex;
  gap: 18px;
  align-items: center;
}

@media (max-width: 540px) {
  .qr-sticker-body {
    flex-direction: column;
    text-align: center;
  }
}

.qr-code-box {
  background: #ffffff;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 170px;
  flex-shrink: 0;
}

.qr-code-box svg {
  width: 100%;
  height: 100%;
}

.qr-unit-details {
  flex: 1;
}

.qr-eco-title {
  font-size: 1.9rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.5px;
}

.qr-plates-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1.5px solid #0f172a;
  color: #0f172a;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  margin: 4px 0 6px 0;
}

.qr-model-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.qr-info-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.qr-pill-mini {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #334155;
}

.qr-scan-instruction {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #1e3a8a;
  margin-top: 8px;
  line-height: 1.3;
}

.qr-scan-icon {
  font-size: 1.1rem;
}

.qr-sticker-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  margin-top: 14px;
  padding-top: 8px;
}

/* FORMAT VARIANTS */
.qr-sticker-card.format-card {
  max-width: 650px;
  padding: 24px;
}

.qr-sticker-card.format-sheet {
  max-width: 100%;
  border-width: 3px;
  padding: 30px;
}

/* PRINT MEDIA QUERY: PRINTS ONLY THE QR LABEL */
@media print {
  body * {
    visibility: hidden;
  }
  
  #printableQRLabel, #printableQRLabel * {
    visibility: visible;
  }

  #printableQRLabel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 650px !important;
    margin: 20px auto !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
  }

  .no-print {
    display: none !important;
  }
}

/* ============================================================
   MÓDULO DE ALERTAS: COMBUSTIBLE INUSUAL, SOAT Y CITV
   ============================================================ */
.tab-pills {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tab-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.fuel-alert-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e2e8f0;
}

.fuel-alert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.alert-mini-map-container {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #e2e8f0;
}

.custom-alert-marker {
  animation: pulseMarker 1.8s infinite;
}

@keyframes pulseMarker {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0.7)); }
  70% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0)); }
}

.doc-alert-card {
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.doc-alert-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.doc-alert-card.vencido {
  border-left: 5px solid #dc2626;
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 25%);
}

.doc-alert-card.por-vencer {
  border-left: 5px solid #f59e0b;
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 25%);
}

/* ============================================================
   MOBILE COMPLIANCE & RESPONSIVE DESIGN (FLEET IPLUS MOBILE)
   ============================================================ */

/* Mobile Controls - Hidden by default on Desktop */
.btn-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-mobile-menu:hover,
.btn-mobile-menu:active {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  user-select: none;
  touch-action: manipulation;
}

.sidebar-backdrop {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* Tablet & Mobile Screens (<= 860px) */
@media (max-width: 860px) {
  body {
    overflow: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .main-wrapper {
    width: 100vw;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
  }

  /* Hamburger & Close Controls Active */
  .btn-mobile-menu {
    display: inline-flex;
  }

  .btn-sidebar-close {
    display: inline-flex;
  }

  /* Off-canvas Sliding Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
  }

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

  /* Dark Backdrop Overlay */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Topbar Responsive */
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-left {
    gap: 10px;
    flex: 1;
    min-width: 0;
  }

  .topbar-title {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    margin-top: 2px;
  }

  .topbar-center > div {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }

  .topbar-center select {
    min-width: 140px;
    max-width: 100%;
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-right .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    height: 38px;
  }

  /* Content area */
  .content-body {
    padding: 14px 12px;
  }

  /* KPI Grids (2 columns on tablet) */
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .kpi-card {
    padding: 14px !important;
  }

  .kpi-value {
    font-size: 1.6rem !important;
  }

  /* Modal Dialogs Full-Width for Touch */
  .modal-box,
  .modal-container {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    padding: 16px !important;
    margin: 8px auto !important;
    border-radius: 12px !important;
  }

  /* Collapse Two-Column Forms */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* WhatsApp Modal grids collapse */
  #modalWhatsAppConfig div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Smartphone Screens (<= 640px) */
@media (max-width: 640px) {
  /* Prevent iOS zoom on tap by keeping inputs >= 16px */
  input.form-input,
  select.form-select,
  textarea.form-textarea {
    font-size: 16px !important;
    min-height: 42px;
  }

  /* Touch-friendly buttons (>= 44px min tap target) */
  .btn {
    min-height: 42px;
    touch-action: manipulation;
  }

  .btn-sm {
    min-height: 36px;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    z-index: 9990;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
    position: relative;
    gap: 2px;
    touch-action: manipulation;
    text-decoration: none;
    user-select: none;
  }

  .mobile-nav-btn.active {
    color: #38bdf8;
  }

  .mobile-nav-btn.active .mobile-nav-icon {
    transform: scale(1.15);
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.15s ease;
  }

  .mobile-nav-label {
    letter-spacing: -0.01em;
  }

  .mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    line-height: 1.2;
  }

  /* Padding at bottom of content to never collide with bottom nav */
  .content-body {
    padding-bottom: 78px !important;
  }

  /* KPI Grids: Single Column on Small Phones */
  .kpi-row {
    grid-template-columns: 1fr !important;
  }

  /* Panel Header wraps buttons nicely */
  .panel-title {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .panel-title > div {
    width: 100% !important;
    flex-direction: column !important;
  }

  .panel-title > div > * {
    width: 100% !important;
  }

  /* Table horizontal scroll touch compliance */
  .fleet-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 8px;
  }

  .data-table {
    min-width: 580px;
  }

  /* Header Sync button compact text */
  #btnSyncWox span:last-child {
    display: none;
  }

  #btnOpenNewWO span:last-child {
    font-size: 0.78rem;
  }

  /* Modal Footer Stack */
  .modal-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ============================================================
   BOTÓN FLOTANTE DE ALERTAS (FAB) & MINI-CENTRO RÁPIDO
   ============================================================ */
.fab-alerts-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9995;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none; /* Allows clicks through container padding */
}

.fab-alerts-container.hidden {
  display: none !important;
}

.fab-alerts-btn {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 25px -4px rgba(220, 38, 38, 0.55), 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  user-select: none;
  touch-action: manipulation;
}

.fab-alerts-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(220, 38, 38, 0.65);
}

.fab-alerts-btn:active {
  transform: scale(0.95);
}

.fab-alerts-btn.pulse-critical {
  animation: pulseFabAlert 1.6s infinite;
}

@keyframes pulseFabAlert {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75), 0 10px 25px -4px rgba(220, 38, 38, 0.55);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(239, 68, 68, 0), 0 14px 28px -4px rgba(220, 38, 38, 0.65);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 10px 25px -4px rgba(220, 38, 38, 0.55);
  }
}

.fab-icon-bell {
  font-size: 1.65rem;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ffffff;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 900;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 2px solid #dc2626;
}

/* POPOVER / MINI-CENTRO RÁPIDO */
.fab-alerts-popover {
  pointer-events: auto;
  width: 340px;
  max-width: 92vw;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpFab 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

@keyframes slideUpFab {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fab-popover-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fab-popover-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.fab-popover-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.fab-popover-body {
  max-height: 310px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.fab-alert-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(2px);
}

.fab-alert-item.critica {
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}

.fab-alert-item.advertencia {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.fab-alert-item.ok {
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}

.fab-popover-footer {
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* En celulares (ajuste con bottom nav para que no se superpongan) */
@media (max-width: 640px) {
  .fab-alerts-container {
    bottom: 74px;
    right: 14px;
  }
  .fab-alerts-btn {
    width: 52px;
    height: 52px;
  }
  .fab-icon-bell {
    font-size: 1.45rem;
  }
  .fab-alerts-popover {
    width: calc(100vw - 28px);
    right: 0;
  }
}


/* =========================================================
   ULTRA-FUNCTIONAL FILTER CHIPS & EXPORT TOOLBAR
   ========================================================= */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.filter-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.filter-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}

.filter-chip .chip-count {
  background: rgba(148, 163, 184, 0.2);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.filter-chip.chip-critical {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}
.filter-chip.chip-critical:hover {
  background: #fee2e2;
}
.filter-chip.chip-critical.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.filter-chip.chip-warning {
  color: #d97706;
  border-color: #fde68a;
  background: #fffbeb;
}
.filter-chip.chip-warning:hover {
  background: #fef3c7;
}
.filter-chip.chip-warning.active {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}


/* =========================================================
   DASHBOARD TRANSPORTES EN VIVO (1+2+3 UPGRADE)
   ========================================================= */
.transport-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: transportLivePulse 1.8s infinite;
}

@keyframes transportLivePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.transport-pill-kpi.clickable-kpi {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.transport-pill-kpi.clickable-kpi:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.transport-pill-kpi.clickable-kpi.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.pill-number-box.pill-navy { background: #0f172a; border-color: #0f172a; color: #ffffff; }
.pill-number-box.pill-crimson { background: #fef2f2; border-color: #f87171; color: #b91c1c; }
.pill-number-box.pill-blue { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.pill-number-box.pill-green { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.pill-number-box.pill-orange { background: #fff7ed; border-color: #fdba74; color: #c2410c; }

.transport-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.transport-map-panel {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.transport-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.status-chip-incidencia {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #991b1b;
  animation: transportAlertBlink 2s infinite;
}

@keyframes transportAlertBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

.transport-table tbody tr.trip-data-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.transport-table tbody tr.trip-data-row:hover {
  background-color: #f1f5f9 !important;
}

.transport-table tbody tr.trip-data-row.trip-selected {
  background-color: #eff6ff !important;
  box-shadow: inset 3px 0 0 #2563eb;
}

.legal-mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.legal-mini-pill {
  font-size: 0.63rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.legal-mini-pill.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.legal-mini-pill.warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.legal-mini-pill.err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.legal-mini-pill.neutral { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.tracking-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.tracking-telemetry-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 7px 9px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.tracking-telemetry-box small {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.tracking-telemetry-box strong {
  font-size: 0.92rem;
  font-weight: 800;
  margin-top: 1px;
}

.quick-status-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.quick-status-btn {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.quick-status-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.quick-status-btn.active-status {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.quick-status-btn.btn-st-transito.active-status { background: #ca8a04; border-color: #a16207; }
.quick-status-btn.btn-st-incidencia.active-status { background: #dc2626; border-color: #b91c1c; }
.quick-status-btn.btn-st-finalizado.active-status { background: #059669; border-color: #047857; }
.quick-status-btn.btn-st-programado.active-status { background: #2563eb; border-color: #1d4ed8; }

.quick-log-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.quick-log-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-log-chip {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
}

.quick-log-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.quick-log-chip.chip-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.quick-log-chip.chip-danger:hover { background: #fee2e2; }

.quick-log-chip.chip-success {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}
.quick-log-chip.chip-success:hover { background: #d1fae5; }


@media (max-width: 768px) {
  .driver-qr-grid {
    grid-template-columns: 1fr !important;
  }
}
