/* Modo nocturno: se activa con la clase "dark" en <html> (botón sol/luna). Todo local, sin dependencias externas. */
.ico-sun{display:none}
html.dark .ico-sun{display:inline}
html.dark .ico-moon{display:none}
html.dark{color-scheme:dark}
:where(html.dark *){border-color:#243049}

html.dark body{background:#0b1120;color:#a8b5c9}
html.dark h1,html.dark h2,html.dark h3{color:#f1f5f9}
html.dark body[style*="radial-gradient"]{background:radial-gradient(1200px 500px at 50% -10%,rgb(var(--c-900)),#0b1120)!important}

/* superficies */
html.dark .bg-white,html.dark .card,html.dark .seg{background-color:#111a2e!important}
html.dark .bg-white\/90{background-color:rgb(17 26 46 / .9)!important}
html.dark .bg-white\/70{background-color:rgb(17 26 46 / .8)!important}
html.dark .bg-slate-50,html.dark thead.bg-slate-50{background-color:#162038!important}
html.dark .bg-slate-100{background-color:#1b2742!important}
html.dark .bg-slate-200{background-color:#243049!important}
html.dark .hover\:bg-slate-50:hover,html.dark .hover\:bg-slate-100:hover,html.dark .hover\:bg-white:hover{background-color:#1b2742!important}
html.dark .card{border-color:#243049;box-shadow:0 1px 2px rgba(0,0,0,.4),0 12px 30px -16px rgba(0,0,0,.6)}
html.dark .card > table tr:hover td{background:#16213a}

/* bordes */
html.dark .border-slate-100,html.dark .border-slate-200,html.dark .border-slate-300,html.dark .border-slate-200\/70{border-color:#243049!important}
html.dark .divide-y>*+*,html.dark .divide-slate-100>*+*{border-color:#243049}

/* texto */
html.dark .text-slate-900,html.dark .text-slate-800,html.dark .text-slate-700{color:#e2e8f0!important}
html.dark .text-slate-600{color:#b6c2d6!important}
html.dark .text-slate-500{color:#94a3b8!important}
html.dark .text-slate-400{color:#7486a3!important}
html.dark .text-slate-300{color:#4b5b78!important}

/* colores de acento (tema) */
html.dark .bg-indigo-50,html.dark .bg-indigo-100{background-color:rgb(var(--c-500) / .18)!important}
html.dark .hover\:bg-indigo-100:hover{background-color:rgb(var(--c-500) / .28)!important}
html.dark .text-indigo-500,html.dark .text-indigo-600,html.dark .text-indigo-700{color:rgb(var(--c-300))!important}
html.dark .nav-link{color:#94a3b8}
html.dark .nav-link:hover{background:#1b2742;color:#e2e8f0}
html.dark .nav-link.on{background:rgb(var(--c-500) / .18);color:rgb(var(--c-300))}
html.dark .seg a{color:#94a3b8}
html.dark .seg a.on{color:#fff}

/* estados */
html.dark .bg-emerald-100,html.dark .bg-green-100{background-color:rgb(16 185 129 / .16)!important}
html.dark .text-emerald-700,html.dark .text-emerald-600,html.dark .text-green-700,html.dark .text-green-600{color:#6ee7b7!important}
html.dark .bg-amber-100{background-color:rgb(245 158 11 / .16)!important}
html.dark .text-amber-700,html.dark .text-amber-600{color:#fcd34d!important}
html.dark .bg-red-50,html.dark .bg-red-100{background-color:rgb(239 68 68 / .15)!important}
html.dark .hover\:bg-red-50:hover{background-color:rgb(239 68 68 / .2)!important}
html.dark .text-red-700,html.dark .text-red-600{color:#fca5a5!important}
html.dark .bg-sky-100{background-color:rgb(14 165 233 / .16)!important}
html.dark .text-sky-700,html.dark .text-sky-600{color:#7dd3fc!important}
html.dark .bg-violet-100{background-color:rgb(139 92 246 / .18)!important}
html.dark .text-violet-700{color:#c4b5fd!important}
html.dark .bg-orange-100{background-color:rgb(249 115 22 / .16)!important}
html.dark .hover\:bg-amber-50:hover,html.dark .hover\:bg-emerald-50:hover{background-color:#1b2742!important}

/* formularios */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
html.dark select,html.dark textarea,html.dark .fi{background-color:#0d1527!important;color:#e2e8f0!important;border-color:#2b3a57!important}
html.dark input::placeholder,html.dark textarea::placeholder{color:#5d6f8d}
html.dark input:disabled,html.dark input[readonly]{background-color:#162038!important;color:#7486a3!important}
html.dark input:focus,html.dark select:focus,html.dark textarea:focus{border-color:rgb(var(--c-500))!important}
html.dark .dz{background:#0d1527;border-color:#2b3a57}
html.dark .dz:hover,html.dark .dz.over{background:rgb(var(--c-500) / .12)}
html.dark .pw button:hover{background:#1b2742;color:#e2e8f0}
html.dark .perm{border-color:#2b3a57}
html.dark .perm:hover{background:#162038}
html.dark input[type=file]::file-selector-button{background:rgb(var(--c-500) / .18);color:rgb(var(--c-300))}

/* alertas y mensajes (ui.css) */
html.dark .ui-card{background:#111a2e;box-shadow:0 25px 50px -12px rgba(0,0,0,.7)}
html.dark .ui-title{color:#f1f5f9}html.dark .ui-msg{color:#b6c2d6}
html.dark .ui-cancel{background:#1b2742;color:#cbd5e1}html.dark .ui-cancel:hover{background:#243049}

/* scroll */
html.dark ::-webkit-scrollbar-thumb{background:#2b3a57}

/* el ticket y la tirilla siempre son papel blanco; al imprimir no se usa el fondo oscuro */
html.dark .tk{background:#fff;color:#000}
@media print{html.dark body{background:#fff!important;color:#000}}
.login-dark{background:rgba(255,255,255,.75);box-shadow:0 1px 3px rgba(15,23,42,.12)}
html.dark .login-dark{background:rgba(17,26,46,.85);color:#cbd5e1}
html.dark select.fi-p{background-color:#0d1527;color:#e2e8f0;border-color:#2b3a57!important}
html.dark .login-logo{background:#fff;border-radius:16px;padding:8px}
