* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f4f4;
    color: #000000;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.logo-contenedor {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 400px;
    max-width: 100%;
    height: auto;
}

.contenedor-login {
    width: 100%;
    max-width: 450px;
    margin: 80px auto 30px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(74, 138, 199, 0.2);
}

.contenedor-login h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #000000;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-login {
    text-align: center;
    margin: 20px auto;
    max-width: 450px;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.footer-login a {
    color: #4a8ac7;
    text-decoration: none;
    font-weight: 500;
}

.footer-login a:hover {
    text-decoration: underline;
}

.contenedor-principal {
    width: 95%;
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cabecera {
    background: #ffffff;
    color: #000000;
    padding: 0;
    margin: -25px -25px 25px -25px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #4a8ac7;
}

.cabecera-logo {
    width: 550px !important;
    min-width: 550px !important;
    max-width: 550px !important;
    height: auto !important;
    display: block;
}

.cabecera > div:first-child {
    background: #ffffff;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cabecera h2 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    text-shadow: none;
}

.cabecera-titulo {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 30px;
    gap: 20px;
}

.cabecera-titulo h2 {
    margin: 0;
    padding: 0;
}

.cabecera .boton {
    background: #4a8ac7;
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cabecera .boton:hover {
    background: #3a7ab7;
    transform: translateY(-2px);
}

.grupo-formulario {
    margin-bottom: 20px;
}

.grupo-formulario label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.grupo-formulario input[type="text"],
.grupo-formulario input[type="email"],
.grupo-formulario input[type="password"],
.grupo-formulario input[type="date"],
.grupo-formulario input[type="number"],
.grupo-formulario textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.grupo-formulario input:focus,
.grupo-formulario textarea:focus {
    outline: none;
    border-color: #4a8ac7;
}

.grupo-formulario textarea {
    min-height: 80px;
    resize: vertical;
}

.boton {
    background: #4a8ac7;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
    font-weight: 500;
}

.boton:hover {
    background: #3a7ab7;
}

.boton-verde {
    background: #27ae60;
}

.boton-verde:hover {
    background: #229954;
}

.boton-rojo {
    background: #e74c3c;
}

.boton-rojo:hover {
    background: #c0392b;
}

.boton-azul {
    background: #3498db;
}

.boton-azul:hover {
    background: #2980b9;
}

.boton-gris {
    background: #95a5a6;
}

.boton-gris:hover {
    background: #7f8c8d;
}

.botones-accion {
    margin: 25px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
}

.tabla th,
.tabla td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tabla th {
    background: #4a8ac7;
    font-weight: bold;
    color: white;
    font-size: 15px;
}

.tabla tr:hover {
    background: #f8f9fa;
}

.tabla-nopagados {
    background: #ffe6e6;
}

.tabla-nopagados th {
    background: #e74c3c;
}

.tabla-nopagados tr:hover {
    background: #ffcccc;
}

.alerta {
    padding: 18px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 16px;
}

.alerta-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alerta-exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alerta-info {
    background: #e7f3ff;
    color: #0c5460;
    border: 1px solid #4a8ac7;
}

.fila-dos-columnas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.seccion {
    margin-bottom: 30px;
}

.seccion h3 {
    color: #000000;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4a8ac7;
    font-size: 20px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
}

.badge-pagado {
    background: #d4edda;
    color: #155724;
}

.badge-nopagado {
    background: #f8d7da;
    color: #721c24;
}

.enlaces-rapidos {
    margin: 20px 0;
}

.enlaces-rapidos a {
    color: #4a8ac7;
    text-decoration: none;
    margin-right: 20px;
    font-weight: 500;
}

.enlaces-rapidos a:hover {
    text-decoration: underline;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #4a8ac7;
}

.grid-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tarjeta-panel {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.3s;
}

.tarjeta-panel:hover {
    box-shadow: 0 4px 12px rgba(74, 138, 199, 0.15);
}

.tarjeta-panel h3 {
    color: #000000;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #4a8ac7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.botones-tarjeta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.botones-tarjeta .boton {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.resumen-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #4a8ac7;
    text-align: center;
}

.stat-box.stat-exito {
    border-color: #27ae60;
}

.stat-box.stat-error {
    border-color: #e74c3c;
}

.stat-numero {
    font-size: 48px;
    font-weight: bold;
    color: #4a8ac7;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-box.stat-exito .stat-numero {
    color: #27ae60;
}

.stat-box.stat-error .stat-numero {
    color: #e74c3c;
}

.stat-label {
    font-size: 16px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-link {
    text-decoration: none;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.stat-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-link:active {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .contenedor-principal {
        width: 98%;
        padding: 15px;
    }

    .fila-dos-columnas {
        grid-template-columns: 1fr;
    }

    .botones-accion {
        flex-direction: column;
    }

    .tabla {
        font-size: 13px;
    }

    .tabla th,
    .tabla td {
        padding: 8px;
    }

    .cabecera {
        flex-direction: column;
        text-align: center;
    }

    .cabecera > div:first-child {
        justify-content: center;
        padding: 15px;
    }

    .cabecera h2 {
        flex-direction: column;
        margin-bottom: 0;
        font-size: 14px;
    }

    .cabecera-logo {
        width: 100%;
        min-width: auto;
        max-width: 350px;
        margin-right: 0;
    }

    .cabecera-titulo {
        justify-content: center;
        padding: 15px;
        flex-wrap: wrap;
    }

    .grid-panel {
        grid-template-columns: 1fr;
    }

    .resumen-panel {
        grid-template-columns: 1fr;
    }

    .stat-numero {
        font-size: 36px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

.modal-contenido {
    background: white;
    padding: 35px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

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

.modal-contenido h3 {
    color: #000000;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #4a8ac7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 18px;
}

.modal-contenido p {
    margin-bottom: 12px;
    color: #333;
    line-height: 1.6;
}

.modal-contenido button,
.modal-contenido .boton {
    margin-top: 10px;
}

/* =====================================================
   SELECTOR DE IDIOMA
   ===================================================== */
.selector-idioma {
    display: flex;
    gap: 5px;
    margin-left: 15px;
}

.selector-idioma a {
    display: inline-block;
    padding: 6px 10px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.selector-idioma a:hover {
    background: #e0e0e0;
    color: #333;
}

.selector-idioma a.idioma-activo {
    background: #4a8ac7;
    color: white;
    border-color: #3a7ab7;
}

/* Selector de idioma en login (sin sesión) */
.selector-idioma-login {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.selector-idioma-login a {
    display: inline-block;
    padding: 8px 12px;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selector-idioma-login a:hover {
    background: #f0f0f0;
    border-color: #4a8ac7;
}

.selector-idioma-login a.idioma-activo {
    background: #4a8ac7;
    color: white;
    border-color: #3a7ab7;
}

@media (max-width: 768px) {
    .selector-idioma {
        margin-left: 0;
        margin-top: 10px;
    }

    .selector-idioma-login {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
}
