body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2933;
}

.login-page {
    min-height: 100vh;
    background: #f4f6f8;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-card {
    width: min(440px, 100%);
    display: grid;
    gap: 22px;
    padding: 34px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
}

.login-logo {
    width: min(280px, 80%);
    height: auto;
    justify-self: center;
}

.login-heading {
    display: grid;
    gap: 6px;
    text-align: center;
}

.login-heading h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

.login-form {
    max-width: none;
}

.password-field {
    display: grid;
    grid-template-columns: 1fr 40px;
    align-items: stretch;
}

.password-field input {
    min-width: 0;
    border-right: 0;
}

.password-toggle {
    min-width: 40px;
    padding: 0;
    border: 1px solid #8c8c8c;
    background: #f7f7f7;
    color: #12305a;
    cursor: pointer;
    line-height: 1;
}

.password-toggle:hover {
    background: #e9edf3;
}

.preview-xml {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #d8dee6;
}

.preview-xml dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 14px;
    margin: 0;
}

.preview-xml dt {
    font-weight: 700;
}

.preview-xml dd {
    margin: 0;
}

.preview-xml pre {
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: #ffffff;
    border-right: 1px solid #d8dee6;
}

.sidebar h1 {
    margin: 0;
    font-size: 24px;
}

.contenido {
    position: relative;
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px;
    padding-top: 82px;
}

.barra-superior {
    position: absolute;
    top: 18px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.usuario-sesion {
    display: grid;
    gap: 2px;
    text-align: right;
    color: #52606d;
    font-size: 12px;
}

.usuario-sesion strong {
    color: #1f2933;
}

.usuario-etiqueta {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f5c8c;
}

.logo-barstow {
    width: 150px;
    height: auto;
    object-fit: contain;
}

.menu-principal {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #d8dee6;
}

form {
    display: grid;
    gap: 16px;
    max-width: 420px;
}

.form-amplio {
    grid-template-columns: 1fr;
    max-width: 980px;
}

.form-bloque {
    display: grid;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d8dee6;
}

.form-bloque h3 {
    margin: 0;
    font-size: 18px;
}

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

.form-acciones {
    display: flex;
    justify-content: flex-start;
}

.form-acciones button {
    width: auto;
    min-width: 260px;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: none;
}

.form-inline button {
    width: auto;
}

.form-tabla {
    max-width: none;
}

.form-tabla .acciones button {
    width: auto;
    min-width: 220px;
}

.firmantes-masivo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    max-width: 920px;
}

.texto-ayuda {
    margin: 0;
    color: #52606d;
}

.texto-error {
    color: #b42318;
    font-weight: 700;
}

.texto-exito {
    color: #1f7a4d;
    font-weight: 700;
}

.form-tabla input[type="checkbox"] {
    width: auto;
}

label {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 0;
}

input,
select,
button {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font: inherit;
}

button,
a {
    color: #0f5c8c;
}

button {
    cursor: pointer;
}

.campo-invalido {
    border-color: #b42318;
    outline: 2px solid rgba(180, 35, 24, 0.18);
}

.popup-error-campo {
    position: absolute;
    z-index: 20;
    left: 0;
    top: calc(100% + 4px);
    width: min(360px, 100%);
    padding: 9px 11px;
    border: 1px solid #b42318;
    border-radius: 6px;
    background: #b42318;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(31, 41, 51, 0.18);
    font-size: 13px;
    font-weight: 700;
}

table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #d8dee6;
    text-align: left;
}

