/* css/platform.css */

/* Ajustes generales para el body de plataforma */
.platform-body {
    background-color: #f4f7f6;
    padding-top: 100px; /* Espacio para el nav fijo */
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

.platform-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 80vh;
}

/* AnimaciÃ³n de entrada */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Banner de Bienvenida */
.welcome-banner {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.2);
}
.welcome-banner h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 10px; }

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.dash-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s;
    width: 300px;
    text-align: center;
    border-left: 5px solid #28a745;
}
.dash-card:hover { transform: translateY(-5px); }

/* NOTICIAS GRID (Otras secciones) */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.news-item {
}

/* ================================================================== */
/* CARNET CENTEOLT — DISEÑO DIGITAL (cn2-card)                         */
/* ================================================================== */

/* Área contenedora */
.carnet-preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    overflow-x: auto;
    background: #f4f7f6; /* Fondo suave para que resalte la tarjeta */
}

/* Base de la Tarjeta */
.cn2-card, .cn2-card * {
    box-sizing: border-box;
}

.cn2-card {
    width: 380px;
    height: 609px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 16px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.22);
    overflow: hidden;
    position: relative;
    font-family: 'Montserrat', 'Arial', sans-serif;
    flex-shrink: 0;
    user-select: none;
}

/* ===================================== */
/* ANVERSO VERTICAL (CARA FRONTAL)       */
/* ===================================== */
.cn2-front-vertical {
    background: #ffffff url('../img/carnet.jpeg') no-repeat center center;
    background-size: 100% 100%;
}

/* 1. Recuadro Superior: Foto de Perfil */
.cn-v-photo-container {
    position: absolute;
    left: 31.62%;
    top: 27.60%;
    width: 36.52%;
    height: 24.39%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.15);
    z-index: 5;
}
.cn-v-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Base de campos de texto sobre líneas punteadas */
.cn-v-field-box {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    pointer-events: none;
    box-sizing: border-box;
}
.cn-v-text {
    font-family: 'Montserrat', 'Arial', sans-serif;
    font-weight: 800;
    color: #0d2818;
    text-transform: uppercase;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 4px;
}

/* 2. Nombres y Apellidos (Primer Nombre + Primer Apellido) */
.cn-v-name-box {
    left: 7%;
    width: 86%;
    top: 62.4%;
    height: 3.8%;
}
.cn-v-name-box .cn-v-text {
    font-size: 0.96rem;
    letter-spacing: 0.6px;
}

/* 3. Cédula de Identidad con letra acorde */
.cn-v-cedula-box {
    left: 10%;
    width: 80%;
    top: 69.3%;
    height: 3.8%;
}
.cn-v-cedula-box .cn-v-text {
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    font-weight: 900;
    color: #061c0f;
}

/* 4. Cargo / Especialidad */
.cn-v-cargo-box {
    left: 5%;
    width: 90%;
    top: 76.6%;
    height: 3.8%;
}
.cn-v-cargo-box .cn-v-text {
    font-size: 0.88rem;
    letter-spacing: 0.6px;
    font-weight: 800;
    color: #123d1e;
}

/* 5. Recuadro Blanco Inferior: Código QR */
.cn-v-qr-container {
    position: absolute;
    left: 37.99%;
    top: 81.96%;
    width: 24.26%;
    height: 15.14%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: transparent;
    padding: 3px;
    box-sizing: border-box;
    overflow: hidden;
}
.cn-v-qr-container #cn-qr-container,
.cn-v-qr-container #cn-qr-container-back {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* Crucial: evitar QR duplicado ocultando la imagen de respaldo generada por QRCode.js */
.cn-v-qr-container #cn-qr-container canvas,
.cn-v-qr-container #cn-qr-container-back canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    object-fit: contain;
}
.cn-v-qr-container #cn-qr-container img,
.cn-v-qr-container #cn-qr-container-back img {
    display: none !important;
}

/* ===================================== */
/* REVERSO VERTICAL (CARA TRASERA)       */
/* ===================================== */
.cn2-back-vertical {
    background: #ffffff url('../img/carnet_reverso.jpeg') no-repeat center center;
    background-size: 100% 100%;
}

/* Firma autorizada sobre la línea del Director */
.cn-v-back-signature {
    position: absolute;
    left: 20%;
    width: 60%;
    top: 64.6%;
    height: 6.2%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}
.cn-v-signature-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0,35,80,0.25));
}

/* Serial y Fechas del reverso: justo arriba del recuadro inferior y debajo de la firma del director */
.cn-v-back-meta-box {
    position: absolute;
    left: 8%;
    width: 84%;
    top: 70%;
    height: 11.2%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1px 2px;
    z-index: 5;
    font-family: 'Montserrat', 'Arial', sans-serif;
    box-sizing: border-box;
    pointer-events: none;
}
.cn-v-meta-serial {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1px;
}
.cn-v-meta-label {
    font-size: 0.70rem;
    font-weight: 900;
    color: #111;
    letter-spacing: 0.8px;
}
.cn-v-meta-num {
    font-size: 0.90rem;
    font-weight: 900;
    color: #c91a1a;
    letter-spacing: 0.6px;
}
.cn-v-meta-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 1px 0 2px 0;
    background: rgba(255, 255, 255, 0.75);
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px dashed rgba(0, 51, 102, 0.45);
}
.cn-v-meta-token-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: #003366;
    letter-spacing: 0.6px;
}
.cn-v-meta-token-num {
    font-size: 0.74rem;
    font-weight: 900;
    font-family: 'Courier New', Courier, monospace;
    color: #0f172a;
    letter-spacing: 1px;
}
.cn-v-meta-dates {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.60rem;
    color: #222;
}
.cn-v-meta-dates small {
    font-weight: 800;
    color: #444;
}
.cn-v-meta-dates span {
    font-weight: 800;
    color: #111;
}
.cn-v-meta-dot {
    color: #777;
    font-weight: 900;
}


/* ---- TOGGLE FRONTAL/REVERSO ---- */
.carnet-face-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 15px;
}
.face-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    border-radius: 30px;
    border: 2px solid #194a2b;
    background: white;
    color: #194a2b;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}
.face-toggle-btn.active {
    background: #194a2b;
    color: white;
}

