:root {
    --ink: #1c2430;
    --muted: #647084;
    --line: #d9e1ea;
    --panel: #ffffff;
    --bg: #f4f7fb;
    --primary: #256f8f;
    --primary-dark: #18536b;
    --accent: #d98b37;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: #182330;
    color: #fff;
    padding: 24px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--accent);
    font-weight: 700;
}

.brand small {
    display: block;
    color: #b9c5d6;
    margin-top: 3px;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #e8eef7;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, .1);
}

.shell {
    margin-left: 240px;
    padding: 28px;
}

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

.login-card,
.panel,
.stats-grid article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(28, 36, 48, .06);
}

.login-card {
    width: min(440px, 100%);
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 26px;
}

h2 {
    font-size: 17px;
    margin-bottom: 16px;
}

p,
small,
.page-header p {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stats-grid article {
    padding: 22px;
}

.stats-grid strong {
    display: block;
    font-size: 34px;
    margin-bottom: 4px;
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.stack,
.filters {
    display: grid;
    gap: 14px;
}

.filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    align-items: end;
}

.compact-filters {
    grid-template-columns: minmax(220px, 360px) minmax(160px, 220px) 140px;
}

label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

input,
select,
button {
    width: 100%;
    min-height: 42px;
    border-radius: 6px;
    font: inherit;
}

input,
select {
    border: 1px solid var(--line);
    padding: 9px 10px;
    background: #fff;
}

textarea {
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    resize: vertical;
    font: inherit;
}

button {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

.button-secondary,
.button-warning,
.button-danger {
    display: inline-grid;
    place-items: center;
    min-height: 42px;
    border-radius: 6px;
    padding: 0 14px;
    font-weight: 700;
}

.button-secondary {
    border: 1px solid var(--line);
    background: #fff;
}

.button-warning {
    background: #8a5a12;
}

.button-danger {
    background: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #475569;
    background: #f8fafc;
}

.table-scroll {
    overflow-x: auto;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.section-title span {
    color: var(--muted);
    font-size: 13px;
}

.student-form {
    display: grid;
    gap: 18px;
}

fieldset {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

legend {
    padding: 0 8px;
    font-weight: 700;
}

.full-field {
    grid-column: 1 / -1;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
}

.check-field input {
    width: 18px;
    min-height: 18px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions button {
    width: auto;
}

.students-table {
    font-size: 12px;
}

.enrollment-filters {
    grid-template-columns: 120px 180px 220px minmax(220px, 1fr) 110px;
}

.enrollment-table th,
.enrollment-table td {
    text-align: center;
}

.enrollment-table th:nth-child(4),
.enrollment-table td:nth-child(4) {
    text-align: left;
    min-width: 190px;
}

.config-table input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
}

.config-table input[type="number"] {
    width: 90px;
    min-height: 34px;
}

.grades-filters {
    grid-template-columns: 120px 220px minmax(240px, 1fr) 180px 120px;
}

.grade-options {
    display: grid;
    grid-template-columns: 220px auto auto;
    gap: 16px;
    align-items: center;
}

.grade-options .check-field {
    padding-top: 0;
}

.grade-options form button {
    width: auto;
}

.grade-sheet-wrap {
    max-height: calc(100vh - 300px);
    border: 1px solid #c9d8e4;
}

.grade-sheet-table {
    min-width: 1180px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
}

.grade-sheet-table th,
.grade-sheet-table td {
    border: 1px solid #dbe5ef;
    padding: 5px 6px;
    text-align: center;
}

.grade-sheet-table th {
    background: #eaf4ff;
    color: #17364a;
}

.grade-sheet-table th:nth-child(2),
.grade-sheet-table td:nth-child(2) {
    width: 260px;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

.grade-sheet-table thead th:nth-child(2) {
    background: #eaf4ff;
    z-index: 2;
}

.grade-sheet-table input {
    width: 70px;
    min-height: 32px;
    padding: 3px 5px;
    text-align: center;
}

.grade-sheet-table tbody tr:nth-child(even) td {
    background: #f8fbff;
}

.grade-sheet-table tbody tr:hover td {
    background: #fff8dc;
}

.grade-sheet-table tbody tr:hover td:nth-child(2) {
    background: #fff8dc;
}

.muted-text {
    color: var(--muted);
    font-size: 12px;
}

.evaluation-header {
    align-items: center;
    gap: 18px;
}

.evaluation-panel {
    border: 1px solid #d7e3ee;
    box-shadow: 0 10px 28px rgba(17, 36, 52, 0.05);
}

.evaluation-add-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 180px auto;
    align-items: end;
    gap: 14px;
}

.action-button,
.evaluation-panel .form-actions button {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 10px;
    padding: 0 16px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(20, 71, 96, 0.08);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.action-button:hover,
.evaluation-panel .form-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(20, 71, 96, 0.12);
}

.button-icon {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 14px;
    font-weight: 900;
}

.back-action {
    background: #f8fbfd;
    color: #17364a;
}

.back-action .button-icon {
    background: #edf5fa;
    color: #174c68;
}

.primary-action {
    min-width: 220px;
}

.danger-action {
    min-height: 34px;
    border: 1px solid #ffd0cc;
    background: #fff2f0;
    color: #b42318;
    box-shadow: none;
}

.danger-action:hover {
    border-color: #f6aaa3;
    background: #ffe5e1;
    color: #8a1f14;
}

.danger-action .button-icon {
    background: #ffd8d4;
    color: #b42318;
}

.evaluation-config-table th,
.evaluation-config-table td {
    vertical-align: middle;
}

.evaluation-config-table td:last-child {
    width: 150px;
}

.evaluation-config-table input[type="number"] {
    width: 90px;
}

.evaluation-panel .form-actions {
    justify-content: flex-end;
    padding-top: 16px;
}

.evaluation-panel .form-actions button {
    min-width: 210px;
}

.evaluation-panel .form-actions button::before {
    content: "✓";
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 14px;
    font-weight: 900;
}

.evaluation-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d8e4ee;
}

.evaluation-hero h1 {
    margin: 10px 0 8px;
    color: #071f37;
    font-size: 28px;
    font-weight: 900;
}

.evaluation-hero p {
    margin: 0;
    color: #526b84;
    font-size: 14px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #174c68;
    font-size: 13px;
    font-weight: 800;
}

.back-link span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #c9d8e4;
    border-radius: 8px;
    background: #f8fbfd;
}

.evaluation-summary {
    display: grid;
    grid-template-columns: repeat(3, 130px);
    gap: 10px;
}

.evaluation-summary div {
    min-height: 74px;
    padding: 12px;
    border: 1px solid #d8e4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17, 36, 52, 0.05);
}

.evaluation-summary span {
    display: block;
    color: #667f96;
    font-size: 11px;
    font-weight: 800;
}

.evaluation-summary strong {
    display: block;
    margin-top: 8px;
    color: #0f3e57;
    font-size: 24px;
    font-weight: 900;
}

.evaluation-toolbar,
.evaluation-board {
    border: 1px solid #d8e4ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(17, 36, 52, 0.05);
}

.evaluation-toolbar {
    margin-bottom: 18px;
    padding: 16px;
}

.evaluation-add-strip {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px auto;
    align-items: end;
    gap: 14px;
}

.evaluation-add-strip label {
    gap: 7px;
    color: #17364a;
    font-size: 12px;
    font-weight: 800;
}

.evaluation-add-strip input {
    min-height: 40px;
    background: #f8fbfd;
}

.icon-button-primary,
.icon-button-save,
.soft-delete-button {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 10px;
    white-space: nowrap;
}

.icon-button-primary,
.icon-button-save {
    padding: 0 18px;
    box-shadow: 0 10px 22px rgba(20, 71, 96, 0.14);
}

.icon-button-primary span,
.icon-button-save span,
.soft-delete-button span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 900;
}

.evaluation-board {
    overflow: hidden;
}

.evaluation-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #d8e4ee;
    background: #fbfdff;
}

.evaluation-board-head h2 {
    margin: 0;
    color: #071f37;
    font-size: 19px;
    font-weight: 900;
}

.evaluation-board-head p {
    margin: 5px 0 0;
    color: #5d758e;
    font-size: 13px;
}

.evaluation-table-wrap {
    overflow: auto;
}

.evaluation-table {
    min-width: 1040px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

.evaluation-table th {
    height: 42px;
    border-bottom: 1px solid #d8e4ee;
    background: #edf6fb;
    color: #17364a;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.evaluation-table td {
    height: 58px;
    border-bottom: 1px solid #e2ebf3;
    padding: 8px 12px;
    text-align: center;
}

.evaluation-table tr:last-child td {
    border-bottom: 0;
}

.evaluation-table tr.is-available td {
    background: #fbfdff;
}

.evaluation-table tr:hover td {
    background: #fff9e8;
}

.evaluation-table th:nth-child(2),
.evaluation-table td:nth-child(2) {
    width: 320px;
    text-align: left;
}

.subject-name strong {
    display: block;
    color: #17364a;
    font-size: 13px;
}

.subject-name small {
    display: block;
    margin-top: 4px;
    color: #6b8398;
    font-size: 11px;
}

.toggle-cell {
    display: inline-flex;
    justify-content: center;
}

.toggle-cell input,
.check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-cell span {
    position: relative;
    width: 42px;
    height: 24px;
    border: 1px solid #bfd0df;
    border-radius: 999px;
    background: #edf2f7;
    cursor: pointer;
}

.toggle-cell span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 36, 52, 0.18);
    transition: left .16s ease, background .16s ease;
}

.toggle-cell input:checked + span {
    border-color: #0f6b8f;
    background: #0f6b8f;
}

.toggle-cell input:checked + span::after {
    left: 21px;
}

.check-chip {
    display: inline-flex;
}

.check-chip span {
    display: inline-grid;
    min-width: 76px;
    min-height: 30px;
    place-items: center;
    border: 1px solid #ccdce8;
    border-radius: 999px;
    background: #f8fbfd;
    color: #526b84;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.check-chip input:checked + span {
    border-color: #b9e4d7;
    background: #e8f8f2;
    color: #0f6d55;
}

.slot-input {
    width: 78px;
    min-height: 34px;
    text-align: center;
    font-weight: 800;
}

.soft-delete-button {
    min-height: 34px;
    border: 1px solid #ffd0cc;
    background: #fff2f0;
    color: #b42318;
    padding: 0 12px;
    box-shadow: none;
}

.soft-delete-button:hover {
    background: #ffe5e1;
    color: #8a1f14;
}

.soft-delete-button span {
    background: #ffd8d4;
}

.status-pill {
    display: inline-grid;
    min-height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #eef3f8;
    color: #667f96;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .evaluation-hero,
    .evaluation-add-strip {
        grid-template-columns: 1fr;
    }

    .evaluation-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .evaluation-board-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.sheet-command {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d8e4ee;
}

.sheet-command h1 {
    margin: 10px 0 6px;
    color: #071f37;
    font-size: 27px;
    font-weight: 900;
}

.sheet-command p {
    margin: 0;
    color: #526b84;
    font-size: 13px;
}

.sheet-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #174c68;
    font-size: 12px;
    font-weight: 900;
}