.orden-tabla {
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.orden-tabla:hover,
.orden-tabla:focus {
    color: #005e8a;
    text-decoration: underline;
}

.historial-academico {
    max-width: 1180px;
}

.historial-hoja {
    padding: 30px;
    border: 1px solid var(--barstow-line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-small);
}

.historial-encabezado {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 28px;
    align-items: center;
}

.historial-encabezado img {
    width: 220px;
    max-width: 100%;
    height: auto;
}

.historial-encabezado h2 {
    margin: 4px 0;
    font-size: 34px;
}

.historial-etiqueta {
    margin: 0;
    color: #005e8a;
    font-weight: 800;
    text-transform: uppercase;
}

.historial-separador {
    height: 3px;
    margin: 22px 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #005e8a, #12b9c4);
}

.historial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.historial-grid > div {
    padding: 16px;
    border: 1px solid var(--barstow-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.historial-grid h3,
.historial-hoja > h3 {
    margin-top: 0;
}

.historial-grid dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 12px;
    margin: 0;
}

.historial-grid dt {
    font-weight: 800;
}

.historial-grid dd {
    margin: 0;
}

.tabla-historial-academico {
    font-size: 13px;
}

.tabla-historial-academico th,
.tabla-historial-academico td {
    padding: 9px;
    vertical-align: top;
}

.historial-totales {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--barstow-line);
    font-weight: 800;
}

.historial-totales span {
    padding: 8px 12px;
    border-radius: 999px;
    background: #e9f8fb;
    color: #0d526d;
}

.historial-paginas-impresion {
    display: none;
}

.historial-hoja-numero {
    align-self: start;
    justify-self: end;
    color: #005e8a;
    font-weight: 800;
}

.historial-firma-director {
    margin-top: 34px;
    text-align: center;
}

.historial-linea-firma {
    width: 280px;
    max-width: 70%;
    height: 1px;
    margin: 0 auto 8px;
    background: #1b2a3a;
}

.historial-firma-director p {
    margin: 0;
    font-weight: 800;
}

.historial-texto-certifica {
    margin: 0 0 14px;
    color: #1b2a3a;
    line-height: 1.45;
    text-align: justify;
}

.historial-meta-linea {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 12px;
    color: #0f5c8c;
    font-weight: 800;
}

@media print {
    @page {
        size: letter portrait;
        margin: 10mm;
    }

    body {
        background: #ffffff !important;
    }

    .sidebar,
    .usuario-box,
    .barra-superior,
    .usuario-topbar,
    .usuario-sesion,
    .boton-salir-top,
    .acciones-no-impresion,
    .site-header,
    .app-sidebar {
        display: none !important;
    }

    .layout,
    .contenido {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .historial-academico {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .historial-hoja {
        display: none !important;
    }

    .historial-paginas-impresion {
        display: block !important;
    }

    .historial-pagina {
        position: relative;
        min-height: 253mm;
        page-break-after: always;
        background: #ffffff;
        border: 1px solid #d8dee6;
        padding: 10mm;
    }

    .historial-pagina:last-child {
        page-break-after: auto;
    }

    .historial-hoja {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .historial-encabezado,
    .historial-encabezado-impresion {
        grid-template-columns: 105px 1fr 110px;
        gap: 14px;
        align-items: center;
    }

    .historial-encabezado img {
        width: 96px;
    }

    .historial-encabezado h2 {
        font-size: 24px;
        margin: 2px 0;
        text-transform: uppercase;
    }

    .historial-encabezado p {
        margin: 0;
    }

    .historial-grid,
    .historial-grid-impresion {
        grid-template-columns: 1fr 1.4fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .historial-resumen-impresion {
        display: none !important;
    }

    .historial-grid > div {
        background: #ffffff;
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .historial-grid h3 {
        margin-bottom: 6px;
        padding-bottom: 4px;
        border-bottom: 1px solid #0f5c8c;
        color: #0f5c8c;
        font-size: 12px;
        text-transform: uppercase;
    }

    .historial-grid dl {
        grid-template-columns: 90px 1fr;
        gap: 4px 9px;
        font-size: 10px;
    }

    .historial-texto-certifica {
        margin: 4px 0 10px;
        font-size: 11px;
    }

    .historial-meta-linea {
        margin-bottom: 10px;
        font-size: 10px;
    }

    .tabla-historial-academico {
        font-size: 9px;
        margin-top: 8px;
        border: 1px solid #d8dee6;
    }

    .tabla-historial-academico th,
    .tabla-historial-academico td {
        padding: 4px;
    }

    .tabla-historial-academico th {
        background: #edf6f8 !important;
        color: #0f5c8c;
        font-weight: 800;
    }

    .historial-totales {
        gap: 6px;
        margin-top: 10px;
        padding-top: 8px;
        font-size: 9px;
    }

    .historial-totales span {
        padding: 4px 7px;
    }

    .historial-firma-director {
        position: absolute;
        right: 0;
        bottom: 8mm;
        left: 0;
        margin-top: 0;
        font-size: 11px;
    }

    .historial-linea-firma {
        width: 260px;
    }
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.acciones-tabla {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acciones-tabla button {
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b42318;
    text-decoration: underline;
    font: inherit;
}

.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 18px;
}

.subnav a {
    padding: 8px 12px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.subnav a.menu-activo {
    color: #083f66;
    background: #e7f2fb;
    border-color: #b8d8ec;
}

.paginacion {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.paginacion a {
    padding: 8px 12px;
    border: 1px solid #d8dee6;
    background: #ffffff;
    text-decoration: none;
}

.paginacion-ir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.paginacion-ir label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #52606d;
    font-weight: 700;
}

.paginacion-ir input {
    width: 82px;
    min-height: 38px;
    padding: 6px 10px;
}

.paginacion-ir button {
    width: auto;
    min-width: 56px;
    min-height: 38px;
    padding: 8px 12px;
}

.detalle-resumen {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 14px;
    max-width: 920px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #d8dee6;
}

.detalle-resumen dt {
    font-weight: 700;
}

.detalle-resumen dd {
    margin: 0;
}

.cadena-previa {
    max-width: 920px;
    padding: 16px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #ffffff;
    border: 1px solid #d8dee6;
}

.bloque-previo-cadena {
    max-width: 940px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #d8dee6;
}

.bloque-previo-cadena h3 {
    margin: 0 0 10px;
}

.modal-confirmacion {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(31, 41, 51, 0.45);
}

.modal-contenido {
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 22px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(31, 41, 51, 0.28);
}

.modal-contenido h2 {
    margin-top: 0;
}

.form-confirmacion {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-width: none;
    margin-top: 18px;
}

.form-confirmacion button {
    width: auto;
}

.seleccion-firmantes {
    display: grid;
    gap: 10px;
}

.firmante-opcion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 6px;
}

.firmante-opcion input {
    flex: 0 0 auto;
    width: auto;
}

.firmante-opcion span {
    min-width: 0;
}

.firmante-opcion small {
    display: block;
    margin-top: 3px;
    color: #52606d;
}

.alerta {
    margin: 16px 0;
    padding: 12px;
    border-left: 4px solid #64748b;
    background: #fff;
}

.alerta-error {
    border-color: #b42318;
}

.alerta-exito {
    border-color: #1f7a4d;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-principal a,
.acciones-card a,
.boton-secundario {
    text-decoration: none;
}

.menu-principal a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    font-weight: 700;
}

.menu-principal a:hover,
.menu-principal summary:hover {
    background: #f4f6f8;
}

.menu-principal a.menu-activo,
.menu-principal a[aria-current="page"] {
    color: #083f66;
    background: #e7f2fb;
    border-left-color: #0f5c8c;
    box-shadow: inset 0 0 0 1px #b8d8ec;
}

.menu-principal details.grupo-activo > summary {
    color: #083f66;
    background: #f0f7fc;
}

.menu-principal details {
    display: grid;
    gap: 6px;
}

.menu-principal summary {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    color: #52606d;
    font-weight: 700;
    list-style-position: inside;
}

.menu-principal details a {
    margin-left: 12px;
    padding-left: 16px;
    border-left: 3px solid #d8dee6;
}

.menu-salir {
    margin-top: 12px;
    color: #b42318;
}

.dashboard-encabezado {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
}

.dashboard-encabezado h2 {
    margin: 4px 0 8px;
    font-size: 34px;
}

.dashboard-encabezado p {
    max-width: 680px;
    margin: 0;
    color: #52606d;
}

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #1f7a4d;
}

.boton-secundario {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 700;
}

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

.dashboard-operacion {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.panel-operativo {
    display: grid;
    gap: 12px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-top: 4px solid #0f5c8c;
    border-radius: 8px;
}

.panel-operativo h3 {
    margin: 0;
    font-size: 20px;
}

.panel-operativo p {
    margin: 0;
    color: #52606d;
}

.acciones-operativas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.acciones-operativas a {
    padding: 10px 12px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 700;
}

.modulo-card {
    display: grid;
    gap: 14px;
    min-height: 190px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
}

.modulo-principal {
    border-top: 4px solid #0f5c8c;
}

.modulo-card h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.modulo-card p {
    margin: 0;
    color: #52606d;
}

.modulo-icono {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e6f0f7;
    color: #0f5c8c;
    font-weight: 700;
}

.modulo-icono-verde {
    background: #e7f5ef;
    color: #1f7a4d;
}

.modulo-icono-ambar {
    background: #fff2d6;
    color: #8a5a00;
}

.modulo-icono-rojo {
    background: #fdeceb;
    color: #b42318;
}

.acciones-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-self: end;
}

.acciones-card a {
    padding: 9px 12px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 700;
}

.dashboard-panel {
    margin-top: 24px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
}

.dashboard-panel h3 {
    margin-top: 0;
}

.dashboard-bienvenida {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.05fr);
    align-items: center;
    justify-content: center;
    gap: clamp(30px, 4vw, 64px);
    min-height: clamp(500px, 68vh, 660px);
    margin: 24px auto 0;
    padding: clamp(34px, 5vw, 68px);
    border: 1px solid rgba(217, 228, 238, 0.95);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 252, 253, 0.94)),
        radial-gradient(circle at 28% 30%, rgba(14, 181, 190, 0.16), transparent 34%);
    box-shadow: var(--shadow-soft);
}

.dashboard-logo-central {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-height: 250px;
}

.dashboard-logo-central img {
    width: min(440px, 62%);
    max-height: 300px;
    object-fit: contain;
    clip-path: inset(0 0 13% 0);
    filter: drop-shadow(0 18px 28px rgba(15, 92, 140, 0.18));
}

.dashboard-bienvenida-texto {
    max-width: 860px;
    text-align: left;
}

.dashboard-bienvenida-texto .eyebrow {
    margin: 0 0 10px;
    color: var(--barstow-blue);
    font-size: 16px;
    letter-spacing: 0;
}

.dashboard-bienvenida-texto h2 {
    margin: 0;
    font-size: clamp(56px, 6.6vw, 92px);
    line-height: 1;
}

.dashboard-subtitulo {
    margin: 14px 0 0;
    color: var(--barstow-ink);
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 800;
    line-height: 1.14;
}

.dashboard-lema {
    grid-column: 1 / -1;
    justify-self: center;
    margin: -10px 0 0;
    color: var(--barstow-muted);
    font-size: clamp(22px, 2.1vw, 30px);
    font-weight: 700;
    font-style: italic;
    line-height: 1.35;
    text-align: center;
}

.dashboard-linea-azul {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(960px, 78%);
    height: 5px;
    margin-top: clamp(-8px, 0.2vw, 4px);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--barstow-blue), var(--barstow-teal));
}

.flujo-titulos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.flujo-titulos li {
    padding: 10px 12px;
    border-left: 4px solid #0f5c8c;
    background: #f8fafc;
    border-radius: 6px;
    font-weight: 700;
}

.captura-selector {
    max-width: 420px;
}

.captura-selector .form-grid {
    grid-template-columns: 1fr;
}

.captura-fecha-expedicion {
    max-width: 420px;
    margin-top: 14px;
}

.alumno-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.alumno-grid label:nth-child(1),
.alumno-grid label:nth-child(2) {
    grid-column: span 3;
}

.alumno-grid label:nth-child(3),
.alumno-grid label:nth-child(4),
.alumno-grid label:nth-child(5) {
    grid-column: span 2;
}

.alumno-grid label:nth-child(6),
.alumno-grid label:nth-child(7) {
    grid-column: span 3;
}

.captura-importar {
    align-items: center;
    margin-top: 0;
}

.captura-importar button,
.captura-importar input {
    width: auto;
}

.acciones-calculo-asignaturas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.acciones-calculo-asignaturas button {
    min-height: 38px;
}

.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
}

