/* ==========================================================================
   LUMINOUS ENTERPRISE DESIGN SYSTEM - CRM E-EDUCANDO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
  --primary: #004ac6;
  --primary-container: #2563eb;
  --secondary: #a73a00;
  --secondary-container: #ea580c;
  --tertiary: #059669;
  --tertiary-container: #007d57;
  --surface: #f8f9ff;
  --surface-lowest: #ffffff;
  --surface-low: #eff4ff;
  --surface-container: #e5eeff;
  --outline: #737686;
  --outline-variant: #c3c6d7;
  --on-surface: #0b1c30;
  --on-surface-variant: #434655;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--surface);
  color: var(--on-surface);
}

h1, h2, h3, h4, h5, h6, .font-headline {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Scrollbar estilizada nórdica */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

/* Efecto Nordic Glass */
.nordic-glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Badges de temperatura del termómetro de ventas (Luminous Enterprise) */
.temp-cold {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.temp-warm {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.temp-hot {
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* Animación sutil de pulso */
@keyframes ai-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(37, 99, 235, 0.2); }
  50% { box-shadow: 0 0 18px rgba(37, 99, 235, 0.4); }
}
.ai-active-glow {
  animation: ai-glow 2s infinite ease-in-out;
}

/* Menús desplegables de cabecera con máxima prioridad de capa */
.dropdown-menu {
  z-index: 100 !important;
}

/* ==========================================================================
   CONTROL DE SCROLL Y MODALES FLOTANTES (BLOQUEO DE FONDO)
   ========================================================================== */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

#modal-container {
  overscroll-behavior: contain !important;
}

#modal-container .fixed.inset-0 {
  overscroll-behavior: contain !important;
}

#modal-container [class*="overflow-y-auto"],
#modal-container [class*="overflow-auto"] {
  overscroll-behavior: contain !important;
}

/* ==========================================================================
   MODO NOCTURNO (DARK MODE) - NOCTURNE PRECISION DESIGN SYSTEM
   ========================================================================== */
html.dark {
  color-scheme: dark;
  --surface: #070b12;
  --surface-lowest: #0e1626;
  --surface-low: #131b2e;
  --surface-container: #19243b;
  --outline: #94a3b8;
  --outline-variant: #1e293b;
  --on-surface: #f8fafc;
  --on-surface-variant: #cbd5e1;
}

html.dark body {
  background-color: #070b12 !important;
  color: #f8fafc !important;
}

/* Scrollbars en modo nocturno */
html.dark ::-webkit-scrollbar-track,
html.dark .custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
html.dark ::-webkit-scrollbar-thumb,
html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb:hover,
html.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* Barras superiores fijas en modo nocturno (Nocturne Precision Header) */
html.dark header,
html.dark header.backdrop-blur-md,
html.dark .bg-\[\#dae3ef\] {
  background-color: #0c1322 !important;
  border-bottom-color: #1e293b !important;
}

html.dark section.bg-white\/95,
html.dark .sticky section,
html.dark nav.bg-white {
  background-color: #0c1322 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Botones e iconos de la barra superior */
html.dark header .bg-white\/90,
html.dark header .bg-white,
html.dark header button[class*="bg-white"] {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}
html.dark header .bg-white\/90:hover,
html.dark header .bg-white:hover,
html.dark header button[class*="bg-white"]:hover {
  background-color: #19243b !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
}
html.dark header .text-slate-700,
html.dark header .text-slate-800 {
  color: #f8fafc !important;
}
html.dark header .border-slate-300\/90,
html.dark header .border-slate-300\/80,
html.dark header .border-slate-300,
html.dark header .border-slate-200 {
  border-color: #1e293b !important;
}

/* Pestañas de Navegación (Tabs) Nocturne Precision */
html.dark #sidebar-menu button {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}
html.dark #sidebar-menu button:hover {
  background-color: #19243b !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
}
html.dark #sidebar-menu button[class*="bg-indigo-600"],
html.dark #sidebar-menu button[class*="bg-teal-600"],
html.dark #sidebar-menu button[class*="bg-slate-800"],
html.dark #sidebar-menu button[class*="scale-[1.02]"],
html.dark #sidebar-menu button.font-bold {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.4) !important;
}

/* Superficies, Cards, Widgets y Contenedores */
html.dark .bg-white,
html.dark .bg-surface-container-lowest,
html.dark .kanban-card {
  background-color: #0e1626 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html.dark .bg-surface {
  background-color: #070b12 !important;
}

html.dark .bg-surface-container-low,
html.dark .bg-surface-container-low\/30,
html.dark .bg-surface-container-low\/40,
html.dark .bg-surface-container-low\/50,
html.dark .bg-surface-container-low\/60,
html.dark .bg-surface-container-low\/70,
html.dark .bg-surface-container,
html.dark .bg-surface-container-high,
html.dark .bg-slate-50,
html.dark .bg-slate-50\/50,
html.dark .bg-slate-50\/80,
html.dark .bg-slate-100,
html.dark .bg-slate-100\/70 {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
}

