/* --- CONFIGURACIÓN GLOBAL --- */
:root {
    --glow-rgb-base: 135, 235, 52;
    --glow-rgb-alt: 57, 169, 0;
    --glow-intensity-factor: 1;
}

body {
    margin: 0;
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7f6;
    /* Un gris muy clarito para que resalte el blanco */
}

/* --- BARRA SUPERIOR (HEADER) --- */
.header {
    width: 100%;
    height: 60px;
    /* Gradiente base + imagen de textura superpuesta */
    background:
        url('../assets/fonfodelapagina.jpg') center/cover no-repeat,
        linear-gradient(135deg, #002100 0%, #003D1A 30%, #1E5D2A 55%, #39A900 80%, #A5D610 100%);
    background-blend-mode: overlay;
    background-size: cover, 200% 200%;
    animation: headerGrad 10s ease-in-out infinite alternate;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    box-sizing: border-box;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(165, 214, 16, 0.3);
}

/* Brillo interno para volumen */
.header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* El contenido del header debe ir sobre el ::after */
.header>* {
    position: relative;
    z-index: 1;
}

@keyframes headerGrad {
    0% {
        background-position: center, 0% 50%;
    }

    100% {
        background-position: center, 100% 50%;
    }
}

#menu-btn {
    font-size: 22px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

#menu-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.header-center-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.logo-top {
    height: 38px;
    width: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    background: white;
    /* Sin filter: el logo se muestra a color sobre el gradiente verde */
}

.noti-container {
    width: 50px;
    display: flex;
    justify-content: flex-end;
}

/* --- MENÚ LATERAL (Blindado para no perder estilo) --- */
#menu {
    position: fixed;
    top: 0;
    left: -330px;
    /* Un poco más ancho */
    width: 330px;
    height: 100%;
    background: #f4f7f6;
    /* Fondo un poco gris para que las tarjetas blancas destaquen */
    z-index: 9999;
    transition: left 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

#menu.active {
    left: 0;
}

.menu-header {
    background: linear-gradient(135deg, #005000 0%, #39A900 50%, #64dd17 100%);
    padding: 70px 20px 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    box-shadow: 0 15px 35px rgba(57, 169, 0, 0.4), inset 0 -5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.menu-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
    opacity: 0.15;
    mix-blend-mode: overlay;
    z-index: 1;
}

.menu-header::after {
    content: '';
    position: absolute;
    width: 250px; height: 250px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px; right: -50px;
    z-index: 1;
    filter: blur(20px);
}

.menu-foto-wrapper {
    position: relative;
    margin-bottom: 25px;
}

.menu-foto-container {
    width: 120px;
    /* Foto más grande */
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #ffffff;
    background: white;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
    /* Sombra fuerte abajo */
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    animation: float 3s ease-in-out infinite;
    /* Efecto flotante constante */
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

.menu-foto-container:hover {
    animation-play-state: paused;
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
}

.menu-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Estado en línea */
.status-online {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background-color: #00e676;
    /* Verde neón */
    border: 3px solid #ffffff;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
    /* Brillo verde */
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 230, 118, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

.menu-info {
    text-align: center;
    position: relative;
    z-index: 2;
}

.menu-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.menu-info .correo {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.menu-rol-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
}

#menu-opciones {
    padding: 35px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Más espacio entre tarjetas flotantes */
}

/* Tarjetas del menú */
#menu a {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    text-decoration: none;
    color: #1a3a00;
    font-weight: 600;
    border-radius: 16px;
    background: transparent;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    border: 1px solid transparent;
}

.menu-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(57, 169, 0, 0.1);
    border-radius: 12px;
    margin-right: 16px;
    transition: all 0.3s ease;
    color: #39A900;
}

.menu-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}

.menu-text {
    flex-grow: 1;
}

#menu a:hover {
    background: #f8fff4;
    transform: translateX(5px);
    border: 1px solid #d0e8c0;
    box-shadow: 0 4px 12px rgba(57, 169, 0, 0.08);
}