.sheet-back span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #c9d8e4;
    border-radius: 8px;
    background: #f8fbfd;
}

.sheet-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.sheet-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid #d8e4ee;
    border-radius: 999px;
    background: #fff;
    color: #5b7288;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(17, 36, 52, 0.04);
}

.sheet-metrics strong {
    color: #0f3e57;
    font-size: 16px;
}

.sheet-card {
    margin-bottom: 16px;
    border: 1px solid #d8e4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(17, 36, 52, 0.045);
}

.sheet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #e0e9f2;
    background: #fbfdff;
}

.sheet-card-head h2 {
    margin: 0;
    color: #071f37;
    font-size: 17px;
    font-weight: 900;
}

.sheet-card-head p {
    margin: 4px 0 0;
    color: #60788d;
    font-size: 12px;
}

.sheet-add-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px auto;
    align-items: end;
    gap: 14px;
    padding: 16px 18px 18px;
}

.sheet-add-form label {
    gap: 7px;
    color: #17364a;
    font-size: 12px;
    font-weight: 900;
}

.sheet-add-form input {
    min-height: 38px;
    background: #f8fbfd;
}

.sheet-primary-button,
.sheet-save-button,
.sheet-remove-button {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 9px;
    white-space: nowrap;
}

.sheet-primary-button,
.sheet-save-button {
    padding: 0 16px;
    box-shadow: 0 9px 20px rgba(20, 71, 96, 0.13);
}

.sheet-primary-button span,
.sheet-save-button span,
.sheet-remove-button span {
    display: inline-grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 900;
}

.sheet-table-wrap {
    overflow: auto;
}

.sheet-config-table {
    min-width: 1040px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

.sheet-config-table th {
    height: 40px;
    border-bottom: 1px solid #d8e4ee;
    background: #eaf4ff;
    color: #17364a;
    font-size: 11px;
    font-weight: 900;
}

.sheet-config-table td {
    height: 56px;
    border-bottom: 1px solid #e1ebf3;
    padding: 8px 12px;
    text-align: center;
}

.sheet-config-table tr:last-child td {
    border-bottom: 0;
}

.sheet-config-table tr.row-available td {
    background: #fbfdff;
}

.sheet-config-table tr:hover td {
    background: #fff9e8;
}

.sheet-config-table th:nth-child(2),
.sheet-config-table td:nth-child(2) {
    width: 330px;
    text-align: left;
}

.sheet-subject strong {
    display: block;
    color: #17364a;
    font-size: 13px;
}

.sheet-subject small {
    display: block;
    margin-top: 3px;
    color: #6c8499;
    font-size: 11px;
}

.sheet-switch,
.sheet-chip {
    display: inline-flex;
}

.sheet-switch input,
.sheet-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sheet-switch span {
    position: relative;
    width: 40px;
    height: 22px;
    border: 1px solid #c8d8e5;
    border-radius: 999px;
    background: #eef3f8;
    cursor: pointer;
}

.sheet-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 36, 52, 0.18);
    transition: left .16s ease;
}

.sheet-switch input:checked + span {
    border-color: #0f6b8f;
    background: #0f6b8f;
}

.sheet-switch input:checked + span::after {
    left: 21px;
}

.sheet-chip span {
    display: inline-grid;
    min-width: 76px;
    min-height: 29px;
    place-items: center;
    border: 1px solid #ccdce8;
    border-radius: 999px;
    background: #f8fbfd;
    color: #526b84;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.sheet-chip input:checked + span {
    border-color: #b9e4d7;
    background: #e8f8f2;
    color: #0f6d55;
}

.sheet-slot-input {
    width: 78px;
    min-height: 34px;
    text-align: center;
    font-weight: 900;
}

.sheet-remove-button {
    min-height: 32px;
    border: 1px solid #ffd0cc;
    background: #fff2f0;
    color: #b42318;
    padding: 0 11px;
    box-shadow: none;
}

.sheet-remove-button:hover {
    background: #ffe5e1;
    color: #8a1f14;
}

.sheet-remove-button span {
    background: #ffd8d4;
}

.sheet-empty-status {
    display: inline-grid;
    min-height: 29px;
    place-items: center;
    border-radius: 999px;
    background: #eef3f8;
    color: #667f96;
    padding: 0 11px;
    font-size: 11px;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .sheet-command,
    .sheet-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sheet-metrics {
        justify-content: flex-start;
    }

    .sheet-add-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .grades-filters,
    .grade-options {
        grid-template-columns: 1fr;
    }
}

.grade-workspace {
    display: grid;
    gap: 12px;
}

.grade-title {
    padding: 6px 4px 2px;
}

.grade-title h1 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 18px;
}

.grade-title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.grade-top-filters {
    display: grid;
    grid-template-columns: 170px 220px minmax(260px, 1fr) 200px 170px 170px;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid #c9d8e4;
    border-radius: 10px;
    background: #f7fbfd;
}

.grade-top-filters label {
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.grade-top-filters select,
.grade-top-filters button {
    min-height: 36px;
}

.grade-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #c5d8ee;
    background: #dbeeff;
    color: #17364a;
}

.grade-subbar strong {
    font-size: 13px;
}

.grade-subbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.grade-subbar-controls button {
    width: auto;
    min-height: 30px;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12px;
}

.grade-subbar-controls .danger-soft {
    background: #b42318;
}

.grade-subbar-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #17364a;
    font-size: 12px;
}

.grade-subbar-controls select {
    width: 130px;
    min-height: 30px;
    padding: 3px 8px;
}

.inline-check input {
    width: 16px;
    min-height: 16px;
}

.grade-grid-wrap {
    overflow: auto;
    max-height: calc(100vh - 270px);
    border: 1px solid #c5d8ee;
    background: #fff;
}

.grade-grid {
    min-width: 1280px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
}

.grade-grid th,
.grade-grid td {
    border: 1px solid #d9e2ec;
    padding: 4px 6px;
    text-align: center;
}

.grade-grid th {
    background: #eaf4ff;
    color: #17364a;
    font-weight: 800;
}

.grade-grid th:first-child,
.grade-grid td:first-child {
    width: 48px;
}

.grade-grid th:nth-child(2),
.grade-grid td:nth-child(2) {
    width: 230px;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 1;
}

.grade-grid td:nth-child(2) {
    background: #fff;
}

.grade-grid thead th:nth-child(2) {
    z-index: 3;
    background: #eaf4ff;
}

.grade-grid tbody tr:nth-child(even) td {
    background: #f8fbff;
}

.grade-grid tbody tr:nth-child(even) td:nth-child(2) {
    background: #f8fbff;
}

.grade-grid tbody tr:hover td,
.grade-grid tbody tr:hover td:nth-child(2) {
    background: #fff8dc;
}

.grade-grid input {
    width: 62px;
    min-height: 30px;
    padding: 3px 6px;
    text-align: center;
}

.grade-grid .grade-input {
    font-weight: 700;
}

.grade-grid .grade-input.invalid-grade {
    border-color: #b42318;
    background: #fff1f0;
    color: #8a1f14;
}

.weight-pill {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 22px;
    border-radius: 4px;
    background: #e7ebef;
    color: #5f6e7c;
    font-weight: 800;
}

.weight-input {
    display: none;
    width: 58px !important;
    min-height: 24px !important;
    margin-top: 3px;
}

.editing-weights .weight-pill {
    display: none;
}

.editing-weights .weight-input {
    display: inline-block;
}

.hidden-button {
    display: none;
}

@media (max-width: 1200px) {
    .grade-top-filters {
        grid-template-columns: 1fr 1fr;
    }

    .grade-subbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .grade-subbar-controls {
        justify-content: flex-start;
    }
}

.students-table th,
.students-table td {
    padding: 7px 8px;
}

.students-table input,
.students-table select,
.students-table button {
    min-height: 30px;
    font-size: 12px;
}

.list-order {
    display: grid;
    grid-template-columns: 28px 54px 28px;
    gap: 4px;
    align-items: center;
    min-width: 126px;
}

.list-order input {
    padding: 4px 5px;
    text-align: center;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 360px;
}

.row-actions form {
    display: flex;
    gap: 4px;
}

.row-actions select {
    width: 130px;
}

.row-actions a,
.row-actions button {
    width: auto;
    padding: 0 8px;
}

.small-button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.student-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
}

.student-actions form {
    display: flex;
    align-items: end;
    gap: 8px;
}

.student-actions select {
    min-width: 220px;
}

.student-actions button {
    width: auto;
}

.student-actions-panel h2 {
    margin-bottom: 12px;
}

.student-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.student-action-buttons button {
    width: auto;
    min-width: 150px;
}

.student-action-buttons button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.student-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    background: rgba(13, 30, 47, .45);
}

.student-modal-backdrop[hidden] {
    display: none;
}

.student-modal {
    width: min(480px, calc(100vw - 36px));
    border: 1px solid #c9d8e4;
    border-top: 3px solid var(--cloud-card-line, #14b8dc);
    background: #fff;
    box-shadow: 0 18px 50px rgba(8, 27, 43, .22);
    padding: 16px;
}

.student-modal h2 {
    margin: 0 0 6px;
    color: #17364a;
    font-size: 17px;
}

.student-modal p {
    margin: 0 0 14px;
    color: #526b84;
    font-size: 12px;
    line-height: 1.45;
}

.student-modal form {
    display: grid;
    gap: 12px;
}

.student-modal label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #26394d;
    font-size: 12px;
    font-weight: 700;
}

.student-modal input,
.student-modal select {
    min-height: 32px;
}

.student-modal select[name="apoderado_id"] {
    max-width: 100%;
    font-size: 11px;
}

.student-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.student-modal-actions button,
.student-modal-actions .button-secondary {
    width: auto;
    min-width: 92px;
}

.teacher-form-panel {
    margin-bottom: 12px;
}

.teacher-form,
.guardian-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.teacher-form .full-field,
.guardian-form .full-field {
    grid-column: span 3;
}

.teacher-form textarea {
    min-height: 54px;
}

.teacher-form-actions,
.guardian-form-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

.teacher-form-actions button,
.teacher-form-actions .button-secondary,
.guardian-form-actions button,
.guardian-form-actions .button-secondary {
    width: auto;
    min-width: 140px;
}

.guardian-search-bar {
    display: grid;
    grid-template-columns: minmax(260px, 360px) auto;
    gap: 8px;
    align-items: end;
    margin: 10px 0 12px;
}

.guardian-search-bar label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #23384b;
    font-size: 11px;
    font-weight: 700;
}

.guardian-search-bar input {
    min-height: 30px;
    border-radius: 0;
}

.guardian-search-bar button,
.guardian-search-bar .button-secondary {
    width: auto;
    min-height: 30px;
    border-radius: 3px;
}

