/* ===== ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    background: linear-gradient(
        180deg,        
        rgba(40,80,170,1) 0%,
        rgba(0,43,127,1) 50%,
        rgba(40,80,170,1) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* ===== ESTILOS DEL MENÚ PRINCIPAL ===== */
.menu-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    background: linear-gradient(
        180deg,
        rgba(0,43,127,1) 0%,
        rgba(222,230,246,1) 50%,
        rgba(0,43,127,1) 100%
    );
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(33, 33, 33, 0.2);
    text-align: center;
}

.menu-header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #00143C;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.menu-header p {
    font-size: 16px;
    font-weight: bold;
    color: #00143C;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.menu-options {
    margin: 40px 0;
}

.menu-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(
        180deg,
        rgba(205, 218, 240, 1) 0%,
        rgba(228, 236, 250, 1) 50%,
        rgba(205, 218, 240, 1) 100%
    );
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    text-decoration: none;
    color: #00143C;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.menu-icon {
    font-size: 24px;
    margin-right: 20px;
    color: #002B7F;
}

.menu-text {
    flex: 1;
    text-align: left;
}

.menu-text h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.menu-text p {
    font-size: 14px;
    color: #002B7F;
    text-transform: none;
}

.menu-arrow {
    font-size: 18px;
    color: #002B7F;
}

.menu-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #002B7F;
}

.menu-footer a {
    color: #002B7F;
    font-size: 12px;
    text-decoration: none;
}

/* ===== NAVEGACIÓN BREADCRUMB ===== */
.nav-breadcrumb {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb-link {
    color: #002B7F;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #002B7F;
}

.breadcrumb-current {
    color: #00143C;
    font-weight: bold;
}

/* ===== CONTENEDORES DE FORMULARIOS ===== */
.form-container {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.form-container h2 {
    font-size: 18px;
    font-weight: bold;
    color: #00143C;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.form-container p {
    font-size: 16px;
    font-weight: bold;
    color: #00143C;
    margin-bottom: 7px;
    text-transform: uppercase;
}

form {
    padding: 50px;
    background: linear-gradient(
        180deg,
        rgba(0,43,127,1) 0%,
        rgba(222,230,246,1) 50%,
        rgba(0,43,127,1) 100%
        );
    width: 100%;
    text-align: left;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(33, 33, 33, 0.2);
    display: flex;
    flex-direction: column;
}

.form-group {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    grid-gap: 30px;
    margin-bottom: 30px;
}

.form-content {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-content input,
.form-content select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-content small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85em;
}

label {
    color: #00143C;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

input, textarea, select {
    padding: 10px 10px;
    background-color: #F4F6FC;
    border: 0;
    border-radius: 10px;
    outline: none;
    color: #00143C;
    font-weight: bold;
    font-size: 16px; 
}

::placeholder {
    color: #DCE4F5;
    font-size: 16px;
}

textarea {
    margin-bottom: 40px;
}

form a {
    display: block;
    align-self: center;
    color: #002B7F;
    font-size: 11px;
    text-decoration: none;
    margin-bottom: 25px;
}

/* ===== BOTONES ===== */
.btn {
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 20, 70, 1) 50%,
        rgba(40, 90, 180, 1) 100%
        );
    padding: 15px 15px;
    width: 100px;
    align-self: center;
    text-transform: capitalize;
    border: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    color: #F4F6FC;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Botones específicos */
.btn-search {
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 45, 130, 1) 50%,
        rgba(40, 90, 180, 1) 100%
    ) !important;
}

.btn-clear {
   background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 20, 70, 1) 50%,
        rgba(40, 90, 180, 1) 100%
        );
    padding: 15px 15px;
    width: 100px;
    align-self: center;
    text-transform: capitalize;
    border: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    color: #F4F6FC;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 20, 70, 1) 50%,
        rgba(40, 90, 180, 1) 100%
        );
    padding: 15px 15px;
    width: 100px;
    align-self: center;
    text-transform: capitalize;
    border: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    color: #F4F6FC;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success {
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 20, 70, 1) 50%,
        rgba(40, 90, 180, 1) 100%
    );
}

.btn-success:hover {
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 20, 70, 1) 50%,
        rgba(40, 90, 180, 1) 100%
    );
}