#menu a:hover .menu-icon {
    background: linear-gradient(135deg, #39A900 0%, #64dd17 100%);
    color: white;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 5px 15px rgba(57, 169, 0, 0.3);
}

/* Estilo específico para Cerrar Sesión */
#menu a.logout {
    margin-top: 20px;
    color: #e53e3e;
    background: transparent;
    border: 1px solid transparent;
}

#menu a.logout .menu-icon {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
}

#menu a.logout:hover {
    background: #fff5f5;
    transform: translateX(5px);
    border: 1px solid #fecaca;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.08);
}

#menu a.logout:hover .menu-icon {
    background: linear-gradient(135deg, #e53e3e 0%, #ff6b6b 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.3);
    transform: scale(1.05) translateY(-2px);
}

/* --- TARJETA DEL CARNET (Único lugar con líneas verdes) --- */
.app-carnet {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 50px;
    padding-bottom: 50px;
    position: relative;
    /* Clave para el centrado */
    perspective: 1000px;
}

.carnet-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 90%;
    max-width: 380px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 10px 40px rgba(var(--glow-rgb-base), calc(0.6 * var(--glow-intensity-factor))), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    padding-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    animation: glow-carnet 3s infinite alternate;
    will-change: transform, box-shadow;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes glow-carnet {
    0% {
        box-shadow: 0 10px 30px rgba(var(--glow-rgb-base), calc(0.4 * var(--glow-intensity-factor))), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    }

    100% {
        box-shadow: 0 15px 50px rgba(var(--glow-rgb-alt), calc(0.8 * var(--glow-intensity-factor))), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
    }
}

.carnet-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(var(--glow-rgb-base), calc(1 * var(--glow-intensity-factor))), inset 0 0 0 1px rgba(255, 255, 255, 1);
    animation-play-state: paused;
}

/* Línea RECTA solo arriba del carnet */
.card-green-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
    background-color: #39A900;
    background-image: radial-gradient(circle at top left, rgba(255, 255, 255, 0.5) 0%, transparent 60%),
        linear-gradient(135deg, rgba(135, 235, 52, 0.85) 0%, rgba(46, 138, 0, 0.9) 100%),
        url('../assets/fondocarnet.jpg');
    background-blend-mode: overlay, normal, normal;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 75%);
}

/* Línea CURVA solo abajo del carnet */
.card-green-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #39A900;
    background-image: radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.4) 0%, transparent 60%),
        linear-gradient(135deg, rgba(135, 235, 52, 0.85) 0%, rgba(46, 138, 0, 0.9) 100%),
        url('../assets/fondocarnet.jpg');
    background-blend-mode: overlay, normal, normal;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

/* ── NUEVO CARNET DIGITAL (Premium Glassmorphism) ─────────────────────────────────────────────── */
.carnet-wrapper {
    width: 100%;
    max-width: 380px;
    perspective: 1000px;
    margin: 40px auto;
}

