/* ==============================================================================
   TEMAS GLOBALES DEL SISTEMA DE CONTROL DE FLOTA
   Constructora Zeroblack SpA
   Soporte para 3 Modos Visuales:
     1. data-theme="blanco"   -> Modo Blanco / Claro
     2. data-theme="pizarra"  -> Modo Azul Pizarra (Color Original / Actual)
     3. data-theme="negro"    -> Modo Negro Puro / OLED
   ============================================================================== */

/* ESTILOS COMUNES DEL SWITCHER */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 12px;
  padding: 3px;
  transition: all 0.2s ease;
  user-select: none;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background: transparent;
  white-space: nowrap;
}

.theme-btn:active {
  transform: scale(0.96);
}

/* ==============================================================================
   1. TEMA PIZARRA (COLOR ACTUAL / ORIGINAL)
   ============================================================================== */
html[data-theme="pizarra"] body {
  background-color: #0f172a !important; /* slate-900 */
  color: #f1f5f9 !important;            /* slate-100 */
}

html[data-theme="pizarra"] .theme-switcher {
  background-color: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
}

html[data-theme="pizarra"] .theme-btn {
  color: #94a3b8;
}

html[data-theme="pizarra"] .theme-btn:hover {
  color: #ffffff;
  background-color: rgba(51, 65, 85, 0.5);
}