.btn-cancel {
    background: linear-gradient(
        180deg,
        rgba(150, 150, 150, 1) 0%,
        rgba(100, 100, 100, 1) 50%,
        rgba(150, 150, 150, 1) 100%
    );
}

.btn-cancel:hover {
    background: linear-gradient(
        180deg,
        rgba(170, 170, 170, 1) 0%,
        rgba(120, 120, 120, 1) 50%,
        rgba(170, 170, 170, 1) 100%
    );
}

/* ===== BOTONES DE ACCIÓN ===== */
.btn-action {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(
        180deg,
        rgba(40, 90, 180, 1) 0%,
        rgba(0, 40, 110, 1) 50%,
        rgba(40, 90, 180, 1) 100%
    );
    color: #F4F6FC;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.btn-action:hover {
    background: linear-gradient(
        180deg,
        rgba(70, 110, 200, 1) 0%,
        rgba(0, 40, 110, 1) 50%,
        rgba(70, 110, 200, 1) 100%
    );
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: linear-gradient(
        180deg,
        rgba(220, 120, 120, 1) 0%,
        rgba(170, 70, 70, 1) 50%,
        rgba(220, 120, 120, 1) 100%
    );
}

/* Botones de acción en tabla */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.action-buttons .btn-action {
    padding: 4px 8px;
    font-size: 11px;
    text-decoration: none;
    display: inline-block;
}

/* Mensajes de éxito */
.mensaje.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.mensaje.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}


.btn-danger:hover {
    background: linear-gradient(
        180deg,
        rgba(240, 140, 140, 1) 0%,
        rgba(190, 90, 90, 1) 50%,
        rgba(240, 140, 140, 1) 100%
    );
}

/* ===== ACCIONES DEL FORMULARIO ===== */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ===== FORMULARIO DE BÚSQUEDA ===== */
.search-form {
    margin-bottom: 20px;
}

.search-group {
    display: grid;
    grid-template-columns: 2fr minmax(190px, 1fr) auto auto;
    gap: 15px;
    align-items: end;
}

/* ===== INFORMACIÓN DE BÚSQUEDA ===== */
.search-info {
    background: linear-gradient(
        180deg,
        rgba(205, 218, 240, 1) 0%,
        rgba(190, 205, 235, 1) 50%,
        rgba(205, 218, 240, 1) 100%
    );
    border-left: 4px solid #002B7F;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-info p {
    margin: 5px 0;
    color: #00143C;
    font-size: 14px;
    text-transform: none;
}

/* ===== TABLA DE RESULTADOS ===== */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(
        180deg,
        rgba(205, 218, 240, 1) 0%,
        rgba(228, 236, 250, 1) 50%,
        rgba(205, 218, 240, 1) 100%
    );
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: linear-gradient(
        180deg,
        rgba(0,43,127,1) 0%,
        rgba(0,40,110,1) 50%,
        rgba(0,43,127,1) 100%
    );
    color: #F4F6FC;
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

.results-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #DCE4F5;
    color: #00143C;
    font-size: 14px;
    text-align: left;
}

.results-table tr:hover {
    background: rgba(222, 230, 246, 0.5);
}

.center {
    text-align: center;
}

