/* ==========================================================
   TEMA OSCURO
   ========================================================== */

html[data-tema="oscuro"] body {
    background: #121212;
    color: #f1f1f1;
}


html[data-tema="oscuro"] .app-header,
html[data-tema="oscuro"] .landing-card,
html[data-tema="oscuro"] .admin-card,
html[data-tema="oscuro"] .incidencia-card,
html[data-tema="oscuro"] .modal-contenido,
html[data-tema="oscuro"] .captura-foto-contenido {
    background: #1e1e1e;
    color: #f1f1f1;
}


html[data-tema="oscuro"] .texto-secundario {
    color: #b8b8b8;
}


html[data-tema="oscuro"] input,
html[data-tema="oscuro"] select,
html[data-tema="oscuro"] textarea {
    background: #2a2a2a;
    color: #ffffff;

    border-color: #555555;
}


html[data-tema="oscuro"] .btn-secundario,
html[data-tema="oscuro"] .btn-logout {
    background: #2a2a2a;
    color: #ffffff;

    border-color: #555555;
}

/* ==========================================================
   SWITCH DE TEMA
   ========================================================== */

.switch-tema {
    position: relative;

    display: inline-block;

    width: 64px;
    height: 34px;

    flex-shrink: 0;
}


.switch-tema input {
    opacity: 0;

    width: 0;
    height: 0;
}


.slider-tema {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 4px 7px;

    box-sizing: border-box;

    border-radius: 999px;

    background: #d9dde3;

    cursor: pointer;

    transition:
        background 0.25s ease;
}


.slider-tema::before {
    content: "";

    position: absolute;

    width: 26px;
    height: 26px;

    left: 4px;
    top: 4px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.25s ease;
}


.switch-tema input:checked
+ .slider-tema {
    background: #2d3748;
}


.switch-tema input:checked
+ .slider-tema::before {
    transform:
        translateX(30px);
}


.icono-tema {
    position: relative;

    z-index: 1;

    font-size: 14px;

    pointer-events: none;
}

/* ==========================================================
   CONTROLES EN MODO OSCURO
   ========================================================== */

html[data-tema="oscuro"] button {
    color: #f1f1f1;
}


html[data-tema="oscuro"] .btn-principal {
    color: #ffffff;
}


html[data-tema="oscuro"] .btn-secundario,
html[data-tema="oscuro"] .btn-logout {
    background: #2a2a2a;

    color: #f1f1f1;

    border-color: #555555;
}


html[data-tema="oscuro"] .menu-card {
    background: #1e1e1e;

    color: #f1f1f1;

    border-color: #3a3a3a;
}


html[data-tema="oscuro"] .menu-card-titulo,
html[data-tema="oscuro"] .menu-card-descripcion {
    color: #f1f1f1;
}


html[data-tema="oscuro"] .area-pendiente,
html[data-tema="oscuro"] .area-autorizada-card,
html[data-tema="oscuro"] .resumen-card,
html[data-tema="oscuro"] .tarea-admin-card,
html[data-tema="oscuro"] .incidencia-card {
    background: #1e1e1e;

    color: #f1f1f1;

    border-color: #3a3a3a;
}


html[data-tema="oscuro"] input,
html[data-tema="oscuro"] select,
html[data-tema="oscuro"] textarea {
    background: #252525;

    color: #ffffff;

    border-color: #555555;
}


html[data-tema="oscuro"] input::placeholder,
html[data-tema="oscuro"] textarea::placeholder {
    color: #a9a9a9;
}


html[data-tema="oscuro"] option {
    background: #252525;

    color: #ffffff;
}

/* ==========================================================
   SWITCH DE TEMA
   ========================================================== */

.switch-tema {
    position: relative;

    display: inline-block;

    width: 62px;
    height: 32px;

    flex-shrink: 0;
}


.switch-tema input {
    position: absolute;

    opacity: 0;

    width: 0;
    height: 0;
}