html[data-theme="pizarra"] [data-theme-btn="pizarra"],
html[data-theme="pizarra"] .theme-btn-active[data-theme-btn="pizarra"] {
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Adaptación de reporte_gerencial.php cuando el usuario elige tema Pizarra */
html[data-theme="pizarra"] .bg-slate-50 {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

html[data-theme="pizarra"] .bg-white {
  background-color: #020617 !important;
  color: #f1f5f9 !important;
  border-color: #1e293b !important;
}

html[data-theme="pizarra"] .bg-slate-100 {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html[data-theme="pizarra"] .border-slate-200,
html[data-theme="pizarra"] .border-slate-300 {
  border-color: #1e293b !important;
}

html[data-theme="pizarra"] .text-slate-900,
html[data-theme="pizarra"] .text-slate-800,
html[data-theme="pizarra"] .text-slate-700 {
  color: #f8fafc !important;
}

html[data-theme="pizarra"] .text-slate-600,
html[data-theme="pizarra"] .text-slate-500 {
  color: #94a3b8 !important;
}

html[data-theme="pizarra"] .text-blue-700,
html[data-theme="pizarra"] .text-blue-800 {
  color: #60a5fa !important;
}

html[data-theme="pizarra"] .text-emerald-700,
html[data-theme="pizarra"] .text-emerald-800 {
  color: #34d399 !important;
}

html[data-theme="pizarra"] .text-amber-700,
html[data-theme="pizarra"] .text-amber-800 {
  color: #fbbf24 !important;
}

html[data-theme="pizarra"] .text-red-700,
html[data-theme="pizarra"] .text-red-800 {
  color: #f87171 !important;
}

html[data-theme="pizarra"] .bg-blue-50,
html[data-theme="pizarra"] .bg-blue-50\/50 {
  background-color: rgba(37, 99, 235, 0.15) !important;
}

html[data-theme="pizarra"] input:not([type="submit"]):not([type="button"]),
html[data-theme="pizarra"] select,
html[data-theme="pizarra"] textarea {
  background-color: #020617 !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

html[data-theme="pizarra"] thead.bg-slate-100 {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

html[data-theme="pizarra"] tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.4) !important;
}

/* ==============================================================================
   2. TEMA BLANCO (CLARO)
   ============================================================================== */
html[data-theme="blanco"] body {
  background-color: #f8fafc !important; /* slate-50 */
  color: #0f172a !important;            /* slate-900 */
}

html[data-theme="blanco"] .theme-switcher {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
}

html[data-theme="blanco"] .theme-btn {
  color: #475569;
}

html[data-theme="blanco"] .theme-btn:hover {
  color: #0f172a;
  background-color: #e2e8f0;
}

html[data-theme="blanco"] [data-theme-btn="blanco"],
html[data-theme="blanco"] .theme-btn-active[data-theme-btn="blanco"] {
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Fondos oscuros de cajas y tarjetas transformados en blanco */
html[data-theme="blanco"] .bg-slate-950,
html[data-theme="blanco"] .bg-slate-900,
html[data-theme="blanco"] .bg-slate-800,
html[data-theme="blanco"] .bg-slate-850,
html[data-theme="blanco"] .bg-slate-800\/90,
html[data-theme="blanco"] .bg-slate-800\/80,
html[data-theme="blanco"] .bg-slate-800\/70,
html[data-theme="blanco"] .bg-slate-800\/60,
html[data-theme="blanco"] .bg-slate-800\/50,
html[data-theme="blanco"] .bg-slate-800\/40,
html[data-theme="blanco"] .bg-slate-900\/80,
html[data-theme="blanco"] .bg-slate-900\/60,
html[data-theme="blanco"] .bg-slate-900\/50,
html[data-theme="blanco"] .bg-slate-900\/40,
html[data-theme="blanco"] .bg-slate-900\/95,
html[data-theme="blanco"] .bg-slate-950\/80,
html[data-theme="blanco"] .bg-slate-950\/60 {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="blanco"] .border-slate-800,
html[data-theme="blanco"] .border-slate-700,
html[data-theme="blanco"] .border-slate-700\/80,
html[data-theme="blanco"] .border-slate-700\/60,
html[data-theme="blanco"] .border-slate-700\/50,
html[data-theme="blanco"] .border-slate-800\/60 {
  border-color: #e2e8f0 !important;
}

/* Tipografía de alto contraste */
html[data-theme="blanco"] .text-white,
html[data-theme="blanco"] .text-slate-100,
html[data-theme="blanco"] .text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="blanco"] .text-slate-300,
html[data-theme="blanco"] .text-slate-400 {
  color: #475569 !important;
}

html[data-theme="blanco"] .text-emerald-400,
html[data-theme="blanco"] .text-emerald-300 {
  color: #047857 !important;
}

html[data-theme="blanco"] .text-blue-400,
html[data-theme="blanco"] .text-blue-300 {
  color: #1d4ed8 !important;
}

html[data-theme="blanco"] .text-amber-400,
html[data-theme="blanco"] .text-amber-300 {
  color: #b45309 !important;
}

html[data-theme="blanco"] .text-red-400,
html[data-theme="blanco"] .text-red-300 {
  color: #b91c1c !important;
}

/* Formularios e inputs */
html[data-theme="blanco"] input:not([type="submit"]):not([type="button"]),
html[data-theme="blanco"] select,
html[data-theme="blanco"] textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* Tablas */
html[data-theme="blanco"] thead,
html[data-theme="blanco"] thead.bg-slate-900,
html[data-theme="blanco"] thead.bg-slate-950,
html[data-theme="blanco"] thead.bg-slate-800 {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="blanco"] tbody tr:hover {
  background-color: #f8fafc !important;
}

html[data-theme="blanco"] tbody tr {
  border-color: #e2e8f0 !important;
}

/* Menú móvil y Drawer */
html[data-theme="blanco"] #mobileDrawer {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="blanco"] nav.fixed.bottom-0 {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="blanco"] nav.fixed.bottom-0 a {
  color: #64748b !important;
}

html[data-theme="blanco"] nav.fixed.bottom-0 a:hover {
  color: #2563eb !important;
}

html[data-theme="blanco"] .font-mono.bg-slate-950,
html[data-theme="blanco"] .font-mono.bg-slate-900 {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* ==============================================================================
   3. TEMA NEGRO (PURO OLED / DARK TOTAL)
   ============================================================================== */
html[data-theme="negro"] body {
  background-color: #000000 !important;
  color: #f4f4f5 !important;
}

html[data-theme="negro"] .theme-switcher {
  background-color: #09090b;
  border: 1px solid #27272a;
}

html[data-theme="negro"] .theme-btn {
  color: #a1a1aa;
}

html[data-theme="negro"] .theme-btn:hover {
  color: #ffffff;
  background-color: #18181b;
}

html[data-theme="negro"] [data-theme-btn="negro"],
html[data-theme="negro"] .theme-btn-active[data-theme-btn="negro"] {
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Cajas principales a negro total */
html[data-theme="negro"] .bg-slate-950,
html[data-theme="negro"] .bg-slate-900,
html[data-theme="negro"] .bg-white,
html[data-theme="negro"] .bg-slate-800,
html[data-theme="negro"] .bg-slate-800\/90,
html[data-theme="negro"] .bg-slate-800\/80,
html[data-theme="negro"] .bg-slate-800\/70,
html[data-theme="negro"] .bg-slate-800\/60,
html[data-theme="negro"] .bg-slate-800\/50,
html[data-theme="negro"] .bg-slate-800\/40,
html[data-theme="negro"] .bg-slate-900\/80,
html[data-theme="negro"] .bg-slate-900\/95,
html[data-theme="negro"] .bg-slate-50 {
  background-color: #0a0a0a !important;
  color: #f4f4f5 !important;
}

/* Elementos secundarios o anidados a gris ultra-oscuro */
html[data-theme="negro"] .bg-slate-100,
html[data-theme="negro"] .bg-slate-900\/60,
html[data-theme="negro"] .bg-slate-900\/40,
html[data-theme="negro"] .bg-slate-800\/40 {
  background-color: #121214 !important;
}

html[data-theme="negro"] .border-slate-800,
html[data-theme="negro"] .border-slate-700,
html[data-theme="negro"] .border-slate-700\/80,
html[data-theme="negro"] .border-slate-700\/60,
html[data-theme="negro"] .border-slate-700\/50,
html[data-theme="negro"] .border-slate-200,
html[data-theme="negro"] .border-slate-300,
html[data-theme="negro"] .border-slate-800\/60 {
  border-color: #222226 !important;
}

html[data-theme="negro"] .text-slate-900,
html[data-theme="negro"] .text-slate-800,
html[data-theme="negro"] .text-slate-700,
html[data-theme="negro"] .text-white,
html[data-theme="negro"] .text-slate-100,
html[data-theme="negro"] .text-slate-200 {
  color: #ffffff !important;
}

html[data-theme="negro"] .text-slate-600,
html[data-theme="negro"] .text-slate-500,
html[data-theme="negro"] .text-slate-400,
html[data-theme="negro"] .text-slate-300 {
  color: #a1a1aa !important;
}

html[data-theme="negro"] input:not([type="submit"]):not([type="button"]),
html[data-theme="negro"] select,
html[data-theme="negro"] textarea {
  background-color: #050505 !important;
  color: #ffffff !important;
  border-color: #27272a !important;
}

html[data-theme="negro"] thead,
html[data-theme="negro"] thead.bg-slate-900,
html[data-theme="negro"] thead.bg-slate-950,
html[data-theme="negro"] thead.bg-slate-100 {
  background-color: #050505 !important;
  color: #d4d4d8 !important;
  border-color: #222226 !important;
}

html[data-theme="negro"] tbody tr {
  border-color: #18181b !important;
}

html[data-theme="negro"] tbody tr:hover {
  background-color: #141416 !important;
}

html[data-theme="negro"] #mobileDrawer {
  background-color: #050505 !important;
  border-color: #27272a !important;
  color: #ffffff !important;
}

html[data-theme="negro"] nav.fixed.bottom-0 {
  background-color: rgba(5, 5, 5, 0.96) !important;
  border-color: #222226 !important;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="negro"] nav.fixed.bottom-0 a {
  color: #71717a !important;
}

html[data-theme="negro"] nav.fixed.bottom-0 a:hover {
  color: #38bdf8 !important;
}

/* ==============================================================================
   REGLA DE IMPRESIÓN (PDF / PRINT): SIEMPRE FONDO BLANCO LIMPIO
   ============================================================================== */
@media print {
  html, body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  .theme-switcher,
  .no-print {
    display: none !important;
  }
}