.tabla-scroll > table {
    min-width: 760px;
}

.tabla-captura-asignaturas {
    min-width: 980px;
}

.tabla-captura-asignaturas th,
.tabla-captura-asignaturas td {
    vertical-align: top;
}

.tabla-captura-asignaturas th:first-child,
.tabla-captura-asignaturas td:first-child {
    width: 48px;
    text-align: center;
}

.tabla-captura-asignaturas input[type="checkbox"] {
    width: auto;
}

.tabla-captura-asignaturas td:nth-child(2) {
    min-width: 260px;
}

.tabla-captura-asignaturas td:nth-child(2) strong,
.tabla-captura-asignaturas td:nth-child(2) span {
    display: block;
}

.tabla-captura-asignaturas td:nth-child(2) span {
    margin-top: 4px;
    color: #52606d;
    font-size: 12px;
}

.tabla-captura-asignaturas input,
.tabla-captura-asignaturas select {
    min-width: 82px;
    padding: 7px 8px;
}

.tabla-captura-asignaturas .campo-precargado {
    color: #777777;
}

.tabla-captura-asignaturas .campo-aplicado-csv {
    color: #0f5c8c;
    background: #eef8ff;
    border-color: #76b6d9;
    font-weight: 700;
}

.tabla-captura-asignaturas select {
    min-width: 190px;
}