.teacher-table,
.guardian-table {
    min-width: 1120px;
    font-size: 11px;
}

.teacher-table th,
.guardian-table th {
    background: #eaf4ff;
    color: #17364a;
}

.teacher-table td,
.guardian-table td {
    vertical-align: top;
}

.teacher-table th:first-child,
.teacher-table td:first-child,
.guardian-table th:first-child,
.guardian-table td:first-child {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

.teacher-table th:nth-child(2),
.teacher-table td:nth-child(2),
.guardian-table th:nth-child(2),
.guardian-table td:nth-child(2) {
    min-width: 220px;
}

.teacher-table td:nth-child(2) small,
.teacher-table td:nth-child(3) small,
.guardian-table td small {
    display: block;
    margin-top: 3px;
    color: #64798c;
}

.teacher-table tr.is-inactive td {
    color: #6b7280;
    background: #fffdf2;
}

.teacher-actions,
.guardian-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.teacher-actions form,
.guardian-actions form {
    margin: 0;
}

.teacher-delete {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-height: 24px;
    border-radius: 50%;
    background: #e74c3c;
    padding: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 1100px) {
    .teacher-form,
    .guardian-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-form .full-field,
    .guardian-form .full-field {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .teacher-form,
    .teacher-form .full-field,
    .guardian-form,
    .guardian-form .full-field {
        grid-template-columns: 1fr;
        grid-column: auto;
    }
}

.matricula-window {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.matricula-window input,
.matricula-window select,
.matricula-window button {
    min-height: auto;
}

.matricula-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #eef8f4 0%, #d3f0e6 46%, #f6fbf8 100%);
    border-bottom: 1px solid #c7e1d8;
}

.toolbar-left,
.toolbar-actions {
    display: flex;
    align-items: center;
}

.toolbar-left {
    gap: 18px;
    color: #4b5563;
    font-size: 13px;
}

.toolbar-icon {
    font-size: 16px;
    line-height: 1;
}

.toolbar-separator {
    width: 1px;
    height: 18px;
    background: rgba(50, 71, 90, .35);
}

.toolbar-actions {
    gap: 30px;
}

.toolbar-actions a {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 58px;
    color: #111827;
    font-size: 11px;
    line-height: 1.05;
    text-align: center;
}

.toolbar-actions .action-icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #1d6f61;
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.toolbar-actions span {
    color: #1d6f61;
    font-size: 15px;
    font-weight: 700;
}

.toolbar-actions small {
    color: #111827;
}

.matricula-body {
    position: relative;
    padding: 18px 0 0;
}

.matricula-heading {
    min-height: 66px;
}

.matricula-heading h1 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 16px;
}

.heading-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 18px;
    border: 1px solid #6b7280;
    border-radius: 2px;
    color: #4b5563;
    font-size: 13px;
}

.heading-icon::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 3px solid #1f2937;
}

.matricula-heading p {
    margin-left: 2px;
    color: #6b7280;
    font-size: 11px;
}

.matricula-filters {
    position: absolute;
    top: 36px;
    right: 0;
    display: grid;
    grid-template-columns: 170px 190px 190px 0;
    align-items: center;
    gap: 10px;
    min-width: 568px;
    min-height: 36px;
    padding: 4px 9px;
    border: 1px solid #c8ddd6;
    border-radius: 8px;
    background: #f7fbf9;
    box-shadow: 0 8px 18px rgba(37, 86, 76, .08);
}

.matricula-filters label {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 6px;
    color: #767085;
    font-size: 10px;
    font-weight: 400;
}

.matricula-filters select {
    width: 100%;
    min-height: 24px;
    border: 1px solid #cfd2dc;
    border-radius: 2px;
    padding: 2px 8px;
    color: #285a52;
    font-size: 10px;
    font-weight: 700;
}

.matricula-filters button {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.matricula-filters button::before {
    content: '';
}

.search-ribbon {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 8px;
    margin: 8px 0 10px;
}

.search-ribbon > button {
    width: 150px;
    min-height: 30px;
    border: 1px solid #bed8d0;
    border-radius: 6px;
    background: #f5faf8;
    color: #285a52;
    font-size: 10px;
    font-weight: 700;
}

.search-box {
    display: grid;
    align-items: center;
    justify-self: end;
    min-width: 260px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #c8ddd6;
    border-radius: 8px;
    background: #f7fbf9;
}

.search-box label {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 4px;
    color: #606274;
    font-size: 10px;
    font-weight: 400;
}

.search-box input {
    width: 100%;
    min-height: 21px;
    border: 1px solid #cfd2dc;
    border-radius: 0;
    padding: 2px 5px;
    font-size: 11px;
}

@media (max-width: 1100px) {
    .matricula-toolbar {
        align-items: flex-start;
        gap: 12px;
    }

    .toolbar-actions {
        gap: 16px;
    }

    .matricula-filters {
        position: static;
        grid-template-columns: repeat(3, minmax(150px, 1fr)) 90px;
        min-width: 0;
        margin: 10px 0;
    }

    .matricula-filters button {
        position: static;
        width: 90px;
        height: 24px;
        opacity: 1;
        pointer-events: auto;
        border-radius: 3px;
        font-size: 11px;
    }

    .search-ribbon {
        grid-template-columns: 150px minmax(220px, 1fr);
    }
}

.matricula-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 250px);
    border-top: 1px solid #c7e1d8;
}

.matricula-table {
    min-width: 1110px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #2f3651;
    font-size: 10px;
}

.matricula-table th,
.matricula-table td {
    border: 1px solid #c5ddd6;
    padding: 5px 6px;
    text-align: center;
    vertical-align: middle;
}

.matricula-table th {
    height: 40px;
    background: #edf7f3;
    color: #315f55;
    font-size: 10px;
    font-weight: 700;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: inherit;
    line-height: 1.15;
}

.sort-link:hover {
    color: #174c68;
    text-decoration: underline;
}

.matricula-table th:nth-child(1),
.matricula-table td:nth-child(1) {
    width: 36px;
}

.matricula-table th:nth-child(2),
.matricula-table td:nth-child(2) {
    width: 45px;
}

.matricula-table th:nth-child(3),
.matricula-table td:nth-child(3) {
    width: 78px;
}

.matricula-table th:nth-child(4),
.matricula-table td:nth-child(4) {
    width: 130px;
    text-align: left;
}

.matricula-table th:nth-child(5),
.matricula-table td:nth-child(5) {
    width: 186px;
}

.matricula-table tbody tr:nth-child(even) {
    background: #f8fbfa;
}

.matricula-table tbody tr:nth-child(odd) {
    background: #fff;
}