/* ===== MENSAJES DE ÉXITO Y ERROR ===== */
.mensaje {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.mensaje.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

/* ===== SIN RESULTADOS ===== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #002B7F;
    background: linear-gradient(
        180deg,
        rgba(205, 218, 240, 1) 0%,
        rgba(228, 236, 250, 1) 50%,
        rgba(205, 218, 240, 1) 100%
    );
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-results p {
    font-size: 16px;
    text-transform: none;
}

/* ===== RESPONSIVE ===== */
@media(max-width:800px){
    body {
        padding: 30px;
    }

    .menu-container {
        margin: 20px;
        padding: 20px;
    }
    
    .menu-btn {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .menu-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .menu-text {
        text-align: center;
    }

    form {
        width: 100%;
        padding: 30px;
    }

    .form-group {
        grid-template-columns: repeat(1,1fr);
        grid-gap: 20px;
        margin-bottom: 20px;
    }

    .search-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    textarea {
        margin-bottom: 30px;
    }

    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 10px;
    }

    .btn-action {
        padding: 6px 12px;
        font-size: 11px;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-breadcrumb {
        padding: 0 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media(max-width:480px){
    form {
        padding: 20px;
    }
    
    .form-container h2 {
        font-size: 16px;
    }
    
    .form-container p {
        font-size: 14px;
    }
    
    label, input, select {
        font-size: 14px;
    }

    .menu-container {
        margin: 10px;
        padding: 15px;
    }

    .menu-header h1 {
        font-size: 20px;
    }

    .menu-header p {
        font-size: 14px;
    }
    
    .btn-action {
        display: block;
        margin: 2px 0;
    }
}

/* ===== AÑADIDOS: sesión, cambio de nivel, bitácora ===== */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 10px 0 15px;
    padding: 8px 14px;
    background: rgba(244, 246, 252, 0.85);
    border-radius: 10px;
    font-size: 14px;
    color: #00143C;
}

.user-bar a {
    color: #002B7F;
    font-weight: bold;
    text-decoration: none;
}

.user-bar a:hover {
    text-decoration: underline;
}

.menu-container .user-bar {
    margin: 0 0 20px;
}

.btn-wide {
    width: auto;
    min-width: 140px;
    padding: 15px 25px;
}

.btn-danger-solid {
    background: linear-gradient(180deg, rgba(220, 120, 120, 1) 0%, rgba(150, 50, 50, 1) 50%, rgba(220, 120, 120, 1) 100%);
}

/* Formulario dentro de una página ya enmarcada: sin el fondo/relleno del form principal */
form.inline-form {
    padding: 0;
    background: none;
    box-shadow: none;
}

.ficha th {
    text-align: left;
    width: 35%;
}

.ficha td.nuevo {
    font-weight: bold;
    color: #155724;
    background: #d4edda;
}

.pregunta {
    margin-top: 15px;
    text-align: center;
}

label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: normal;
}

label.check input {
    width: auto;
}

.enlace-inline {
    display: inline;
    font-size: inherit;
    margin: 0;
    text-decoration: underline;
}

.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    color: #00143C;
    font-weight: bold;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.badge-exito { background: #d4edda; color: #155724; }
.badge-rechazado { background: #fff3cd; color: #856404; }
.badge-error { background: #f8d7da; color: #721c24; }

@media (max-width: 800px) {
    .user-bar { font-size: 13px; }
    .action-buttons { flex-wrap: wrap; }
}

/* ===== AÑADIDOS: reportes ===== */
.resumen-reporte {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.resumen-reporte div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(244, 246, 252, 0.9);
    border-radius: 10px;
    text-align: center;
    color: #00143C;
}

.resumen-reporte span {
    font-size: 12px;
}

.resumen-reporte strong {
    font-size: 18px;
}

.resumen-reporte .total-pagar {
    background: #d4edda;
    border: 2px solid #155724;
}

.descargas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 18px;
    font-weight: bold;
    color: #00143C;
}

.reporte-filtro {
    grid-template-columns: 1fr 1fr auto;
}

.atajos {
    display: block;
    margin-top: 10px;
    color: #00143C;
}

@media (max-width: 800px) {
    .resumen-reporte { grid-template-columns: 1fr 1fr; }
    .reporte-filtro { grid-template-columns: 1fr; }
}

.tabla-reporte th,
.tabla-reporte td {
    padding: 8px 6px;
    font-size: 13px;
}

.tabla-reporte td:nth-child(2),
.tabla-reporte td:nth-child(3),
.tabla-reporte td:nth-child(6),
.tabla-reporte td:nth-child(8) {
    white-space: nowrap;
}

/* ===== MENÚ LATERAL (secciones a la izquierda, funciones a la derecha) ===== */
body.con-menu {
    display: block;
    padding: 0;
    min-height: 100vh;
}

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-areas: "menu main";
    min-height: 100vh;
}

.topbar {
    display: none;
}

.sidebar {
    grid-area: menu;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    background: linear-gradient(180deg, rgba(0, 30, 100, 1) 0%, rgba(0, 15, 60, 1) 100%);
    color: #F4F6FC;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}

.sidebar-marca {
    padding: 4px 8px 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(244, 246, 252, 0.25);
    text-align: left;
}

.sidebar-marca strong {
    display: block;
    font-size: 17px;
    letter-spacing: 0.5px;
}

.sidebar-marca span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #F4F6FC;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    transition: background 0.2s;
}

.side-item > i:first-child {
    width: 20px;
    text-align: center;
}

.side-item span {
    flex: 1;
}

.side-flecha {
    font-size: 11px;
    opacity: 0.6;
}

.side-item:hover {
    background: rgba(244, 246, 252, 0.14);
}

.side-item.activo {
    background: #F4F6FC;
    color: #00143C;
}

.side-item.activo .side-flecha {
    opacity: 1;
}

.sidebar-pie {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(244, 246, 252, 0.25);
}

.sidebar-usuario {
    padding: 6px 12px 10px;
    font-size: 13px;
    opacity: 0.9;
    text-align: left;
}

.app-main {
    grid-area: main;
    padding: 24px 20px;
    min-width: 0;
}

.app-main .form-container {
    max-width: 960px;
    margin: 0 auto;
}

.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 14px;
}

.subnav a {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(244, 246, 252, 0.55);
    color: #00143C;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
}

.subnav a:hover {
    background: rgba(244, 246, 252, 0.85);
}

.subnav a.activo {
    background: #00143C;
    color: #F4F6FC;
}

.seccion-titulo {
    text-align: left;
    margin: 22px 0 -6px;
    font-size: 16px;
    text-transform: uppercase;
}

.seccion-titulo a {
    color: #00143C;
    text-decoration: none;
}

.bienvenida {
    text-transform: none !important;
    font-weight: normal !important;
    margin-top: 10px;
}

.app-main .menu-options {
    margin: 22px 0;
}

@media (max-width: 800px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "top" "menu" "main";
        grid-template-rows: auto auto 1fr;
    }

    .topbar {
        grid-area: top;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 10px 14px;
        background: rgba(0, 15, 60, 1);
        color: #F4F6FC;
        font-weight: bold;
    }

    .menu-toggle {
        padding: 8px 14px;
        border: 0;
        border-radius: 10px;
        background: rgba(244, 246, 252, 0.15);
        color: #F4F6FC;
        font-size: 15px;
        font-weight: bold;
        cursor: pointer;
    }

    .sidebar {
        position: static;
        height: auto;
        box-shadow: none;
    }

    /* Con JavaScript el menú se pliega y se abre con el botón ☰; sin JavaScript queda visible. */
    html.js .sidebar {
        display: none;
    }

    html.js .sidebar.abierto {
        display: flex;
    }

    .app-main {
        padding: 14px 10px;
    }
}

.app-main .menu-text p {
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
    margin: 0;
}

/* ===== TABLERO DE INICIO ===== */
.kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 14px 0;
}

.kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: rgba(244, 246, 252, 0.92);
    border-radius: 12px;
    color: #00143C;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kpi i { font-size: 20px; color: #002B7F; }
.kpi strong { font-size: 26px; }
.kpi span { font-size: 12px; text-align: center; }
.kpi.total { background: #d4edda; border: 2px solid #155724; }

.panel {
    margin: 16px 0;
    padding: 16px 18px;
    background: rgba(244, 246, 252, 0.88);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-align: left;
    color: #00143C;
}

.panel h3 {
    margin-bottom: 12px;
    font-size: 16px;
    text-transform: uppercase;
    color: #00143C;
}

.panel h3 i { margin-right: 6px; color: #002B7F; }

.barras { display: flex; flex-direction: column; gap: 8px; }

.barra-fila {
    display: grid;
    grid-template-columns: 120px 1fr 110px;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.barra-etq { font-weight: bold; }
.barra-pista { background: rgba(0, 30, 100, 0.15); border-radius: 8px; height: 18px; overflow: hidden; }
.barra { height: 100%; background: linear-gradient(90deg, rgba(0, 50, 140, 1), rgba(40, 90, 180, 1)); border-radius: 8px; }
.barra-val { text-align: right; font-weight: bold; }
.barra-val small { font-weight: normal; color: #002B7F; }

.movimiento { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.mov {
    padding: 12px 14px;
    border: 1px solid rgba(0, 30, 100, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.mov h4 { margin-bottom: 8px; font-size: 14px; }
.mov ul { list-style: none; margin: 0 0 10px; padding: 0; }
.mov li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed rgba(0, 30, 100, 0.25); }
.mov li.pagar { border-bottom: 0; margin-top: 4px; font-size: 16px; color: #155724; }

.vacio { padding: 14px 0; color: #002B7F; }

.atajos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }

.atajo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0, 50, 140, 1) 0%, rgba(0, 30, 100, 1) 100%);
    color: #F4F6FC;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
}

.atajo:hover { filter: brightness(1.25); }

@media (max-width: 800px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .kpi.total { grid-column: 1 / -1; }
    .barra-fila { grid-template-columns: 95px 1fr 80px; font-size: 12px; }
    .barra-val small { display: none; }
    .movimiento { grid-template-columns: 1fr; }
}

.tabla-movs th,
.tabla-movs td {
    padding: 8px 8px;
    font-size: 13px;
    vertical-align: top;
}

.tabla-movs td:nth-child(1),
.tabla-movs td:nth-child(2),
.tabla-movs td:nth-child(5) {
    white-space: nowrap;
}

.tabla-movs td:nth-child(3) {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabla-movs td:nth-child(4) {
    min-width: 200px;
}

/* ===== Colores de la bandera de Costa Rica: azul #002B7F, rojo #CE1126, blanco ===== */
:root { --cr-azul: #002B7F; --cr-rojo: #CE1126; }
.form-container { border-top: 8px solid var(--cr-rojo); border-bottom: 8px solid var(--cr-azul); }
.form-container h2 { border-bottom: 3px solid var(--cr-rojo); padding-bottom: 6px; }
.sidebar { border-right: 4px solid var(--cr-rojo); }
.side-item.activo { box-shadow: inset 4px 0 0 var(--cr-rojo); }
.sidebar-marca { border-bottom: 3px solid var(--cr-rojo); }
.results-table th { border-bottom: 3px solid var(--cr-rojo); }
.seccion-form { color: var(--cr-azul); border-bottom: 2px solid var(--cr-rojo); padding-bottom: 4px; margin: 22px 0 10px; }
fieldset.estudiante { border: 1px solid #9fb1d9; border-radius: 8px; margin: 10px 0; padding: 6px 12px 12px; background: #fff; }
fieldset.estudiante legend { color: var(--cr-azul); font-weight: 700; padding: 0 6px; }
.total-recibo input { font-weight: 700; font-size: 1.2em; color: var(--cr-rojo); }
.conceptos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.recibo-papel { background: #fff; border: 2px solid var(--cr-azul); border-radius: 8px; padding: 18px 22px; max-width: 760px; margin: 0 auto; }
.recibo-papel h4 { margin: 0; text-align: center; color: var(--cr-azul); }
.recibo-papel .rp-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--cr-rojo); padding-bottom: 8px; margin-bottom: 10px; }
.recibo-papel table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.recibo-papel td, .recibo-papel th { padding: 4px 6px; border-bottom: 1px dotted #9fb1d9; text-align: left; }
.recibo-papel td.num { text-align: right; white-space: nowrap; }
.recibo-papel .rp-total td { font-weight: 700; border-top: 2px solid var(--cr-azul); font-size: 1.1em; }
@media print {
  body * { visibility: hidden; }
  .recibo-papel, .recibo-papel * { visibility: visible; }
  .recibo-papel { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border-color: #000; }
}
.edad-vista { display: block; padding: 10px 0; color: var(--cr-azul); font-size: 1.05em; }
.quitar-est { margin-left: 10px; font-size: .8em; }

/* ===== Logos de la escuela y MEDUCA ===== */
.cabecera-logos { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; background: rgba(255,255,255,.94); border-radius: 10px; padding: 10px 16px; box-shadow: 0 2px 8px rgba(0,20,60,.25); }
.cabecera-logos .cabecera-texto h2, .cabecera-logos .cabecera-texto p { color: #00143C; }
.cabecera-logos .cabecera-texto { flex: 1; text-align: center; }
.cabecera-logos .cabecera-texto h2 { margin-top: 0; }
.cabecera-logos .logo-meduca { height: 72px; width: auto; max-width: 28%; object-fit: contain; }
.cabecera-logos .logo-escuela { height: 88px; width: auto; max-width: 20%; object-fit: contain; }
.sidebar-marca { text-align: center; }
.sidebar-marca .marca-logo { display: block; margin: 0 auto 8px; height: 70px; width: auto; }
@media (max-width: 700px) {
  .cabecera-logos { flex-wrap: wrap; justify-content: center; }
  .cabecera-logos .cabecera-texto { order: 3; flex-basis: 100%; }
  .cabecera-logos .logo-meduca { height: 52px; }
  .cabecera-logos .logo-escuela { height: 64px; }
}
label.chk { display: flex; align-items: center; gap: 8px; font-weight: normal; }
label.chk input { width: auto; }

/* Legibilidad sobre el fondo azul y avisos */
.mensaje.warning { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; border-radius: 6px; padding: 10px 14px; margin: 8px 0; font-weight: bold; }
.seccion-form { background: rgba(255,255,255,.94); padding: 8px 14px; border-radius: 6px 6px 0 0; border-bottom: 3px solid var(--cr-rojo); }
p.vacio { background: rgba(255,255,255,.92); color: #00143C; padding: 8px 14px; border-radius: 6px; margin: 8px 0; }

/* ===== Botones de descarga ===== */
.descargas-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: rgba(255,255,255,.96); border-radius: 12px; border-left: 6px solid var(--cr-rojo); padding: 14px 18px; margin: 14px 0; box-shadow: 0 2px 10px rgba(0,20,60,.25); }
.descargas-panel h4 { margin: 0; flex: 1 0 100%; color: #00143C; font-size: 1.05rem; }
.btn-desc { display: inline-flex; align-items: center; gap: 12px; padding: 11px 20px; border-radius: 10px; color: #fff !important; text-decoration: none !important; font-weight: 700; line-height: 1.15; box-shadow: 0 3px 8px rgba(0,0,0,.28); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; border: 0; cursor: pointer; }
.btn-desc i { font-size: 1.9em; }
.btn-desc small { display: block; font-weight: 400; opacity: .92; font-size: .72em; margin-top: 2px; }
.btn-desc:hover, .btn-desc:focus { transform: translateY(-2px); box-shadow: 0 7px 16px rgba(0,0,0,.34); filter: brightness(1.07); outline: none; }
.btn-desc:active { transform: translateY(0); }
.btn-excel { background: linear-gradient(#32a860, #1c6e41); }
.btn-pdf { background: linear-gradient(#e63b4f, #b00e21); }
.btn-csv { background: linear-gradient(#3a78dd, #0a3d91); }
.btn-md { background: linear-gradient(#737b8e, #434a5c); }
.btn-desc.sm { padding: 6px 13px; gap: 7px; font-size: .88em; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.btn-desc.sm i { font-size: 1.15em; }
.descarga-grupo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: 10px; vertical-align: middle; }
.descarga-grupo b { color: #00143C; }
@media (max-width: 600px) { .btn-desc { flex: 1 1 100%; justify-content: center; } }

/* ===== Botones: el texto nunca debe salirse del botón ===== */
.btn, .btn-search, .btn-clear, .btn-secondary, .btn-success, .btn-cancel, .btn-danger-solid {
    width: auto;
    min-width: 110px;
    padding: 13px 22px;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}
.btn-wide { min-width: 140px; }
.btn-action { white-space: nowrap; }
.form-actions { flex-wrap: wrap; }
/* Formularios de búsqueda: los campos y botones pasan a la línea siguiente en vez de apretarse */
.search-group { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
.search-group > .form-content { flex: 1 1 190px; min-width: 150px; }
.search-group > .form-content:first-child { flex: 2 1 280px; }
.search-group > .btn, .search-group > a.btn { flex: 0 0 auto; margin-bottom: 0; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.menu-btn h3, .menu-btn p { overflow-wrap: anywhere; }
.action-buttons > form, .action-buttons > form.inline-form { display: inline-flex; margin: 0; padding: 0; }
.action-buttons .btn-action { width: auto; }