.slider-tema {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 0 8px;

    box-sizing: border-box;

    border: 1px solid #d0d4d9;
    border-radius: 999px;

    background: #eef1f4;

    cursor: pointer;

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}


.slider-tema::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.25s ease;
}


.switch-tema input:checked
+ .slider-tema {
    background: #20252c;

    border-color: #3c434c;
}


.switch-tema input:checked
+ .slider-tema::before {
    transform:
        translateX(30px);
}


.tema-icono {
    position: relative;

    z-index: 1;

    width: 15px;
    height: 15px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}


.tema-sol {
    color: #6f7782;
}


.tema-luna {
    color: #ffffff;
}

/* ==========================================================
   SUPERFICIES / TARJETAS EN MODO OSCURO
   ========================================================== */

html[data-tema="oscuro"] .asignacion-card,
html[data-tema="oscuro"] .asignacion-area-contenido,
html[data-tema="oscuro"] .usuario-card,
html[data-tema="oscuro"] .edificio-card,
html[data-tema="oscuro"] .area-card,
html[data-tema="oscuro"] .tarea-admin-card,
html[data-tema="oscuro"] .detalle-foto-card,
html[data-tema="oscuro"] .historial-card,
html[data-tema="oscuro"] .incidencia-card,
html[data-tema="oscuro"] .landing-card,
html[data-tema="oscuro"] .admin-card {
    background: #1e1e1e;

    color: #f1f1f1;

    border-color: #3a3a3a;
}

html[data-tema="oscuro"] .areas-selector,
html[data-tema="oscuro"] .contenedor-areas,
html[data-tema="oscuro"] .lista-areas,
html[data-tema="oscuro"] .roles-fieldset,
html[data-tema="oscuro"] fieldset {
    background: #252525;

    color: #f1f1f1;

    border-color: #4a4a4a;
}

html[data-tema="oscuro"] input,
html[data-tema="oscuro"] select,
html[data-tema="oscuro"] textarea {
    background: #252525;

    color: #ffffff;

    border-color: #555555;
}


html[data-tema="oscuro"] input[type="checkbox"] {
    accent-color: #4f8cff;
}

html[data-tema="oscuro"] .btn-principal {
    color: #ffffff;

    border-color: transparent;
}

html[data-tema="oscuro"] .btn-secundario,
html[data-tema="oscuro"] .btn-logout {
    background: #2b2b2b;

    color: #f1f1f1;

    border-color: #555555;
}

html[data-tema="oscuro"] button:disabled {
    opacity: 0.55;
}

html[data-tema="oscuro"] .qr-admin-contenedor {
    background: #ffffff;
}

/* ==========================================================
   COMPONENTES QUE AÚN QUEDAN BLANCOS EN MODO OSCURO
   ========================================================== */

html[data-tema="oscuro"] .asignacion-edificio,
html[data-tema="oscuro"] .reporte-card,
html[data-tema="oscuro"] .excepcion-card {
    background: #1e1e1e;

    color: #f1f1f1;

    border-color: #3a3a3a;
}

html[data-tema="oscuro"] .usuario-roles {
    color: #f1f1f1;
}

html[data-tema="oscuro"] .rol-badge {
    background: #2f3a46;

    color: #ffffff;

    border-color: #4a5563;
}

html[data-tema="oscuro"] .menu-card-categoria {
    color: #d0d5dc;
}

html[data-tema="oscuro"] .menu-card-categoria {
    color: #aeb8c4;

    background: #2a3138;

    border: 1px solid #3e4852;

    padding: 3px 8px;

    border-radius: 999px;
}

html[data-tema="oscuro"] .btn-principal {
    background: #2f6fed;

    color: #ffffff;

    border: 1px solid #5a8cff;

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-tema="oscuro"] .btn-principal:hover {
    background: #3b78f0;
}

html[data-tema="oscuro"] .login-card {
    background: #1f2329;

    color: #f3f5f7;

    border: 1px solid #343a42;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-tema="oscuro"] .login-header h1 {
    color: #ffffff;
}