.student-photo {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid #111827;
    border-radius: 3px;
    background: linear-gradient(135deg, #274f8f, #c6e2b5 48%, #81491e);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.student-photo-img {
    width: 32px;
    height: 32px;
    border: 2px solid #111827;
    border-radius: 3px;
    object-fit: cover;
}

.photo-preview {
    align-self: end;
}

.photo-preview img {
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.status-ok {
    color: #00bf10;
    font-size: 18px;
    line-height: 1;
}

.status-clock {
    color: #183da4;
    font-size: 15px;
}

.mini-edit,
.eye-action {
    color: #1d6f61;
    font-weight: 700;
}

.mini-edit {
    margin-left: 4px;
}

.eye-action {
    font-size: 14px;
}

@media print {
    .sidebar,
    .matricula-toolbar,
    .search-ribbon,
    .matricula-filters {
        display: none;
    }

    .shell {
        margin: 0;
        padding: 0;
    }

    .matricula-window {
        max-width: none;
        border: 0;
        box-shadow: none;
    }
}

.matricula-window {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.matricula-body {
    min-height: calc(100vh - 56px);
    padding: 20px 28px 0;
    background: #fff;
}

.matricula-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.matricula-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #c9d8e4;
    border-radius: 7px;
    background: #f7fbfd;
    color: #17364a;
    font-size: 12px;
    font-weight: 700;
}

.matricula-actions span {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #174c68;
    color: #fff;
    font-size: 11px;
}

.matricula-heading h1 {
    color: #17364a;
}

.matricula-heading p {
    color: #60798b;
}

.matricula-filters,
.search-box {
    border-color: #c9d8e4;
    background: #f7fbfd;
    box-shadow: 0 8px 18px rgba(23, 76, 104, .07);
}

.matricula-filters select {
    color: #174c68;
}

.search-ribbon > button {
    border-color: #c9d8e4;
    background: #f7fbfd;
    color: #174c68;
}

.matricula-table-wrap {
    border-top-color: #c9d8e4;
}

.matricula-table th,
.matricula-table td {
    border-color: #c9d8e4;
}

.matricula-table th {
    background: #eef6fb;
    color: #17364a;
}

.matricula-table tbody tr:nth-child(even) {
    background: #f7fbfd;
}

.mini-edit,
.eye-action {
    color: #174c68;
}

.matricula-header {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: start;
    gap: 18px;
    margin-bottom: 14px;
}

.matricula-actions {
    justify-content: flex-end;
    margin-bottom: 0;
}

.matricula-heading {
    min-height: auto;
}

.matricula-heading h1 {
    margin-bottom: 8px;
}

.matricula-filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: auto;
    margin: 0 0 12px;
    padding: 10px 12px;
}

.matricula-filters label {
    grid-template-columns: 42px 1fr;
}

.matricula-filters button {
    position: static;
    width: 86px;
    height: 28px;
    opacity: 1;
    pointer-events: auto;
    border-radius: 6px;
    background: #174c68;
    font-size: 11px;
}

@media (max-width: 1100px) {
    .matricula-header {
        grid-template-columns: 1fr;
    }

    .matricula-actions {
        justify-content: flex-start;
    }

    .matricula-filters {
        grid-template-columns: 1fr;
    }

    .matricula-filters button {
        width: 100%;
    }
}

.grades-table th,
.grades-table td {
    min-width: 120px;
}

.grades-table th:first-child,
.grades-table td:first-child {
    min-width: 230px;
    position: sticky;
    left: 0;
    background: #fff;
}

.grades-table th:first-child {
    background: #f8fafc;
}

.grades-table small {
    display: block;
    margin-top: 3px;
}

.grades-table input {
    min-width: 76px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.steps span {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdff;
}

.enrollment-steps {
    margin: 0;
}

.flash,
.error {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.flash {
    background: #e8f7ef;
    color: #17633a;
}

.error {
    background: #fff1f0;
    color: var(--danger);
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shell {
        margin-left: 0;
        padding: 18px;
    }

    .stats-grid,
    .two-columns,
    .filters,
    .compact-filters,
    .steps {
        grid-template-columns: 1fr;
    }

    fieldset {
        grid-template-columns: 1fr;
    }
}

/* Ajustes finos despues de revisar pantalla: tipografia, logo y hoja de notas. */
body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.brand {
    justify-content: center;
    height: 40px;
    padding: 4px 6px;
    overflow: hidden;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 142px;
    height: 32px;
    object-fit: contain;
}

.brand-placeholder {
    display: grid;
    width: 138px;
    height: 30px;
    place-items: center;
    border: 1px dashed #b7d7f2;
    background: #f7fbff;
    color: #228de0;
    font-size: 11px;
    font-weight: 700;
}

.topbar-title strong {
    font-size: 12px;
    font-weight: 700;
}

.topbar-title span,
.topbar-actions {
    font-size: 11px;
}

.menu-button {
    width: 46px;
    font-size: 0;
}

.menu-button::before {
    content: "";
    display: block;
    width: 16px;
    height: 2px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 5px 0 #fff, 0 -5px 0 #fff;
}

.grade-workspace {
    gap: 10px;
}

.grade-title {
    border-bottom: 2px solid var(--cloud-card-line);
    background: #fff;
    padding: 10px 12px;
}

.grade-title h1 {
    color: #202d3a;
    font-size: 18px;
    font-weight: 600;
}

.grade-title p {
    font-size: 11px;
}

.grade-top-filters {
    grid-template-columns: 170px 200px minmax(260px, 1fr) 170px 140px 150px;
    gap: 10px;
    border: 1px solid #d9e6f1;
    border-radius: 0;
    background: #f8fbfd;
    padding: 12px;
}

.grade-top-filters label {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    margin: 0;
    font-size: 11px;
}

.grade-top-filters select,
.grade-top-filters button {
    min-height: 30px;
}

.grade-subbar {
    min-height: 42px;
    border: 1px solid #cfe2f3;
    border-radius: 0;
    background: #dceeff;
    padding: 8px 10px;
}

.grade-subbar-controls {
    gap: 8px;
}

.grade-subbar-controls button {
    min-height: 30px;
    border-radius: 3px;
}

.grade-subbar-controls .danger-soft {
    background: #bf271f;
}

.grade-subbar-controls label {
    font-size: 11px;
}

.grade-subbar-controls select {
    min-height: 30px;
}

.grade-grid-wrap {
    max-height: calc(100vh - 250px);
    border: 1px solid #c6d9e9;
    background: #fff;
}

.grade-grid {
    min-width: 1220px;
    font-size: 11px;
}

.grade-grid th,
.grade-grid td {
    height: 34px;
    padding: 4px 6px;
    border-color: #d7e4ef;
}

.grade-grid th {
    background: #eaf4ff;
    color: #17364a;
    font-weight: 700;
}

.grade-grid th:nth-child(2),
.grade-grid td:nth-child(2) {
    width: 230px;
}

.grade-grid input.grade-input {
    width: 62px;
    min-height: 29px;
    border-radius: 0;
    background: #fff;
    font-weight: 500;
}

.weight-pill {
    min-width: 40px;
    height: 22px;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .grade-top-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Global product shell inspired by modern school management tools. */
:root {
    --ink: #102235;
    --muted: #607387;
    --line: #d7e0ea;
    --panel: #ffffff;
    --bg: #f6f8fb;
    --primary: #17364a;
    --primary-dark: #10283a;
    --accent: #ffc526;
    --accent-soft: #fff3bf;
    --success: #00a873;
    --danger: #d93025;
}

body {
    background: var(--bg);
    color: var(--ink);
}

.sidebar {
    width: 234px;
    background: #fff;
    color: var(--ink);
    border-right: 1px solid #dde5ee;
    padding: 24px 20px;
}

.brand {
    margin-bottom: 30px;
}

.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent);
    color: #17364a;
    font-size: 12px;
}

.brand strong {
    color: var(--ink);
}

.brand small {
    color: var(--muted);
}

.sidebar nav {
    gap: 4px;
}

.nav-label {
    display: block;
    margin: 22px 0 8px;
    color: #526b84;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 9px 10px;
    border-radius: 6px;
    color: #20364c;
    font-weight: 600;
}

.sidebar a span {
    display: grid;
    place-items: center;
    width: 18px;
    color: #17364a;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--accent-soft);
    color: #102235;
}

.logout-link {
    color: var(--danger) !important;
}

.shell {
    min-height: 100vh;
    margin-left: 234px;
    padding: 22px 24px;
    background: var(--bg);
}

.page-header {
    padding: 0 0 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid #cfdbe6;
}

.page-header h1 {
    color: var(--ink);
    font-size: 24px;
    font-weight: 800;
}

.page-header p {
    margin-bottom: 0;
    color: var(--muted);
}

.panel,
.stats-grid article,
.login-card {
    border: 1px solid #e6edf4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 53, .05);
}

.stats-grid article {
    display: grid;
    gap: 4px;
    padding: 20px;
}

.stats-grid strong {
    color: var(--ink);
    font-size: 28px;
}

input,
select,
textarea {
    border: 1px solid #c9d5e2;
    border-radius: 8px;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #174c68;
    box-shadow: 0 0 0 3px rgba(23, 76, 104, .12);
    outline: none;
}

button,
.button-secondary,
.button-warning,
.button-danger {
    border-radius: 10px;
}

button {
    background: var(--primary);
}

button:hover {
    background: var(--primary-dark);
}

.button-secondary {
    border-color: #c9d5e2;
    background: #f8fbfd;
    color: var(--ink);
}

table {
    color: #26394d;
}

th {
    background: #eef6fb;
    color: #17364a;
    font-size: 12px;
    font-weight: 800;
}

td {
    color: #24384d;
}

tr:nth-child(even) td {
    background: #fbfdff;
}

.flash {
    border: 1px solid #cbeedc;
    background: #effaf4;
    color: #17633a;
}

.error {
    border: 1px solid #ffd6d2;
    background: #fff1f0;
}

.matricula-shell {
    padding: 22px 24px;
    background: var(--bg);
}

.matricula-shell .matricula-window {
    border: 1px solid #e6edf4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 53, .05);
}

.matricula-shell .matricula-body {
    min-height: auto;
    padding: 22px;
}

@media (max-width: 900px) {
    .sidebar {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .shell {
        margin-left: 0;
        padding: 18px;
    }

    .matricula-shell {
        padding: 18px;
    }
}

/* Hoja de evaluacion: propuesta final alineada al lenguaje visual del sistema. */
.sheet-page {
    display: grid;
    gap: 16px;
}

.sheet-page .sheet-command {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 0 0 16px;
    border-bottom: 1px solid #d8e4ee;
}

.sheet-page .sheet-command h1 {
    margin: 8px 0 5px;
    color: #071f37;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 900;
}

.sheet-page .sheet-command p {
    margin: 0;
    color: #526b84;
    font-size: 13px;
}

.sheet-page .sheet-back {
    display: inline-flex;
    width: auto;
    align-items: center;
    gap: 8px;
    color: #174c68;
    font-size: 12px;
    font-weight: 900;
}

.sheet-page .sheet-back span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #c9d8e4;
    border-radius: 8px;
    background: #f8fbfd;
}

.sheet-page .sheet-overview {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.sheet-page .sheet-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
}

.sheet-page .sheet-metrics span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    border: 1px solid #d8e4ee;
    border-radius: 10px;
    background: #fff;
    color: #5b7288;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(17, 36, 52, 0.04);
}

.sheet-page .sheet-metrics strong {
    color: #0f3e57;
    font-size: 18px;
    font-weight: 900;
}

.sheet-page .sheet-add-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px auto;
    align-items: end;
    gap: 12px;
    margin: 0;
    padding: 14px;
    border: 1px solid #d8e4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(17, 36, 52, 0.045);
}

.sheet-page .sheet-add-form label {
    display: grid;
    gap: 6px;
    margin: 0;
    color: #17364a;
    font-size: 12px;
    font-weight: 900;
}

.sheet-page .sheet-add-form input {
    width: 100%;
    min-height: 38px;
    background: #f8fbfd;
}

.sheet-page .sheet-primary-button,
.sheet-page .sheet-save-button,
.sheet-page .sheet-remove-button {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 9px;
    padding: 0 15px;
    white-space: nowrap;
}

.sheet-page .sheet-primary-button,
.sheet-page .sheet-save-button {
    background: #173f56;
    color: #fff;
    box-shadow: 0 9px 20px rgba(20, 71, 96, 0.13);
}

.sheet-page .sheet-primary-button:hover,
.sheet-page .sheet-save-button:hover {
    background: #0f3044;
}

.sheet-page .sheet-primary-button span,
.sheet-page .sheet-save-button span,
.sheet-page .sheet-remove-button span {
    display: inline-grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 900;
}

.sheet-page .sheet-card {
    margin: 0;
    border: 1px solid #d8e4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(17, 36, 52, 0.045);
    overflow: hidden;
}

.sheet-page .sheet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid #e0e9f2;
    background: #fbfdff;
}

.sheet-page .sheet-card-head h2 {
    margin: 0;
    color: #071f37;
    font-size: 17px;
    font-weight: 900;
}

.sheet-page .sheet-card-head p {
    margin: 4px 0 0;
    color: #60788d;
    font-size: 12px;
}

.sheet-page .sheet-table-wrap {
    overflow: auto;
}

.sheet-page .sheet-config-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

.sheet-page .sheet-config-table th {
    height: 40px;
    border-bottom: 1px solid #d8e4ee;
    background: #eaf4ff;
    color: #17364a;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.sheet-page .sheet-config-table td {
    height: 54px;
    border-bottom: 1px solid #e1ebf3;
    padding: 8px 12px;
    color: #24384d;
    text-align: center;
}

.sheet-page .sheet-config-table tr:last-child td {
    border-bottom: 0;
}

.sheet-page .sheet-config-table tr:nth-child(even) td,
.sheet-page .sheet-config-table tr.row-available td {
    background: #fbfdff;
}

.sheet-page .sheet-config-table tr:hover td {
    background: #fff9e8;
}

.sheet-page .sheet-config-table th:nth-child(2),
.sheet-page .sheet-config-table td:nth-child(2) {
    width: 330px;
    text-align: left;
}

.sheet-page .sheet-subject strong {
    display: block;
    color: #17364a;
    font-size: 13px;
}

.sheet-page .sheet-subject small {
    display: block;
    margin-top: 3px;
    color: #6c8499;
    font-size: 11px;
    font-weight: 500;
}

.sheet-page .sheet-switch,
.sheet-page .sheet-chip {
    display: inline-flex;
    width: auto;
    min-height: auto;
    align-items: center;
    justify-content: center;
}

.sheet-page .sheet-switch input,
.sheet-page .sheet-chip input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.sheet-page .sheet-switch > span {
    position: relative;
    display: block;
    width: 40px;
    height: 22px;
    border: 1px solid #c8d8e5;
    border-radius: 999px;
    background: #eef3f8;
    cursor: pointer;
}

.sheet-page .sheet-switch > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 36, 52, 0.18);
    transition: left .16s ease;
}

.sheet-page .sheet-switch input:checked + span {
    border-color: #0f6b8f;
    background: #0f6b8f;
}

.sheet-page .sheet-switch input:checked + span::after {
    left: 21px;
}