@media (max-width: 720px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #d8dee6;
    }

    .contenido {
        width: auto;
        padding-top: 92px;
    }

    .barra-superior {
        top: 16px;
        right: 16px;
        left: 16px;
        justify-content: space-between;
        align-items: center;
    }

    .logo-barstow {
        width: min(150px, 42vw);
    }

    .dashboard-operacion {
        grid-template-columns: 1fr;
    }

    .dashboard-bienvenida {
        grid-template-columns: 1fr;
        gap: 22px;
        min-height: auto;
        padding: 28px 20px;
        text-align: center;
    }

    .dashboard-logo-central {
        min-height: 150px;
    }

    .dashboard-logo-central img {
        width: min(260px, 84%);
        max-height: 190px;
    }

    .dashboard-bienvenida-texto {
        margin: 0 auto;
        text-align: center;
    }

    .acciones-operativas {
        grid-template-columns: 1fr;
    }

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

    .alumno-grid label:nth-child(n) {
        grid-column: auto;
    }

    .dashboard-encabezado {
        display: grid;
    }

    .boton-secundario {
        justify-self: start;
    }
}
.contenido {
    position: relative !important;
}

.barra-superior {
    position: absolute !important;
    top: 16px !important;
    right: 24px !important;
    z-index: 5 !important;
    display: flex;
    align-items: center;
    justify-content: flex-end !important;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
}