.carnet {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    animation: slideUp 0.5s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes slideUp {
    from { opacity:0; transform:translateY(30px) scale(0.96); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

.carnet-header {
    background: linear-gradient(135deg, #005000 0%, #39A900 50%, #64dd17 100%);
    position: relative;
    overflow: hidden;
}

.carnet-header.funcionario { background: linear-gradient(135deg, #a30000 0%, #ff3d00 50%, #ff9100 100%); }
.carnet-header.instructor { background: linear-gradient(135deg, #003366 0%, #0091ea 50%, #00e5ff 100%); }

.carnet-bottom-curve {
    height: 85px;
    background: linear-gradient(135deg, #005000 0%, #39A900 50%, #64dd17 100%);
    position: relative;
    overflow: hidden;
    margin-top: -15px;
    z-index: 1;
    border-radius: 0;
}
.carnet-bottom-curve::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15%;
    width: 140%;
    height: 105px;
    background: #ffffff;
    border-bottom-right-radius: 100% 100%;
    z-index: 2;
}
.carnet-bottom-curve.funcionario { background: linear-gradient(135deg, #a30000 0%, #ff3d00 50%, #ff9100 100%); }
.carnet-bottom-curve.instructor { background: linear-gradient(135deg, #003366 0%, #0091ea 50%, #00e5ff 100%); }

.carnet-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.15;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

.carnet-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 180px;
    height: 180px;
    background: none;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.carnet-header {
    padding: 30px 20px 25px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.sena-logo-wrap {
    width: 65px; height: 65px;
    background: #ffffff;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    flex-shrink: 0;
    position: relative;
    border: none;
}

.sena-logo-wrap img {
    width: 45px; height: 45px;
    object-fit: contain;
}

.carnet-header-text { color: white; position: relative; text-align: left; }
.carnet-header-text h1 {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    text-align: left;
    color: white;
    text-transform: uppercase;
}

.carnet-header-text p {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 4px;
    margin-bottom: 0;
}

.rol-stripe {
    background: #39A900;
    color: white;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 0;
}

.rol-stripe.funcionario { background: #FF671F; }
.rol-stripe.instructor { background: #003366; }

.carnet-body {
    padding: 24px 22px 20px;
}

.foto-section {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.foto-frame {
    width: 110px; height: 140px;
    border-radius: 6px;
    padding: 4px; /* Gradient border thickness */
    background: linear-gradient(135deg, #64dd17 0%, #39A900 50%, #005000 100%);
    overflow: hidden;
    border: none;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 25px rgba(57, 169, 0, 0.4);
}
.foto-frame.funcionario { background: linear-gradient(135deg, #ff9100 0%, #ff3d00 50%, #a30000 100%); box-shadow: 0 10px 25px rgba(216, 67, 21, 0.4); }
.foto-frame.instructor { background: linear-gradient(135deg, #00e5ff 0%, #0091ea 50%, #003366 100%); box-shadow: 0 10px 25px rgba(1, 87, 155, 0.4); }

.foto-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
}

.info-principal { flex: 1; min-width: 0; text-align: left; }
.info-nombre {
    font-size: 1.15rem;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.3;
    word-break: break-word;
}
.info-doc {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
.info-item.full-width { grid-column: span 2; }

.info-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-label svg {
    margin-right: 2px;
}

.info-value {
    font-size: 0.95rem;
    color: #1a1a1a;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #39A900;
    margin-top: 8px;
    letter-spacing: 1px;
    background: rgba(57, 169, 0, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(57, 169, 0, 0.2);
}

.status-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #39A900;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(57, 169, 0, 0.6);
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% { box-shadow: 0 0 0 0 rgba(57, 169, 0, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(57, 169, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 169, 0, 0); }
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 4px 0 16px;
}

.carnet-bottom-faceted {
    background-color: #2e7d32;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%232e7d32'/%3E%3Cstop offset='100%25' stop-color='%231b5e20'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23bg)'/%3E%3Cpolygon points='0,0 200,100 0,200' fill='%234caf50' opacity='0.4'/%3E%3Cpolygon points='400,0 200,100 400,200' fill='%2381c784' opacity='0.3'/%3E%3Cpolygon points='0,0 400,0 200,100' fill='%23388e3c' opacity='0.5'/%3E%3Cpolygon points='0,200 400,200 200,100' fill='%231b5e20' opacity='0.5'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    padding: 35px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-top: 2px solid rgba(255,255,255,0.1);
}

.qr-container-floating {
    background: #ffffff;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    position: relative;
    z-index: 2;
}

.qr-container-floating img {
    width: 140px;
    height: 140px;
    display: block;
    border-radius: 8px;
}

.carnet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 18px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.readonly-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 600;
}
.readonly-badge .readonly-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
    0%,100% { opacity:1; }
    50%      { opacity:0.3; }
}

.sena-watermark {
    font-size: 0.65rem;
    color: #d1d5db;
    font-weight: 700;
    letter-spacing: 1px;
}

.readonly-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 600;
}

.readonly-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%,100% { opacity:1; }
    50%      { opacity:0.3; }
}

.sena-watermark {
    font-size: 0.65rem;
    color: #d1d5db;
    font-weight: 700;
    letter-spacing: 1px;
}

.qr-container-premium {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: inline-block;
}

.qr-img-premium {
    width: 130px;
    height: 130px;
    border-radius: 8px;
}

/* --- CONTENIDO DEL CARNET --- */
.foto-container {
    margin-top: 50px;
    position: relative;
    z-index: 2;
    padding: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.foto {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
}

.foto:hover {
    transform: scale(1.08) rotate(3deg);
}

.carnet-card h2 {
    margin: 25px 0 8px 0;
    /* Más espacio superior */
    font-size: 1.9rem;
    /* Ligeramente más grande */
    color: #1a3a00;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
    padding: 0 15px;
    /* Evitar que toque bordes */
}

.programa-text {
    margin: 0 0 15px 0;
    font-size: 1.0rem;
    color: #39A900;
    /* Color sólido para mejor lectura en pantalla */
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0 20px;
}

.area-text {
    margin: -8px 0 12px 0;
    font-size: 0.95rem;
    color: #555;
    font-weight: 600;
}

.ficha-text {
    margin: 0 0 25px 0;
    /* Más espacio inferior */
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 700;
    background: #39A900;
    /* Fondo sólido */
    padding: 7px 20px;
    border-radius: 25px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(57, 169, 0, 0.2);
    letter-spacing: 1px;
}

.carnet-datos {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Espaciado generoso entre líneas */
    width: 85%;
    margin: 10px auto 30px auto;
    /* Márgenes ajustados */
    text-align: left;
    /* Alineación a la izquierda para datos */
}

.dato-item {
    background: #f8fff4;
    border: 1px solid #d0e8c0;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.dato-label {
    font-size: 0.75rem;
    color: #777;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.dato-valor {
    font-size: 0.95rem;
    color: #222;
    font-weight: 800;
}

.qr-container {
    margin-top: 25px;
    z-index: 2;
    position: relative;
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

/* --- ESTILO PARA MÓDULOS (Eventos, Apoyos, Convocatorias) --- */

/* Contenedor que centra la tarjeta en la pantalla */
.modulo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

/* La tarjeta blanca basada en el diseño del carnet */
.modulo-card {
    background: white;
    width: 90%;
    max-width: 500px;
    /* Un poco más ancha que el carnet para ver mejor las listas */
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    box-sizing: border-box;
    min-height: 400px;
}

/* Estilo para los títulos dentro de los módulos */
.modulo-card h1 {
    color: #39A900;
    font-size: 24px;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    text-align: center;
}


/* --- ESTILO DE TARJETAS DINÁMICAS (FINAL) --- */
.lista-item {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 8px solid #39A900;
    /* Línea verde más gruesa para que la veas */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

/* El efecto de salto y agrandado */
.lista-item:hover {
    transform: translateY(-12px) scale(1.05);
    /* Salto muy notorio */
    box-shadow: 0 15px 30px rgba(57, 169, 0, 0.2);
    /* Sombra verde */
    border-top: 8px solid #2e7d32;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.item-titulo {
    color: #222;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
}

.item-badge {
    background: #e8f5e9;
    color: #39A900;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.item-footer {
    display: flex;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
    gap: 15px;
}

/* El círculo rojo con el número */
/* --- BADGE NOTIFICACIONES --- */
.badge-noti {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #A5D610, #39A900);
    color: #002100;
    font-size: 9px;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(165, 214, 16, 0.6);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* --- PANEL DE NOTIFICACIONES --- */
.noti-container {
    position: relative;
}

.noti-btn-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.noti-btn-wrap:active {
    background: rgba(255, 255, 255, 0.25);
}

/* --- CAMPANA MINIMALISTA --- */
.noti-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    /* Ocultar cualquier texto/emoji residual */
}

/* SVG inline generado por CSS con clip-path */
.noti-icon::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background: white;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.noti-btn-wrap:active .noti-icon::before {
    opacity: 1;
}

/* Balanceo cuando hay notificaciones nuevas */
.noti-icon.has-notis::before {
    animation: bellSwing 0.6s ease-in-out 2;
}

@keyframes bellSwing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-15deg);
    }

    60% {
        transform: rotate(12deg);
    }

    80% {
        transform: rotate(-8deg);
    }
}

.noti-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 330px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.12), 
        0 0 0 1px rgba(0, 0, 0, 0.04);
    display: none;
    z-index: 2000;
    overflow: hidden;
    transform-origin: top right;
    animation: notiIn 0.4s cubic-bezier(.22, .68, 0, 1.2) both;
}

@keyframes notiIn {
    from { opacity: 0; transform: scale(0.9) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.noti-panel.active { display: block; }

.noti-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #004d00 0%, #39A900 100%);
    color: white;
}

.noti-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.noti-panel-header .noti-count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

#noti-lista-content {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 0;
}

.noti-item {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    background: transparent;
}

.noti-item-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    width: 100%;
    transition: transform 0.2s ease, background 0.2s;
    background: white;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.noti-item:last-child .noti-item-inner { border-bottom: none; }

.noti-item:hover .noti-item-inner {
    background: #f9fbf9;
}

.noti-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
}
.noti-dot.red { background: #ff3b30; box-shadow: 0 0 10px rgba(255,59,48,0.4); }
.noti-dot.orange { background: #ff9500; }

.noti-item-body { flex: 1; min-width: 0; }

.noti-text {
    font-size: 0.92rem;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

.noti-text strong { font-weight: 800; color: #39A900; }

.noti-time {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

.noti-item-bg {
    position: absolute;
    inset: 0;
    background: #ff3b30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    color: white;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.noti-item.swiping .noti-item-bg { opacity: 1; }

.noti-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-weight: 600;
}
.noti-empty span { display: block; font-size: 2rem; margin-bottom: 10px; }

@keyframes notiDismiss {
    to { transform: translateX(var(--swipe-end, 100%)); max-height: 0; opacity: 0; padding: 0; }
}

.dismissed { animation: notiDismiss 0.3s forwards; }


/* --- ESTILOS PARA EL LOGIN --- */

.login-page {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #39A900 0%, #004b23 100%);
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-card img {
    width: 80px;
    margin-bottom: 15px;
}

.login-card h2 {
    color: #333;
    margin: 0 0 5px 0;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: #39A900;
    font-weight: bold;
    margin: 0 0 5px 5px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    box-sizing: border-box;
    transition: 0.3s;
    font-family: inherit;
    font-size: 16px;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #39A900;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #39A900;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn-login:hover {
    background: #2d8500;
}

/* Clases para los mensajes de JS */
#mensaje {
    margin-top: 15px;
    font-size: 13px;
    height: 20px;
}

#mensaje.error {
    color: #e74c3c;
}

#mensaje.success {
    color: #39A900;
}

.footer-link {
    margin-top: 20px;
    font-size: 13px;
    color: #888;
}

.footer-link a {
    color: #39A900;
    text-decoration: none;
    font-weight: bold;
}

/* --- NUEVOS ESTILOS PARA PARTÍCULAS DEL FONDO --- */
#floating-elements-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* No interfiere con los clics */
    z-index: -1;
    /* Detrás de todo el contenido */
    overflow: hidden;
    background: transparent;
}

/* Estilo para cada partícula */
.particle {
    position: absolute;
    background-color: rgba(57, 169, 0, 0.5);
    /* Verde SENA semitransparente */
    border-radius: 50%;
    /* Las hace redondas */
    opacity: 0;
    /* Empiezan invisibles */
    animation: particle-animation linear infinite;
    will-change: transform, opacity;
    /* Optimización de animación GPU */
}

/* Animación de movimiento */
@keyframes particle-animation {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
        /* Aparecen suavemente */
    }

    90% {
        opacity: 1;
        /* Se mantienen visibles */
    }

    100% {
        /* Se mueven hacia arriba y un poco a un lado */
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
        /* Desaparecen suavemente */
    }
}

.login-card {
    width: 90%;
    /* En móviles ocupa casi todo el ancho */
    max-width: 400px;
    /* En PC no se estira demasiado */
    border-radius: 15px;
    /* Bordes redondeados tipo iOS/Android */
    padding: 20px;
}

/* Evitar que el zoom automático de iPhone rompa el diseño */
input {
    font-size: 16px !important;
}

/* --- MODO OSCURO --- */
body.dark-mode {
    background: #121212 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a2e1a 50%, #1e3d0a 100%) !important;
    border-bottom: 1px solid rgba(57, 169, 0, 0.25);
}

body.dark-mode #menu {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6);
    border-right: 1px solid #2d2d2d;
}

body.dark-mode #menu a {
    color: #ccc;
    border-left: 4px solid transparent;
}

body.dark-mode #menu a:hover {
    background: #2a2a2a !important;
    color: #4caf50 !important;
    border-left: 4px solid #4caf50;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .carnet-card,
body.dark-mode .modulo-card,
body.dark-mode .lista-item,
body.dark-mode .conf-card,
body.dark-mode .info-card,
body.dark-mode .login-card,
body.dark-mode .role-card,
body.dark-mode .noti-panel {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .lista-item {
    border-top: 8px solid #2e7d32;
}

body.dark-mode .lista-item:hover,
body.dark-mode .role-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7) !important;
    background: #222 !important;
}

body.dark-mode .item-titulo,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #fff !important;
}

body.dark-mode .item-footer,
body.dark-mode p.correo,
body.dark-mode .doc-text,
body.dark-mode .ficha-text,
body.dark-mode p {
    color: #aaa;
    border-top-color: #333 !important;
}

body.dark-mode .conf-item {
    border-bottom: 1px solid #333;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #2a2a2a !important;
    color: #fff !important;
    border: 1px solid #444 !important;
}

body.dark-mode .tab {
    background: #333;
    color: #bbb;
}

body.dark-mode .form-info,
body.dark-mode .form-curso,
body.dark-mode .material-item {
    background: #2a2a2a !important;
}

body.dark-mode .curso-header {
    border-bottom-color: #444 !important;
}

body.dark-mode .qr-container {
    background: #fff;
    /* Que el QR siga viéndose bien */
}

body.dark-mode .card-green-top,
body.dark-mode .card-green-bottom {
    opacity: 0.8;
}

/* --- MODALES Y FORMULARIOS FLOTANTES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    /* Reemplaza blur por un fondo más oscuro para mejor FPS */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    border-top: 6px solid #39A900;
}

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

.modal-content h2 {
    margin-top: 0;
    color: #39A900;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
}

/* Inputs de estilo moderno */
.input-sena {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-sena:focus {
    outline: none;
    border-color: #39A900;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(57, 169, 0, 0.15);
}

textarea.input-sena {
    resize: vertical;
    min-height: 100px;
}

/* --- BOTONES MODERNOS --- */
.btn-sena {
    background: linear-gradient(135deg, #39A900 0%, #2A7C00 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 10px rgba(57, 169, 0, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
}

.btn-sena:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(57, 169, 0, 0.3);
    background: linear-gradient(135deg, #3fb800 0%, #2e8c00 100%);
}

.btn-sena:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 1px 6px rgba(57, 169, 0, 0.2);
}

/* Botón peligro / cancelar */
.btn-cancel {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.2) !important;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #ec5f50 0%, #cc4030 100%) !important;
    box-shadow: 0 5px 18px rgba(231, 76, 60, 0.35) !important;
    transform: translateY(-2px);
}

/* Modo oscuro para modales */
body.dark-mode .modal-content {
    background: #1e1e1e;
    border-top: 6px solid #4caf50;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

body.dark-mode .modal-content h2 {
    color: #4caf50;
}

body.dark-mode .input-sena {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .input-sena:focus {
    border-color: #4caf50;
    background: #333;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 380px;
}

.toast {
    background: #1e1e1e;
    color: #fff;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    pointer-events: all;
    animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
    border-left: 4px solid #39A900;
    letter-spacing: 0.2px;
}

.toast.toast-error   { border-left-color: #e74c3c; }
.toast.toast-warning { border-left-color: #f39c12; }
.toast.toast-info    { border-left-color: #0288d1; }
.toast.toast-success { border-left-color: #39A900; }

.toast-icon { font-size: 1.15rem; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }

.toast.hiding {
    animation: toastOut 0.28s ease forwards;
}

@keyframes toastIn {
    from { opacity:0; transform: translateY(24px) scale(0.94); }
    to   { opacity:1; transform: translateY(0)   scale(1);    }
}
@keyframes toastOut {
    to { opacity:0; transform: translateY(16px) scale(0.93); }
}

/* --- CUSTOM CONFIRM MODAL --- */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.confirm-box {
    background: #fff;
    width: 85%;
    max-width: 320px;
    padding: 30px 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: 1px solid #f0f0f0;
}

.confirm-box h3 {
    margin-top: 0;
    color: #111;
    font-size: 1.4rem;
}

.confirm-box p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.btn-minimal-cancel {
    flex: 1;
    background: #f5f5f5;
    color: #555;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-minimal-cancel:hover {
    background: #e0e0e0;
}

.btn-minimal-ok {
    flex: 1;
    background: #111;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-minimal-ok:hover {
    background: #333;
    transform: translateY(-1px);
}

/* Botón Eliminar Full Width al final */
.btn-delete-full {
    background: rgba(231, 76, 60, 0.05);
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-delete-full:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-delete-full:active {
    transform: translateY(0);
}

.btn-eliminar-ico:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-eliminar-ico:active {
    transform: scale(0.9);
}

body.dark-mode .confirm-box {
    background: #1e1e1e;
}

body.dark-mode .confirm-box h3 {
    color: #fff;
}

body.dark-mode .confirm-box p {
    color: #ccc;
}

/* Preservar saltos de línea en descripciones */
.item-cuerpo p,
.info-card p,
.curso-card p {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ══════════════════════════════════════════════════════════
   📱 MOBILE-FIRST GLOBAL — Aplica a todas las páginas
   ══════════════════════════════════════════════════════════ */

/* ── Prevención de overflow horizontal global ── */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ── LOGIN PAGE ── */
@media (max-width: 480px) {
    .login-page {
        align-items: flex-start;
        padding-top: env(safe-area-inset-top, 0);
        height: 100dvh;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        border-radius: 0;
        padding: 40px 24px 32px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-shadow: none;
    }

    .login-card img {
        width: 70px;
        margin-bottom: 10px;
    }

    .login-card h2 {
        font-size: 1.4rem;
    }

    .input-group input,
    .input-group select {
        padding: 14px 12px;
        font-size: 16px;
        /* Evita zoom automático en iOS */
        border-radius: 12px;
    }

    .btn-login {
        padding: 16px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 52px;
    }

    .footer-link {
        font-size: 0.8rem;
        margin-top: 16px;
    }
}

/* ── PORTALES CARNET (index, instructor, funcionario) ── */
@media (max-width: 480px) {

    /* Carnet más compacto */
    .app-carnet {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .carnet-card {
        width: 92%;
        border-radius: 20px;
    }

    .card-green-top {
        height: 110px;
    }

    .foto-container {
        margin-top: 40px;
    }

    .foto {
        width: 95px;
        height: 95px;
    }

    .carnet-card h2 {
        font-size: 1.2rem;
        margin: 12px 0 4px;
    }

    .doc-text {
        font-size: 0.85rem;
    }

    .user-details {
        width: 88%;
        padding: 8px 12px;
    }

    .programa-text {
        font-size: 0.9rem;
    }

    .centro {
        font-size: 0.78rem;
        margin: 4px 15px;
    }

    .ficha-text {
        font-size: 0.9rem;
    }

    .qr-container {
        margin-top: 16px;
        padding: 10px;
    }

    .qr-img {
        width: 120px;
        height: 120px;
    }
}

/* ── MÓDULOS DE LISTA (eventos, apoyos, convocatorias) ── */
@media (max-width: 480px) {

    /* Contenedor ajustado al header sticky de 60px */
    .modulo-container {
        padding: 12px 0 24px;
        align-items: flex-start;
    }

    .modulo-card {
        width: 100%;
        border-radius: 0;
        padding: 16px 14px;
        min-height: unset;
        box-shadow: none;
        border-top: none;
    }

    .modulo-card h1 {
        font-size: 1.3rem;
        padding-bottom: 10px;
    }

    /* Botón de agregar: full width y táctil */
    .modulo-card .btn-sena {
        width: 100% !important;
        min-height: 48px;
        font-size: 1rem;
        border-radius: 14px;
        margin-bottom: 4px;
    }

    /* Tarjetas de lista */
    .lista-item {
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 14px;
        border-top: 6px solid #39A900;
    }

    .lista-item:hover {
        transform: none;
        /* Sin hover en móvil */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .item-titulo {
        font-size: 1.1rem;
    }

    .item-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        white-space: nowrap;
    }

    .item-footer {
        flex-direction: column;
        gap: 4px;
        font-size: 0.82rem;
    }

    /* Botón de eliminar en tarjetas */
    .btn-delete-full {
        min-height: 46px;
        font-size: 0.95rem;
        border-radius: 12px;
        margin-top: 12px;
    }
}

/* ── FORMULARIOS (preregistro, activación, registro) ── */
@media (max-width: 480px) {

    .main-content {
        padding: 10px 0 24px;
        align-items: flex-start;
    }

    .form-container {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        padding: 20px 16px !important;
        box-shadow: none !important;
        border: none !important;
    }

    .form-container::before {
        height: 5px;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .form-group.full-width {
        grid-column: 1 !important;
    }

    .form-header h2,
    h2 {
        font-size: 1.4rem !important;
    }

    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 20px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Evita zoom iOS */
        padding: 13px 14px !important;
        border-radius: 12px !important;
    }

    .btn-submit,
    .btn-login {
        min-height: 52px;
        font-size: 1rem;
        border-radius: 14px;
    }
}

/* ── MÓDULOS ESPECÍFICOS PEQUEÑOS (configuración, informativa, cursos) ── */
@media (max-width: 480px) {

    /* Configuración */
    .conf-card {
        border-radius: 16px !important;
        padding: 16px !important;
    }

    .conf-item {
        padding: 14px 0 !important;
        font-size: 0.95rem;
    }

    /* Info SENA */
    .info-card {
        border-radius: 0 !important;
        width: 100% !important;
        padding: 16px !important;
    }

    /* Cursos */
    .curso-card {
        border-radius: 16px !important;
        padding: 16px !important;
    }

    .material-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .material-item a.btn-sena {
        width: 100%;
        min-height: 44px;
        font-size: 0.9rem;
        justify-content: center;
    }

    /* Instructor course controls */
    .instructor-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

    .instructor-controls .btn-sena {
        width: 100% !important;
        min-height: 44px;
        font-size: 0.9rem;
        margin-left: 0 !important;
    }

    /* Tabs */
    .tab {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
    }
}

/* ── MODALES ── */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 22px 18px;
        border-radius: 18px;
    }

    .modal-content h2 {
        font-size: 1.3rem;
    }

    .input-sena {
        padding: 13px 14px;
        font-size: 16px !important;
        border-radius: 12px;
    }

    .confirm-box {
        width: 90%;
        padding: 20px;
    }

    .confirm-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .confirm-buttons button {
        min-height: 48px;
        font-size: 0.95rem;
    }
}

/* ── NOTIFICACIONES ── */
@media (max-width: 480px) {
    .noti-panel {
        width: 90vw;
        right: -15px;
        border-radius: 16px;
    }
}

/* ── MENÚ LATERAL — ajuste para pantallas muy pequeñas ── */
@media (max-width: 360px) {
    #menu {
        width: 100%;
        left: -100%;
    }
}

/* ── SAFE AREA (notch iPhone/Android) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .header {
        padding-top: env(safe-area-inset-top, 0);
    }

    .chat-input-wrapper,
    .modal-overlay,
    .btn-login {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

/* ── ACCESIBILIDAD TÁCTIL — áreas mínimas ── */
@media (max-width: 768px) {

    button,
    a,
    input[type="submit"],
    .btn-sena,
    .btn-action,
    .btn-delete-full,
    .menu-icon,
    #menu-btn,
    .noti-icon {
        min-height: 44px;
    }

    #menu-btn {
        width: 44px;
        min-width: 44px;
    }
}