.sheet-page .sheet-chip > span {
    display: inline-grid;
    min-width: 76px;
    min-height: 29px;
    place-items: center;
    border: 1px solid #ccdce8;
    border-radius: 999px;
    background: #f8fbfd;
    color: #526b84;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.sheet-page .sheet-chip input:checked + span {
    border-color: #b9e4d7;
    background: #e8f8f2;
    color: #0f6d55;
}

.sheet-page .sheet-slot-input {
    width: 78px;
    min-height: 34px;
    text-align: center;
    font-weight: 900;
}

.sheet-page .sheet-remove-button {
    min-height: 32px;
    border: 1px solid #ffd0cc;
    background: #fff2f0;
    color: #b42318;
    padding: 0 11px;
    box-shadow: none;
}

.sheet-page .sheet-remove-button:hover {
    background: #ffe5e1;
    color: #8a1f14;
}

.sheet-page .sheet-remove-button span {
    background: #ffd8d4;
}

.sheet-page .sheet-empty-status {
    display: inline-grid;
    min-height: 29px;
    place-items: center;
    border-radius: 999px;
    background: #eef3f8;
    color: #667f96;
    padding: 0 11px;
    font-size: 11px;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .sheet-page .sheet-command,
    .sheet-page .sheet-overview,
    .sheet-page .sheet-add-form {
        grid-template-columns: 1fr;
    }

    .sheet-page .sheet-command {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Visual institucional inspirado en sistemas escolares cloud, con identidad propia. */
:root {
    --cloud-blue: #2296e8;
    --cloud-blue-dark: #177fc8;
    --cloud-sidebar: #132236;
    --cloud-sidebar-soft: #1b314b;
    --cloud-content: #e9eef4;
    --cloud-card-line: #14b8dc;
    --cloud-text: #2b3948;
    --cloud-muted: #6b7d90;
}

body {
    background: var(--cloud-content);
    color: var(--cloud-text);
    font-family: "Arial Narrow", "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.sidebar {
    width: 164px;
    padding: 0;
    background: var(--cloud-sidebar);
    color: #c8d4e2;
    border-right: 1px solid #0b1726;
}

.brand {
    height: 40px;
    margin: 0;
    padding: 4px 8px;
    gap: 8px;
    border-bottom: 1px solid #213a59;
    background: #fff;
    color: #1f8be3;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border: 2px solid #2b9af0;
    border-radius: 50%;
    background: #fff;
    color: #2b9af0;
    font-size: 11px;
}

.brand strong {
    display: block;
    max-width: 104px;
    overflow: hidden;
    color: #238ee8;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    display: block;
    margin-top: 1px;
    color: #7aa8cd;
    font-family: Arial, sans-serif;
    font-size: 8px;
}

.sidebar nav {
    display: block;
    padding: 6px 0;
}

.nav-label {
    display: none;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 0;
    color: #c7d4e2;
    font-size: 12px;
    font-weight: 600;
}

.sidebar a span {
    display: inline-grid;
    width: 14px;
    place-items: center;
    color: #d8e4ef;
    font-size: 13px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--cloud-blue);
    color: #fff;
}

.logout-link {
    color: #ffd2cf !important;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 164px;
    z-index: 20;
    display: flex;
    align-items: center;
    height: 40px;
    background: var(--cloud-blue);
    color: #fff;
    box-shadow: 0 1px 3px rgba(10, 31, 51, .18);
}

.menu-button {
    width: 42px;
    min-height: 40px;
    border-radius: 0;
    background: transparent;
    padding: 0;
    color: #fff;
    font-size: 18px;
}

.menu-button:hover {
    background: rgba(255, 255, 255, .12);
}

.topbar-title {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.topbar-title strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-title span {
    color: #d8efff;
    font-size: 11px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 14px;
    font-size: 12px;
}

.shell {
    min-height: 100vh;
    margin-left: 164px;
    padding: 54px 14px 36px;
    background: var(--cloud-content);
}

.page-header,
.cloud-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -6px 0 10px;
    border-bottom: 2px solid var(--cloud-card-line);
    background: #fff;
    padding: 8px 10px;
}

.page-header h1,
.cloud-page-head h1 {
    margin: 0;
    color: #333f4d;
    font-size: 20px;
    font-weight: 500;
}

.page-header p,
.cloud-page-head p {
    margin: 3px 0 0;
    color: var(--cloud-muted);
    font-size: 11px;
}

.panel,
.cloud-card,
.stats-grid article,
.sheet-page .sheet-card,
.sheet-page .sheet-add-form {
    border: 1px solid #dfe7ef;
    border-top: 3px solid var(--cloud-card-line);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.panel,
.cloud-card {
    padding: 12px;
}

.cloud-card {
    margin-bottom: 12px;
}

.cloud-card-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid #edf1f5;
    padding-bottom: 8px;
}

.cloud-card-title h2 {
    margin: 0;
    color: #4a5867;
    font-size: 15px;
    font-weight: 500;
}

.cloud-card-title span {
    color: #8b9aac;
    font-size: 11px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stats-grid article {
    min-height: 88px;
    padding: 15px 16px;
    border-top: 0;
    color: #fff;
}

.stats-grid article:nth-child(1) {
    background: #ff8063;
}

.stats-grid article:nth-child(2) {
    background: #e65b93;
}

.stats-grid article:nth-child(3) {
    background: #8f6bc9;
}

.stats-grid article:nth-child(4) {
    background: #4eb8aa;
}

.stats-grid strong {
    color: #fff;
    font-size: 30px;
    line-height: 1;
}

.stats-grid span {
    color: #fff;
    font-size: 12px;
}

label {
    color: #313d4a;
    font-size: 11px;
    font-weight: 700;
}

input,
select,
textarea {
    min-height: 30px;
    border: 1px solid #d7dfe8;
    border-radius: 0;
    color: #3d4a58;
    font-size: 12px;
}

input,
select {
    padding: 5px 8px;
}

button,
.button-secondary,
.button-warning,
.button-danger,
.cloud-btn {
    min-height: 30px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
}

button,
.cloud-btn {
    border: 0;
    background: #09aeea;
    color: #fff;
    padding: 0 12px;
}

button:hover,
.cloud-btn:hover {
    background: #079bd1;
}

.button-secondary,
.cloud-btn.light {
    border: 1px solid #d7dfe8;
    background: #f7f9fb;
    color: #3f4e5f;
}

.small-button {
    min-height: 26px;
    padding: 0 9px;
}

table {
    border-collapse: collapse;
    color: #2f3f50;
    font-size: 11px;
}

th,
td {
    border: 1px solid #edf1f5;
    padding: 7px 8px;
}

th {
    background: #fff;
    color: #2f3f50;
    font-size: 11px;
    font-weight: 700;
}

tr:nth-child(even) td {
    background: #fbfcfd;
}

.flash {
    margin-bottom: 10px;
    border: 1px solid #bdebd0;
    border-left: 3px solid #00a86b;
    border-radius: 0;
    background: #effaf4;
    padding: 9px 12px;
    color: #17633a;
}

.cloud-settings {
    display: grid;
    gap: 12px;
}

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

.cloud-form-grid .full-field {
    grid-column: 1 / -1;
}

.settings-current-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}

.settings-current-grid span {
    min-height: 48px;
    border: 1px solid #d7e5f1;
    border-left: 3px solid #15aee2;
    background: #f8fbfd;
    padding: 8px 10px;
    color: #17364a;
    font-size: 12px;
    line-height: 1.3;
}

.settings-current-grid strong {
    display: block;
    margin-bottom: 3px;
    color: #526b84;
    font-size: 10px;
    text-transform: uppercase;
}

.academic-current-grid span {
    border-left-color: #00a86b;
}

.academic-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 14px;
}

.academic-rule-check {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #d7e5f1;
    background: #f8fbfd;
    padding: 10px 12px;
    color: #17364a;
    font-size: 12px;
    font-weight: 700;
}

.academic-rule-check input {
    width: 16px;
    height: 16px;
}

.academic-rule-check.full-field {
    grid-column: 1 / -1;
}

.school-logo-panel {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    margin-bottom: 14px;
}

.school-logo-preview {
    display: grid;
    width: 112px;
    height: 78px;
    place-items: center;
    border: 1px dashed #b9c8d8;
    background: #f7fbff;
}

.school-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.school-logo-preview span {
    color: #2296e8;
    font-size: 28px;
    font-weight: 800;
}

.cloud-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border: 1px solid #dfe7ef;
    background: #fff;
    padding: 10px;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .topbar {
        position: static;
        left: 0;
    }

    .shell,
    .matricula-shell {
        margin-left: 0;
        padding: 14px;
    }

    .cloud-form-grid,
    .school-logo-panel {
        grid-template-columns: 1fr;
    }
}

/* Correccion final: prioridad sobre la capa CloudSchool base. */
html body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif !important;
    letter-spacing: 0;
}

body .brand {
    justify-content: center;
    height: 40px;
    padding: 3px 6px;
    overflow: hidden;
}

body .brand-logo {
    display: block;
    width: auto;
    max-width: 150px;
    height: 34px;
    object-fit: contain;
}

body .brand-placeholder {
    display: grid;
    width: 138px;
    height: 30px;
    place-items: center;
    border: 1px dashed #b7d7f2;
    background: #f7fbff;
    color: #228de0;
    font-size: 11px;
    font-weight: 700;
}

body .brand > div,
body .brand strong,
body .brand small {
    display: none;
}

body .topbar-title strong {
    font-size: 12px;
    font-weight: 700;
}

body .topbar-title span,
body .topbar-actions {
    font-size: 11px;
}

body .menu-button {
    width: 46px;
    font-size: 0;
}

body .menu-button::before {
    content: "";
    display: block;
    width: 16px;
    height: 2px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 5px 0 #fff, 0 -5px 0 #fff;
}

body .grade-workspace {
    gap: 10px;
}

body .grade-title {
    border-bottom: 2px solid var(--cloud-card-line);
    background: #fff;
    padding: 10px 12px;
}

body .grade-title h1 {
    color: #202d3a;
    font-size: 18px;
    font-weight: 600;
}

body .grade-title p {
    font-size: 11px;
}

body .grade-top-filters {
    grid-template-columns: 170px 200px minmax(260px, 1fr) 170px 140px 150px;
    gap: 10px;
    border: 1px solid #d9e6f1;
    border-radius: 0;
    background: #f8fbfd;
    padding: 12px;
}

body .grade-top-filters label {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    margin: 0;
    font-size: 11px;
}

body .grade-top-filters select,
body .grade-top-filters button {
    min-height: 30px;
}

body .grade-subbar {
    min-height: 42px;
    border: 1px solid #cfe2f3;
    border-radius: 0;
    background: #dceeff;
    padding: 8px 10px;
}

body .grade-subbar-controls {
    gap: 8px;
}

body .grade-subbar-controls button {
    min-height: 30px;
    border-radius: 3px;
}

body .grade-subbar-controls .danger-soft {
    background: #bf271f;
}

body .grade-subbar-controls label {
    font-size: 11px;
}