.usuario-sesion {
    font-size: 12px;
    line-height: 1.2;
}

.logo-barstow {
    width: 150px !important;
    max-width: 20vw !important;
    height: auto;
    object-fit: contain;
}

@media (max-width: 720px) {
    .barra-superior {
        position: static !important;
        justify-content: space-between;
        margin-bottom: 18px;
    }

    .logo-barstow {
        width: min(150px, 42vw);
        max-width: none;
    }
}

.barra-superior {
    right: 24px !important;
    left: 24px;
    justify-content: flex-end !important;
}

.usuario-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    width: 100%;
}

.usuario-sesion {
    min-width: 190px;
    max-width: 260px;
    gap: 4px;
    line-height: 1.25;
}

.usuario-sesion strong {
    font-size: 13px;
}

.usuario-sesion span {
    overflow-wrap: anywhere;
}

.usuario-sesion a {
    font-size: 12px;
}

.boton-salir-top {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #ffffff;
    color: #b42318;
    font-weight: 700;
}

.logo-barstow {
    flex: 0 0 auto;
    width: 120px !important;
    max-width: 120px !important;
}

@media (max-width: 720px) {
    .usuario-topbar {
        align-items: flex-start;
        gap: 10px;
    }

    .usuario-sesion {
        min-width: 0;
        text-align: left;
    }

    .logo-barstow {
        width: 96px !important;
        max-width: 96px !important;
    }
}

/* Modern Barstow theme */
:root {
    --barstow-navy: #12305a;
    --barstow-blue: #0b5f88;
    --barstow-teal: #09b9c6;
    --barstow-teal-soft: #dff8f9;
    --barstow-ink: #162331;
    --barstow-muted: #5f6f80;
    --barstow-line: #d9e4ee;
    --barstow-page: #f3f7fb;
    --barstow-card: #ffffff;
    --barstow-danger: #b42318;
    --barstow-success: #157a56;
    --shadow-soft: 0 12px 32px rgba(18, 48, 90, 0.09);
    --shadow-small: 0 6px 18px rgba(18, 48, 90, 0.08);
}

