/* FIXLOG 8-BITS - NÚCLEO RESTAURADO V3.1 */

:root {
    --nes-black: #000;
    --nes-white: #fff;
    --nes-label-color: #000000;
    --mario-black: #000000;
    --mario-white: #fff;
    --mario-red: #FF3131;
    --mario-yellow: #fac42f;
    --mario-blue: #0277a8;
    --mario-green: #39ff14;
    --mario-grey: #888888;
    --mario-orange: #ff8e00;
    --mario-pink: #ff77a8;
    --mario-fixlog: #76481b;
    --mario-default: #6f00b0;

}

/* LA REGLA DE ORO PARA QUE NADA SE DESBORDE */
*,
::after,
::before {
    box-sizing: border-box;
}

/* =========================================
   1. CAPA DE FONDO Y BODY
   ========================================= */
body::after {
    content: "";
    background-image: url('../recursos/img/background.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center bottom;
    opacity: 0.5;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    position: fixed;
    z-index: -1;
}

body {
    background-color: #1a1a1a;
    color: var(--nes-white);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    padding-bottom: 40px;
    font-size: 16px;
}

/* =========================================
   CONTENEDORES MAESTROS
   ========================================= */

/* contenedor header y contenido principal */
.nes-container {
    background-color: rgba(0, 0, 0, 0.5);
    border: 4px double var(--mario-orange);
    padding: 30px;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    backdrop-filter: blur(5px);
    position: relative;
}

.origen-foto-container {
    border: 2px solid var(--mario-red) !important;
    padding: 30px !important;
}

.form-section-box {
    background-color: rgba(0, 0, 0, 0.3);
    border: 4px solid var(--mario-orange);
    padding: 35px 20px 20px 20px;
    position: relative;
    margin-top: 35px;
    margin-bottom: 25px;
    display: block;
}

.form-section-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--mario-orange);
    color: #393838;
    padding: 5px 10px;
    font-size: 18px;
    border: 2px solid #cbc7c7;
    font-weight: bold;
    letter-spacing: 1px;
    transform: skewX(-10deg);
    box-shadow: 2px 2px 0 #000;
    z-index: 10;
}

/* VARIANTES DE COLOR PARA CAJAS .form-section-box */
.form-section-box.fixlog {
    border-color: var(--mario-fixlog);
    box-shadow: inset 0 0 20px rgba(118, 72, 27, 0.1);
}

.form-section-box.fixlog .form-section-label {
    background: var(--mario-fixlog);
    color: #fff;
}

.form-section-box.blue {
    border-color: var(--mario-blue);
    box-shadow: inset 0 0 20px rgba(92, 148, 252, 0.1);
}

.form-section-box.blue .form-section-label {
    background: var(--mario-blue);
    color: #fff;
}

.form-section-box.morado {
    border-color: var(--mario-default);
    box-shadow: inset 0 0 20px rgba(92, 148, 252, 0.1);
}

.form-section-box.morado .form-section-label {
    background: var(--mario-default);
    color: #fff;
}

.form-section-box.yellow {
    border-color: var(--mario-yellow);
    box-shadow: inset 0 0 20px rgba(250, 196, 47, 0.1);
}

.form-section-box.yellow .form-section-label {
    background: var(--mario-yellow);
    color: #312c2c;
}

.form-section-box.red {
    border-color: var(--mario-red);
    box-shadow: inset 0 0 20px rgba(228, 0, 15, 0.1);
}

.form-section-box.red .form-section-label {
    background: var(--mario-red);
    color: #fff;
}

.form-section-box.green {
    border-color: var(--mario-green);
    box-shadow: inset 0 0 20px rgba(67, 176, 71, 0.1);
}

.form-section-box.green .form-section-label {
    background: var(--mario-green);
    color: #333333;
}

.form-section-box.pink {
    border-color: var(--mario-pink);
    box-shadow: inset 0 0 20px rgba(255, 119, 168, 0.1);
}

.form-section-box.pink .form-section-label {
    background: var(--mario-pink);
    color: #fff;
}

.form-section-box.grey {
    border-color: grey;
    box-shadow: inset 0 0 20px rgba(136, 136, 136, 0.1);
}

.form-section-box.grey .form-section-label {
    background: grey;
    color: #fff;
}

/* =========================================
   CAJAS DE MISIÓN (EVIDENCIA)
=========================================*/