body .grade-subbar-controls select {
    min-height: 30px;
}

body .grade-grid-wrap {
    max-height: calc(100vh - 250px);
    border: 1px solid #c6d9e9;
    background: #fff;
}

body .grade-grid {
    min-width: 1220px;
    font-size: 11px;
}

body .grade-grid th,
body .grade-grid td {
    height: 34px;
    padding: 4px 6px;
    border-color: #d7e4ef;
}

body .grade-grid th {
    background: #eaf4ff;
    color: #17364a;
    font-weight: 700;
}

body .grade-grid th:nth-child(2),
body .grade-grid td:nth-child(2) {
    width: 230px;
}

body .grade-grid input.grade-input {
    width: 62px;
    min-height: 29px;
    border-radius: 0;
    background: #fff;
    font-weight: 500;
}

body .grade-grid tbody tr.is-withdrawn td,
body .grade-grid tbody tr.is-withdrawn td:nth-child(2) {
    color: #5f6873;
    background: #fffdf2;
}

body .grade-grid tbody tr.is-withdrawn .grade-student-name > span {
    display: inline;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

body .grade-grid .grade-student-name small {
    display: block;
    margin-top: 2px;
    color: #a32620;
    font-size: 9px;
    font-weight: 700;
}

body .weight-pill {
    min-width: 40px;
    height: 22px;
    border-radius: 4px;
}

body .roster-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 27, 43, .42);
}

body .roster-modal-backdrop[hidden] {
    display: none;
}

body .roster-modal {
    width: min(760px, calc(100vw - 48px));
    max-height: calc(100vh - 64px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border: 1px solid #c7d9e8;
    border-top: 3px solid #14b8dc;
    background: #fff;
    box-shadow: 0 18px 54px rgba(8, 27, 43, .26);
}

body .roster-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #dce7f1;
}

body .roster-modal-header h2 {
    margin: 0;
    color: #09243a;
    font-size: 18px;
    font-weight: 800;
}

body .roster-modal-header p {
    margin: 4px 0 0;
    color: #49647d;
    font-size: 12px;
}

body .roster-modal-close {
    width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #bfd3e4;
    border-radius: 3px;
    background: #f8fbff;
    color: #17364a;
    font-size: 20px;
    line-height: 1;
}

body .roster-order-head,
body .roster-order-row {
    display: grid;
    grid-template-columns: 52px 140px minmax(0, 1fr);
    align-items: center;
}

body .roster-order-head {
    margin: 12px 18px 0;
    border: 1px solid #cbdbe8;
    border-bottom: 0;
    background: #dceeff;
    color: #17364a;
    font-size: 11px;
    font-weight: 800;
}

body .roster-order-head span {
    padding: 8px 10px;
    border-right: 1px solid #cbdbe8;
}

body .roster-order-head span:last-child {
    border-right: 0;
}

body .roster-order-list {
    margin: 0 18px;
    overflow: auto;
    border: 1px solid #cbdbe8;
    background: #fff;
}

body .roster-order-row {
    position: relative;
    min-height: 33px;
    border-bottom: 1px solid #d5dfc0;
    background: #fbfcf4;
    color: #122f43;
    font-size: 12px;
    cursor: grab;
}

body .roster-order-row:nth-child(even) {
    background: #eef2d6;
}

body .roster-order-row:last-child {
    border-bottom: 0;
}

body .roster-order-row.is-dragging {
    opacity: .55;
    outline: 2px solid #14b8dc;
}

body .roster-order-row > span {
    min-height: 33px;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-right: 1px solid #d5dfc0;
}

body .roster-order-row > span:last-of-type {
    border-right: 0;
}

body .roster-drag-handle {
    position: absolute;
    right: 8px;
    width: 22px;
    justify-content: center;
    border: 0 !important;
    color: #5f7588;
    font-size: 13px;
}

body .roster-order-number {
    justify-content: center;
    font-weight: 800;
}

body .roster-order-rut {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: .3px;
    white-space: nowrap;
}

body .roster-order-name {
    padding-right: 34px !important;
    text-transform: lowercase;
    font-weight: 700;
}

body .roster-order-name small {
    margin-left: 8px;
    color: #b42318;
    font-size: 10px;
    text-transform: uppercase;
}

body .roster-order-row.is-withdrawn .roster-order-name > span {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

body .roster-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #dce7f1;
}

body .roster-modal-actions button {
    width: auto;
    min-width: 116px;
    min-height: 32px;
    border-radius: 3px;
}

@media (max-width: 1200px) {
    body .grade-top-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Hoja de evaluacion ajustada a la linea visual CloudSchool del sistema. */
body .sheet-page {
    display: grid;
    gap: 12px;
}

body .sheet-page .sheet-command {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    border: 0;
    background: transparent;
    padding: 0 0 4px;
}

body .sheet-page .sheet-command h1 {
    margin: 8px 0 5px;
    color: #202d3a;
    font-size: 22px;
    font-weight: 600;
}

body .sheet-page .sheet-command p {
    color: #526b84;
    font-size: 12px;
}

body .sheet-page .sheet-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0f3e57;
    font-size: 12px;
    font-weight: 700;
}

body .sheet-page .sheet-back span {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd9e6;
    border-radius: 3px;
    background: #f7fbfd;
}

body .sheet-page .sheet-save-button,
body .sheet-page .sheet-primary-button {
    min-height: 30px;
    border-radius: 3px;
    background: #17445f;
    box-shadow: none;
    padding: 0 14px;
    font-size: 12px;
}

body .sheet-page .sheet-save-button:hover,
body .sheet-page .sheet-primary-button:hover {
    background: #12384e;
}

body .sheet-page .sheet-save-button span,
body .sheet-page .sheet-primary-button span {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .18);
}

body .sheet-page .sheet-overview {
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 14px;
}

body .sheet-page .sheet-metrics {
    display: grid;
    gap: 8px;
}

body .sheet-page .sheet-metrics span {
    min-height: 38px;
    border: 1px solid #d7e2ec;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    font-size: 12px;
}

body .sheet-page .sheet-metrics strong {
    font-size: 16px;
}

body .sheet-page .sheet-add-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px auto;
    align-content: end;
    align-items: end;
    gap: 12px;
    margin: 0;
    border: 1px solid #dfe7ef;
    border-top: 3px solid #14b8dc;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    padding: 52px 14px 14px;
}

body .sheet-page .sheet-add-form label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #23384b;
    font-size: 11px;
    font-weight: 700;
}

body .sheet-page .sheet-add-form input {
    min-height: 30px;
    border-radius: 0;
    background: #fff;
}

body .sheet-page .sheet-card {
    margin: 0;
    border: 1px solid #dfe7ef;
    border-top: 3px solid #14b8dc;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

body .sheet-page .sheet-card-head {
    border-bottom: 1px solid #edf1f5;
    background: #fff;
    padding: 12px 14px;
}

body .sheet-page .sheet-card-head h2 {
    color: #202d3a;
    font-size: 17px;
    font-weight: 600;
}

body .sheet-page .sheet-card-head p {
    color: #61768a;
    font-size: 12px;
}

body .sheet-page .sheet-config-table {
    min-width: 1040px;
    font-size: 11px;
}

body .sheet-page .sheet-config-table th {
    height: 38px;
    border-color: #e4ebf2;
    background: #eaf4ff;
    color: #17364a;
    font-size: 11px;
    font-weight: 700;
}

body .sheet-page .sheet-config-table td {
    height: 48px;
    border-color: #e4ebf2;
    padding: 7px 10px;
}

body .sheet-page .sheet-config-table tr:hover td {
    background: #fffbea;
}

body .sheet-page .sheet-subject strong {
    font-size: 12px;
    font-weight: 700;
}

body .sheet-page .sheet-subject small {
    font-size: 11px;
}

body .sheet-page .sheet-switch > span {
    width: 36px;
    height: 20px;
    border-color: #b9cedd;
    border-radius: 12px;
    background: #e8eff5;
}

body .sheet-page .sheet-switch > span::after {
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
}

body .sheet-page .sheet-switch input:checked + span {
    border-color: #13799d;
    background: #13799d;
}

body .sheet-page .sheet-switch input:checked + span::after {
    left: 19px;
}

body .sheet-page .sheet-chip > span {
    min-width: 76px;
    min-height: 28px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
}

body .sheet-page .sheet-slot-input {
    width: 78px;
    min-height: 30px;
    border-radius: 0;
}

body .sheet-page .sheet-remove-button {
    min-height: 30px;
    border-radius: 3px;
    padding: 0 10px;
}

body .sheet-page .sheet-remove-button span {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

body .evaluation-standard-table .subject-order-row {
    cursor: default;
}

body .evaluation-standard-table.ordering-enabled .subject-order-row {
    cursor: grab;
}

body .evaluation-standard-table .subject-order-row.is-dragging td {
    opacity: .58;
    background: #fff8dc !important;
    outline: 2px solid #14b8dc;
}

body .evaluation-standard-table .subject-drag-handle {
    display: none;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    place-items: center;
    border: 1px solid #c9d8e4;
    border-radius: 3px;
    background: #f7fbfd;
    color: #17445f;
    font-size: 12px;
    vertical-align: middle;
}

body .evaluation-standard-table.ordering-enabled .subject-drag-handle {
    display: inline-grid;
}

body .evaluation-standard-table.ordering-enabled .subject-order-row td:nth-child(2) {
    background: #f5fbff;
}

body #enableSubjectOrder {
    min-height: 30px;
    border-radius: 3px;
}

body .signature-panel {
    margin-top: 12px;
}

body .signature-preview {
    width: 180px;
    height: 72px;
    border-radius: 3px;
}

body .signature-preview img {
    object-fit: contain;
}

body .reports-head {
    align-items: center;
}

body .reports-filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
    border: 1px solid #dfe7ef;
    border-top: 3px solid #14b8dc;
    background: #fff;
    padding: 12px;
}

body .reports-filter-panel label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #23384b;
    font-size: 11px;
    font-weight: 700;
}

body .reports-filter-panel select,
body .reports-filter-panel input,
body .reports-filter-panel button {
    min-height: 31px;
    border-radius: 0;
    font-size: 11px;
}

body .report-filter-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    gap: 7px;
    align-items: end;
    min-width: min(100%, 330px);
}

body .report-filter-actions button {
    width: auto;
    white-space: nowrap;
}

body .report-filter-actions .report-print-button {
    background: #173f56;
}

body .report-filter-actions .report-print-button:hover {
    background: #102f41;
}

body .report-filter-actions .report-pdf-button {
    background: #0f8f6a;
}

body .report-filter-actions .report-pdf-button:hover {
    background: #0b7355;
}

body .reports-type-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
}

body .reports-type-grid a {
    display: grid;
    gap: 3px;
    min-height: 52px;
    border: 1px solid #dce6ef;
    border-top: 2px solid #cfe2f3;
    background: #fff;
    padding: 7px 8px;
    color: #17364a;
    text-decoration: none;
}