body {
    background:
        radial-gradient(circle at 18% 8%, rgba(9, 185, 198, 0.16), transparent 34%),
        linear-gradient(180deg, #f8fbfe 0%, var(--barstow-page) 100%);
    color: var(--barstow-ink);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
}

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    padding: 26px 20px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #0cc4ca 0%, #079bb4 42%, #0a527c 100%);
    border-right: 0;
    color: #ffffff;
    box-shadow: 18px 0 40px rgba(18, 48, 90, 0.12);
}

.sidebar::before {
    content: "";
    display: block;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 8px;
    background:
        url("../img/logo-barstow.png") center / 80% auto no-repeat,
        rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-small);
}

.sidebar h1 {
    max-width: 190px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
}

.menu-principal {
    gap: 8px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.menu-principal a,
.menu-principal summary {
    color: rgba(255, 255, 255, 0.84);
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.menu-principal a {
    padding: 10px 12px;
    font-weight: 700;
}

.menu-principal summary {
    padding: 11px 12px;
    color: rgba(255, 255, 255, 0.88);
}

.menu-principal details a {
    margin-left: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.22);
}

.menu-principal a:hover,
.menu-principal summary:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.menu-principal a.menu-activo,
.menu-principal a[aria-current="page"],
.menu-principal details.grupo-activo > summary {
    color: var(--barstow-navy);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(18, 48, 90, 0.14);
}

.contenido {
    width: calc(100% - 56px);
    max-width: none;
    padding: 28px;
    padding-top: 22px;
}

.barra-superior {
    position: sticky !important;
    top: 10px !important;
    right: auto !important;
    left: auto !important;
    z-index: 20 !important;
    margin-bottom: 18px !important;
}

.usuario-topbar {
    width: auto;
    max-width: 520px;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid rgba(217, 228, 238, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(12px);
}

.usuario-sesion {
    color: var(--barstow-muted);
}

.usuario-sesion strong,
.dashboard-encabezado h2,
h2,
h3 {
    color: var(--barstow-ink);
}

.usuario-etiqueta {
    color: var(--barstow-blue);
}

.logo-barstow {
    padding: 5px;
    border-radius: 8px;
    background: #ffffff;
    width: 92px !important;
    max-width: 92px !important;
}

.boton-salir-top {
    border-color: #ffd1cc;
    background: #fff8f7;
    color: var(--barstow-danger);
}

.dashboard-encabezado,
.dashboard-panel,
.modulo-card,
.panel-operativo,
.form-bloque,
.login-card,
.modal-contenido {
    border: 1px solid rgba(217, 228, 238, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.dashboard-encabezado {
    align-items: center;
    padding: 24px;
    min-height: 82px;
}

.dashboard-encabezado h2 {
    margin: 2px 0 4px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.08;
}

.eyebrow {
    color: var(--barstow-success);
    font-size: 11px;
}

.dashboard-panel {
    padding: 24px;
}

.form-bloque {
    margin-bottom: 24px;
    padding: 20px;
    border-bottom: 0;
}

.detalle-resumen,
.cadena-previa,
.preview-xml pre {
    border: 1px solid var(--barstow-line);
    border-radius: 8px;
    background: #fbfdff;
}

input,
select,
button {
    border: 1px solid #c9d7e4;
    border-radius: 6px;
    background: #ffffff;
    color: var(--barstow-ink);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--barstow-teal);
    outline: 3px solid rgba(9, 185, 198, 0.18);
}

.firma-certificados-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.firma-certificados-grid label:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 420px;
}

@media (max-width: 720px) {
    .firma-certificados-grid {
        grid-template-columns: 1fr;
    }

    .firma-certificados-grid label:nth-child(3) {
        grid-column: auto;
        max-width: none;
    }
}

input[readonly],
input:disabled,
select:disabled {
    background: #eef4f8;
    color: #6b7b89;
}

button,
.boton-secundario,
.acciones-card a,
.acciones-operativas a,
.subnav a,
.paginacion a {
    border-color: transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--barstow-teal) 0%, var(--barstow-blue) 100%);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(9, 117, 148, 0.16);
}