.mission-box {
    background-color: rgba(0, 0, 0, 0.5);
    border: 4px solid var(--mario-default);
    padding: 35px 20px 20px 20px;
    position: relative;
    margin-top: 25px;
    box-shadow: inset 0 0 20px rgba(111, 0, 176, 0.1);
}

.mission-textarea {
    background: transparent;
    border: none;
    color: var(--mario-green);
    width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 18px;
    line-height: 1.2;
    outline: none;
    resize: vertical;
    /* CSS válido: 'vertical' en lugar de 'true' */
}


.mission-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--mario-green);
    color: #333333;
    padding: 5px 10px;
    font-size: 18px;
    border: 2px solid #fff;
    transform: skewX(-10deg);
    box-shadow: 2px 2px 0 #000;
}

/* =========================================
   VARIANTES DE COLOR PARA MISSION-BOX
   Uso: <div class="mission-box red">
   ========================================= */

/* --- AZUL --- */
.mission-box.blue {
    border-color: var(--mario-blue) !important;
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1) !important;
}

.mission-box.blue .mission-label {
    background: var(--mario-blue) !important;
    color: #000 !important;
}

.mission-box.blue .mission-textarea,
.mission-box.blue .blinking-cursor {
    color: var(--mario-blue) !important;
}

/* --- NARANJA --- */
.mission-box.orange {
    border-color: var(--mario-orange) !important;
    box-shadow: inset 0 0 20px rgba(255, 142, 0, 0.1) !important;
}

.mission-box.orange .mission-label {
    background: var(--mario-orange) !important;
    color: #fff !important;
}

.mission-box.orange .mission-textarea,
.mission-box.orange .blinking-cursor {
    color: var(--mario-orange) !important;
}

/* --- AMARILLO --- */
.mission-box.yellow {
    border-color: var(--mario-yellow) !important;
    box-shadow: inset 0 0 20px rgba(250, 196, 47, 0.1) !important;
}

.mission-box.yellow .mission-label {
    background: var(--mario-yellow) !important;
    color: #312c2c !important;
    /* Texto oscuro para que se lea en fondo amarillo */
}

.mission-box.yellow .mission-textarea,
.mission-box.yellow .blinking-cursor {
    color: var(--mario-yellow) !important;
}

/* --- ROJO --- */
.mission-box.red {
    border-color: var(--mario-red) !important;
    box-shadow: inset 0 0 20px rgba(255, 49, 49, 0.1) !important;
}

.mission-box.red .mission-label {
    background: var(--mario-red) !important;
    color: #fff !important;
}

.mission-box.red .mission-textarea,
.mission-box.red .blinking-cursor {
    color: var(--mario-red) !important;
}

/* --- VERDE --- */
.mission-box.green {
    border-color: var(--mario-green) !important;
    box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.1) !important;
}

.mission-box.green .mission-label {
    background: var(--mario-green) !important;
    color: #333 !important;
    /* Texto oscuro para fondo brillante */
}

.mission-box.green .mission-textarea,
.mission-box.green .blinking-cursor {
    color: var(--mario-green) !important;
}

/* --- ROSA --- */
.mission-box.pink {
    border-color: var(--mario-pink) !important;
    box-shadow: inset 0 0 20px rgba(255, 119, 168, 0.1) !important;
}

.mission-box.pink .mission-label {
    background: var(--mario-pink) !important;
    color: #fff !important;
}

.mission-box.pink .mission-textarea,
.mission-box.pink .blinking-cursor {
    color: var(--mario-pink) !important;
}

/* --- GRIS --- */
.mission-box.grey {
    border-color: grey !important;
    box-shadow: inset 0 0 20px rgba(136, 136, 136, 0.1) !important;
}

.mission-box.grey .mission-label {
    background: grey !important;
    color: #fff !important;
}

.mission-box.grey .mission-textarea,
.mission-box.grey .blinking-cursor {
    color: #ccc !important;
    /* Texto un poco más claro para distinguir */
}

/* =========================================
   Estilo de los modal-content
   ========================================= */
.modal-content {
    background: #000 !important;
    border: 4px double var(--mario-blue) !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7), inset 0 0 10px var(--mario-blue) !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    color: var(--nes-white);
}

.modal-header,
.modal-footer {
    background: #000 !important;
    border-color: var(--mario-blue) !important;
    padding: 15px;
}

.modal-header {
    border-bottom: 2px solid var(--mario-blue) !important;
    border-top: none !important;
}

.modal-footer {
    border-top: 2px solid var(--mario-blue) !important;
    border-bottom: none !important;
}