html[data-tema="oscuro"] .login-header p {
    color: #b9c0c8;
}

html[data-tema="oscuro"] .login-card label {
    color: #e6e9ed;
}

html[data-tema="oscuro"] .login-logo {
    background: #ffffff;

    padding: 8px;

    border-radius: 10px;
}

html[data-tema="oscuro"] .login-card input {
    background: #2a2f36;

    color: #ffffff;

    border: 1px solid #4a515b;
}

html[data-tema="oscuro"] .btn-principal {
    background: #3f5f78;

    color: #ffffff;

    border: 1px solid #58758c;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.20);
}


html[data-tema="oscuro"] .btn-principal:hover {
    background: #496b85;

    border-color: #66849b;
}

html[data-tema="oscuro"] .btn-area-escanear {
    background: #3f5f78;
    color: #ffffff;

    border-color: #58758c;
}

html[data-tema="oscuro"] .btn-area-escanear:hover {
    background: #496b85;
    border-color: #66849b;
}

.tema-sol {
    color: #7a6b38;
}

.tema-luna {
    color: #68727d;
}

.switch-tema input:checked
+ .slider-tema .tema-sol {
    color: #8f98a3;
}

.switch-tema input:checked
+ .slider-tema .tema-luna {
    color: #e8edf2;
}

.tema-icono {
    opacity: 0.65;
}

.switch-tema input:not(:checked)
+ .slider-tema .tema-sol {
    opacity: 1;
}

.switch-tema input:checked
+ .slider-tema .tema-luna {
    opacity: 1;
}

/* ==========================================================
   ICONO DE CALENDARIO EN MODO OSCURO
   ========================================================== */

html[data-tema="oscuro"]
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.85;

    cursor: pointer;
}

/* ==========================================================
   LECTOR QR - MODO OSCURO
   ========================================================== */

html[data-tema="oscuro"] .qr-modal-contenido {
    background: #1e1e1e;
    color: #f1f1f1;

    border: 1px solid #3a3a3a;
}


html[data-tema="oscuro"] .qr-modal-encabezado h2 {
    color: #ffffff;
}


html[data-tema="oscuro"] .qr-modal-cerrar {
    color: #ffffff;
}


html[data-tema="oscuro"] .qr-reader {
    background: #000000;
}


/*
    html5-qrcode genera estas esquinas con estilos inline.
    Por eso necesitamos !important.
*/
html[data-tema="oscuro"]
.qr-reader
#qr-shaded-region > div {
    background-color: #d7dde4 !important;
}

/* ==========================================================
   AVISO DE TAREA EN PROCESO
   ========================================================== */

html[data-tema="oscuro"] .aviso-tarea {
    background: #2b3036;

    color: #e8edf2;

    border-color: #515a64;
}

.btn-reportar-incidencia:hover {
    background: #496b85;

    border-color: #66849b;
}

html[data-tema="oscuro"] .btn-reportar-incidencia {
    background: #3f5f78;
    color: #ffffff;

    border-color: #58758c;
}

html[data-tema="oscuro"] .captura-foto-contenido {
    background: #1e1e1e;
    color: #f1f1f1;
}

html[data-tema="oscuro"] #tituloCapturaFoto {
    color: #ffffff;
}

html[data-tema="oscuro"] #descripcionCapturaFoto {
    color: #b8b8b8;
}

html[data-tema="oscuro"] .password-toggle {
    color: #b8b8b8;
}

html[data-tema="oscuro"] .password-toggle:hover {
    color: #ffffff;
}

/* ============================================
   REPORTES - CHECKBOX EN TEMA OSCURO
   ============================================ */

html[data-tema="oscuro"] .campo-filtro-checkbox .filtro-checkbox {
    background: #2a2a2a;
    border-color: #555555;
    color: #ffffff;
}

html[data-tema="oscuro"] .campo-filtro-checkbox .filtro-checkbox span {
    color: #ffffff;
}