button:hover,
.boton-secundario:hover,
.acciones-card a:hover,
.acciones-operativas a:hover,
.subnav a:hover,
.paginacion a:hover {
    filter: brightness(0.98);
    box-shadow: 0 10px 24px rgba(9, 117, 148, 0.22);
}

.boton-secundario,
.subnav a,
.paginacion a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.acciones-tabla button {
    background: transparent;
    box-shadow: none;
    color: var(--barstow-danger);
}

table {
    overflow: hidden;
    border: 1px solid var(--barstow-line);
    border-radius: 8px;
    background: var(--barstow-card);
    box-shadow: var(--shadow-small);
}

thead th {
    background: #f7fbfd;
    color: #233647;
    font-size: 13px;
    text-transform: none;
}

th,
td {
    border-bottom: 1px solid #e4edf4;
}

tbody tr:hover {
    background: #f8fcff;
}

.tabla-scroll {
    border-radius: 8px;
}

.alerta {
    border: 1px solid var(--barstow-line);
    border-left-width: 5px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-small);
}

.alerta-error {
    border-left-color: var(--barstow-danger);
}

.alerta-exito {
    border-left-color: var(--barstow-success);
}

.modulo-icono,
.flujo-titulos li {
    border-radius: 8px;
    background: var(--barstow-teal-soft);
    color: var(--barstow-blue);
}

.panel-operativo,
.modulo-principal {
    border-top-color: var(--barstow-teal);
}

.login-page {
    background:
        radial-gradient(circle at 18% 14%, rgba(9, 185, 198, 0.23), transparent 34%),
        linear-gradient(135deg, #f7fbff 0%, #edf7fa 100%);
}

.login-card {
    box-shadow: 0 18px 44px rgba(18, 48, 90, 0.14);
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e8f1f7;
}

::-webkit-scrollbar-thumb {
    background: #87aebe;
    border: 3px solid #e8f1f7;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--barstow-blue);
}

@media (max-width: 720px) {
    .sidebar {
        border-bottom: 0;
        box-shadow: 0 12px 30px rgba(18, 48, 90, 0.12);
    }

    .sidebar::before {
        display: none;
    }

    .contenido {
        width: auto;
        padding: 18px;
        padding-top: 18px;
    }

    .barra-superior {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin-bottom: 16px !important;
    }

    .usuario-topbar {
        display: grid;
        grid-template-columns: 1fr auto;
        width: auto;
    }

    .boton-salir-top {
        grid-column: 1 / -1;
    }
}

.modal-sistema {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: start center;
    padding: 84px 24px 24px;
    background: rgba(18, 35, 49, 0.34);
    backdrop-filter: blur(5px);
}

.modal-sistema-contenido {
    width: min(520px, 100%);
    overflow: hidden;
    border: 1px solid rgba(217, 228, 238, 0.96);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(18, 48, 90, 0.26);
}

.modal-sistema-encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--barstow-line);
    background: linear-gradient(135deg, #f8fcff 0%, #eef9fb 100%);
}

.modal-sistema-encabezado h2 {
    margin: 0;
    font-size: 20px;
}

.modal-sistema-cerrar {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #d7e3ee;
    border-radius: 8px;
    background: #ffffff;
    color: var(--barstow-muted);
    box-shadow: none;
    font-size: 24px;
    line-height: 1;
}

.modal-sistema-cerrar:hover {
    color: var(--barstow-danger);
    box-shadow: none;
}

.modal-sistema-cuerpo {
    padding: 18px;
    color: var(--barstow-ink);
}

.modal-sistema-cuerpo p,
.modal-sistema-cuerpo ul {
    margin-top: 0;
}

.modal-sistema-cuerpo > :last-child {
    margin-bottom: 0;
}

.modal-sistema-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.modal-sistema-acciones button {
    width: auto;
    min-width: 112px;
}

.modal-sistema-error .modal-sistema-contenido {
    border-top: 5px solid var(--barstow-danger);
}

.modal-sistema-exito .modal-sistema-contenido {
    border-top: 5px solid var(--barstow-success);
}

.modal-sistema-confirmacion .modal-sistema-contenido,
.modal-sistema-info .modal-sistema-contenido {
    border-top: 5px solid var(--barstow-teal);
}