body .reports-type-grid a.active {
    border-top-color: #14b8dc;
    background: #f5fbff;
}

body .reports-type-grid strong {
    font-size: 11px;
    line-height: 1.2;
}

body .reports-type-grid span {
    color: #60788d;
    font-size: 10px;
    line-height: 1.25;
}

body .report-paper {
    border: 1px solid #dfe7ef;
    border-top: 3px solid #14b8dc;
    background: #fff;
    padding: 16px;
}

body .report-letterhead {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid #e4ecf3;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

body .report-letterhead img {
    max-width: 90px;
    max-height: 62px;
    object-fit: contain;
}

body .report-letterhead h2 {
    margin: 0 0 4px;
    color: #202d3a;
    font-size: 20px;
}

body .report-letterhead p {
    margin: 2px 0;
    color: #526b84;
    font-size: 12px;
}

body .report-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

body .report-summary-cards span {
    display: grid;
    gap: 3px;
    border: 1px solid #dce6ef;
    background: #f8fbfd;
    padding: 10px;
    color: #526b84;
    font-size: 11px;
}

body .report-summary-cards strong {
    color: #17364a;
    font-size: 18px;
}

body .report-student-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 12px;
    color: #17364a;
}

body .report-student-title span {
    color: #526b84;
    font-size: 12px;
}

body .report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

body .report-table th,
body .report-table td {
    border: 1px solid #dfe7ef;
    padding: 7px 8px;
    vertical-align: top;
}

body .report-table th {
    background: #eaf4ff;
    color: #17364a;
    font-weight: 800;
}

body .compact-report-table {
    min-width: 980px;
}

body .grade-token {
    display: inline-block;
    margin: 0 4px 4px 0;
    border: 1px solid #d7e2ec;
    background: #f8fbfd;
    padding: 3px 5px;
}

body .status-pill {
    display: inline-grid;
    min-width: 76px;
    place-items: center;
    border-radius: 12px;
    padding: 3px 8px;
    background: #e8f8f2;
    color: #0f6d55;
    font-weight: 800;
}

body .status-pill.en-riesgo {
    background: #fff4d6;
    color: #946200;
}

body .status-pill.reprobado {
    background: #fff2f0;
    color: #b42318;
}

body .report-observations,
body .report-empty {
    margin-top: 14px;
    border: 1px solid #dfe7ef;
    background: #f8fbfd;
    padding: 12px;
    color: #526b84;
    font-size: 12px;
}

body .report-signature {
    display: flex;
    justify-content: flex-end;
    margin-top: 42px;
}

body .report-signature div {
    width: 250px;
    text-align: center;
    color: #17364a;
}

body .report-signature img {
    display: block;
    width: 234px;
    height: 91px;
    margin: 0 auto 4px;
    object-fit: contain;
}

body .report-signature span {
    display: block;
    border-top: 1px solid #17364a;
    padding-top: 5px;
    font-size: 12px;
}

body .report-signature strong {
    display: block;
    margin-top: 2px;
    font-size: 11px;
}

body .report-certificate {
    max-width: 980px;
    min-height: 720px;
    margin: 0 auto;
    border: 0;
    background: #fff;
    padding: 26px 46px 34px;
    color: #595b60;
    font-family: "Times New Roman", Times, serif;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .06);
}

body .certificate-head {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    align-items: center;
    margin-bottom: 14px;
}

body .certificate-head-template {
    display: none;
}

body .certificate-logo {
    display: flex;
    justify-content: center;
}

body .certificate-logo img {
    width: 146px;
    height: 146px;
    object-fit: contain;
}

body .certificate-title {
    grid-column: 2;
    text-align: center;
}

body .certificate-title h2 {
    margin: 0;
    color: #595b60;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
}

body .certificate-title p {
    margin: 2px 0;
    color: #595b60;
    font-size: 11px;
}

body .certificate-student-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    margin: 10px 0 16px;
    border-radius: 5px;
    background: #f2f2f2;
    padding: 10px 14px;
    color: #515151;
    font-size: 10.5px;
    line-height: 1.35;
}

body .certificate-academic-alert {
    display: grid;
    gap: 7px;
    margin: 0 0 10px;
    border: 1px solid #ffd596;
    border-left: 4px solid #c98200;
    background: #fff8e8;
    padding: 9px 12px;
    color: #5b4308;
    font-size: 11px;
    line-height: 1.35;
}

body .certificate-academic-alert.is-applied {
    border-color: #bfe8d2;
    border-left-color: #00a86b;
    background: #effaf4;
    color: #17633a;
}

body .certificate-academic-alert form {
    margin: 0;
}

body .certificate-academic-alert button {
    width: fit-content;
    min-height: 30px;
    border: 0;
    background: #17364a;
    padding: 0 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

body .certificate-notes-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Times New Roman", Times, serif;
    font-size: 9px;
    color: #595b60;
}

body .certificate-notes-table th,
body .certificate-notes-table td {
    height: 16px;
    border: 1px solid #c9c9c9;
    padding: 2px 4px;
    text-align: center;
    vertical-align: middle;
}

body .certificate-notes-table th {
    background: #fff;
    color: #595b60;
    font-weight: 700;
}

body .certificate-notes-table td:first-child,
body .certificate-notes-table th:first-child {
    text-align: left;
}

body .certificate-notes-table td:not(:first-child) {
    color: #595b60;
    font-weight: 700;
}

body .certificate-notes-table .grade-low,
body .certificate-notes-table td.grade-low,
body .certificate-notes-table .status-risk {
    color: #f00 !important;
}

body .certificate-notes-table .grade-normal,
body .certificate-notes-table td.grade-normal {
    color: #00f !important;
}

body .certificate-notes-table .certificate-status-cell.grade-normal {
    color: #595b60 !important;
}

body .certificate-notes-table .student-name-cell {
    color: #595b60 !important;
}

body .certificate-notes-table .certificate-subject-cell {
    color: #595b60 !important;
    font-weight: 400;
}

body .certificate-notes-table .certificate-text-cell,
body .certificate-notes-table .certificate-course-subject-head {
    color: #595b60 !important;
}

body .certificate-notes-table .certificate-left-cell {
    text-align: left;
}

body .certificate-notes-table .certificate-average-row td {
    color: #595b60;
    background: #f7f7f7;
    text-align: right;
}

body .certificate-notes-table .certificate-average-row td:last-child {
    text-align: center;
}

body .certificate-course-table {
    font-size: 9px;
}

body .certificate-course-table th,
body .certificate-course-table td {
    height: 19px;
}

body .report-course-view {
    max-width: min(100%, 1120px);
    padding: 22px 24px 30px;
}

body .certificate-course-summary-table {
    table-layout: fixed;
    width: 100%;
    font-size: 8.4px;
}

body .certificate-course-summary-table th,
body .certificate-course-summary-table td {
    height: 17px;
    padding: 1px 2px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

body .certificate-course-summary-table th {
    font-size: 7.6px;
}

body .certificate-course-summary-table th:first-child,
body .certificate-course-summary-table td:first-child {
    width: 24px;
    text-align: center;
}

body .certificate-course-summary-table th:nth-child(2),
body .certificate-course-summary-table td:nth-child(2) {
    width: 150px;
    text-align: left;
}

body .certificate-risk-table {
    table-layout: fixed;
    font-size: 9.5px;
}

body .certificate-risk-table th,
body .certificate-risk-table td {
    height: 18px;
    line-height: 1.12;
}

body .certificate-risk-table th:first-child,
body .certificate-risk-table td:first-child {
    width: 98px;
}

body .certificate-risk-table th:nth-child(2),
body .certificate-risk-table td:nth-child(2) {
    width: 28px;
    text-align: center;
}

body .certificate-risk-table th:nth-child(4),
body .certificate-risk-table td:nth-child(4) {
    width: 54px;
    text-align: center;
}

body .certificate-risk-table th:nth-child(5),
body .certificate-risk-table td:nth-child(5) {
    width: 88px;
    text-align: center;
}

body .certificate-risk-table .risk-subject-chip {
    display: inline-block;
    margin: 1px 5px 1px 0;
    color: #f00;
    font-weight: 700;
}

body .certificate-course-summary-table th:nth-last-child(2),
body .certificate-course-summary-table td:nth-last-child(2) {
    width: 36px;
}

body .report-course-view .certificate-course-summary-table th:nth-last-child(2),
body .report-course-view .certificate-course-summary-table td:nth-last-child(2) {
    width: auto;
}

body .certificate-course-summary-table th:last-child,
body .certificate-course-summary-table td:last-child {
    width: 58px;
}

body .report-course-view .certificate-course-summary-table th:last-child,
body .report-course-view .certificate-course-summary-table td:last-child {
    width: 36px;
}

@media screen {
    body .report-course-view {
        max-width: none;
        overflow-x: hidden;
        padding: 24px 28px 32px;
    }

    body .certificate-course-summary-table {
        width: 100%;
        min-width: 0;
        font-size: 9.4px;
    }

    body .certificate-course-summary-table th {
        font-size: 7.8px;
    }

    body .certificate-course-summary-table th,
    body .certificate-course-summary-table td {
        height: 20px;
        padding: 2px 3px;
        line-height: 1.08;
    }

    body .certificate-course-summary-table th:nth-child(2),
    body .certificate-course-summary-table td:nth-child(2) {
        width: 150px;
    }
}

body .certificate-notes {
    margin-top: 12px;
    color: #595b60;
    font-size: 9.5px;
    line-height: 1.35;
}

body .certificate-notes p {
    margin: 2px 0;
}

body .certificate-observations {
    margin-top: 16px;
    min-height: 54px;
    color: #595b60;
    font-size: 9.5px;
}

body .certificate-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 110px;
    align-items: end;
    margin: 58px 70px 0;
}

body .certificate-signatures div {
    display: grid;
    grid-template-rows: 95px 1px auto;
    align-items: end;
    min-height: 92px;
    text-align: center;
    color: #555;
    font-size: 11px;
}

body .certificate-signatures img {
    display: block;
    max-width: 234px;
    height: 91px;
    object-fit: contain;
    margin: 0 auto;
}

body .certificate-signatures .signature-image-space {
    display: block;
    height: 91px;
    border: 0;
}

body .certificate-signatures span {
    display: block;
    border-top: 1px solid #555;
}

body .certificate-signatures strong {
    display: block;
    margin-top: 5px;
}

body .certificate-student-report {
    break-inside: avoid;
}

body .certificate-student-report:not(:last-child) {
    margin-bottom: 42px;
}

