/**
 * Ruta: public/assets/css/app.css
 * Modificado: 10-ago-26 6:45 am
 */

:root {
    --ink: #18221c;
    --muted: #647168;
    --paper: #ffffff;
    --canvas: #f3f6f2;
    --green: #1d6b45;
    --green-dark: #12472f;
    --green-soft: #e8f3ec;
    --gold: #b8923d;
    --line: #d8e0da;
    --danger: #a83232;
    --warning: #fff3cf;
    --shadow: 0 16px 42px rgba(27, 54, 38, .09);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #edf4ee 0, var(--canvas) 320px); }
a { color: var(--green); }
button, input, select { font: inherit; }

.site-header { padding: 22px clamp(20px, 5vw, 70px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: var(--green); color: #fff; font-size: 24px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 48px auto 72px; }
.site-footer { padding: 24px; color: var(--muted); text-align: center; }
.site-footer .visit-counter-wrap {
    margin: 12px 0 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    cursor: help;
}
.site-footer .visit-counter-wrap small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

h1, h2, h3 { margin-top: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
h2 { font-size: 1.35rem; }
p { line-height: 1.58; }
.lead { max-width: 60ch; color: #405047; font-size: 1.1rem; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .7fr); gap: clamp(28px, 6vw, 78px); align-items: start; }

.card, .form-section, .status-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card { padding: 28px; }
.access-card, .login-card { display: grid; gap: 12px; }
.login-card { width: min(460px, 100%); margin: 70px auto; }

.visit-counter {
    display: inline-block;
    min-width: 4.5ch;
    padding: 4px 10px;
    border-radius: 6px;
    background: #1a1f27;
    color: #7dffb3;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.brand-registered {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 40;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}
.brand-registered-tip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    padding: 6px 10px;
    border-radius: 8px;
    background: #1f2a23;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.brand-registered:hover .brand-registered-tip,
.brand-registered:focus-visible .brand-registered-tip {
    opacity: 1;
    transform: translateY(0);
}
.privacy-note { margin-top: 26px; padding: 20px 22px; border-left: 5px solid var(--gold); border-radius: 12px; background: #fff9e8; line-height: 1.6; }
.form-warning { margin: 0 0 24px; }

label { color: #2d3b32; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]), select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #b9c5bd;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: auto;
    padding: 0;
    cursor: pointer;
}
input:focus, select:focus { outline: 3px solid rgba(29,107,69,.15); border-color: var(--green); }
.field-help, .section-help { margin: 0; color: var(--muted); font-size: .9rem; }
.field-error { margin: 5px 0 0; color: var(--danger); font-size: .9rem; font-weight: 700; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 800; text-decoration: none; }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border-color: #8eaa98; background: var(--green-soft); color: var(--green-dark); }
.button-danger { border-color: #d7a0a0; background: #fde8e8; color: var(--danger); }
.button-danger:hover { background: #f8d4d4; }
.button-ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.danger-action-form { margin-top: 14px; }
.button-icon { min-width: 44px; padding: 5px; border-color: #d4dcd6; background: #fff; color: var(--danger); font-size: 1.4rem; }

.alert { margin-bottom: 18px; padding: 14px 17px; border-radius: 10px; font-weight: 650; }
.alert-success { background: #e4f5ea; color: #155a35; }
.alert-warning { background: var(--warning); color: #714d00; }
.alert-error { background: #fde8e8; color: #8b2323; }

.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 28px; }
.page-heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-heading-actions form { margin: 0; }
.admin-steps { margin: 12px 0 18px; padding-left: 1.25rem; line-height: 1.6; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.admin-detail-actions .status-card-actions { margin-top: 8px; }
.detail-list { display: grid; gap: 12px; margin: 0; }
.detail-list div { display: grid; gap: 4px; }
.detail-list dt { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-list dd { margin: 0; font-weight: 700; }
.table-link { font-weight: 800; white-space: nowrap; }
.admin-data-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.admin-import-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.admin-import-label { display: flex; gap: 8px; align-items: center; font-weight: 700; color: #2d3b32; }
.admin-import-label input[type="file"] { max-width: 240px; min-height: auto; padding: 6px; }
.import-error-list { margin: 12px 0 0; padding-left: 1.2rem; line-height: 1.6; }
.page-heading.compact h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.page-heading p { margin-bottom: 0; }
.status-card { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 26px; flex-wrap: wrap; }
.status-card .button-secondary { margin-left: 0; }
.status-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-card strong { font-size: 1.2rem; }
.status-card p { margin: 4px 0 0; color: var(--muted); }
.status-dot { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; background: var(--gold); }
.status-card.is-complete .status-dot { background: #20a45d; }
.credentials-card, .muted-card { margin-top: 24px; }
.group-shift-card { margin-top: 24px; }

.admin-access {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 30px;
    height: 30px;
    color: #7a8792;
    border: 1px solid #cdd6dd;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: 0.83rem;
    opacity: 0.6;
    z-index: 20;
}

.admin-access:hover,
.admin-access:focus-visible {
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.enrollment-name-cell {
    vertical-align: middle;
    line-height: 1.35;
}

.enrollment-name-cell strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.group-shift-header {
    text-align: center;
    vertical-align: bottom;
}

.group-shift-visibility-form {
    margin: 0;
}

.group-shift-visibility-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.group-shift-visibility-label input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    cursor: pointer;
}

.enrollment-assignment-form {
    margin: 0;
}

.enrollment-assignment-form select {
    width: auto;
    min-height: 32px;
    min-width: 0;
    max-width: 100%;
    padding: 4px 24px 4px 8px;
    font-size: 0.84rem;
}

.enrollment-shift-column,
.enrollment-group-column {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.enrollment-program-column {
    width: 1%;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--muted);
    vertical-align: middle;
}

.enrollment-status-column,
.enrollment-credentials-column {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.86rem;
}

.enrollment-action-column {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}

.enrollment-action-column .table-link {
    font-size: 0.86rem;
}

.admin-filter-card {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.admin-filter-grid-wide {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.admin-filter-grid-wide .admin-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.admin-filter-grid label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.86rem;
}

.admin-filter-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.bulk-actions-bar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #f5f8f5;
    display: grid;
    grid-template-columns: auto minmax(170px, 1fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) auto;
    align-items: center;
    gap: 10px;
}

.bulk-actions-bar strong {
    color: var(--green-dark);
    font-size: 0.88rem;
    white-space: nowrap;
}

.bulk-actions-bar select,
.bulk-actions-bar .button {
    min-height: 38px;
    margin: 0;
}

.bulk-actions-bar select {
    padding: 6px 10px;
}

.selection-column {
    width: 42px;
    padding-right: 6px;
    text-align: center;
    vertical-align: middle;
}

.selection-column input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--green);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.enrollment-list-card {
    min-height: 160px;
}

.empty-list-message {
    display: grid;
    gap: 6px;
    padding: 28px 8px 12px;
    color: var(--muted);
    text-align: center;
}

.empty-list-message strong {
    color: var(--ink);
}

.table-card table th,
.table-card table td {
    padding: 10px 8px;
    font-size: 0.92rem;
}

#tabla-inscripciones tbody td {
    vertical-align: middle;
}

#tabla-inscripciones .col-selection {
    width: 42px;
}

#tabla-inscripciones .col-name {
    width: 34%;
    min-width: 160px;
}

#tabla-inscripciones .col-program {
    width: 11%;
}

#tabla-inscripciones .col-status {
    width: 7%;
}

#tabla-inscripciones .col-shift {
    width: 9%;
}

#tabla-inscripciones .col-group {
    width: 5%;
}

#tabla-inscripciones .col-credentials {
    width: 9%;
}

#tabla-inscripciones .col-action {
    width: 52px;
}

.table-card .group-shift-header {
    min-width: 210px;
}

.enrollment-totals-page .page-shell {
    width: min(980px, calc(100% - 32px));
}

.enrollment-totals-sheet {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.print-only {
    display: none;
}

.enrollment-totals-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.enrollment-totals-table-wrap {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

.enrollment-totals-filter {
    margin: 0;
}

.enrollment-totals-hide-empty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.enrollment-totals-hide-empty input {
    width: auto;
    min-height: auto;
}

.enrollment-totals-title {
    margin: 0 0 18px;
    font-size: 1.5rem;
    text-align: center;
}

.enrollment-totals-table {
    width: auto;
    border-collapse: collapse;
}

.enrollment-totals-table th,
.enrollment-totals-table td {
    padding: 3px 10px;
    border: 1px solid var(--line);
    text-align: left;
    line-height: 1.15;
}

.enrollment-totals-table tbody td {
    font-size: 0.92rem;
}

.enrollment-totals-table thead th,
.enrollment-totals-table tfoot th {
    background: var(--green-soft);
}

.enrollment-totals-table tfoot th {
    font-size: 150%;
    padding-top: 6px;
    padding-bottom: 6px;
}

.enrollment-totals-generated-at {
    margin: 14px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

@media print {
    body.enrollment-totals-page {
        background: #fff;
    }

    body.enrollment-totals-page .site-header,
    body.enrollment-totals-page .site-footer,
    body.enrollment-totals-page .no-print {
        display: none !important;
    }

    body.enrollment-totals-page .page-shell {
        width: 100%;
        margin: 0;
    }

    .enrollment-totals-sheet {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .print-only {
        display: block;
    }

    .enrollment-totals-title {
        font-size: 18pt;
    }

    .enrollment-totals-table-wrap {
        margin-inline: auto;
    }

    .enrollment-totals-table {
        width: auto;
    }

    .enrollment-totals-table th,
    .enrollment-totals-table td {
        padding: 2px 8px;
    }

    .enrollment-totals-table tfoot th {
        font-size: 13.5pt;
    }

    .table-scroll {
        overflow: visible;
    }
}
.credentials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 0; }
.credentials-grid div { padding: 16px; border-radius: 12px; background: var(--green-soft); }
.credentials-grid dt { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.credentials-grid dd { margin: 8px 0 0; overflow-wrap: anywhere; font-weight: 800; }

.enrollment-form { display: grid; gap: 22px; }
.form-section { min-width: 0; margin: 0; padding: 26px; }
.form-section legend { padding: 0 9px; color: var(--green-dark); font-size: 1.25rem; font-weight: 850; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.field-grid > div { display: grid; gap: 7px; }
.check-row, .radio-row { display: flex; gap: 11px; align-items: start; margin: 10px 0; font-weight: 600; }
.check-row input, .radio-row input { flex: 0 0 auto; width: 19px; min-height: 19px; margin-top: 3px; }
.repeat-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.repeat-list { display: grid; gap: 10px; margin: 12px 0; }
.repeat-row { display: grid; grid-template-columns: 1fr 1.3fr 44px; gap: 10px; align-items: center; }
.repeat-row.simple { grid-template-columns: 1fr 44px; }
.whatsapp-warning { border-color: #dfbd63; background: #fffaf0; }
.documents-card { box-shadow: none; }
.documents-card ul { line-height: 1.8; }
.documents-notice {
    margin-top: 18px;
    padding: 16px 18px;
    border-left: 5px solid var(--gold);
    border-radius: 12px;
    background: #fff4d6;
    color: #5c4300;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.55;
}
.yes-no-block { margin-top: 18px; }
.yes-no-question { margin: 0 0 10px; font-weight: 800; color: #2d3b32; }
.conditional-fields { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.conditional-fields[hidden] { display: none !important; }
.form-actions { display: flex; justify-content: end; gap: 12px; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.inline-form { display: flex; gap: 10px; margin-top: 14px; }
.program-code-list { display: grid; gap: 8px; margin: 14px 0; }
.program-code-list label { display: grid; grid-template-columns: 1fr 64px; gap: 12px; align-items: center; }
.program-code-list input { text-align: center; text-transform: lowercase; }
.table-card { margin-top: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; }
.admin-table-search { margin: 16px 0 10px; }
.admin-table-search label { display: block; margin-bottom: 8px; font-weight: 800; color: #2d3b32; }
.admin-table-search input {
    width: min(560px, 100%);
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
}
.admin-table-search-count { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.admin-table-empty {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f4f7f5;
    color: var(--muted);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.error-card { width: min(640px, 100%); margin: 80px auto; text-align: center; }

.print-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.insc-print-page {
    background: #fff;
    border: 1px solid #d8e0da;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 6px 34px 28px;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 12pt;
    line-height: 1.25;
}

.insc-print-page-two {
    margin-top: 28px;
}

.insc-print-header-band {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 148px;
    margin: 0 0 18px;
}

.institutional-logo-left {
    height: 148px;
    max-width: 252px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.institutional-logo-right {
    height: 140px;
    max-width: 140px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.official-sheet-heading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: min(100%, 520px);
    text-align: center;
    z-index: 2;
}

.official-sheet-heading strong,
.official-sheet-heading span {
    display: block;
}

.official-sheet-heading strong {
    font-size: 0.92rem;
    line-height: 1.28;
}

.official-sheet-heading span {
    margin-top: 3px;
    font-size: 0.76rem;
}

.insc-print-date {
    margin: 0 0 14px;
    text-align: right;
    font-weight: 700;
}

body.print-page .page-shell {
    margin-top: 9px;
}

.insc-print-body p {
    margin: 0.35em 0;
    text-align: justify;
}

.insc-print-data {
    margin-top: 1em;
}

.insc-print-data p {
    margin: 0.2975em 0;
    line-height: 1.0625;
}

.insc-print-recipient {
    margin-bottom: 0.8em !important;
}

.insc-print-fill {
    display: inline;
    padding: 0;
    border-bottom: 0;
    font-weight: 700;
    line-height: 1.2;
}

.insc-print-signature {
    margin-top: 24px;
    text-align: center;
}

.insc-print-signature p {
    margin: 0.2em 0;
    text-align: center;
}

.insc-print-normativity {
    margin: 0.4em 0 0.8em;
    padding-left: 1.35rem;
}

.insc-print-normativity li {
    margin-bottom: 0.135em;
    line-height: 1.125;
    text-align: justify;
}

.insc-print-signature-block {
    margin-top: 22px;
    text-align: center;
}

.insc-print-closing {
    margin-top: 22px;
}

.insc-print-closing-salute {
    margin: 0 0 18px;
    text-align: center;
    font-weight: 700;
}

.insc-print-dual-signatures {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
}

.insc-print-dual-signatures td.insc-print-dual-signature {
    width: 50%;
    vertical-align: top;
    text-align: center;
    padding: 0 10px;
}

.insc-print-dual-signature p {
    margin: 8px 0 0;
    font-size: 10pt;
    line-height: 1.2;
}

.insc-print-dual-signature .insc-print-signature-line {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
}

.insc-print-signature-line {
    display: inline-block;
    min-width: 220px;
    max-width: 100%;
    margin: 0;
}

@media screen and (max-width: 780px) {
    .grid-two, .admin-grid, .admin-detail-grid, .field-grid, .credentials-grid { grid-template-columns: 1fr; }
    .admin-filter-grid,
    .admin-filter-grid-wide {
        grid-template-columns: 1fr;
    }
    .admin-filter-actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }
    .bulk-actions-bar {
        grid-template-columns: 1fr;
    }
    .page-shell { margin-top: 28px; }
    .page-heading, .status-card { align-items: stretch; flex-direction: column; }
    .repeat-row { grid-template-columns: 1fr 44px; }
    .repeat-row select { grid-column: 1 / -1; grid-row: 2; }
    .form-actions, .inline-form { flex-direction: column; }
    .insc-print-page { padding: 6px 18px 20px; }

    .insc-print-header-band {
        min-height: 118px;
    }

    .institutional-logo-left {
        height: 118px;
        max-width: 201px;
    }

    .institutional-logo-right {
        height: 112px;
        max-width: 112px;
    }
}

@media print {
    @page {
        size: letter;
        margin: 0.5mm 9mm 0.5mm 9mm;
    }

    html, body {
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        background: #fff !important;
        color: #000;
        font-family: "Times New Roman", Times, serif;
        font-size: 12pt;
        line-height: 1.25;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-page {
        background: #fff;
        min-height: 0;
    }

    .print-page .site-header,
    .print-page .site-footer,
    .print-toolbar {
        display: none !important;
    }

    .print-page .page-shell {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .insc-print-page {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        page-break-inside: avoid;
        break-inside: avoid-page;
    }

    .insc-print-page-one {
        page-break-after: always;
        break-after: page;
    }

    .insc-print-page-two {
        page-break-before: always;
        break-before: page;
        margin-top: 0;
    }

    .insc-print-header-band {
        min-height: 132px;
        margin-bottom: 12px;
    }

    .institutional-logo-left {
        height: 132px;
        max-width: 225px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .institutional-logo-right {
        height: 126px;
        max-width: 126px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .official-sheet-heading strong {
        font-size: 10pt;
        line-height: 1.2;
    }

    .official-sheet-heading span {
        font-size: 8.5pt;
    }

    .insc-print-date {
        margin-bottom: 10px;
        font-size: 12pt;
    }

    .insc-print-body p {
        font-size: 12pt;
        line-height: 1.25;
    }

    .insc-print-data p {
        line-height: 1.0625;
    }

    .insc-print-normativity li {
        font-size: 12pt;
        line-height: 1.125;
    }

    .insc-print-closing {
        page-break-inside: avoid;
        break-inside: avoid-page;
    }

    .insc-print-dual-signatures {
        width: 100% !important;
        table-layout: fixed !important;
    }

    .insc-print-dual-signatures td.insc-print-dual-signature {
        width: 50% !important;
    }

    .insc-print-dual-signature p {
        font-size: 10pt;
    }
}

/* SAE-E extensions */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-nav a { font-weight: 800; text-decoration: none; color: var(--green-dark); }
.admin-session-label { font-size: 0.92rem; font-weight: 700; color: var(--muted); }
.inline-form { display: inline; margin: 0; }
.logo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.inst-logo { height: 64px; width: auto; object-fit: contain; }
.exam-shell { width: min(720px, calc(100% - 24px)); margin-top: 24px; }
.exam-card { padding: 20px; }
.exam-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.section-hero {
    margin: 0 0 18px;
    padding: 22px 24px;
    border-radius: 16px;
    display: grid;
    gap: 6px;
    justify-items: start;
    border: 2px solid transparent;
}
.section-hero-value {
    font-size: clamp(1.55rem, 3.4vw, 2.35rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.unir-dialog {
    margin: 10px 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7faf8;
    display: grid;
    gap: 8px;
}
.is-hidden { display: none !important; }
#unir-warning {
    color: #a83232;
    font-weight: 700;
    margin: 0;
}
.exam-section-tone-0 .section-hero,
.section-hero.exam-section-tone-0 { color: #145b3d; background: #e8f7ef; border-color: #9fd4b5; }
.exam-section-tone-1 .section-hero,
.section-hero.exam-section-tone-1 { color: #1f4e79; background: #e7eef9; border-color: #9db7d8; }
.exam-section-tone-2 .section-hero,
.section-hero.exam-section-tone-2 { color: #7a3b12; background: #fff1e6; border-color: #efc09a; }
.exam-section-tone-3 .section-hero,
.section-hero.exam-section-tone-3 { color: #5b2d75; background: #f4eafb; border-color: #d0aee6; }
.exam-section-tone-4 .section-hero,
.section-hero.exam-section-tone-4 { color: #0f5c63; background: #e6f7f8; border-color: #95d0d6; }
.exam-section-tone-5 .section-hero,
.section-hero.exam-section-tone-5 { color: #755314; background: #fff8e7; border-color: #ead39a; }
.exam-section-tone-6 .section-hero,
.section-hero.exam-section-tone-6 { color: #8a2f4a; background: #fdeef3; border-color: #e5a9bc; }
.exam-section-tone-7 .section-hero,
.section-hero.exam-section-tone-7 { color: #3d4a1f; background: #f3f6e8; border-color: #c5d39a; }
.exam-card.exam-section-tone-0 { box-shadow: inset 6px 0 0 #4bc07d; }
.exam-card.exam-section-tone-1 { box-shadow: inset 6px 0 0 #5b8fc9; }
.exam-card.exam-section-tone-2 { box-shadow: inset 6px 0 0 #e08a45; }
.exam-card.exam-section-tone-3 { box-shadow: inset 6px 0 0 #a66bc7; }
.exam-card.exam-section-tone-4 { box-shadow: inset 6px 0 0 #3aa8b2; }
.exam-card.exam-section-tone-5 { box-shadow: inset 6px 0 0 #d4a63a; }
.exam-card.exam-section-tone-6 { box-shadow: inset 6px 0 0 #d4658a; }
.exam-card.exam-section-tone-7 { box-shadow: inset 6px 0 0 #8aa63a; }
.progress-bar { height: 10px; background: #e2ebe5; border-radius: 999px; overflow: hidden; margin-top: 8px; width: min(280px, 100%); }
.progress-bar span { display: block; height: 100%; background: var(--green); }
.exam-clock { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbf8; min-width: 120px; text-align: center; }
.exam-clock.is-hidden { display: none; }
.clock-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.exam-clock strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.question-text { font-size: 1.08rem; line-height: 1.55; }
.question-image { display: block; max-width: 100%; height: auto; margin: 14px 0; border-radius: 10px; border: 1px solid var(--line); }
.options-list { display: grid; gap: 10px; margin: 18px 0; }
.option-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.option-item:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.exam-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button-small { min-height: 36px; padding: 6px 12px; font-size: .92rem; }
.config-grid { display: grid; gap: 14px; }
.check-inline { display: flex !important; gap: 8px; align-items: center; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.data-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.metrics-cell { font-size: .82rem; color: #405047; min-width: 140px; }
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.manual-form { display: grid; gap: 8px; margin-top: 8px; min-width: 160px; }
.option-edit-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
textarea { width: 100%; padding: 10px 12px; border: 1px solid #b9c5bd; border-radius: 10px; font: inherit; }
.exam-finished { text-align: left; }
.exam-instructions {
    margin: 16px 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
    line-height: 1.45;
    color: #334239;
}
@media (max-width: 700px) {
  .exam-actions .button { width: 100%; }
  .page-shell { width: min(100% - 16px, 1120px); margin-top: 20px; }
  .inst-logo { height: 48px; }
}

.admin-filter-card {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: var(--shadow);
}
.admin-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.admin-filter-grid-wide {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}
.admin-filter-grid-wide .admin-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}
.admin-filter-grid label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.86rem;
}
.admin-filter-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}
.info-banner {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff3cf;
    color: #714d00;
    font-weight: 700;
    font-size: .9rem;
}
.print-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.print-sheet { background: #fff; padding: 8px; }
.print-header { margin-bottom: 16px; }
.print-table { font-size: .85rem; }
@media print {
    .no-print, .site-header, .site-footer, .alert { display: none !important; }
    .page-shell, .exam-shell { width: 100%; margin: 0; }
    body { background: #fff; }
}
@media (max-width: 900px) {
    .admin-filter-grid,
    .admin-filter-grid-wide { grid-template-columns: 1fr; }
}

.data-table tr.row-pago-si td { background: #e8f6ee; }
.data-table tr.row-pago-no td { background: #fdecec; }
.data-table tr.row-pago-si:hover td,
.data-table tr.row-pago-no:hover td { filter: brightness(0.98); }

.data-table tr.row-examen-hecho td { background: #e7eef9; }
.action-menu summary {
    cursor: pointer;
    list-style: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 800;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] summary { background: var(--green-soft); }
.action-menu .manual-form { margin-top: 8px; }
.student-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.student-ficha h2 { margin-top: 28px; }
@media (max-width: 700px) {
    .student-detail-grid { grid-template-columns: 1fr; }
}

.data-table td,
.data-table th { vertical-align: top; }

.questions-table {
    table-layout: fixed;
}
.questions-table th,
.questions-table td {
    white-space: normal;
}
.questions-table .col-id { width: 56px; }
.questions-table .col-seccion { width: 160px; }
.questions-table .col-flag { width: 64px; text-align: center; }
.questions-table .col-actions { width: 140px; }
.questions-table .col-enunciado {
    width: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.exam-status-cell { line-height: 1.25; }
.exam-status-extra { margin-top: 2px; color: var(--muted); font-size: .78rem; font-weight: 700; }

.table-status {
    width: fit-content;
    padding: 6px 9px;
    border-radius: 999px;
    color: #5c6872;
    background: #edf1f4;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}
.table-result-aceptado {
    color: #145b3d !important;
    background: #e8f7ef !important;
}
.table-result-pendiente,
.table-status-pending {
    color: #755314 !important;
    background: #fff8e7 !important;
}
.table-result-no_aceptado {
    color: #a83232 !important;
    background: #fff0f0 !important;
}
.table-result-presentado {
    color: #1f4e79 !important;
    background: #e7eef9 !important;
}
.result-select {
    min-height: 38px;
    min-width: 140px;
    width: auto !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
    padding: 6px 12px !important;
    cursor: pointer;
}
select.result-select.table-result-aceptado {
    color: #145b3d !important;
    background-color: #e8f7ef !important;
}
select.result-select.table-result-pendiente {
    color: #755314 !important;
    background-color: #fff8e7 !important;
}
select.result-select.table-result-no_aceptado {
    color: #a83232 !important;
    background-color: #fff0f0 !important;
}
select.result-select.table-result-presentado {
    color: #1f4e79 !important;
    background-color: #e7eef9 !important;
}
select.result-select option[value="aceptado"] { color: #145b3d; background-color: #e8f7ef; }
select.result-select option[value="pendiente"] { color: #755314; background-color: #fff8e7; }
select.result-select option[value="presentado"] { color: #1f4e79; background-color: #e7eef9; }
select.result-select option[value="no_aceptado"] { color: #a83232; background-color: #fff0f0; }
.result-hero.table-result-presentado { border-color: #9db7d8; }
.result-hero {
    margin: 18px 0 8px;
    padding: 22px 24px;
    border-radius: 16px;
    display: grid;
    gap: 6px;
    justify-items: start;
    border: 2px solid transparent;
}
.result-hero-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}
.result-hero-value {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}
.result-hero.table-result-aceptado { border-color: #9fd4b5; }
.result-hero.table-result-pendiente { border-color: #ead39a; }
.result-hero.table-result-no_aceptado { border-color: #e3a2a2; }

/* Resumen por licenciatura (SAE-E) */
.exam-summary-page .page-shell {
    width: min(1280px, calc(100% - 24px));
}
.exam-summary-toolbar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.exam-summary-sheet {
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}
.exam-summary-header {
    padding-bottom: 20px;
    border-bottom: 3px solid var(--green-dark);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
.exam-summary-header h1 {
    margin: 7px 0;
    color: var(--green-dark);
    font-size: clamp(1.45rem, 3.2vw, 2.1rem);
}
.exam-summary-header p:last-child {
    margin: 0;
    color: var(--muted);
}
.exam-summary-total {
    min-width: 170px;
    padding: 16px 20px;
    border-radius: 12px;
    color: #fff;
    background: var(--green-dark);
    text-align: center;
}
.exam-summary-total span,
.exam-summary-total strong {
    display: block;
}
.exam-summary-total span {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}
.exam-summary-total strong {
    margin-top: 4px;
    font-size: 2.25rem;
    line-height: 1;
}
.exam-summary-date {
    margin: 18px 0;
    color: var(--muted);
    text-align: right;
    font-size: 0.85rem;
}
.exam-summary-hint {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.92rem;
}
.exam-summary-table-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-x: auto;
}
.exam-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.exam-summary-table th,
.exam-summary-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.exam-summary-table thead th {
    background: #eef6f1;
    color: var(--green-dark);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.exam-summary-table td small {
    margin-top: 4px;
    color: var(--muted);
    display: block;
    line-height: 1.35;
}
.exam-summary-col-toggle {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: right;
    justify-content: flex-end;
}
.exam-summary-col-toggle input {
    margin: 2px 0 0;
    flex: 0 0 auto;
}
.exam-summary-col-toggle span {
    line-height: 1.25;
}
.exam-summary-col-print-label {
    display: none;
}
.exam-summary-table .numeric-column.is-print-deselected {
    opacity: 0.42;
}
.exam-summary-table .numeric-column {
    width: 96px;
    text-align: right;
    white-space: nowrap;
}
.exam-summary-count-link {
    color: var(--green-dark);
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    border-bottom: 1px dotted rgba(18, 71, 47, 0.35);
}
.exam-summary-count-link:hover {
    color: var(--green);
}
.exam-summary-count-link-total {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.55);
}
.exam-summary-zero {
    color: var(--muted);
}
.exam-summary-table tfoot th {
    border-top: 2px solid var(--green-dark);
    border-bottom: 0;
    color: #fff;
    background: var(--green-dark);
    font-size: 0.9rem;
}

@media print {
    .exam-summary-toolbar,
    .exam-summary-hint,
    .no-print,
    .site-header,
    .site-footer,
    .alert {
        display: none !important;
    }
    .exam-summary-page .page-shell,
    .exam-summary-print-page .page-shell {
        width: 100%;
        margin: 0;
        max-width: none;
    }
    .exam-summary-sheet,
    .exam-summary-print-sheet {
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
    .exam-summary-header {
        align-items: flex-start;
    }
    .exam-summary-total {
        color: #000;
        background: #fff;
        border: 2px solid #000;
    }
    .exam-summary-table thead th,
    .exam-summary-table tfoot th {
        color: #000;
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .exam-summary-count-link,
    .exam-summary-count-link-total {
        color: #000;
        border-bottom: 0;
        font-weight: 800;
        text-decoration: none;
    }
    .exam-summary-col-toggle {
        display: none !important;
    }
    .exam-summary-col-print-label {
        display: inline !important;
    }
    .exam-summary-table [data-metric-col].is-print-hidden {
        display: none !important;
    }
    .exam-summary-table .numeric-column.is-print-deselected {
        opacity: 1;
    }
    .exam-summary-table tr {
        break-inside: avoid;
    }
}