.boton-modal-secundario {
    border-color: #cfdce7;
    background: #f7fafc;
    color: var(--barstow-ink);
    box-shadow: none;
}

.boton-modal-secundario:hover {
    box-shadow: none;
}

@media (max-width: 720px) {
    .modal-sistema {
        place-items: start center;
        padding: 24px 14px;
    }

    .modal-sistema-acciones {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal-sistema-acciones button {
        width: 100%;
    }
}

.contenido a:not(.boton-salir-top) {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #c9d7e4;
    border-radius: 8px;
    background: #ffffff;
    color: var(--barstow-blue);
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(18, 48, 90, 0.07);
}

.contenido a:not(.boton-salir-top):hover {
    border-color: var(--barstow-teal);
    background: var(--barstow-teal-soft);
    color: var(--barstow-navy);
    box-shadow: 0 8px 18px rgba(9, 117, 148, 0.12);
}

.contenido td a:not(.boton-salir-top) {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 14px;
}

.contenido .acciones a:not(.boton-salir-top),
.contenido .form-confirmacion a:not(.boton-salir-top),
.contenido .dashboard-encabezado a:not(.boton-salir-top) {
    min-height: 38px;
    padding: 10px 14px;
}

.contenido > section > h2:first-child {
    margin: 12px 0 20px;
    font-size: clamp(26px, 2.4vw, 34px);
    line-height: 1.08;
}

.encabezado-auto h2 {
    margin: 2px 0 4px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.08;
}

.encabezado-auto nav.acciones {
    margin-top: 0;
}

.contenido form:not(.login-form):not(.form-inline):not(.form-confirmacion) {
    max-width: 100%;
}

.contenido > section > form:not(.login-form):not(.form-inline):not(.form-confirmacion):not(.form-tabla):not(.form-bloque):not(.form-amplio):not(:has(.dashboard-panel)):not(:has(.form-bloque)) {
    width: min(720px, 100%);
    box-sizing: border-box;
    padding: 22px;
    border: 1px solid rgba(217, 228, 238, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.contenido form:has(table),
.contenido form.form-tabla,
.contenido form:has(.tabla-scroll),
.contenido form.form-con-tabla {
    width: 100%;
    max-width: 100%;
}

.contenido form:has(table) > .tabla-scroll,
.contenido form.form-tabla > .tabla-scroll,
.contenido form.form-con-tabla > .tabla-scroll {
    width: 100%;
}

.contenido form:has(table) button,
.contenido form.form-tabla button,
.contenido form.form-con-tabla button {
    width: auto;
}

.contenido > section.seccion-con-tabla,
.contenido > section > form.form-con-tabla {
    width: 100% !important;
    max-width: none !important;
}

.contenido > section > form.form-con-tabla {
    box-sizing: border-box;
}

.contenido > section > form.form-con-tabla > .tabla-scroll {
    width: 100% !important;
    max-width: none !important;
}

.contenido > section > form.form-con-tabla table {
    width: 100%;
}

.contenido > section > form.form-tabla,
.contenido > section > form.form-con-tabla {
    padding: 24px;
    border: 1px solid rgba(217, 228, 238, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.contenido > section > form.form-con-tabla > p:first-child {
    margin-top: 0;
}

.contenido .form-bloque {
    width: 100%;
    box-sizing: border-box;
}

.contenido form.form-bloque {
    width: 100%;
}

.contenido form.form-amplio,
.contenido .form-amplio {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.contenido form:has(table) .form-bloque,
.contenido .form-bloque:has(table) {
    width: 100%;
}

.contenido form > .form-acciones {
    width: 100%;
}

.contenido form:has(table) > .form-acciones {
    width: 100%;
}

.contenido form > .form-acciones button,
.contenido form.form-bloque .form-acciones button {
    width: min(320px, 100%);
}

.contenido .form-grid {
    align-items: end;
}

.contenido .form-bloque > form.form-inline {
    width: 100%;
    max-width: none;
    align-items: end;
}

textarea {
    min-height: 112px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #c9d7e4;
    border-radius: 6px;
    background: #ffffff;
    color: var(--barstow-ink);
    font: inherit;
    resize: vertical;
}

textarea:focus {
    border-color: var(--barstow-teal);
    outline: 3px solid rgba(9, 185, 198, 0.18);
}