@media (max-width: 1280px) {
    body .reports-filter-panel,
    body .reports-type-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body .reports-filter-panel,
    body .reports-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    body .sidebar,
    body .topbar,
    body .reports-head,
    body .reports-filter-panel,
    body .reports-type-grid {
        display: none !important;
    }

    body .certificate-student-report {
        break-after: page;
        page-break-after: always;
    }

    body .certificate-student-report:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    body .shell {
        margin: 0;
        padding: 0;
    }

    body .report-paper {
        border: 0;
        padding: 0;
        box-shadow: none;
        max-width: none;
    }

    body .certificate-notes-table .certificate-subject-cell {
        color: #595b60 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body .certificate-notes-table .certificate-text-cell,
    body .certificate-notes-table .certificate-course-subject-head {
        color: #595b60 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body .certificate-notes-table .certificate-left-cell {
        text-align: left;
    }

    body .report-admin-only {
        display: none !important;
    }
}

/* Hoja de evaluacion en estilo estandar del sistema. */
.evaluation-summary-panel {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: end;
}

.sheet-summary-inline {
    display: grid;
    gap: 8px;
}

.sheet-summary-inline span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    border: 1px solid #d7dfe8;
    background: #fbfdff;
    padding: 0 10px;
    color: #526b84;
    font-size: 11px;
    font-weight: 700;
}

.sheet-summary-inline strong {
    color: #17364a;
    font-size: 14px;
}

.evaluation-add-standard {
    grid-template-columns: minmax(260px, 1fr) 150px 170px;
    gap: 12px;
    align-items: end;
}

.evaluation-add-standard button {
    min-height: 30px;
}

.evaluation-standard-table th,
.evaluation-standard-table td {
    vertical-align: middle;
}

.evaluation-standard-table td:nth-child(2) {
    text-align: left;
}

.evaluation-standard-table td:nth-child(2) strong {
    display: block;
    color: #17364a;
    font-size: 12px;
}

.evaluation-standard-table td:nth-child(2) small {
    display: block;
    margin-top: 2px;
    color: #6b7d90;
    font-size: 10px;
}

.evaluation-standard-table input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
}

.evaluation-standard-table input[type="number"] {
    width: 78px;
    min-height: 28px;
    text-align: center;
}

.evaluation-standard-table .button-danger {
    width: auto;
    min-height: 26px;
    background: #e74c3c;
}

@media (max-width: 1000px) {
    .evaluation-summary-panel,
    .evaluation-add-standard {
        grid-template-columns: 1fr;
    }
}

body .evaluation-add-standard {
    grid-template-columns: minmax(320px, 1fr) 170px;
}

body .evaluation-standard-table input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
}

.course-working-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    border-left: 3px solid #14b8dc;
    background: #eef8fc;
    color: #36576e;
    padding: 6px 10px;
    font-size: 12px;
}

.course-working-badge strong {
    color: #07344d;
}

.course-working-badge span {
    color: #6b7d90;
}

.system-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(13, 30, 47, .45);
}

.system-modal {
    width: min(420px, calc(100vw - 36px));
    border: 1px solid #c9d8e4;
    border-top: 3px solid #14b8dc;
    background: #fff;
    box-shadow: 0 18px 50px rgba(8, 27, 43, .22);
    padding: 18px;
}

.system-modal h2 {
    margin: 0 0 8px;
    color: #17364a;
    font-size: 17px;
    font-weight: 700;
}

.system-modal p {
    margin: 0 0 16px;
    color: #42566a;
    font-size: 13px;
    line-height: 1.45;
}

.system-modal button {
    display: block;
    width: auto;
    min-width: 92px;
    margin-left: auto;
}

/* Registro de matriculas: misma linea visual global, conservando su estructura. */
body .shell > .matricula-window.cloud-card {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 1px solid #dfe7ef;
    border-top: 3px solid var(--cloud-card-line);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
}

body .matricula-window .matricula-body {
    min-height: auto;
    padding: 12px;
}

body .matricula-window .matricula-header {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin: 0 0 12px;
    border-bottom: 2px solid var(--cloud-card-line);
    padding: 0 0 10px;
}

body .matricula-window .matricula-heading h1 {
    margin: 0;
    color: #333f4d;
    font-size: 19px;
    font-weight: 600;
}

body .matricula-window .matricula-heading p {
    margin: 4px 0 0;
    color: var(--cloud-muted);
    font-size: 11px;
}

body .matricula-window .matricula-actions {
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
}

body .matricula-window .matricula-actions a {
    min-height: 30px;
    border: 1px solid #cfdde9;
    border-radius: 3px;
    background: #f8fbfd;
    color: #17364a;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
}

body .matricula-window .matricula-actions span {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background: #17445f;
    color: #fff;
}

body .matricula-window .matricula-action-icon,
body .matricula-window .button-symbol {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    line-height: 1;
    font-size: 13px;
    font-weight: 800;
}

body .matricula-window .matricula-filters {
    position: static;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) 86px;
    gap: 10px;
    width: 100%;
    margin: 0 0 10px;
    border: 1px solid #d9e6f1;
    border-radius: 0;
    background: #f8fbfd;
    padding: 12px;
}

body .matricula-window .matricula-filters label {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    margin: 0;
    color: #526b84;
    font-size: 11px;
    font-weight: 600;
}

body .matricula-window .matricula-filters select,
body .matricula-window .search-box input {
    min-height: 30px;
    border-radius: 0;
    background: #fff;
    color: #17364a;
    font-size: 11px;
}

body .matricula-window .matricula-filters button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: static;
    width: auto;
    min-height: 30px;
    border-radius: 3px;
    background: #17445f;
    font-size: 12px;
}

body .matricula-window .search-ribbon {
    display: grid;
    grid-template-columns: 150px minmax(240px, 280px);
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
}

body .matricula-window .search-ribbon > button,
body .matricula-window .search-box {
    min-height: 30px;
    border: 1px solid #cfdde9;
    border-radius: 3px;
    background: #f8fbfd;
}

body .matricula-window .search-ribbon > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #17364a;
    font-size: 11px;
    font-weight: 700;
}

body .matricula-window .search-box {
    padding: 5px 10px;
}

body .matricula-window .search-box label {
    grid-template-columns: 42px minmax(0, 1fr);
    margin: 0;
    color: #526b84;
    font-size: 11px;
}

body .matricula-window .matricula-table-wrap {
    max-height: calc(100vh - 268px);
    border: 1px solid #c6d9e9;
    border-top: 0;
    background: #fff;
}

body .matricula-window .matricula-table {
    min-width: 1170px;
    font-size: 10px;
}

body .matricula-window .matricula-table th,
body .matricula-window .matricula-table td {
    border-color: #d7e4ef;
    padding: 5px 6px;
}

body .matricula-window .matricula-table th {
    height: 38px;
    background: #eaf4ff;
    color: #17364a;
    font-weight: 700;
}

body .matricula-window .matricula-table tbody tr:nth-child(even) {
    background: #f8fbfd;
}

body .matricula-window .matricula-table tbody tr:hover {
    background: #fffbea;
}

body .matricula-window .matricula-table tbody tr.is-withdrawn td {
    color: #5f6873;
    background: #fffdf2;
}

body .matricula-window .matricula-table tbody tr.is-withdrawn .student-name-cell > span {
    display: inline;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

body .matricula-window .student-name-cell small {
    display: block;
    margin-top: 3px;
    color: #a32620;
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

body .matricula-window .status-withdrawn {
    color: #a32620;
    font-size: 10px;
    font-weight: 700;
}

body .matricula-window .mini-edit {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    border: 1px solid #cfdde9;
    border-radius: 50%;
    background: #f8fbfd;
    color: #17445f;
    font-size: 11px;
    text-decoration: none;
}

body .matricula-window .eye-action {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    border: 1px solid #b7cfe0;
    border-radius: 50%;
    background: #eaf4ff;
    color: #17445f;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

body .matricula-window .eye-action:hover,
body .matricula-window .mini-edit:hover {
    border-color: #17445f;
    background: #17445f;
    color: #fff;
}

@media (max-width: 1100px) {
    body .matricula-window .matricula-header,
    body .matricula-window .matricula-filters,
    body .matricula-window .search-ribbon {
        grid-template-columns: 1fr;
    }

    body .matricula-window .matricula-actions {
        justify-content: flex-start;
    }
}

.sidebar .settings-nav { margin: 0; }
.sidebar .settings-nav > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    color: #dbe8f4;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.sidebar .settings-nav > summary::-webkit-details-marker { display: none; }
.sidebar .settings-nav > summary::after { content: '+'; margin-left: auto; }
.sidebar .settings-nav[open] > summary::after { content: '-'; }
.sidebar .settings-nav > summary:hover,
.sidebar .settings-nav > summary.active { background: #1b314b; color: #fff; }
.sidebar .settings-submenu a { display: block; padding-left: 32px; font-size: 11px; }
.sidebar .settings-submenu a.audit-link { display: block !important; visibility: visible !important; }
.audit-context,.audit-new-change,.audit-old-change { margin-top: 5px; font-size: 11px; color: #40546b; }
.audit-new-change pre,.audit-old-change pre { display: inline; margin: 0 0 0 4px; white-space: pre-wrap; font: inherit; color: #172a40; }
.audit-table { table-layout: fixed; min-width: 760px; }
.audit-table th:nth-child(1) { width: 145px; }
.audit-table th:nth-child(2) { width: 170px; }
.audit-table th:nth-child(3) { width: 150px; }
.audit-table th:nth-child(4) { width: auto; }
.audit-table td { vertical-align: top; overflow-wrap: anywhere; }
.audit-detail-box { display: block; width: 100%; min-height: 80px; padding: 10px 14px; box-sizing: border-box; border: 1px solid #cbd9e7; background: #f8fbff; border-radius: 4px; }
.audit-detail-grid { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr); gap: 18px; margin-top: 8px; }
.audit-detail-grid .audit-new-change { margin-top: 5px; padding-left: 18px; border-left: 1px solid #cbd9e7; }
.audit-detail-grid .audit-old-change { color: #64748b; }
@media (max-width: 900px) { .audit-detail-grid { grid-template-columns: 1fr; gap: 8px; } .audit-detail-grid .audit-new-change { padding-left: 0; border-left: 0; border-top: 1px solid #cbd9e7; padding-top: 8px; } }

body .certificate-ranking-table { table-layout: fixed; font-size: 12px; }
body .certificate-ranking-table th,body .certificate-ranking-table td { padding: 6px; overflow-wrap: anywhere; }
body .certificate-ranking-table th:first-child { width: 55px; }
body .certificate-ranking-table th:nth-child(2) { width: 45px; }
body .certificate-ranking-table th:last-child { width: 110px; }
@media screen and (max-width: 700px) {
    body .report-ranking-view { padding: 18px 14px; min-height: 0; }
    body .report-ranking-view .certificate-head { grid-template-columns: minmax(0,1fr); gap: 12px; }
    body .report-ranking-view .certificate-title { grid-column: 1; }
    body .report-ranking-view .certificate-logo img { width: 140px; height: 62px; }
    body .report-ranking-view .certificate-student-box { grid-template-columns: minmax(0,1fr); gap: 4px; }
    body .certificate-ranking-table th:first-child { width: 48px; white-space: nowrap; }
    body .certificate-ranking-table th:nth-child(2) { width: 28px; }
    body .certificate-ranking-table th:last-child { width: 76px; }
}