.modal-title {
    color: var(--mario-yellow) !important;
    font-size: 12px !important;
    text-shadow: 2px 2px 0 #000;
}

.modal-body {
    padding: 25px;
}

.modal-body label {
    color: var(--nes-white) !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 10px !important;
    margin-bottom: 5px !important;
    display: block !important;
}

/* Ajustes Inputs en Modal */
.modal-body .input-terminal {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid var(--nes-white) !important;
    color: var(--mario-yellow) !important;
    padding: 10px 15px !important;
    font-size: 12px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
}

.modal-body .input-terminal:focus {
    border-color: var(--mario-blue) !important;
    box-shadow: 0 0 10px var(--mario-blue) !important;
}

/* Ajustes para ticket_listo.php*/
/* Layout Split-Screen (Grid) para la terminal de éxito */
.mission-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 25px;
    margin-top: 20px;
}

.pdf-holo-visor {
    width: 100%;
    height: 750px;
    border: 4px solid var(--nes-border-color);
    background: #000;
    box-shadow: 0 0 20px rgba(92, 148, 252, 0.2);
}

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

    .pdf-holo-visor {
        height: 500px;
    }
}

.info-panel-item {
    border-bottom: 2px dashed var(--nes-border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.info-panel-label {
    font-size: 22px;
    font-weight: bold;
    color: var(--mario-yellow);
    display: block;
    margin-bottom: 8px;
}

.info-panel-value {
    font-size: 26px;
    font-weight: bold;
    color: var(--mario-green);
    border-bottom: 2px solid #888 !important;
    display: block !important;
    width: 100% !important;
}

/*=========================================
   7. CONFIGURACION DEL FOOTER
   ========================================= */

.retro-footer {
    margin-top: 50px;
    border-top: 4px solid var(--mario-orange);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 40px 20px;
    text-align: center;
}

.footer-credits {
    font-size: 16px;
    line-height: 1.5;
    color: var(--mario-yellow);
    margin-bottom: 10px;
}

.footer-slogan {
    color: var(--mario-green);
    font-size: 16px;
    text-transform: uppercase;
    margin-top: 15px;
    letter-spacing: 1px;
}

/* =========================================
   3. INPUTS Y FORMULARIOS
   ========================================= */

/* --- 3.1 INPUT BLOQUEADO / DESACTIVADO --- */
/* (Mantenemos esto para proteger los campos de solo lectura) */
.input-locked,
.input-retro:disabled,
.input-retro[readonly],
.input-terminal:disabled,
.input-terminal[readonly] {
    background-color: #222 !important;
    /* Fondo gris muy oscuro */
    border: 2px solid #555 !important;
    /* Borde gris apagado (sin neón) */
    color: #777 !important;
    /* Letras atenuadas */
    cursor: not-allowed !important;
    /* Icono de "Prohibido" */
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Evitamos que brillen si el usuario intenta darles clic a la fuerza */
.input-locked:focus,
.input-retro:disabled:focus,
.input-retro[readonly]:focus,
.input-terminal:disabled:focus,
.input-terminal[readonly]:focus {
    border-color: #555 !important;
    color: #777 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* --- 3.2 CAJAS SÓLIDAS 8-BITS (UNIFICADAS) --- */
.input-terminal,
.input-retro {
    background-color: rgba(0, 0, 0, 0.7) !important;
    /* Fondo oscuro translúcido */
    border: 2px solid #ffea00 !important;
    /* Marco blanco base */
    color: var(--nes-white) !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 18px;
    padding: 12px 15px !important;
    width: 100% !important;
    text-align: left;
    outline: none;
    margin-bottom: 10px;
    border-radius: 4px;
    display: block !important;
    transition: all 0.3s ease-in-out;
}

/* El input-retro del login lo centramos para que se vea como RPG */
.input-retro {
    text-align: center !important;
    padding: 18px !important;
}

/* --- 3.3 EFECTO BRILLO NEÓN INTENSO (:focus) --- */
.input-terminal:focus,
.input-retro:focus {
    border-color: var(--mario-yellow) !important;
    color: var(--mario-yellow) !important;

    /* SOMBRAS MULTICAPA: Efecto de luz real y difusa */
    box-shadow:
        0 0 5px var(--mario-yellow),
        /* Resplandor fuerte pegado al borde */
        0 0 15px var(--mario-yellow),
        /* Glow difuso hacia afuera */
        inset 0 0 10px rgba(250, 196, 47, 0.2) !important;
    /* Reflejo interno */

    text-shadow: 0 0 5px var(--mario-yellow);
}

/* --- 3.4 AJUSTES PARA LOS SELECTORES --- */
select.input-terminal,
select.input-retro {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

select.input-terminal option,
select.input-retro option {
    background-color: #000;
    color: var(--nes-white);
    padding: 10px;
}

/* --- LA LUZ ROJA DE "REC" --- */
.rec-light {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 12px;
    height: 12px;
    background-color: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 12px #ff0000;
    z-index: 3;
    /* Para que quede por encima de la foto y el cristal */
    animation: blink 1s infinite;
}

/* --- TEXTO DE "NO SIGNAL / SIN FOTO" --- */
#crt-no-signal {
    color: rgb(245, 13, 13);
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgb(202, 187, 187);
    z-index: 1;
}

@keyframes flicker {
    0% {
        opacity: 0.2;
    }

    20% {
        opacity: 0.6;
    }

    40% {
        opacity: 0.3;
    }

    60% {
        opacity: 0.7;
    }

    80% {
        opacity: 0.2;
    }

    100% {
        opacity: 0.5;
    }
}
/* =========================================
   EFECTO VISUAL: MONITOR CRT (ESTILO RETRO)
   ========================================= */
/* 1. El chasis/marco de plástico exterior del monitor */
.crt-monitor {
    background-color: rgba(0, 0, 0, 0.5);
    border: 4px solid #444;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 5px 5px 0 #000, inset 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}
/* 2. El cristal de la pantalla (área de visualización) */
.crt-screen {
    width: 100%;
    height: 220px;
    /* Altura fija para tener buen espacio de clic */
    background-color: #050505;
    /* Color base oscuro (apagado) */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #222;
}
/* 3. Efecto de líneas de escaneo (Scanlines) sobre el cristal */
.crt-screen::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    /* Dibuja las diminutas líneas RGB y oscuras imitando una TV vieja */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 4px 100%;
    z-index: 2;
    /* Garantiza que el efecto quede por encima de la foto */
    pointer-events: none;
    /* Permite que el usuario pueda dar clic a través del efecto */
    animation: flicker 0.15s infinite;
    /* Llama a la animación de parpadeo */
}
/* =========================================
   4.b BOTONES 3D ARCADE (UNIFICADOS)
   ========================================= */
/* Botones Generales */
.btn-retro {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-family: 'Press Start 2P';
    font-size: 12px;
    text-transform: uppercase;
    color: var(--nes-white);
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
    border-radius: 10px;
    /* REDONDEADO */
    /* Estilo base gris */
    background: linear-gradient(180deg, #888 0%, #555 100%);
    box-shadow: 0 6px 0 #333, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-retro:hover {
    filter: brightness(1.2);
}

.btn-retro:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #333, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-yellow {
    background: linear-gradient(180deg, #fac42f 0%, #c69b26 100%);
    box-shadow: 0 6px 0 #c69b26, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-yellow:active {
    box-shadow: 0 0 0 #c69b26, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-orange {
    background: linear-gradient(180deg, var(--mario-orange) 0%, #cc7200 100%);
    box-shadow: 0 6px 0 #995600, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-orange:active {
    box-shadow: 0 0 0 #995600, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-green {
    background: linear-gradient(180deg, #43b047 0%, #2e7d32 100%);
    box-shadow: 0 6px 0 #1b5e20, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-green:active {
    box-shadow: 0 0 0 #1b5e20, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-blue {
    background: linear-gradient(180deg, #049cd8 0%, #0277a8 100%);
    box-shadow: 0 6px 0 #01579b, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-blue:active {
    box-shadow: 0 0 0 #01579b, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-red {
    background: linear-gradient(180deg, #E4000F 0%, #b71c1c 100%);
    box-shadow: 0 6px 0 #7f0000, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-red:active {
    box-shadow: 0 0 0 #7f0000, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-purple {
    background: linear-gradient(180deg, #8A2BE2 0%, #6a1b9a 100%);
    box-shadow: 0 6px 0 #4a148c, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-purple:active {
    box-shadow: 0 0 0 #4a148c, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-whatsapp {
    background: linear-gradient(180deg, #43b047 0%, #2e7d32 100%);
    box-shadow: 0 6px 0 #1b5e20, 0 10px 10px rgba(0, 0, 0, 0.5);
}

.btn-whatsapp:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 transparent, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* =========================================
   5. TABLAS HACKER
   ========================================= */
.table-retro {
    background: #000 !important;
    border: 2px solid var(--mario-green) !important;
    color: var(--mario-green) !important;
}

.table-retro th {
    border-bottom: 2px solid var(--mario-green) !important;
    color: var(--mario-green) !important;
}

.table-retro td {
    border-bottom: 1px dashed var(--mario-green-dim) !important;
}

/* =========================================
   6. HEADER ARCADE Y EXTRAS
   ========================================= */
.arcade-header {
    background-color: rgba(0, 0, 0, 0.6);
    border-bottom: 4px solid var(--mario-orange);
    padding: 30px 0;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.arcade-title {
    font-size: 38px !important;
    color: var(--mario-orange) !important;
    text-shadow: 4px 4px 0px #392204;
    margin: 0;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.arcade-title i {
    color: var(--mario-red);
    margin-right: 15px;
}

.arcade-subtitle {
    font-size: 24px;
    color: var(--mario-white) !important;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.arcade-header::before {
    content: "INSERT COIN";
    position: absolute;
    top: 15px;
    right: 30px;
    font-size: 24px;
    color: var(--mario-yellow);
    animation: blink 1s infinite;
}

/* TIMELINE EDITAR.PHP */
.log-box {
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    box-shadow: inset 0 0 15px #000;
}

.log-item {
    border-left: 2px solid var(--mario-blue);
    padding-left: 10px;
    margin-bottom: 15px;
}

.log-date {
    font-size: 12px;
    color: #666;
}

.log-status {
    color: var(--mario-yellow);
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.log-detail {
    font-size: 12px;
    color: var(--mario-green);
    line-height: 1.4;
}

/* ANIMACIONES UTILIDADES */
.blinking-cursor {
    animation: blink 1s infinite;
    color: var(--mario-green);
}

.blinking-cursor-grey {
    animation: blink 1s infinite;
    color: grey;
}

.blinking-cursor-red {
    animation: blink 1s infinite;
    color: var(--mario-red);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes scanline {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 -100px;
    }
}

.options-gap {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.text-yellow {
    color: var(--mario-yellow) !important;
}

.text-red {
    color: var(--mario-red) !important;
}

.text-green {
    color: var(--mario-green) !important;
}

.text-blue {
    color: var(--mario-blue) !important;
}

.text-muted {
    color: #666 !important;
}

/* --- ALERTAS Y MODALES CUSTOM --- */
.alert-retro {
    background: var(--mario-green);
    color: #000;
    padding: 10px;
    text-align: center;
    border: 2px solid #fff;
    margin-bottom: 20px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

.alert-retro.error {
    background: var(--mario-red) !important;
    color: #fff !important;
    border-color: #fff !important;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.btn-close-modal {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--nes-black);
    color: white;
    border: 2px solid var(--mario-red);
    cursor: pointer;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 14px;
    padding: 8px 12px;
    box-shadow: 4px 4px 0px #000;
}

.btn-close-white {
    filter: invert(1) grayscale(1) brightness(2);
}

/* --- AJUSTES DE TELÉFONO --- */

/* El fix para que la caja abarque el 100% del ancho */
.iti {
    width: 100% !important;
    display: block !important;
}

.phone-input-retro,
#telefono_nuevo,
#telefono_editar {
    padding-left: 80px !important;
}

.iti__selected-dial-code {
    color: var(--nes-white);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 20px;
}

/* --- CLASES REFACTORIZADAS DE EDITAR.PHP --- */
.etiqueta_folio_bloqueada {
    color: #aaa;
}

.ajuste_visual_foto_crt {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.texto_estado_evidencia {
    font-size: 14px;
    color: #cbc0c0;
    margin-top: 15px;
    line-height: 1.5;
    text-align: center;
}

.mensaje_error_validador {
    color: var(--mario-red);
    font-size: 8px;
    margin-top: 5px;
}

.alerta_retraso_critico {
    color: var(--mario-red);
    font-size: 8px;
}

.texto_ayuda_input {
    color: #888;
    font-size: 8px;
}

.texto_error_pequeno {
    color: var(--mario-red);
    font-size: 8px;
}

.desplegable_estado_critico {
    font-weight: bold;
    border-bottom: 2px dashed var(--mario-red) !important;
}

.titulo_instruccion_verde {
    color: var(--mario-green);
}

.input_timeline_detalle {
    border-bottom: 2px dashed var(--mario-green) !important;
    color: var(--mario-red);
}

.log_historial_vacio {
    border-left-color: #555;
    color: #666;
}

.modal_personalizado_retro {
    background: var(--nes-black) !important;
    padding: 25px;
    width: 320px;
    text-align: center;
    position: relative;
}

/* Modal de Sistema Retro JS */
.contenedor_alerta_retro_js {
    background: rgba(0, 0, 0, 0.95);
    padding: 35px 25px 25px 25px;
    width: 320px;
    text-align: center;
    margin: 0 auto;
}

.etiqueta_alerta_centrada {
    left: 50%;
    transform: translateX(-50%) skewX(-10deg);
    top: -12px;
}

.titulo_alerta_retro {
    margin-bottom: 20px;
    color: var(--mario-yellow);
    text-shadow: 2px 2px 0 #000;
}

.cuerpo_mensaje_retro {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 25px;
    color: #fff;
}

/* --- VISOR DE SALDO Y ESTADOS FINANCIEROS --- */
.visor_saldo_dinamico {
    font-size: 14px;
    font-weight: bold;
}

.saldo_pendiente {
    color: var(--mario-yellow) !important;
}

.saldo_pagado {
    color: var(--mario-green) !important;
}

/* =========================================
   🕹️ BARRA DE HP: BASE Y ESTRUCTURA
   ========================================= */

/* 1. EL CHASIS */
.hp-container {
    width: 100%; height: 35px;
    background-color: #222;
    border: 3px solid var(--nes-white);
    position: relative; overflow: hidden;
    box-shadow: inset 0 0 10px #000, 4px 4px 0px rgba(0,0,0,0.5);
    margin-top: 5px;
}

/* 2. EL RELLENO (Inicia en 0 para animarse con el JS) */
.hp-fill {
    height: 100%;
    width: 0%; 
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. EL TEXTO (¡Aquí está! Mantiene los días centrados) */
.hp-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--nes-white); font-weight: bold; font-size: 14px;
    text-shadow: 2px 2px 0px #000; z-index: 2;
}

/* =========================================
   🩸 BARRA DE HP: ANIMACIÓN DE LATIDO CRÍTICO
   ========================================= */

/* --- KEYFRAMES --- */
@keyframes latidoCritico {
    0% { transform: scale(1); }
    15% { transform: scale(1.02); }
    30% { transform: scale(1); }
    45% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes auraRespiracion {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(228, 0, 15, 0.4), inset 0 0 10px rgba(0,0,0,0.8);
        border-color: rgba(255, 255, 255, 0.5);
    }
    15%, 45% { 
        box-shadow: 0 0 25px rgba(228, 0, 15, 1), inset 0 0 15px rgba(228, 0, 15, 0.5);
        border-color: #E4000F;
    }
}

@keyframes crtLento {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

@keyframes textoPeligroSuave {
    0%, 100% { opacity: 0.6; text-shadow: none; }
    50% { opacity: 1; text-shadow: 0 0 10px #E4000F; }
}

/* --- CLASES DE ACTIVACIÓN (Cuando PHP detecta > 15 días) --- */

.hp-container.blink-anim {
    animation: 
        latidoCritico 1.5s infinite ease-in-out,
        auraRespiracion 1.5s infinite ease-in-out;
}

.hp-fill[style*="background-color: #E4000F"]::after,
.hp-fill[style*="background-color: #e4000f"]::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUh4wAAABAAAAAQAgMAAAB13u5oAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kMFRM5DjS9694AAAAZdEVYdENvbW1lbnQAAArrQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAX0lEQVQY02NgIAX8ByEM//8fMGAAEPz/gAEDgOD/AwwYAAT/H2DAACD4/wEDBgwAgv8PMGAAYAIAsX/AsD8Awf8HGDAACOb/AQMGAAH8/4EBQwEAVv+AsD8AAP//AwD16yT5f9b1OAAAAABJRU5ErkJggg==');
    opacity: 0.15;
    animation: crtLento 2s infinite linear;
    z-index: 1;
}

.texto-alarma-blink {
    animation: textoPeligroSuave 1.5s infinite ease-in-out;
    font-weight: bold;
    letter-spacing: 1px;
}

/* --- COMPONENTES ESPECÍFICOS DE NUEVO.PHP --- */

/* Contenedor de error para el input de teléfono (intl-tel-input) */
.alerta_error_telefono {
    min-height: 15px;
    /* Evita que el formulario "salte" cuando aparece el error */
    color: var(--mario-red);
    font-size: 16px;
    margin-top: 2px;
    margin-bottom: 5px;
    display: block;
}

/* Caja de pre-visualización de saldo en la creación */
.contenedor_visor_saldo_nuevo {
    border: 1px dashed #666;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}