/* Columnas del Kanban */
html.dark .kanban-column,
html.dark [id^="kanban-col-"],
html.dark [class*="kanban-col"] {
  background-color: #080c14 !important;
  border-color: #1e293b !important;
}

/* Menús Desplegables */
html.dark .dropdown-menu {
  background-color: #0e1626 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7) !important;
}

html.dark .dropdown-menu .bg-slate-50,
html.dark .dropdown-menu .bg-blue-50\/80 {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
}

/* Tipografía de Alto Contraste Nocturne Precision */
html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700,
html.dark .text-on-surface {
  color: #f8fafc !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500,
html.dark .text-outline,
html.dark .text-on-surface-variant {
  color: #94a3b8 !important;
}

html.dark .text-slate-400 {
  color: #64748b !important;
}

/* Bordes y Divisiones Nítidos */
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-200\/80,
html.dark .border-slate-200\/60,
html.dark .border-slate-300,
html.dark .border-outline-variant,
html.dark .border-outline-variant\/70,
html.dark .border-outline-variant\/60,
html.dark .border-outline-variant\/50,
html.dark .border-outline-variant\/40,
html.dark .border-outline-variant\/30,
html.dark .border-outline-variant\/20 {
  border-color: #1e293b !important;
}

html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-outline-variant\/40 > :not([hidden]) ~ :not([hidden]) {
  border-color: #1e293b !important;
}

/* Inputs, Selects, Textareas */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="date"],
html.dark input[type="search"],
html.dark select,
html.dark textarea {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

/* Modales Flotantes */
html.dark #modal-container .bg-white,
html.dark #modal-container .bg-surface-container-lowest {
  background-color: #0e1626 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html.dark #modal-container .bg-surface-container-low,
html.dark #modal-container .bg-slate-50,
html.dark #modal-container .bg-slate-100 {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
}

/* Efectos Hover */
html.dark .hover\:bg-slate-50:hover,
html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-slate-200:hover,
html.dark .hover\:bg-surface-container-low:hover,
html.dark .hover\:bg-surface-container:hover {
  background-color: #19243b !important;
}

/* Badges Luminosos de Precisión */
html.dark .bg-blue-50,
html.dark .bg-blue-100,
html.dark .bg-indigo-50 {
  background-color: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

html.dark .bg-emerald-50,
html.dark .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

html.dark .bg-amber-50,
html.dark .bg-amber-100,
html.dark .bg-orange-50,
html.dark .bg-orange-100 {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

html.dark .bg-purple-50,
html.dark .bg-purple-100 {
  background-color: rgba(168, 85, 247, 0.12) !important;
  color: #c084fc !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
}

html.dark .bg-rose-50,
html.dark .bg-rose-100,
html.dark .bg-red-50,
html.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN Y EXPORTACIÓN PDF DE RENDICIONES OFICIALES
   ========================================================================== */
@media print {
  /* Ocultar elementos de la interfaz general */
  body > *:not(#modal-container) {
    display: none !important;
  }
  
  header, footer, nav, #sidebar-menu, .no-print {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #modal-container {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  #modal-container > div {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #planilla-rendicion-imprimible,
  #balance-document-sheet {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    max-height: none !important;
    overflow: visible !important;
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
    page-break-after: avoid;
  }

  /* Encabezado oficial sin solapamientos */
  #planilla-rendicion-imprimible .planilla-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    gap: 16px !important;
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
  }

  #planilla-rendicion-imprimible table {
    width: 100% !important;
    page-break-inside: avoid;
    border-collapse: collapse !important;
    border-color: #cbd5e1 !important;
  }

  #planilla-rendicion-imprimible th,
  #planilla-rendicion-imprimible td {
    padding: 2.5px 4px !important;
    color: #0f172a !important;
    font-size: 7.5pt !important;
    border-color: #cbd5e1 !important;
  }

  #planilla-rendicion-imprimible .bg-slate-900,
  #planilla-rendicion-imprimible .bg-slate-800 {
    background-color: #0f172a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #planilla-rendicion-imprimible .bg-blue-50 {
    background-color: #eff6ff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #planilla-rendicion-imprimible .bg-slate-50 {
    background-color: #f8fafc !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #planilla-rendicion-imprimible .bg-slate-100 {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #planilla-rendicion-imprimible .border-slate-900,
  #planilla-rendicion-imprimible .border-slate-800 {
    border-color: #0f172a !important;
  }

  #planilla-rendicion-imprimible .text-primary {
    color: #1e3a8a !important;
  }

  #planilla-rendicion-imprimible .planilla-header img,
  #planilla-rendicion-imprimible .logo-impresion {
    max-height: 42px !important;
    width: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #planilla-rendicion-imprimible .comprobante-anexo-img {
    max-height: 420px !important;
    max-width: 100% !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 6px auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-page-break,
  .print\:break-before-page,
  [class*="print:break-before-page"] {
    page-break-before: always !important;
    break-before: page !important;
  }

  .print-avoid-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  @page {
    size: letter portrait;
    margin: 8mm 10mm;
  }
}