/* ---- UPLOAD FOTO ---- */
.carnet-photo-upload-area {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.carnet-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px dashed #194a2b;
    color: #194a2b;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.2s;
}
.carnet-upload-label:hover { background: #eaf3ea; }

/* ---- BOTONES DESCARGA ---- */
.carnet-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.action-btn {
    padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;
    font-weight: bold; transition: 0.3s;
}
.cn-download-btn, .cn-download-btn-reverso {
    background: #194a2b;
    color: white;
    padding: 12px 26px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.cn-download-btn:hover:not(:disabled), .cn-download-btn-reverso:hover { transform: translateY(-2px); opacity:0.9; }

/* ===================================== */
/* RESPONSIVO PARA MÓVILES (ZOOM ESCALADO)*/
/* ===================================== */
@media (max-width: 440px) {
    .carnet-preview-wrapper {
        transform: scale(0.86);
        transform-origin: top center;
        margin-bottom: -75px;
    }
}
@media (max-width: 360px) {
    .carnet-preview-wrapper {
        transform: scale(0.76);
        transform-origin: top center;
        margin-bottom: -130px;
    }
}

/* ---- ESTILOS FORMULARIO FRACCIONADO ---- */
.form-section-block {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #28a745; /* Indicador visual verde */
}

.block-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.step-number {
    background: #28a745;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: bold;
    margin-right: 15px;
}

.block-header h3 {
    margin: 0;
    color: #2e2e2e;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas */
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input, .input-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.input-group input[type="date"],
input[type="date"] {
    cursor: pointer;
    font-family: inherit;
    color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(48%) sepia(79%) saturate(459%) hue-rotate(86deg) brightness(98%) contrast(92%);
    opacity: 0.85;
    padding: 4px;
    border-radius: 4px;
    transition: opacity 0.2s, transform 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.15);
}

.full-width {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
}

.big-save {
    width: 100%;
    font-size: 1.2rem;
    padding: 15px;
    margin-bottom: 50px;
}

/* RESPONSIVE PARA FORMULARIO */
@media (max-width: 768px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ---- ESTILOS BIOMETRIA (MODIFICADO) ---- */
.biometric-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.camera-area, .video-verify-area {
    flex: 1;
    min-width: 300px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.video-box {
    width: 100%; height: 200px;
    background: #000;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    display: flex; justify-content: center; align-items: center;
}
#video-stream, #photo-preview { width: 100%; height: 100%; object-fit: cover; }
#video-stream { transform: scaleX(-1); }

.btn-action {
    padding: 8px 15px; border-radius: 5px; cursor: pointer; border: 1px solid #ccc;
    font-weight: bold; transition: 0.2s;
}
.outline { background: white; color: #333; }
.solid { background: #28a745; color: white; border: none; }
.solid-red { background: #dc3545; color: white; border: none; }
.status-pending { margin: 10px 0; font-weight: bold; color: #777; }

/* ---- NUEVO DISEÃ‘O DE CARNET: BLANCO Y LIMPIO ---- */
.carnet-white-theme {
    width: 550px; /* Ancho tarjeta crÃ©dito aumentado proporcionalmente */
    height: 320px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
    border: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
}

.cw-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    /* Un toque sutil decorativo en la cabecera */
    background-image: url('../img/texture.png'); /* Opcional, o fondo blanco puro */
    border-bottom: 2px solid #28a745;
}

.cw-logo {
    height: 50px; /* Logo a color */
}

.cw-body {
    flex: 1;
    display: flex;
    padding: 15px 20px;
    align-items: center;
    gap: 20px;
}

.cw-photo-frame {
    width: 110px; height: 130px;
    border: 2px solid #eee;
    padding: 2px;
    border-radius: 5px;
}
.cw-photo-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.cw-info {
    flex: 1;
}

.cw-info h2 {
    color: #2e2e2e;
    font-size: clamp(0.75rem, 2.5vw, 1.1rem);
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
    word-break: break-word;
    overflow-wrap: break-word;
}

.cw-info h3 {
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.cw-data-row {
    display: flex;
    gap: 15px;
    margin-bottom: 6px;
}
.cw-data-item {
    display: flex; flex-direction: column;
}
.cw-data-item span {
    font-size: 0.6rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px;
}
.cw-data-item p {
    font-size: 0.85rem; color: #333; font-weight: 700; line-height: 1.2;
}

.cw-qr-box {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    padding: 5px;
}
#qrcode img {
    width: 100%;
}

.cw-footer {
    height: 35px;
    background: #2e2e2e;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* RESPONSIVE SCALE para MÃ³viles (Escalar el carnet si es muy grande) */
@media (max-width: 600px) {
    .carnet-white-theme {
        transform: scale(0.65);
        margin: -40px -80px; /* Compensar espacio por scale */
    }
}

/* PERFIL */
.profile-blocks-grid-obsolete {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.profile-card {
    background: white; border-radius: 10px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
#show-org, #show-cc, #show-camp, #show-comuna, #show-rif {
    font-weight: bold; font-size: clamp(0.4rem, 5vw, 1.2rem); text-align: center; align-self: center; margin-left: 5px;
}
.profile-card h3 { text-align: center; 
    font-size: clamp(0.4rem, 5vw, 1.5rem);}
.main-card { text-align: center; }
.profile-header-img img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid #f4f7f6;}
.data-list { list-style: none; padding: 0; }
.data-list li {
    padding: 10px 0; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between;
}
.data-list li strong { text-align: right; color: #2e2e2e; }

/* RESPONSIVE PERFIL */
@media (max-width: 768px) {
    .profile-blocks-grid-obsolete {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
    margin: auto;
}
    #profile-name {
    text-align: center; 
    font-size: clamp(0.4rem, 5vw, 1.5rem); }
}
/* MODAL SCANNER */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; display:flex; justify-content:center; align-items:center; }
.modal-content { background:white; width:90%; max-width:400px; border-radius:15px; overflow:hidden; position: relative; }
.modal-header { background:#2e2e2e; padding:20px; color:white; display:flex; align-items:center; justify-content:space-between; }
.modal-logo { height:30px; filter: brightness(0) invert(1); }
.modal-body { padding:20px; text-align:center; }
.modal-photo { width:100px; height:100px; border-radius:50%; margin-top:-50px; border:4px solid white; object-fit:cover; background: #ddd; }
.close-modal { 
    position: absolute; 
    right: 15px; 
    top: 15px; 
    font-size: 28px; 
    color: #fff; 
    background: rgba(0,0,0,0.3); 
    border: none; 
    cursor: pointer; 
    z-index: 100;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.close-modal:hover { background: rgba(0,0,0,0.5); }

/* ---- WIZARD DE PRODUCCION MEJORADO (Estilo Premium) ---- */

/* Ajuste del Modal para el Wizard */
#production-modal .modal-content {
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: none;
}

/* Animacion de Pasos */
.wizard-step {
    animation: slideUpFade 0.4s ease-out;
}
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid de Nichos Inteactivo */
.niche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.niche-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}
.niche-card:hover { transform: translateY(-3px); }

/* Ocultar el radio nativo accesiblmente */
.niche-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

/* Caja Visual del Nicho */
.niche-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    padding: 20px 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    min-height: 120px;
    color: #555;
}

.niche-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

/* Estado Seleccionado */
.niche-card input:checked + .niche-box {
    border-color: #28a745;
    background: linear-gradient(to bottom right, #f0fff4, #ffffff);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.15);
    color: #1e2e1e;
    transform: scale(1.02);
}
.niche-card input:checked + .niche-box .niche-icon {
    filter: grayscale(0%);
    transform: scale(1.1);
}
.niche-card input:checked + .niche-box span {
    font-weight: 700;
    color: #28a745;
}

/* Botones CTA Premium */
.hero-cta-button {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.4);
    filter: brightness(1.1);
}
.hero-cta-button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Inputs y Selects Aesthetics */
.input-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: #f9f9f9;
}
.input-group input:focus, .input-group select:focus {
    border-color: #28a745;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Grillas DinÃ¡micas */
.dynamic-section {
    display: grid;
    gap: 20px;
    animation: fadeIn 0.3s ease-in;
}

/* Spinner Custom */
.spinner {
    border: 4px solid rgba(0,0,0,0.05);
    border-left-color: #28a745;
}

/* RESULTADOS ESTILO */
#ai-result h2 { font-size: 1.5rem; margin-top: 0; }
#res-rubro-title { text-decoration: underline; text-decoration-color: #28a745; text-underline-offset: 5px; }


/* RESPONSIVE OPTIMIZATIONS ( MOBILE FIRST ) */
@media (max-width: 768px) {
    /* Modal Full Screen en mÃ³vil para mejor uso */
    #production-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    #production-modal .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 15px !important;
    }
    
    /* Grid de nichos a 2 columnas */
    .niche-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Inputs stacking */
    .form-grid-2, .dynamic-section {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Ajuste de grÃ¡ficos en mÃ³vil */
    #ai-result > div[style*="grid"] {
        grid-template-columns: 1fr !important; /* Stack grÃ¡ficos vertically */
    }
    
    /* Botones mÃ¡s grandes para dedos */
    .hero-cta-button, .btn-action {
        width: 100%;
        padding: 16px;
        margin-bottom: 10px;
    }
}

/* AJUSTES SOLICITADOS (Z-Index Header y Padding H3) */
#production-modal .modal-header {
    position: relative;
    z-index: 10;
}

#step-prod-2 h3 {
    padding-top: 15px; /* Un pequeÃ±o padding top extra */
    font-size: clamp(1rem, 2.5vw, 1.4rem); /* Texto Responsivo */
}

/* Padding para el TÃ­tulo de ProyecciÃ³n (Solicitado) */
#ai-result h2 {
    padding-top: 15px;
    font-size: clamp(1.2rem, 3vw, 1.8rem); /* Texto Responsivo */
}

/* Contenedor de GrÃ¡ficos Flexbox (Solicitado) */
.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    height: 300px;
    position: relative; /* Ensure it contains the canvas correctly */
}

.main-chart {
    flex: 2;
    min-width: 300px; /* Evita que se aplaste demasiado */
}

.pie-chart {
    flex: 1;
    min-width: 250px;
}

/* En mÃ³viles, que ocupen todo el ancho */
@media (max-width: 600px) {
    .main-chart, .pie-chart {
        flex: 1 1 100%;
        min-width: 100%;
    }
}
/* --- NUEVOS ESTILOS PARA PERFIL MODULAR --- */
.profile-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.profile-block-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-left: 6px solid #28a745;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-block-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
}

.block-icon-container {
    width: 70px;
    height: 70px;
    background: #f0fff4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #28a745;
    font-size: 2rem;
}

.block-index {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #eee;
    color: #666;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: #fdfdfd;
    border: 1px solid #ddd;
    color: #888;
}

.profile-block-card.completed .block-status {
    background: #e6ffed;
    color: #28a745;
    border-color: #bef5cb;
}

/* Modal Full Screen */
.modal-full {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 3000;
    display: none;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-full-header {
    background: #1e2e1e;
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.modal-full-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-close-full {
    background: none;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-close-full:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.modal-full-body {
    flex: 1;
    overflow-y: auto;
    padding: 50px 20px;
    display: flex;
    justify-content: center;
}

.modal-full-container {
    width: 100%;
    max-width: 800px;
}

.modal-section-title {
    color: #28a745;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* ---- UTILITIES FOR MODALS (Refactor) ---- */
.radio-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.radio-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.description-text {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-full-footer {
    padding: 15px 30px;
    border-top: 1px solid #eee;
    background: #fdfdfd;
    display: flex;
    justify-content: space-between; /* Adjusted for back arrow on left and buttons on right */
    align-items: center;
    gap: 15px;
}

/* --- ESTILOS PARA NAVEGACIÓN Y BOTÓN VOLVER --- */
.nav-aligned-row {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    min-height: 40px; /* Asegura espacio para la flecha */
}

.nav-aligned-row .btn-back-minimal {
    position: absolute;
    left: 0;
    top: 50%;
    z-index: 10;
}

.nav-aligned-row p {
    flex: 1;
    margin-bottom: 0 !important;
    padding: 0 40px; /* Deja espacio para la flecha a los lados si es necesario */
}

.section-header-nav {
    display: none; /* Reemplazado por nav-aligned-row */
}

.btn-back-minimal, .btn-back-minimal-modal {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    outline: none;
    box-shadow: none !important;
}

.btn-back-minimal:hover, .btn-back-minimal-modal:hover {
    transform: scale(1.1);
}

.btn-back {
    background: white;
    border: 1px solid #28a745;
    color: #28a745;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 15px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-back:hover {
    background: #28a745;
    color: white;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

.btn-back svg {
    transition: transform 0.2s;
}

.btn-back:hover svg {
    transform: translateX(-2px);
}

/* Styled Textarea (Non-resizable, Aesthetic) */
.styled-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #f9f9f9;
    resize: none; /* User cannot manually resize */
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    line-height: 1.5;
    color: #333;
    display: block;
    box-sizing: border-box;
}

.styled-textarea:focus {
    border-color: #28a745;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* ---- SELECTION CHIPS (Checkbox estilo premium) ---- */
.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.selection-chip {
    display: block;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #fafafa;
    position: relative;
}

.selection-chip:hover {
    border-color: #a5d6a7;
    background: #f0fff4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

/* Ocultar checkbox nativo */
.selection-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Círculo personalizado (reemplaza checkbox) */
.custom-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.custom-circle::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.chip-content span {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    transition: color 0.2s;
}

/* Estado seleccionado */
.selection-chip input:checked ~ .chip-content .custom-circle {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.selection-chip input:checked ~ .chip-content .custom-circle::after {
    transform: translate(-50%, -50%) scale(1);
}

.selection-chip input:checked ~ .chip-content span {
    color: #1b5e20;
    font-weight: 700;
}

.selection-chip:has(input:checked) {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.12);
}

/* Sub-input que aparece al seleccionar */
.chip-sub-input {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.selection-chip input:checked ~ .chip-sub-input,
.chip-sub-input.show {
    max-height: 150px;
    margin-top: 12px;
}

.chip-sub-input input,
.chip-sub-input textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 0.88rem;
    background: white;
    font-family: inherit;
}

.chip-sub-input input:focus,
.chip-sub-input textarea:focus {
    border-color: #28a745;
    outline: none;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

/* ---- INDICADOR DE ESTADO INCOMPLETO (Amarillo/Ámbar) ---- */
.profile-block-card.incomplete .block-status {
    background: #fff8e1;
    color: #f57f17;
    border-color: #ffe082;
}

.profile-block-card.incomplete {
    border-left-color: #ffa726;
}

/* --- RESALTADO VISUAL DE CAMPOS FALTANTES (Sombreado en Rojo y Glow) --- */
.field-error-highlight {
    border: 2px solid #e53935 !important;
    background-color: rgba(229, 57, 53, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.25) !important;
    animation: shakeError 0.35s ease-in-out;
}

[data-theme="dark"] .field-error-highlight {
    border-color: #ff5252 !important;
    background-color: rgba(255, 82, 82, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.3) !important;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.missing-field-hint {
    display: block;
    color: #e53935;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    animation: fadeInHint 0.25s ease-in;
}

[data-theme="dark"] .missing-field-hint {
    color: #ff5252;
}

@keyframes fadeInHint {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

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

    /* Optimización de fluidez móvil y saturación GPU */
    .dash-card,
    .profile-block-card,
    .news-item,
    .predio-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .dash-card:hover,
    .profile-block-card:hover {
        transform: none;
    }

    .token-modal-overlay {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
}

/* --- ESTILOS PARA LISTAS DE DATOS DE PERFIL (UI) --- */
.profile-data-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    text-align: left;
    font-size: 0.85rem;
    color: #555;
}
.profile-data-list li {
    margin-bottom: 6px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 4px;
    line-height: 1.3;
}
.profile-data-list li strong {
    color: #333;
}
.highlight-ubicacion {
    background: #f0fff4;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    margin-bottom: 10px;
}

/* ==========================================================================
   TEMA OSCURO Y ADAPTACIONES PARA PLATAFORMA (Dark / Light Theme Tokens)
   ========================================================================== */

.platform-body {
    background-color: var(--bg-body, #f4f7f6);
    color: var(--text-primary, #1a1a1a);
    transition: background-color var(--transition-normal, 0.3s), color var(--transition-normal, 0.3s);
}

[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #142e18 0%, #0c1a0e 100%);
    border: 1px solid var(--apple-green-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .dash-card,
[data-theme="dark"] .form-section-block,
[data-theme="dark"] .predio-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .info-block,
[data-theme="dark"] .platform-body .news-card,
[data-theme="dark"] .profile-block-card {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-left: 5px solid var(--apple-green-500);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .profile-block-card:hover {
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.18);
    border-color: var(--apple-green-500);
}

[data-theme="dark"] .block-icon-container {
    background: rgba(40, 167, 69, 0.12);
    color: var(--apple-green-400);
}

[data-theme="dark"] .block-index {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

[data-theme="dark"] .block-status {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

[data-theme="dark"] .profile-block-card.completed .block-status {
    background: rgba(40, 167, 69, 0.15);
    color: var(--apple-green-400);
    border-color: rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .profile-block-card.incomplete .block-status {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.25);
}

[data-theme="dark"] .profile-block-card .block-label {
    color: var(--text-primary);
}

[data-theme="dark"] .profile-block-card .block-summary {
    color: var(--text-secondary);
}

[data-theme="dark"] .dash-card h3,
[data-theme="dark"] .block-header h3,
[data-theme="dark"] .section-title {
    color: var(--text-primary);
}

[data-theme="dark"] .block-header {
    border-bottom: 2px solid var(--border-subtle);
}

[data-theme="dark"] .step-number {
    background: var(--apple-green-600);
    color: #fff;
}

[data-theme="dark"] .input-group label {
    color: var(--text-secondary);
}

[data-theme="dark"] .input-group input,
[data-theme="dark"] .input-group select,
[data-theme="dark"] .input-group textarea {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm, 8px);
}

[data-theme="dark"] .input-group input[type="date"],
[data-theme="dark"] input[type="date"] {
    color-scheme: dark;
    background: var(--bg-input);
    color: var(--text-primary);
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(72%) sepia(61%) saturate(512%) hue-rotate(84deg) brightness(98%) contrast(90%);
}

[data-theme="dark"] .input-group input:focus,
[data-theme="dark"] .input-group select:focus,
[data-theme="dark"] .input-group textarea:focus {
    border-color: var(--apple-green-500);
    box-shadow: 0 0 0 3px var(--apple-green-glow);
    outline: none;
}

[data-theme="dark"] .camera-area,
[data-theme="dark"] .video-verify-area {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

[data-theme="dark"] .profile-data-list li {
    border-bottom-color: var(--border-subtle);
    color: var(--text-secondary);
}

[data-theme="dark"] .profile-data-list li strong {
    color: var(--text-primary);
}

[data-theme="dark"] .highlight-ubicacion {
    background: rgba(132, 204, 22, 0.12);
    border-left: 3px solid var(--apple-green-500);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .face-toggle-btn {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

[data-theme="dark"] .face-toggle-btn.active {
    background: var(--apple-green-600);
    color: #ffffff;
    border-color: var(--apple-green-500);
}

[data-theme="dark"] .carnet-upload-label {
    background: var(--bg-surface);
    color: var(--apple-green-400);
    border-color: var(--apple-green-500);
}

[data-theme="dark"] .carnet-preview-wrapper {
    background: #090e0a;
}

[data-theme="dark"] .btn-action {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

[data-theme="dark"] .big-save {
    background: linear-gradient(135deg, var(--apple-green-600), var(--apple-green-500));
    color: #fff;
    box-shadow: var(--shadow-apple);
    border: none;
}

/* ==========================================================================
   TEMA OSCURO: VENTANAS MODALES DE PERFIL MODULAR (.modal-full y componentes)
   ========================================================================== */

[data-theme="dark"] .modal-full {
    background: var(--bg-body, #080b08);
    color: var(--text-primary, #f8faf8);
}

[data-theme="dark"] .modal-full-header {
    background: #0d140e;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-full-header h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .btn-back-minimal-modal {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

[data-theme="dark"] .btn-back-minimal-modal:hover {
    background: rgba(132, 204, 22, 0.12);
}

[data-theme="dark"] .modal-full-body {
    background: var(--bg-body, #080b08);
}

[data-theme="dark"] .modal-section-title {
    color: var(--apple-green-400);
    border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .modal-full-footer {
    background: #0d140e;
    border-top: 1px solid var(--border-subtle);
}

[data-theme="dark"] .modal-full-footer .btn-action.outline {
    background: var(--bg-surface-elevated, #151d17);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .modal-full-footer .btn-action.outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--apple-green-500);
}

/* Tarjetas de actividades dinámicas dentro de la modal */
[data-theme="dark"] .actividad-card {
    background-color: var(--bg-card, #121813) !important;
    border: 1.5px solid var(--apple-green-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .actividad-card h4 {
    color: var(--apple-green-400) !important;
    border-bottom-color: var(--border-subtle) !important;
}

[data-theme="dark"] .btn-remove-act {
    background: rgba(220, 53, 69, 0.15) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
    color: #ff6b6b !important;
}

[data-theme="dark"] .btn-remove-act:hover {
    background: rgba(220, 53, 69, 0.25) !important;
}

/* Chips de selección múltiple (Agua, Maquinaria, Herramientas) */
[data-theme="dark"] .selection-chip {
    background: var(--bg-card, #121813);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

[data-theme="dark"] .selection-chip:hover {
    background: rgba(132, 204, 22, 0.08);
    border-color: var(--apple-green-500);
}

[data-theme="dark"] .chip-content span {
    color: var(--text-secondary);
}

[data-theme="dark"] .selection-chip input:checked ~ .chip-content span {
    color: var(--apple-green-300, #bef264);
}

[data-theme="dark"] .selection-chip:has(input:checked) {
    background: rgba(132, 204, 22, 0.12);
    border-color: var(--apple-green-500);
    box-shadow: 0 4px 15px var(--apple-green-glow);
}

[data-theme="dark"] .custom-circle {
    border-color: var(--border-subtle);
}

[data-theme="dark"] .selection-chip input:checked ~ .chip-content .custom-circle {
    background: var(--apple-green-500);
    border-color: var(--apple-green-500);
}

[data-theme="dark"] .chip-sub-input input,
[data-theme="dark"] .chip-sub-input textarea,
[data-theme="dark"] .styled-textarea {
    background: var(--bg-input, #0d120e) !important;
    color: var(--text-primary, #f8faf8) !important;
    border: 1.5px solid var(--border-subtle) !important;
}

[data-theme="dark"] .chip-sub-input input:focus,
[data-theme="dark"] .chip-sub-input textarea:focus,
[data-theme="dark"] .styled-textarea:focus {
    border-color: var(--apple-green-500) !important;
    box-shadow: 0 0 0 3px var(--apple-green-glow) !important;
}

/* Tablas de desglose animal en modal */
[data-theme="dark"] .actividad-card table {
    background-color: var(--bg-card, #121813) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .actividad-card table thead tr {
    background-color: #0d140e !important;
    border-bottom: 2px solid var(--border-subtle) !important;
}

[data-theme="dark"] .actividad-card table th {
    color: var(--apple-green-400) !important;
}

[data-theme="dark"] .animal-detail-row {
    background-color: var(--bg-card, #121813) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

[data-theme="dark"] .animal-detail-row:hover {
    background-color: rgba(132, 204, 22, 0.08) !important;
}

[data-theme="dark"] .animal-detail-row td {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .detail-cant,
[data-theme="dark"] .detail-fecha {
    background: var(--bg-input, #0d120e) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .util-pill {
    background: var(--bg-surface, #101612) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .util-pill:has(input:checked) {
    background: var(--apple-green-600) !important;
    color: #ffffff !important;
    border-color: var(--apple-green-500) !important;
}

[data-theme="dark"] [id^="vaccine-form-"] {
    background: var(--bg-surface-elevated, #151d17) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] [id^="vaccine-form-"] input {
    background: var(--bg-input, #0d120e) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .btn-add-vaccine {
    background: var(--bg-surface, #101612) !important;
    color: var(--apple-green-400) !important;
    border-color: var(--apple-green-500) !important;
}

[data-theme="dark"] .btn-add-vaccine:hover {
    background: rgba(132, 204, 22, 0.15) !important;
}

/* Contenedor del mapa en la modal */
[data-theme="dark"] #modal-map-container {
    background: #111a13 !important;
    border-color: var(--border-subtle) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL DE CÓDIGO SECRETO DE SEGURIDAD (CVV CARNET) — Centeotl
   ═══════════════════════════════════════════════════════════════════ */
.token-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 11, 8, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.token-modal-card {
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0a0e0b);
    border: 1px solid var(--apple-green-border, rgba(132, 204, 22, 0.35));
    border-radius: var(--radius-lg, 20px);
    max-width: 480px;
    width: 100%;
    padding: 32px 28px 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 35px var(--apple-green-glow, rgba(132, 204, 22, 0.15));
    text-align: center;
    box-sizing: border-box;
    animation: scaleUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUpModal {
    from { transform: scale(0.92) translateY(15px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

[data-theme="dark"] .token-modal-card {
    background: #111712;
    border: 1px solid rgba(132, 204, 22, 0.4);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(132, 204, 22, 0.2);
}

.token-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(132, 204, 22, 0.15);
    border: 2px solid var(--apple-green-500, #84cc16);
    color: var(--apple-green-500, #84cc16);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    box-shadow: 0 0 20px rgba(132, 204, 22, 0.25);
}

.token-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: var(--text-primary, #0a0e0b);
}

.token-modal-subtitle {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--apple-green-600, #65a30d);
    margin: 0 0 16px 0;
}

[data-theme="dark"] .token-modal-subtitle {
    color: var(--apple-green-400, #a3e635);
}

.token-modal-alert {
    background: rgba(132, 204, 22, 0.08);
    border-left: 4px solid var(--apple-green-500, #84cc16);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary, #374151);
}

[data-theme="dark"] .token-modal-alert {
    background: rgba(132, 204, 22, 0.12);
    color: #d1d5db;
}

.token-modal-alert p {
    margin: 0 0 6px 0;
}
.token-modal-alert p:last-child {
    margin-bottom: 0;
}

.token-box-wrapper {
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed var(--apple-green-500, #84cc16);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: center;
}

[data-theme="dark"] .token-box-wrapper {
    background: rgba(0, 0, 0, 0.4);
}

.token-box-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6b7280);
    margin-bottom: 8px;
}

.token-box-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.token-code-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--apple-green-600, #65a30d);
    user-select: all;
}

[data-theme="dark"] .token-code-text {
    color: #bef264;
    text-shadow: 0 0 10px rgba(190, 242, 100, 0.3);
}

.btn-token-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--apple-green-500, #84cc16);
    color: #0c120e;
    font-weight: 700;
    font-size: 0.82rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-token-copy:hover {
    background: var(--apple-green-400, #a3e635);
    transform: translateY(-1px);
}

.token-modal-footer-hint {
    font-size: 0.76rem;
    color: var(--text-muted, #6b7280);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.btn-token-confirm {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--apple-green-500, #84cc16), var(--apple-green-600, #65a30d));
    color: #0c120e;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(132, 204, 22, 0.35);
    transition: all 0.25s ease;
}

.btn-token-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(132, 204, 22, 0.45);
}

/* Botón "Ver mi código secreto" en Perfil */
.perfil-token-action {
    display: flex;
    justify-content: center;
    margin: -8px 0 20px 0;
}

.btn-ver-codigo-secreto {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(132, 204, 22, 0.12);
    color: var(--apple-green-600, #65a30d);
    border: 1px solid var(--apple-green-500, #84cc16);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(132, 204, 22, 0.12);
}

.btn-ver-codigo-secreto svg {
    color: var(--apple-green-600, #65a30d);
}

.btn-ver-codigo-secreto:hover {
    background: var(--apple-green-500, #84cc16);
    color: #0c120e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(132, 204, 22, 0.35);
}

.btn-ver-codigo-secreto:hover svg {
    color: #0c120e;
}

[data-theme="dark"] .btn-ver-codigo-secreto {
    background: rgba(132, 204, 22, 0.15);
    color: var(--apple-green-400, #a3e635);
    border-color: rgba(132, 204, 22, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-ver-codigo-secreto svg {
    color: var(--apple-green-400, #a3e635);
}

[data-theme="dark"] .btn-ver-codigo-secreto:hover {
    background: var(--apple-green-500, #84cc16);
    color: #0c120e;
}

[data-theme="dark"] .btn-ver-codigo-secreto:hover svg {
    color: #0c120e;
}


/* ═══════════════════════════════════════════════════════════════════
   MÓDULO: PLAN SANITARIO Y CONTROL VETERINARIO DUAL
   ═══════════════════════════════════════════════════════════════════ */

/* Botonera de Modos de Carga (Perfil vs Manual) */
.sanitary-mode-switcher-container {
    margin: 20px 0;
}

.sanitary-mode-switcher-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sanitary-mode-btn {
    flex: 1;
    min-width: 220px;
    padding: 13px 20px;
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.sanitary-mode-btn:hover {
    border-color: #28a745;
    color: #28a745;
    transform: translateY(-1px);
}

.sanitary-mode-btn.active {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.16) 100%);
    border-color: #28a745;
    color: #1e7e34;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.18);
}

/* Alerta Caso 3: Sin actividades en perfil */
.sanitary-alert-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

.sanitary-alert-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.sanitary-alert-text strong {
    display: block;
    color: #92400e;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.sanitary-alert-text p {
    margin: 0;
    color: #b45309;
    font-size: 0.88rem;
}

/* Selector Múltiple Caso 2 */
.sanitary-multi-selector-box {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

.sanitary-multi-header h4 {
    margin: 0 0 14px 0;
    font-size: 1rem;
    color: var(--text-primary, #0f172a);
}

.sanitary-activities-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.sanitary-activity-select-card {
    background: var(--bg-surface, #f8fafc);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sanitary-activity-select-card:hover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.sanitary-activity-select-card.selected {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.sanitary-activity-select-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    display: flex;
    justify-content: space-between;
}

.sanitary-activity-select-card .card-meta {
    font-size: 0.84rem;
    color: var(--text-secondary, #64748b);
}

/* Banner de Actividad Activa */
.sanitary-active-info-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.08) 100%);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
}

.active-badge-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.active-badge-tag {
    background: #28a745;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.active-badge-desc {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.btn-sanitary-change-act {
    background: transparent;
    border: 1px solid #28a745;
    color: #1e7e34;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sanitary-change-act:hover {
    background: #28a745;
    color: #fff;
}

/* Wizard Carga Manual */
.sanitary-wizard-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.wizard-header h3 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    color: var(--text-primary, #0f172a);
}

.wizard-header p {
    margin: 0 0 18px 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.92rem;
}

.wizard-grid-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.wizard-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.wizard-category-item {
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.wizard-category-item label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 6px;
}

.wizard-category-item input {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #cbd5e1);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    box-sizing: border-box;
}

.badge-total-cabezas {
    background: rgba(40, 167, 69, 0.12);
    color: #1e7e34;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
}

.wizard-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary, #1e293b);
    cursor: pointer;
}

.sanitary-tabs-bar-container {
    margin: 15px 0 20px 0;
    display: flex;
    justify-content: center;
}

.sanitary-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-surface-secondary, #f1f5f9);
    padding: 4px;
    border-radius: 10px;
}

.sanitary-tab-btn {
    padding: 9px 18px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sanitary-tab-btn:hover {
    color: var(--text-primary, #0f172a);
}

.sanitary-tab-btn.active {
    background: var(--bg-card, #ffffff);
    color: #28a745;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Banner de Medidas Complementarias */
.sanitary-measures-card {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(32, 201, 151, 0.05) 100%);
    border: 1px solid rgba(40, 167, 69, 0.25);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.sanitary-measures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sanitary-measures-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #1e7e34;
    font-weight: 700;
}

.measures-badge {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sanitary-measures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.measure-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--bg-card, rgba(255,255,255,0.7));
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.measure-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.measure-item strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary, #0f172a);
    margin-bottom: 2px;
}

.measure-item p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
    line-height: 1.3;
}

/* Resumen Sanitario Colectivo */
.sanitary-summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sanitary-stat-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.sanitary-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.sanitary-stat-info h5 {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sanitary-stat-info .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.2;
}

/* Tablas Sanitarias */
.sanitary-table-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sanitary-table-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sanitary-table-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary, #0f172a);
    font-weight: 700;
}

.sanitary-table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sanitary-primary {
    background: #28a745;
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sanitary-primary:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-sanitary-outline {
    background: transparent;
    color: #28a745;
    border: 1px solid #28a745;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sanitary-outline:hover {
    background: rgba(40, 167, 69, 0.08);
}

.sanitary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.sanitary-table th {
    background: var(--bg-surface-secondary, #f8fafc);
    color: var(--text-secondary, #475569);
    padding: 12px 14px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    white-space: nowrap;
}

.sanitary-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #1e293b);
    vertical-align: middle;
}

.sanitary-table tbody tr:hover {
    background: rgba(40, 167, 69, 0.03);
}

/* Badges Sanitarios */
.badge-sanitary {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-aplicada {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.badge-pendiente {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.badge-vencida {
    background: rgba(220, 53, 69, 0.15);
    color: #721c24;
}

.badge-programada {
    background: rgba(13, 202, 240, 0.18);
    color: #055160;
}

.badge-obligatorio {
    background: #e02424;
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 700;
}

/* Barra de progreso de cobertura */
.sanitary-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.sanitary-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.sanitary-progress-fill {
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Expediente Individual (Carnet) */
.animal-search-bar-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.animal-search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.carnet-sanitario-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.carnet-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.carnet-arete-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carnet-arete-badge {
    background: #28a745;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.carnet-animal-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.92rem;
    color: var(--text-secondary, #475569);
    margin-top: 6px;
}

.carnet-progress-section {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--bg-surface-secondary, #f8fafc);
    border-radius: 10px;
}

.carnet-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary, #0f172a);
}

.carnet-alert-deworming {
    background: #fff8e1;
    border-left: 4px solid #ffb300;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: #6d4c41;
}

/* Modo Oscuro para Plan Sanitario */
[data-theme="dark"] .sanitary-header-bar,
[data-theme="dark"] .sanitary-table-card,
[data-theme="dark"] .sanitary-stat-card,
[data-theme="dark"] .animal-search-bar-card,
[data-theme="dark"] .carnet-sanitario-card,
[data-theme="dark"] .sanitary-multi-selector-box,
[data-theme="dark"] .sanitary-wizard-card {
    background: #18221c;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sanitary-mode-btn {
    background: #18221c;
    border-color: #2b3930;
    color: #cbd5e1;
}

[data-theme="dark"] .sanitary-mode-btn.active {
    background: rgba(40, 167, 69, 0.2);
    border-color: #4ade80;
    color: #4ade80;
}

[data-theme="dark"] .sanitary-alert-card {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    border-left-color: #f59e0b;
}

[data-theme="dark"] .sanitary-alert-text strong {
    color: #fde68a;
}

[data-theme="dark"] .sanitary-alert-text p {
    color: #fef3c7;
}

[data-theme="dark"] .sanitary-activity-select-card,
[data-theme="dark"] .wizard-category-item {
    background: #121915;
    border-color: #2b3930;
}

[data-theme="dark"] .sanitary-activity-select-card:hover {
    background: rgba(40, 167, 69, 0.15);
}

[data-theme="dark"] .wizard-category-item input {
    background: #18221c;
    border-color: #2b3930;
    color: #f1f5f9;
}

[data-theme="dark"] .wizard-header h3,
[data-theme="dark"] .sanitary-multi-header h4,
[data-theme="dark"] .sanitary-activity-select-card .card-title,
[data-theme="dark"] .active-badge-desc {
    color: #f1f5f9;
}

[data-theme="dark"] .wizard-header p,
[data-theme="dark"] .wizard-category-item label,
[data-theme="dark"] .wizard-checkbox-label {
    color: #94a3b8;
}

[data-theme="dark"] .sanitary-selector-wrapper label,
[data-theme="dark"] .sanitary-table-header h3,
[data-theme="dark"] .sanitary-stat-info .stat-value,
[data-theme="dark"] .carnet-progress-header {
    color: #e2e8f0;
}

[data-theme="dark"] .sanitary-selector-wrapper select {
    background: #121915;
    border-color: #2b3930;
    color: #e2e8f0;
}

[data-theme="dark"] .sanitary-tabs {
    background: #121915;
}

[data-theme="dark"] .sanitary-tab-btn.active {
    background: #1e2c24;
    color: #4ade80;
}

[data-theme="dark"] .measure-item {
    background: rgba(20, 30, 24, 0.6);
    border-color: rgba(40, 167, 69, 0.25);
}

[data-theme="dark"] .measure-item strong {
    color: #f1f5f9;
}

[data-theme="dark"] .measure-item p {
    color: #94a3b8;
}

[data-theme="dark"] .sanitary-table th {
    background: #131c17;
    color: #94a3b8;
    border-bottom-color: #2b3930;
}

[data-theme="dark"] .sanitary-table td {
    border-bottom-color: #2b3930;
    color: #cbd5e1;
}

[data-theme="dark"] .carnet-progress-section {
    background: #121915;
}

[data-theme="dark"] .carnet-alert-deworming {
    background: rgba(255, 179, 0, 0.12);
    border-left-color: #ffb300;
    color: #fef08a;
}

[data-theme="dark"] .sanitary-progress-bar {
    background: #2b3930;
}

@media (max-width: 768px) {
    .sanitary-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .sanitary-tabs {
        width: 100%;
    }
    .sanitary-tab-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.82rem;
    }
    .animal-search-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════════════════
 * MODAL FULLSCREEN: PLAN SANITARIO (#sanitary-fullscreen-modal)
 * ═══════════════════════════════════════════════════════════════════ */
.sanitary-modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow-y: auto;
    background: var(--bg-body, #f8fafc);
    color: var(--text-primary, #0f172a);
    box-sizing: border-box;
    font-family: inherit;
    -webkit-overflow-scrolling: touch;
}

.sanitary-modal-header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 16px 28px 0 28px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.sanitary-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sanitary-header-info {
    flex: 1;
    min-width: 280px;
}

.sanitary-header-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.sanitary-last-update-tag {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    background: rgba(100, 116, 139, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.sanitary-fullscreen-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sanitary-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-sanitary-close-modal {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-sanitary-close-modal:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-sanitary-close-modal:active {
    transform: translateY(0);
}

/* Tabs en Header Sticky */
.sanitary-fullscreen-tabs-bar {
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 4px;
}

.sanitary-modal-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sanitary-modal-tab-btn:hover {
    color: #28a745;
    background: rgba(40, 167, 69, 0.04);
}

.sanitary-modal-tab-btn.active {
    color: #28a745;
    border-bottom-color: #28a745;
    background: rgba(40, 167, 69, 0.08);
}

/* Modal Body */
.sanitary-modal-body-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 28px 80px 28px;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════
 * LISTA PERSISTENTE: MIS PLANES SANITARIOS (#sanitary-saved-plans-section)
 * ═══════════════════════════════════════════════════════════════════ */
.sanitary-saved-plans-section {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

.sanitary-section-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.sanitary-saved-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Tarjeta individual de Plan Guardado */
.sanitary-plan-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.sanitary-plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #28a745;
}

.plan-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.plan-card-species-badge {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.plan-card-origin-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.plan-card-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0 0 8px 0;
}

.plan-card-census {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.plan-card-stages-breakdown {
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 16px;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-card-progress-box {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.plan-card-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.plan-progress-bar-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.plan-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #34d399);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.plan-card-date {
    font-size: 0.76rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
}

.btn-plan-action-primary {
    flex: 1;
    background: #28a745;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-plan-action-primary:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-plan-action-delete {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-plan-action-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Empty State de Planes Guardados */
.sanitary-empty-plans-card {
    grid-column: 1 / -1;
    background: var(--bg-surface, #ffffff);
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, #64748b);
}

.sanitary-empty-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

/* DARK MODE */
[data-theme="dark"] .sanitary-modal-fullscreen {
    background: #090d0b;
    color: #f1f5f9;
}

[data-theme="dark"] .sanitary-modal-header-sticky {
    background: rgba(18, 25, 21, 0.95);
    border-bottom-color: #2b3930;
}

[data-theme="dark"] .sanitary-fullscreen-title {
    color: #f1f5f9;
}

[data-theme="dark"] .sanitary-modal-tab-btn {
    color: #94a3b8;
}

[data-theme="dark"] .sanitary-modal-tab-btn.active {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border-bottom-color: #4ade80;
}

[data-theme="dark"] .sanitary-plan-card {
    background: #121915;
    border-color: #2b3930;
}

[data-theme="dark"] .sanitary-plan-card:hover {
    border-color: #4ade80;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .plan-card-title,
[data-theme="dark"] .plan-card-census {
    color: #f1f5f9;
}

[data-theme="dark"] .plan-card-origin-tag {
    background: #1e2c24;
    color: #cbd5e1;
}

[data-theme="dark"] .plan-card-progress-box {
    background: #18221c;
    border-color: #2b3930;
}

[data-theme="dark"] .plan-progress-bar-track {
    background: #2b3930;
}

[data-theme="dark"] .sanitary-empty-plans-card {
    background: #121915;
    border-color: #2b3930;
}

/* RESPONSIVE & PRINT */
@media (max-width: 768px) {
    .sanitary-modal-header-sticky {
        padding: 12px 16px 0 16px;
    }
    .sanitary-header-top-row {
        gap: 12px;
    }
    .sanitary-fullscreen-title {
        font-size: 1.15rem;
    }
    .sanitary-modal-body-container {
        padding: 16px 16px 60px 16px;
    }
    .sanitary-fullscreen-tabs-bar {
        overflow-x: auto;
    }
    .sanitary-modal-tab-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }
    #sanitary-fullscreen-modal,
    #sanitary-fullscreen-modal * {
        visibility: visible !important;
    }
    #sanitary-fullscreen-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    .sanitary-modal-header-sticky {
        position: static !important;
        box-shadow: none !important;
        border-bottom: 2px solid #000000 !important;
    }
    .sanitary-header-actions,
    .sanitary-fullscreen-tabs-bar,
    .btn-sanitary-outline,
    .btn-sanitary-primary {
        display: none !important;
    }
}

/* ===================================================================
 * NAVEGACIÓN: GESTIONADA CENTRALMENTE POR css/toast-nav.css
 * =================================================================== */

/* Spinner animado para acciones del módulo sanitario */
@keyframes sanitarySpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sanitary-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: sanitarySpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
