:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --field: #ffffff;
    --table-head: #eef3f5;
    --sheet-head: #eaf0f3;
    --sheet-final: #fff8e6;
    --explain-bg: #eef8f6;
    --explain-ink: #16483f;
    --explain-line: #c8e8e0;
    --ink: #18212f;
    --muted: #667085;
    --line: #d9e0e8;
    --accent: #176b5b;
    --accent-2: #0f8a9d;
    --warn: #a64f00;
    --bad: #b42318;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111827;
    --panel: #182230;
    --field: #101828;
    --table-head: #202b3a;
    --sheet-head: #202b3a;
    --sheet-final: #2f2a18;
    --explain-bg: #12342f;
    --explain-ink: #d8fff5;
    --explain-line: #216558;
    --ink: #f3f6fb;
    --muted: #b6c2d1;
    --line: #344154;
    --accent: #25a98f;
    --accent-2: #39bfd1;
    --warn: #f2a23a;
    --bad: #ff8f83;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
body.nav-loading::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 4px;
    z-index: 10000;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
    background-size: 200% 100%;
    animation: navLoading 1s linear infinite;
}
body.nav-loading::after {
    content: "Cargando...";
    position: fixed;
    top: 10px;
    right: 14px;
    z-index: 10000;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0,0,0,.16);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    padding: 7px 12px;
}
@keyframes navLoading {
    from { background-position: 0 0; }
    to { background-position: 200% 0; }
}
a { color: inherit; text-decoration: none; }
button, .button {
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--ink);
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}
.install-button, .sidebar-button {
    width: 100%;
    background: transparent;
    border-color: rgba(255,255,255,.25);
    color: #d7dee8;
    margin-top: 2px;
    font-size: 13px;
    min-height: 34px;
}
.install-button:hover, .sidebar-button:hover { background: rgba(255,255,255,.08); }
button.primary, .button.primary, .primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
    background: var(--field);
    color: var(--ink);
}
textarea { resize: vertical; min-height: 78px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
label input, label select, label textarea { color: var(--ink); }
.check-line {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}
.check-line input {
    width: auto;
}
.check-grid {
    display: grid;
    gap: 6px;
    min-width: 220px;
}

@media print {
    @page {
        size: legal landscape;
        margin: 8mm;
    }
    body:not(.print-bulletin-only) {
        background: #fff !important;
        color: #0d1726 !important;
    }
    body:not(.print-bulletin-only) .main {
        margin: 0 !important;
        padding: 0 !important;
    }
    body:not(.print-bulletin-only) .main > .panel:not(.report-panel),
    body:not(.print-bulletin-only) .report-suggestion-strip,
    body:not(.print-bulletin-only) .pager {
        display: none !important;
    }
    body:not(.print-bulletin-only) .report-panel {
        border: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body:not(.print-bulletin-only) .coord-report-title {
        border-bottom: 1.5px solid #176b5b !important;
        margin: 0 0 6px !important;
        padding-bottom: 5px !important;
    }
    body:not(.print-bulletin-only) .coord-report-title strong {
        display: block !important;
        font-size: 12px !important;
        line-height: 1.1 !important;
    }
    body:not(.print-bulletin-only) .coord-report-title span,
    body:not(.print-bulletin-only) .coord-report-title small {
        display: block !important;
        font-size: 8px !important;
        line-height: 1.1 !important;
    }
    body:not(.print-bulletin-only) .report-panel h2 {
        font-size: 10px !important;
        margin: 4px 0 5px !important;
    }
    body:not(.print-bulletin-only) .report-print-group-page {
        break-after: page;
        page-break-after: always;
        margin: 0 !important;
    }
    body:not(.print-bulletin-only) .report-print-group-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }
    body:not(.print-bulletin-only) .report-print-group-page h3 {
        font-size: 10px !important;
        margin: 0 0 5px !important;
    }
    body:not(.print-bulletin-only) .report-table-wrap,
    body:not(.print-bulletin-only) .table-wrap {
        border: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    body:not(.print-bulletin-only) .coord-report-table,
    body:not(.print-bulletin-only) .coord-report-table thead,
    body:not(.print-bulletin-only) .coord-report-table tbody,
    body:not(.print-bulletin-only) .coord-report-table tr,
    body:not(.print-bulletin-only) .coord-report-table th,
    body:not(.print-bulletin-only) .coord-report-table td {
        visibility: visible !important;
    }
    body:not(.print-bulletin-only) .coord-report-table {
        border-collapse: collapse !important;
        display: table !important;
        font-size: 7.4px !important;
        line-height: 1.05 !important;
        min-width: 0 !important;
        table-layout: auto !important;
        width: 100% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table thead {
        display: table-header-group !important;
    }
    body:not(.print-bulletin-only) .coord-report-table tbody {
        display: table-row-group !important;
    }
    body:not(.print-bulletin-only) .coord-report-table tr {
        border: 0 !important;
        border-radius: 0 !important;
        display: table-row !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
    }
    body:not(.print-bulletin-only) .coord-report-table th,
    body:not(.print-bulletin-only) .coord-report-table td {
        border: 1px solid #aab5c3 !important;
        display: table-cell !important;
        padding: 2px 3px !important;
        text-align: center !important;
        vertical-align: top !important;
        width: auto !important;
    }
    body:not(.print-bulletin-only) .coord-report-table th {
        background: #edf4f6 !important;
        border-bottom: 1.5px solid #176b5b !important;
        color: #42526b !important;
        font-weight: 700 !important;
    }
    body:not(.print-bulletin-only) .coord-report-table td[data-label*="alumno"],
    body:not(.print-bulletin-only) .coord-report-table td[data-label*="Alumno"],
    body:not(.print-bulletin-only) .coord-report-table td[data-label*="Estudiante"],
    body:not(.print-bulletin-only) .coord-report-table td[data-label*="estudiante"] {
        text-align: left !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso th:first-child,
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso td:first-child {
        width: 5% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-all-groups th:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-all-groups td:nth-child(2) {
        width: 9% !important;
        white-space: nowrap !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-all-groups th:nth-child(3),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-all-groups td:nth-child(3),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-single-group th:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso.report-single-group td:nth-child(2) {
        text-align: left !important;
        width: 34% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso th:last-child,
    body:not(.print-bulletin-only) .coord-report-table.report-lista_multiuso td:last-child {
        text-align: left !important;
        width: 52% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-lista_clase th:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_clase td:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_clase th:nth-child(3),
    body:not(.print-bulletin-only) .coord-report-table.report-lista_clase td:nth-child(3) {
        text-align: left !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(1),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(1) {
        text-align: left !important;
        width: 34% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(2),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(4),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(4),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(5),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(5),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(6),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(6) {
        width: 8% !important;
        white-space: nowrap !important;
    }
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones th:nth-child(3),
    body:not(.print-bulletin-only) .coord-report-table.report-listado_nivelaciones td:nth-child(3) {
        text-align: left !important;
        width: 34% !important;
    }
    body:not(.print-bulletin-only) .coord-report-table td::before,
    body:not(.print-bulletin-only) .coord-report-table th::before {
        content: none !important;
        display: none !important;
    }
}
.check-grid label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 0;
}
.check-grid input[type="checkbox"] {
    width: auto;
    min-width: 16px;
    height: 16px;
    margin: 0;
}
.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 16px 0 10px;
}
.wizard-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: var(--ink);
    text-decoration: none;
}
.wizard-step.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.wizard-step-number {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(23, 107, 91, .12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}
.wizard-step.active .wizard-step-number {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}
.wizard-arrow {
    color: var(--muted);
    font-weight: 800;
}
.wizard-bottom-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 24px;
}
.sede-checks-form {
    display: grid;
    gap: 10px;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #101820;
    color: #fff;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.32) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.28);
    border-radius: 999px;
}
.brand { font-size: 24px; font-weight: 800; }
.who { display: grid; gap: 4px; color: #d7dee8; }
.who strong { color: #fff; }
.who span, .who small { font-size: 13px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    color: #edf2f7;
}
.sidebar nav a:hover { background: rgba(255,255,255,.1); }
.sidebar nav a.is-current {
    background: rgba(255,255,255,.12);
}
.sidebar nav .nav-section {
    margin: 4px 0;
}
.sidebar nav .nav-section-title {
    align-items: center;
    color: rgba(237,242,247,.72);
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: space-between;
    letter-spacing: .04em;
    padding: 10px 12px 4px;
    text-transform: uppercase;
    user-select: none;
}
.sidebar nav .nav-section-title::-webkit-details-marker {
    display: none;
}
.sidebar nav .nav-section-title::after {
    content: ">";
    font-size: 14px;
    line-height: 1;
    transition: transform .16s ease;
}
.sidebar nav details[open] > .nav-section-title::after {
    transform: rotate(90deg);
}
.sidebar nav .nav-submenu {
    border-left: 1px solid rgba(255,255,255,.16);
    display: grid;
    gap: 4px;
    margin-left: 10px;
    padding-left: 8px;
}
.sidebar nav .nav-submenu a {
    font-size: 14px;
    padding: 8px 10px;
}
.sidebar nav a.nav-pending {
    background: var(--accent);
    color: #fff;
}
.nav-badge,
.mobile-menu-badge {
    align-items: center;
    background: #f59e0b;
    border-radius: 999px;
    color: #111827;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    padding: 0 6px;
}
.sidebar.nav-locked nav a:not(.nav-pending) {
    opacity: .48;
    pointer-events: none;
}
.sidebar.nav-locked .sidebar-button,
.sidebar.nav-locked .install-button {
    opacity: .48;
    pointer-events: none;
}
.main {
    margin-left: 260px;
    padding: 28px;
    min-height: 100vh;
}
.topbar { margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 28px; }
.mobile-menu-button {
    display: none;
}
.mobile-menu-badge {
    box-shadow: 0 0 0 2px var(--bg);
    position: absolute;
    right: -6px;
    top: -7px;
}

.panel, .sheet-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}
.panel h2 { margin: 0 0 12px; font-size: 19px; }
.panel p { color: var(--muted); line-height: 1.45; }
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.section-heading h2,
.section-heading p {
    margin: 0 0 6px;
}
.button.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.card span { display: block; color: var(--muted); margin-bottom: 6px; }
.card strong { font-size: 24px; }
.metric { display: grid; gap: 8px; }
.metric span { color: var(--muted); }
.metric strong { font-size: 30px; }
.form-grid { display: grid; gap: 12px; }
.filters-form {
    display: grid;
    grid-template-columns: 1.4fr .8fr .7fr .8fr auto auto;
    gap: 10px;
    align-items: end;
}
.report-print-option {
    align-self: center;
    grid-column: 1 / -1;
}
.inline-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.4fr auto;
    gap: 10px;
    align-items: end;
}
.inline-action-form { display: inline-flex; margin: 0; }
.actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filters-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}
.soft-separator {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}
.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.subpanel {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}
.subpanel h3 { margin: 0; }
.stacked-list { display: grid; gap: 12px; }
.stack-form { display: grid; gap: 10px; }
.stack-form textarea { min-height: 96px; }
.secretary-document .print-sheet {
    background: #fff;
    color: #101828;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.document-letterhead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    border-bottom: 2px solid #176b5b;
    padding-bottom: 12px;
    margin-bottom: 18px;
}
.document-letterhead img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex: 0 0 auto;
}
.document-letterhead div {
    display: grid;
    gap: 4px;
}
.document-letterhead strong { font-size: 20px; }
.document-letterhead small {
    display: block;
    color: #344054;
    font-size: 11px;
    line-height: 1.25;
}
.document-letterhead span { display: block; }
.leveling-print-sheet {
    max-width: 980px;
}
.leveling-print-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 10px 0 16px;
    font-size: 13px;
}
.leveling-print-table th:nth-child(1),
.leveling-print-table td:nth-child(1) {
    width: 52px;
    text-align: center;
}
.leveling-print-table th:nth-child(3),
.leveling-print-table td:nth-child(3) {
    width: 90px;
    text-align: center;
}
.leveling-print-table th:nth-child(4),
.leveling-print-table th:nth-child(5),
.leveling-print-table td:nth-child(4),
.leveling-print-table td:nth-child(5) {
    width: 150px;
}
.leveling-print-table td:nth-child(4),
.leveling-print-table td:nth-child(5) {
    height: 34px;
}
.document-serial-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #475467;
    font-size: 12px;
    margin: -8px 0 16px;
}
.document-verification-box {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    margin-top: 16px;
}
.document-verification-box img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    flex: 0 0 auto;
}
.document-verification-box p {
    margin: 0;
    font-size: 12px;
    color: #475467;
}
.signature-line {
    border-top: 1px solid #101828;
    margin: 42px auto 0;
    padding-top: 6px;
    text-align: center;
    max-width: 280px;
}
.inline-upload-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.secretary-tabs .actions-wrap {
    gap: 8px;
}
.student-edit-form {
    margin: 0;
}
.student-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}
.student-edit-grid.compact {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
}
.student-edit-grid.compact input:nth-child(n+3) {
    grid-column: span 2;
}
.assignment-create-form {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(140px, .8fr) minmax(420px, 2fr) 110px auto;
    gap: 10px;
    align-items: start;
}
.assignment-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(160px, .9fr) minmax(110px, .6fr) minmax(180px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}
.group-picker {
    display: grid;
    grid-template-columns: 1.6fr .8fr .7fr .8fr;
    gap: 8px;
    min-width: 420px;
}
.group-picker.compact {
    grid-template-columns: .7fr .8fr;
    min-width: 180px;
}
.data-table .group-picker {
    min-width: 520px;
}
.notice {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    background: #e8f5ef;
    color: #095b46;
    border: 1px solid #b6dfd0;
}
.notice.bad { background: #fff0ed; border-color: #ffc9c1; color: var(--bad); }
html[data-theme="dark"] .notice { background: #12342f; border-color: #216558; color: #d8fff5; }
html[data-theme="dark"] .notice.bad { background: #3a1c1b; border-color: #6d302d; color: #ffd0cc; }
.install-help {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    background: var(--explain-bg);
    border: 1px solid var(--explain-line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.install-help[hidden] { display: none; }
.install-help p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.35;
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.data-table th { background: var(--table-head); font-size: 13px; color: var(--muted); }
.report-heading {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
}
.report-heading h2,
.report-heading p {
    margin: 0;
}
.report-heading p,
.coord-report-title small,
.report-suggestion-strip {
    color: var(--muted);
}
.report-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.coord-report-title {
    border-bottom: 2px solid var(--accent);
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}
.coord-report-title strong {
    font-size: 18px;
}
.report-suggestion-strip {
    background: color-mix(in srgb, var(--accent) 9%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
}
.report-table-wrap {
    border-radius: 6px;
}
.coord-report-table {
    font-size: 13px;
}
.coord-report-table th {
    border-bottom: 2px solid var(--accent);
    text-transform: none;
}
.coord-report-table td:nth-last-child(-n+4),
.coord-report-table th:nth-last-child(-n+4) {
    text-align: center;
}
.coord-report-table td[data-label*="alumno"],
.coord-report-table td[data-label*="Alumno"],
.coord-report-table td[data-label*="Estudiante"],
.coord-report-table td[data-label*="estudiante"],
.coord-report-table th:nth-child(2),
.coord-report-table.report-lista_multiuso th:nth-child(2),
.coord-report-table.report-lista_clase th:nth-child(2) {
    text-align: left;
}
.coord-report-table.report-lista_multiuso th:last-child,
.coord-report-table.report-lista_multiuso td:last-child {
    width: 38%;
}
.coord-report-table.report-lista_clase th:nth-child(5),
.coord-report-table.report-lista_clase td:nth-child(5) {
    width: 26%;
}
.period-stack {
    display: grid;
    grid-template-rows: repeat(4, minmax(18px, auto));
    margin: -3px -6px;
    min-width: 44px;
}
.period-stack span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 3px 6px;
    border-bottom: 1px solid var(--line);
    line-height: 1.15;
}
.period-stack span:last-child {
    border-bottom: 0;
}
.period-label-stack span {
    color: var(--muted);
    font-weight: 700;
}
.period-grade-stack span {
    font-variant-numeric: tabular-nums;
}
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.choice-dialog {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    color: var(--text);
    max-width: min(460px, calc(100vw - 28px));
    padding: 18px;
    width: 460px;
}
.choice-dialog::backdrop {
    background: rgba(15, 23, 42, .42);
}
.choice-dialog h3,
.choice-dialog p {
    margin: 0;
}
.field-display {
    display: grid;
    gap: 5px;
    align-content: start;
}
.field-display span {
    color: var(--muted);
    font-size: 12px;
}
.field-display strong {
    overflow-wrap: anywhere;
}
.field-display.compact {
    min-width: 92px;
    text-align: right;
}
.assignment-list {
    display: grid;
    gap: 12px;
}
.assignment-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 14px;
    display: grid;
    gap: 12px;
}
.assignment-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}
.assignment-card-grid {
    display: grid;
    grid-template-columns: minmax(145px, .8fr) minmax(190px, 1fr) minmax(120px, .6fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: end;
}
.assignment-card .group-picker {
    min-width: 0;
}
.assignment-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}
.pager {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}
@media (max-width: 1180px) {
    .assignment-filter-form,
    .assignment-card-grid {
        grid-template-columns: 1fr 1fr;
    }
    .assignment-card .group-picker {
        grid-template-columns: 1fr 1fr;
    }
}
.create-worksheet-panel summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
}
.create-worksheet-panel form {
    margin-top: 14px;
}
.worksheet-filter-form {
    display: grid;
    grid-template-columns: minmax(130px, .5fr) minmax(170px, .8fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.worksheet-card-main,
.worksheet-card-subject {
    font-weight: 800;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
    padding: 20px;
}
.login-shell {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(260px, 1fr);
    gap: 28px;
    align-items: center;
}
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    display: grid;
    gap: 14px;
    box-shadow: 0 22px 60px rgba(16, 24, 40, .08);
}
.public-page {
    min-height: 100vh;
    background: var(--bg);
    display: grid;
    place-items: center;
    padding: 20px;
}
.public-page .login-shell {
    width: min(620px, 100%);
    grid-template-columns: 1fr;
}
.validation-card h1,
.validation-card h2 {
    margin: 0;
}
.validation-institution-head {
    align-items: center;
    display: flex;
    gap: 14px;
}
.validation-institution-head img {
    height: 64px;
    object-fit: contain;
    width: 64px;
}
.validation-institution-head p {
    color: var(--muted);
    margin: 4px 0 0;
}
.register-card {
    width: min(720px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    display: grid;
    gap: 14px;
    box-shadow: 0 22px 60px rgba(16, 24, 40, .08);
}
.register-card h1 {
    margin: 0;
}
.register-card .login-logo {
    width: min(260px, 100%);
}
.school-search-label {
    position: relative;
}
.school-search-label small {
    color: var(--muted);
}
.field-error {
    color: var(--bad) !important;
}
.field-ok {
    color: var(--accent) !important;
}
button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: .55;
}
.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 20px);
    z-index: 20;
    display: grid;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 42px rgba(16, 24, 40, .14);
}
.suggestion-option {
    width: 100%;
    min-height: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    justify-content: flex-start;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    text-align: left;
    background: var(--panel);
}
.suggestion-option:hover,
.suggestion-option:focus {
    background: var(--table-head);
}
.suggestion-option strong,
.suggestion-option span {
    overflow-wrap: anywhere;
}
.suggestion-option span,
.suggestion-empty {
    color: var(--muted);
    font-size: 13px;
}
.suggestion-empty {
    padding: 12px;
}
.login-logo {
    width: min(310px, 100%);
    height: auto;
    display: block;
}
.login-card h1 { margin: 0; }
.login-card p { margin: 0; color: var(--muted); }
.login-legal {
    margin-top: 12px !important;
    text-align: center;
}
.legal-shell {
    align-items: flex-start;
    justify-content: center;
    padding-bottom: 48px;
    padding-top: 48px;
}
.legal-card {
    max-width: 920px;
}
.legal-card h1 {
    margin-top: 18px;
}
.legal-card h2 {
    font-size: 20px;
    margin-top: 24px;
}
.legal-card li {
    margin-bottom: 8px;
}
.login-graphic {
    padding: 18px;
}
.login-graphic img {
    width: 100%;
    height: auto;
    display: block;
}
html[data-theme="dark"] .login-card {
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

.landing-page {
    background: #f6f8fb;
    color: #142033;
    min-height: 100vh;
}
.landing-page main {
    overflow: hidden;
}
.landing-header {
    align-items: center;
    background: rgba(246, 248, 251, .94);
    border-bottom: 1px solid #dce4ec;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    min-height: 74px;
    padding: 12px clamp(18px, 5vw, 72px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.landing-brand img {
    display: block;
    height: 42px;
    width: auto;
}
.landing-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: flex-end;
}
.landing-nav a:not(.button) {
    color: #475467;
    font-size: 14px;
    font-weight: 700;
}
.landing-hero {
    align-items: center;
    display: grid;
    gap: clamp(28px, 5vw, 70px);
    grid-template-columns: minmax(0, 1fr) minmax(300px, .88fr);
    min-height: calc(100vh - 74px);
    padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 72px) clamp(28px, 5vw, 58px);
}
.landing-hero-copy {
    display: grid;
    gap: 18px;
    max-width: 760px;
}
.landing-kicker {
    color: #0f8a9d;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.landing-hero h1 {
    color: #0f172a;
    font-size: clamp(48px, 8vw, 96px);
    line-height: .95;
    margin: 0;
}
.landing-hero p,
.landing-section-head p,
.landing-contact-copy p {
    color: #536174;
    font-size: 18px;
    line-height: 1.55;
    margin: 0;
}
.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}
.landing-app-offer {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cfe0df;
    border-radius: 8px;
    box-shadow: 0 16px 44px rgba(15, 23, 42, .09);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 6px;
    padding: 16px;
}
.landing-app-offer[hidden] {
    display: none;
}
.landing-app-offer div {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.landing-app-offer span {
    color: #0f8a9d;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.landing-app-offer strong {
    color: #111827;
    font-size: 18px;
}
.landing-app-offer p {
    color: #536174;
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}
.landing-store-button {
    gap: 8px;
    white-space: nowrap;
}
.landing-store-icon {
    display: inline-block;
    flex: 0 0 auto;
    height: 22px;
    width: 22px;
}
.landing-store-icon svg {
    display: block;
    height: 100%;
    width: 100%;
}
.landing-product {
    min-width: 0;
}
.landing-window {
    background: #ffffff;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .14);
    overflow: hidden;
}
.landing-window-bar {
    align-items: center;
    background: #101820;
    display: flex;
    gap: 7px;
    height: 42px;
    padding: 0 16px;
}
.landing-window-bar span {
    background: #d7dee8;
    border-radius: 999px;
    display: block;
    height: 10px;
    width: 10px;
}
.landing-dashboard-preview {
    display: grid;
    gap: 14px;
    padding: clamp(18px, 3vw, 28px);
}
.landing-dashboard-preview div {
    background: #f8fbfc;
    border: 1px solid #dbe7ea;
    border-left: 5px solid #176b5b;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 16px;
}
.landing-dashboard-preview small {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.landing-dashboard-preview strong {
    color: #111827;
    font-size: 22px;
}
.landing-dashboard-preview span {
    color: #536174;
    line-height: 1.4;
}
.landing-section {
    padding: clamp(52px, 7vw, 92px) clamp(18px, 5vw, 72px);
}
.landing-band {
    background: #ffffff;
    border-block: 1px solid #dce4ec;
}
.landing-section-head {
    display: grid;
    gap: 12px;
    max-width: 820px;
}
.landing-section h2,
.landing-contact h2 {
    color: #111827;
    font-size: clamp(30px, 4.5vw, 52px);
    line-height: 1.04;
    margin: 0;
}
.landing-proof-grid,
.landing-feature-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 28px;
}
.landing-proof-grid div,
.landing-feature-grid article,
.landing-contact-form {
    background: #ffffff;
    border: 1px solid #dce4ec;
    border-radius: 8px;
}
.landing-proof-grid div,
.landing-feature-grid article {
    display: grid;
    gap: 8px;
    padding: 18px;
}
.landing-feature-grid article {
    background: #f8fbfc;
}
.landing-proof-grid strong,
.landing-feature-grid h3 {
    color: #111827;
    font-size: 19px;
    margin: 0;
}
.landing-proof-grid span,
.landing-feature-grid p {
    color: #536174;
    line-height: 1.45;
    margin: 0;
}
.landing-contact {
    align-items: start;
    display: grid;
    gap: clamp(24px, 5vw, 64px);
    grid-template-columns: minmax(0, .86fr) minmax(320px, 520px);
    padding: clamp(52px, 7vw, 92px) clamp(18px, 5vw, 72px);
}
.landing-contact-copy {
    display: grid;
    gap: 14px;
}
.landing-email {
    color: #176b5b;
    font-weight: 800;
}
.landing-contact-form {
    box-shadow: 0 22px 58px rgba(15, 23, 42, .09);
    display: grid;
    gap: 13px;
    padding: clamp(18px, 3vw, 28px);
}
.landing-contact-form textarea {
    min-height: 128px;
}
.landing-hp {
    height: 0;
    left: -100vw;
    overflow: hidden;
    position: absolute;
    width: 0;
}

.sheet-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}
.sheet-meta p { margin: 0; }
.sheet-panel { padding: 0; position: relative; }
.save-state {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.formula-tools {
    display: grid;
    grid-template-columns: 140px minmax(190px, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    background: var(--field);
}
.worksheet-options {
    border-bottom: 1px solid var(--line);
}
.worksheet-options summary {
    cursor: pointer;
    font-weight: 700;
    padding: 12px 14px;
}
.worksheet-options .formula-tools {
    border-bottom: 0;
    padding-top: 0;
}
.save-state.saving { color: var(--warn); }
.save-state.saved { color: var(--accent); }
.save-state.error { color: var(--bad); }
.sheet-scroll { overflow: auto; max-height: calc(100vh - 230px); }
.sheet {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}
.sheet th, .sheet td {
    border: 1px solid var(--line);
    padding: 0;
    background: var(--field);
}
.sheet th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--sheet-head);
    min-width: 118px;
    height: 58px;
}
.sheet th span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    padding-top: 4px;
}
.sheet .num { width: 58px; min-width: 58px; text-align: center; background: var(--sheet-head); }
.sheet .name { width: 260px; min-width: 260px; padding: 8px 10px; background: var(--field); }
.sheet .name.piar-student-name {
    position: relative;
    background: #fff7ed;
    box-shadow: inset 4px 0 0 #f59e0b;
    cursor: pointer;
}
html[data-theme="dark"] .sheet .name.piar-student-name {
    background: #2a2114;
}
.piar-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border: 1px solid rgba(245, 158, 11, .45);
    border-radius: 999px;
    background: rgba(245, 158, 11, .12);
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}
html[data-theme="dark"] .piar-badge {
    color: #fbbf24;
}
.piar-info-bubble {
    position: absolute;
    z-index: 95;
    width: min(260px, calc(100vw - 24px));
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fffbeb;
    color: #78350f;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
    font-size: 13px;
    line-height: 1.35;
}

.achievement-help p {
    margin: 6px 0 10px;
}
.achievement-code-list {
    display: grid;
    gap: 8px;
    margin: 10px 0;
}
.achievement-code-list > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--field);
}
.achievement-code-list strong {
    color: var(--accent);
    display: inline-block;
    min-width: 36px;
}
.achievement-code-list small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}
.custom-achievement {
    border-color: rgba(23, 107, 91, .35);
}
.sheet .achievement-col {
    min-width: 210px;
}
.achievement-codes,
.achievement-notes {
    width: 100%;
}
.achievement-codes {
    margin-bottom: 6px;
}
.achievement-notes {
    min-height: 58px;
    resize: vertical;
}
.bulletin-preview {
    background: var(--panel);
}
.bulletin-head {
    align-items: center;
    border-bottom: 2px solid var(--accent);
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
}
.bulletin-head img {
    height: 72px;
    object-fit: contain;
    width: 72px;
}
.bulletin-head p {
    white-space: pre-line;
}
.signature-row {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 42px;
}
.signature-row span {
    border-top: 1px solid var(--text);
    padding-top: 8px;
    text-align: center;
}
.area-summary-row td {
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
    border-top: 2px solid var(--accent);
}
.area-summary-row strong {
    color: var(--accent);
}
.bulletin-table td,
.bulletin-table th {
    vertical-align: top;
}
.bulletin-document {
    background: var(--panel);
    color: var(--text);
}
.batch-print-preview .bulletin-document {
    margin-bottom: 18px;
}
.bulletin-letterhead {
    align-items: center;
    border-bottom: 2px solid var(--accent);
    display: grid;
    gap: 14px;
    grid-template-columns: 72px 1fr auto;
    margin-bottom: 10px;
    padding-bottom: 10px;
    text-align: center;
}
.bulletin-letterhead img {
    height: 68px;
    object-fit: contain;
    width: 68px;
}
.bulletin-letterhead h2 {
    margin: 0;
    text-transform: uppercase;
}
.bulletin-letterhead p {
    margin: 2px 0;
    white-space: pre-line;
}
.bulletin-letterhead span {
    align-self: end;
    color: var(--muted);
    font-size: 12px;
}
.bulletin-student-meta {
    border-collapse: collapse;
    margin-bottom: 0;
    width: 100%;
}
.bulletin-student-meta td {
    border: 1px solid var(--line);
    padding: 5px 7px;
}
.institutional-bulletin-table td:nth-child(2),
.institutional-bulletin-table td:nth-child(4),
.institutional-bulletin-table th:nth-child(2),
.institutional-bulletin-table th:nth-child(4) {
    text-align: center;
}
.institutional-bulletin-table td:nth-child(5) {
    font-size: 13px;
}
.bulletin-observations {
    border: 1px solid var(--line);
    border-top: 0;
    min-height: 52px;
    padding: 6px 8px;
}
.bulletin-observations p {
    margin: 4px 0 0;
}
.bulletin-bottom {
    border: 1px solid var(--line);
    border-top: 0;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1fr;
    padding: 6px 8px;
}
.bulletin-signature {
    border-top: 1px solid var(--text);
    padding-top: 12px;
    text-align: center;
}

@media print {
    @page {
        size: legal landscape;
        margin: 10mm;
    }
    .sidebar,
    .topbar,
    .install-help,
    .button,
    button,
    .filters-form,
    .tabs {
        display: none !important;
    }
    .main {
        margin: 0;
        padding: 0;
    }
    .panel {
        border: 0;
        box-shadow: none;
    }
    .report-suggestion-strip,
    .report-heading p {
        display: none !important;
    }
    .coord-report-title {
        border-bottom: 1.5px solid #176b5b;
        color: #0d1726;
        margin-bottom: 8px;
    }
    .coord-report-title strong {
        font-size: 14px;
    }
    .coord-report-title span,
    .coord-report-title small {
        font-size: 10px;
    }
    .report-table-wrap {
        border: 0;
        overflow: visible;
    }
    .coord-report-table {
        border-collapse: collapse;
        color: #0d1726;
        font-size: 8px;
        min-width: 0;
        table-layout: auto;
    }
    .coord-report-table th,
    .coord-report-table td {
        border: 1px solid #596273;
        padding: 2px 4px;
    }
    .coord-report-table th {
        background: #edf4f6 !important;
        border-bottom: 1.5px solid #176b5b;
    }
    body.print-bulletin-only * {
        display: none !important;
        visibility: hidden !important;
    }
    body.print-bulletin-only #printOnlyBulletin,
    body.print-bulletin-only #printOnlyBulletin * {
        display: revert;
        visibility: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin {
        display: block !important;
    }
    body.print-bulletin-only #printOnlyBulletin table {
        display: table !important;
    }
    body.print-bulletin-only #printOnlyBulletin thead {
        display: table-header-group !important;
    }
    body.print-bulletin-only #printOnlyBulletin tbody {
        display: table-row-group !important;
    }
    body.print-bulletin-only #printOnlyBulletin tr {
        display: table-row !important;
    }
    body.print-bulletin-only #printOnlyBulletin th,
    body.print-bulletin-only #printOnlyBulletin td {
        display: table-cell !important;
    }
    body.print-bulletin-only #printOnlyBulletin {
        border: 0 !important;
        box-shadow: none !important;
        left: 0;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute;
        top: 0;
        width: 100% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .table-wrap {
        overflow: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin {
        font-size: 10.5px;
        line-height: 1.18;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-head {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-head img {
        height: 48px;
        width: 48px;
    }
    body.print-bulletin-only #printOnlyBulletin h2 {
        font-size: 15px;
        margin: 6px 0;
    }
    body.print-bulletin-only #printOnlyBulletin p {
        margin: 4px 0;
    }
    body.print-bulletin-only #printOnlyBulletin .data-table th,
    body.print-bulletin-only #printOnlyBulletin .data-table td {
        padding: 3px 5px;
    }
    body.print-bulletin-only #printOnlyBulletin .signature-row {
        margin-top: 20px;
    }
}
html[data-theme="dark"] .piar-info-bubble {
    border-color: #92400e;
    background: #1f1609;
    color: #fde68a;
}
.sheet th.name, .sheet th.num { z-index: 3; background: var(--sheet-head); }
.sheet input {
    border: 0;
    border-radius: 0;
    width: 118px;
    min-height: 36px;
    padding: 7px;
    background: transparent;
}
.sheet .col-label {
    height: 32px;
    font-size: 12px;
    background: var(--field);
    border-top: 1px solid var(--line);
}
.fixed-col-label {
    margin-top: 5px;
    padding: 8px 10px;
    background: var(--field);
    border-top: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
}
.sheet .final-col { background: var(--sheet-final); }
.sheet .final-col input { background: var(--sheet-final); font-weight: 700; }
.sheet .parent-note-col { min-width: 260px; background: var(--explain-bg); }
.sheet .parent-note-col input { width: 260px; background: var(--explain-bg); }
.sheet input:focus {
    outline: 2px solid var(--accent-2);
    outline-offset: -2px;
    background: var(--field);
}
.cell.formula-error { background: #fff0ed; }
html[data-theme="dark"] .cell.formula-error { background: #3a1c1b; }
.profile-grid, .stats-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.profile-grid div, .stats-box div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 4px;
}
.profile-grid span, .stats-box span { color: var(--muted); font-size: 13px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.ai-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
    align-items: start;
}
.ai-chat-shell {
    display: grid;
    gap: 14px;
    min-height: calc(100vh - 132px);
}
.ai-assistant-head,
.ai-actions,
.ai-side-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.ai-head-actions {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.ai-chat-history {
    display: grid;
    gap: 14px;
    align-content: start;
    max-height: calc(100vh - 382px);
    min-height: 340px;
    overflow: auto;
    padding: 4px;
    scroll-behavior: smooth;
}
.ai-message {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    max-width: 82%;
}
.ai-message.from-user {
    grid-template-columns: minmax(0, 1fr) 38px;
    justify-self: end;
}
.ai-message.from-user .ai-avatar {
    grid-column: 2;
    grid-row: 1;
    background: var(--accent);
    color: #fff;
}
.ai-message.from-user .ai-bubble {
    grid-column: 1;
    grid-row: 1;
    background: color-mix(in srgb, var(--accent) 13%, var(--panel));
    border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.ai-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-2) 14%, var(--panel));
    border: 1px solid var(--line);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}
.ai-bubble {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    padding: 13px;
    box-shadow: 0 6px 18px rgba(15, 35, 55, .05);
}
.ai-bubble p {
    margin: 0;
    color: var(--ink);
}
.ai-message-mode {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.ai-typing-message {
    opacity: .96;
}
.ai-typing-bubble {
    width: max-content;
    min-width: 104px;
}
.ai-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
    padding: 2px 0;
}
.ai-typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    opacity: .38;
    animation: aiTypingPulse 1.05s infinite ease-in-out;
}
.ai-typing-indicator span:nth-child(2) {
    animation-delay: .16s;
}
.ai-typing-indicator span:nth-child(3) {
    animation-delay: .32s;
}
@keyframes aiTypingPulse {
    0%, 80%, 100% {
        opacity: .34;
        transform: translateY(0);
    }
    40% {
        opacity: .95;
        transform: translateY(-4px);
    }
}
.ai-chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.ai-chat-composer textarea {
    min-height: 56px;
    max-height: 150px;
}
.ai-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ai-quick-prompts form {
    margin: 0;
}
.ai-quick-prompts button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
    background: color-mix(in srgb, var(--accent-2) 8%, var(--field));
}
.ai-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
    color: var(--accent);
    border-radius: 999px;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}
.ai-mode-badge.external {
    border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
    background: color-mix(in srgb, var(--warn) 12%, var(--panel));
    color: var(--warn);
}
.ai-alternatives {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}
.ai-alternatives a {
    color: var(--accent);
    font-weight: 700;
}
.ai-side-panel {
    display: grid;
    gap: 16px;
}
.ai-request-list {
    display: grid;
    gap: 10px;
}
.ai-request-list div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--field);
}
.ai-request-list span {
    color: var(--muted);
    line-height: 1.35;
}
@media (max-width: 900px) {
    .landing-header {
        align-items: flex-start;
        display: grid;
        gap: 12px;
        min-height: 0;
    }
    .landing-nav {
        justify-content: flex-start;
    }
    .landing-hero,
    .landing-contact {
        grid-template-columns: 1fr;
    }
    .landing-hero {
        min-height: auto;
    }
    .landing-proof-grid,
    .landing-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ai-chat-layout {
        grid-template-columns: 1fr;
    }
    .ai-chat-shell {
        min-height: auto;
    }
    .ai-chat-history {
        max-height: none;
        min-height: 360px;
    }
    .ai-message {
        max-width: 96%;
    }
    .ai-chat-composer {
        grid-template-columns: 1fr;
    }
}
.plain-explain {
    background: var(--explain-bg);
    color: var(--explain-ink) !important;
    border: 1px solid var(--explain-line);
    padding: 12px;
    border-radius: 8px;
}
.formula-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
.student-grade-value {
    display: block;
    font-weight: 700;
}
.student-grade-concept {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}
.cell-date {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
.parent-note-box {
    border: 1px solid var(--explain-line);
    background: var(--explain-bg);
    color: var(--explain-ink);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}
.parent-note-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}
.parent-note-box p {
    margin: 0;
    color: var(--explain-ink);
    line-height: 1.45;
    white-space: normal;
}
.student-notes-list {
    display: grid;
    gap: 12px;
}
.student-note-accordion {
    padding: 0;
}
.student-note-accordion > summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
    list-style: none;
    padding: 14px 16px;
}
.student-note-accordion > summary::-webkit-details-marker {
    display: none;
}
.student-note-accordion > summary::before {
    color: var(--brand);
    content: "+";
    font-weight: 800;
}
.student-note-accordion[open] > summary::before {
    content: "-";
}
.student-note-accordion > summary > span:first-child {
    display: grid;
    gap: 3px;
}
.student-note-accordion > summary small {
    color: var(--muted);
    font-size: 12px;
}
.student-note-final {
    color: var(--brand);
    font-weight: 800;
    white-space: nowrap;
}
.muted {
    color: var(--muted);
}
.student-note-accordion > :not(summary) {
    margin-left: 16px;
    margin-right: 16px;
}
.student-note-accordion > :last-child {
    margin-bottom: 16px;
}
.attendance-list {
    display: grid;
    gap: 10px;
}
.attendance-list-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: var(--field);
}
.attendance-list-card strong { font-size: 20px; }
.attendance-list-card span { color: var(--muted); }
.attendance-shell { display: grid; gap: 16px; }
.attendance-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.attendance-head h2 { margin-bottom: 4px; }
.attendance-progress { display: grid; gap: 6px; }
.attendance-progress progress {
    width: 100%;
    height: 12px;
    accent-color: var(--accent);
}
.attendance-card {
    min-height: 430px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 22px;
    padding: 28px;
    border-radius: 14px;
    background: radial-gradient(circle at top, rgba(31, 126, 108, .20), transparent 38%), #07141c;
    color: #fff;
    text-align: center;
}
.attendance-avatar {
    width: 118px;
    height: 118px;
    display: grid;
    place-items: center;
    border: 4px solid #9ec5ff;
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    font-size: 34px;
    font-weight: 800;
}
.attendance-student-meta { display: grid; gap: 8px; }
.attendance-student-meta small,
.attendance-student-meta span { color: rgba(255, 255, 255, .72); }
.attendance-student-meta strong {
    max-width: 760px;
    font-size: clamp(30px, 7vw, 54px);
    line-height: 1.04;
    text-transform: uppercase;
}
.attendance-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: min(760px, 100%);
}
.attendance-action {
    min-height: 96px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 42px;
    font-weight: 800;
}
.attendance-action span { font-size: 15px; font-weight: 700; }
.attendance-action.present { background: rgba(22, 163, 74, .24); }
.attendance-action.absent { background: rgba(220, 38, 38, .22); }
.attendance-action.out-of-class { background: rgba(245, 158, 11, .24); }
.attendance-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.attendance-nav button {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border-color: rgba(255, 255, 255, .22);
}
.attendance-summary { display: grid; gap: 12px; }
.attendance-summary-counts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.attendance-summary-counts div,
.attendance-student-summary {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
}
.attendance-summary-counts span,
.attendance-student-head span {
    display: block;
    color: var(--muted);
}
.attendance-roster { display: grid; gap: 6px; }
.attendance-roster-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.attendance-roster-row > span {
    display: grid;
    gap: 3px;
}
.attendance-roster-row small {
    color: var(--muted);
}
.attendance-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.attendance-mini {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}
.attendance-mini.present {
    border-color: rgba(21, 128, 61, .35);
    color: #15803d;
}
.attendance-mini.absent {
    border-color: rgba(185, 28, 28, .35);
    color: #b91c1c;
}
.attendance-mini.out-of-class {
    border-color: rgba(180, 83, 9, .38);
    color: #b45309;
}
.attendance-roster-row.present strong,
.attendance-marks .present { color: #15803d; }
.attendance-roster-row.absent strong,
.attendance-marks .absent { color: #b91c1c; }
.attendance-roster-row.out_of_class small,
.attendance-marks .out-of-class { color: #b45309; }
.attendance-student-summary {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}
.attendance-student-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.attendance-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.attendance-marks button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-size: 22px;
    font-weight: 800;
    padding: 0;
    min-height: 0;
}
.attendance-info-bubble {
    position: absolute;
    z-index: 80;
    width: max-content;
    max-width: 210px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
    color: var(--text);
    font-size: 13px;
}
.piar-layout {
    align-items: start;
}
.case-list {
    display: grid;
    gap: 10px;
}
.case-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
}
.case-card.active {
    border-color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}
.case-card span {
    color: var(--muted);
    font-size: 13px;
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.bulletin-section-tabs {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    overflow-x: auto;
}
.bulletin-section-tabs .button {
    white-space: nowrap;
    background: var(--panel);
}
.bulletin-section-tabs .button.active,
.bulletin-section-tabs .button[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.bulletin-tab-stage {
    display: block;
}
.bulletin-tab-panel {
    display: none !important;
}
.bulletin-tab-panel.is-active {
    display: block !important;
}
.bulletin-tab-panel.form-grid.is-active {
    display: grid !important;
}
.module-section-tabs {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
}
.module-section-tabs .button {
    white-space: nowrap;
    background: var(--panel);
}
.module-section-tabs .button.active,
.module-section-tabs .button[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.module-tab-panel {
    display: none !important;
}
.module-tab-panel.is-active {
    display: block !important;
}
.module-tab-panel.grid.is-active,
.module-tab-panel.form-grid.is-active {
    display: grid !important;
}
.piar-form {
    display: grid;
    gap: 14px;
}
.piar-form[hidden] {
    display: none !important;
}
.piar-form h3 {
    margin: 0;
}
.piar-form fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    gap: 12px;
}
.piar-form legend {
    padding: 0 6px;
    font-weight: 700;
}
.piar-form textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    font: inherit;
    color: var(--ink);
    background: var(--field);
}
.piar-form textarea[readonly] {
    background: var(--bg);
}
.adjustments-table {
    min-width: 1120px;
}
.adjustments-table th,
.adjustments-table td {
    width: 180px;
}
.adjustments-table td:first-child,
.adjustments-table th:first-child {
    width: 170px;
}
.adjustments-table textarea {
    min-height: 120px;
    font-size: 13px;
}
.adjustments-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}
.teacher-adjustment-list {
    display: grid;
    gap: 16px;
}
.teacher-adjustment-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: var(--field);
}
.teacher-adjustment-card h3,
.teacher-adjustment-card p {
    margin: 0;
}
.teacher-adjustment-card textarea {
    min-height: 140px;
    line-height: 1.45;
}
.worksheet-source {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}
.visibility-toggle-form {
    display: inline-flex;
}
.switch-button {
    gap: 8px;
    min-width: 112px;
    justify-content: flex-start;
}
.switch-button span {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: var(--line);
    position: relative;
    flex: 0 0 auto;
}
.switch-button span::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--panel);
    top: 2px;
    left: 2px;
    transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch-button.on {
    border-color: var(--accent);
}
.switch-button.on span {
    background: var(--accent);
}
.switch-button.on span::after {
    transform: translateX(16px);
}
.locked-visibility {
    color: var(--muted);
    font-size: 13px;
}
.student-admin-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--field);
}
.student-admin-box summary {
    cursor: pointer;
    font-weight: 700;
}
.student-edit-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}
.student-edit-grid.compact {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    margin-top: 0;
}
.secretary-student-name-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    max-width: 430px;
}

@media (max-width: 860px) {
    .landing-header,
    .landing-hero,
    .landing-section,
    .landing-contact {
        padding-left: 16px;
        padding-right: 16px;
    }
    .landing-nav {
        gap: 8px 12px;
    }
    .landing-nav .button {
        width: 100%;
    }
    .landing-actions,
    .landing-actions .button,
    .landing-app-offer,
    .landing-app-offer .button,
    .landing-contact-form button {
        width: 100%;
    }
    .landing-app-offer {
        grid-template-columns: 1fr;
    }
    .landing-proof-grid,
    .landing-feature-grid {
        grid-template-columns: 1fr;
    }
    .landing-window {
        box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
    }
    .sidebar {
        bottom: 0;
        box-shadow: 12px 0 34px rgba(0,0,0,.28);
        display: flex;
        left: 0;
        max-width: 86vw;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform .18s ease;
        width: 280px;
        z-index: 9999;
    }
    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }
    body.mobile-menu-open::before {
        background: rgba(0,0,0,.38);
        content: "";
        position: fixed;
        inset: 0;
        z-index: 9998;
    }
    .main {
        margin-left: 0;
        padding: 14px;
    }
    .topbar {
        align-items: center;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        margin-bottom: 14px;
    }
    .topbar h1 {
        font-size: 24px;
        min-width: 0;
    }
    .mobile-menu-button {
        align-items: center;
        background: var(--accent);
        border-color: var(--accent);
        border-radius: 8px;
        display: inline-flex;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 4px;
        height: 42px;
        justify-content: center;
        padding: 0;
        position: relative;
        width: 44px;
        z-index: 10002;
    }
    .mobile-menu-button span {
        background: #fff;
        border-radius: 999px;
        display: block;
        height: 3px;
        width: 22px;
    }
    .grid.two, .inline-form, .inline-upload-form, .assignment-create-form, .group-picker, .filters-form, .filters-grid, .two-columns, .assignment-filter-form, .assignment-card-head, .assignment-card-grid, .worksheet-filter-form {
        grid-template-columns: 1fr;
    }
    .report-heading {
        grid-template-columns: 1fr;
    }
    .report-actions {
        justify-content: stretch;
    }
    .report-actions .button,
    .report-actions button {
        width: 100%;
    }
    .field-display.compact {
        text-align: left;
    }
    .assignment-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .assignment-actions button {
        width: 100%;
    }
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 430px;
    }
    .login-graphic {
        display: none;
    }
    .formula-tools {
        grid-template-columns: 1fr;
    }
    .table-wrap,
    .teacher-list-wrap {
        overflow: visible;
        border: 0;
    }
    .data-table,
    .teacher-worksheets {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 12px;
    }
    .data-table thead,
    .teacher-worksheets thead {
        display: none;
    }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td,
    .teacher-worksheets,
    .teacher-worksheets tbody,
    .teacher-worksheets tr,
    .teacher-worksheets td {
        display: block;
        width: 100%;
    }
    .data-table tr,
    .teacher-worksheets tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--panel);
        padding: 12px;
    }
    .data-table td,
    .teacher-worksheets td {
        border: 0;
        padding: 5px 0;
        overflow-wrap: anywhere;
    }
    .data-table td[data-label]::before,
    .teacher-worksheets td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 2px;
    }
    .data-table td.actions,
    .data-table td:last-child,
    .teacher-worksheets td.actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 10px;
    }
    .data-table td.actions::before,
    .data-table td:last-child::before,
    .teacher-worksheets td.actions::before {
        display: none;
    }
    .data-table .actions,
    .data-table td:last-child form,
    .data-table td:last-child .button,
    .data-table td:last-child button,
    .teacher-worksheets .actions .button,
    .teacher-worksheets .actions button {
        width: 100%;
    }
    .data-table td:last-child form.actions {
        display: grid;
        gap: 8px;
    }
    .teacher-worksheets .worksheet-card-main::before,
    .teacher-worksheets .worksheet-card-subject::before {
        display: none;
    }
    .teacher-worksheets .worksheet-card-main {
        font-size: 28px;
        line-height: 1.05;
        padding-bottom: 0;
    }
    .teacher-worksheets .worksheet-card-subject {
        color: var(--accent);
        font-size: 22px;
        line-height: 1.1;
        padding-top: 0;
    }
    .attendance-head {
        display: grid;
    }
    .attendance-card {
        min-height: calc(100vh - 270px);
        padding: 22px 16px;
        border-radius: 10px;
    }
    .attendance-avatar {
        width: 98px;
        height: 98px;
        font-size: 28px;
    }
    .attendance-student-meta strong {
        font-size: clamp(28px, 10vw, 42px);
    }
    .attendance-actions,
    .attendance-summary-counts {
        grid-template-columns: 1fr;
    }
    .attendance-action {
        min-height: 78px;
    }
    .attendance-student-head {
        display: grid;
    }
    .student-edit-grid,
    .student-edit-grid.compact {
        grid-template-columns: 1fr;
    }
    .secretary-student-name-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }
    .piar-layout {
        grid-template-columns: 1fr;
    }
}

@media print {
    body:not(.print-bulletin-only) .secretary-document {
        border: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body:not(.print-bulletin-only) .secretary-document > .section-heading {
        display: none !important;
    }
    body:not(.print-bulletin-only) .secretary-document .print-sheet {
        background: #fff !important;
        border: 1px solid #d5dde8 !important;
        border-radius: 8px !important;
        color: #101828 !important;
        margin: 0 auto !important;
        max-width: 900px !important;
        padding: 24px !important;
        width: 100% !important;
    }
    body:not(.print-bulletin-only) .secretary-document .table-wrap {
        border: 0 !important;
        overflow: visible !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        display: table !important;
        min-width: 0 !important;
        table-layout: auto !important;
        width: 100% !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table thead {
        display: table-header-group !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table tbody {
        display: table-row-group !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table tr {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        display: table-row !important;
        padding: 0 !important;
        width: auto !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table th,
    body:not(.print-bulletin-only) .secretary-document .data-table td {
        border-bottom: 1px solid #d5dde8 !important;
        display: table-cell !important;
        padding: 10px 12px !important;
        vertical-align: middle !important;
        width: auto !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table th {
        background: #edf4f6 !important;
        color: #5b6b86 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        text-align: left !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table td[data-label]::before,
    body:not(.print-bulletin-only) .secretary-document .data-table td::before {
        content: none !important;
        display: none !important;
    }
    body:not(.print-bulletin-only) .secretary-document .data-table td:last-child,
    body:not(.print-bulletin-only) .secretary-document .data-table td.actions {
        display: table-cell !important;
        margin-top: 0 !important;
    }
    body:not(.print-bulletin-only) .secretary-document .leveling-print-meta {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px 8px !important;
        font-size: 10px !important;
    }
    body:not(.print-bulletin-only) .secretary-document .leveling-print-table th,
    body:not(.print-bulletin-only) .secretary-document .leveling-print-table td {
        padding: 5px 7px !important;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .sidebar {
        display: none;
    }
    .main {
        margin-left: 0;
        padding: 6px;
    }
    .topbar {
        display: none;
    }
    .sheet-meta {
        display: none;
    }
    .sheet-meta h2 {
        font-size: 15px;
        margin: 0;
    }
    .sheet-meta p {
        display: none;
    }
    .sheet-meta .button {
        min-height: 30px;
        padding: 5px 8px;
        font-size: 13px;
    }
    .formula-tools {
        grid-template-columns: 90px minmax(140px, 1fr) auto;
        gap: 6px;
        padding: 6px 8px;
    }
    .worksheet-options {
        display: none;
    }
    .formula-tools input,
    .formula-tools select,
    .formula-tools button {
        min-height: 30px;
        padding: 5px 7px;
        font-size: 13px;
    }
    .save-state {
        padding: 5px 8px;
    }
    .sheet-scroll {
        max-height: calc(100vh - 96px);
    }
    .sheet th {
        height: 44px;
    }
    .sheet .col-label {
        height: 24px;
        padding: 4px;
    }
    .fixed-col-label {
        margin-top: 2px;
        padding: 4px 6px;
    }
}

@media (orientation: landscape) and (max-height: 520px) and (min-width: 700px) {
    .sheet .num {
        position: sticky;
        left: 0;
        z-index: 4;
    }
    .sheet .name {
        position: sticky;
        left: 58px;
        z-index: 3;
        background: var(--field);
    }
    .sheet th.num,
    .sheet th.name {
        z-index: 6;
        background: var(--sheet-head);
    }
}

@media print {
    @page {
        size: legal portrait;
        margin: 12mm 11mm 14mm 11mm;
    }
    body.print-bulletin-only {
        background: #fff !important;
    }
    body.print-bulletin-only * {
        display: none !important;
        visibility: hidden !important;
    }
    body.print-bulletin-only #printOnlyBulletin,
    body.print-bulletin-only #printOnlyBulletin .bulletin-preview,
    body.print-bulletin-only #printOnlyBulletin .bulletin-document,
    body.print-bulletin-only #printOnlyBulletin .bulletin-head,
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead,
    body.print-bulletin-only #printOnlyBulletin .table-wrap,
    body.print-bulletin-only #printOnlyBulletin .signature-row,
    body.print-bulletin-only #printOnlyBulletin .bulletin-observations,
    body.print-bulletin-only #printOnlyBulletin .bulletin-bottom,
    body.print-bulletin-only #printOnlyBulletin h2,
    body.print-bulletin-only #printOnlyBulletin p,
    body.print-bulletin-only #printOnlyBulletin div,
    body.print-bulletin-only #printOnlyBulletin span,
    body.print-bulletin-only #printOnlyBulletin strong,
    body.print-bulletin-only #printOnlyBulletin img {
        display: block !important;
        visibility: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin {
        color: #0d1726 !important;
        font-size: 10.8px !important;
        left: 0;
        line-height: 1.24 !important;
        position: absolute;
        top: 0;
        width: 100% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-preview {
        background: #fff !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .batch-print-preview {
        display: block !important;
    }
    body.print-bulletin-only #printOnlyBulletin .batch-print-preview .bulletin-document {
        break-after: page !important;
        page-break-after: always !important;
    }
    body.print-bulletin-only #printOnlyBulletin .batch-print-preview .bulletin-document:last-child {
        break-after: auto !important;
        page-break-after: auto !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-document {
        background: #fff !important;
        border: 1px solid #2d3748 !important;
        display: block !important;
        padding: 0 !important;
        width: 100% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead {
        align-items: center !important;
        border-bottom: 1px solid #2d3748 !important;
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: 58px 1fr 72px !important;
        margin: 0 !important;
        padding: 7px 8px 5px !important;
        text-align: center !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead img {
        display: block !important;
        height: 50px !important;
        object-fit: contain !important;
        width: 50px !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead h2 {
        font-size: 14px !important;
        margin: 0 !important;
        text-transform: uppercase !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead p {
        font-size: 9px !important;
        line-height: 1.15 !important;
        margin: 1px 0 !important;
        white-space: pre-line !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead strong,
    body.print-bulletin-only #printOnlyBulletin .bulletin-letterhead span {
        font-size: 9px !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-head {
        align-items: center !important;
        border-bottom: 2px solid #176b5b !important;
        display: flex !important;
        gap: 13px !important;
        margin: 0 0 9px !important;
        padding: 0 0 9px !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-head img {
        display: block !important;
        height: 52px !important;
        visibility: visible !important;
        width: 52px !important;
    }
    body.print-bulletin-only #printOnlyBulletin h2 {
        font-size: 15px !important;
        margin: 6px 0 !important;
    }
    body.print-bulletin-only #printOnlyBulletin p {
        margin: 2px 0 !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-head p {
        white-space: pre-line !important;
    }
    body.print-bulletin-only #printOnlyBulletin > .bulletin-preview > p:last-of-type {
        border-top: 1px solid #d8e0ea !important;
        font-size: 9.5px !important;
        margin-top: 10px !important;
        padding-top: 6px !important;
        text-align: center !important;
    }
    body.print-bulletin-only #printOnlyBulletin .table-wrap {
        border: 0 !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }
    body.print-bulletin-only #printOnlyBulletin table,
    body.print-bulletin-only #printOnlyBulletin .data-table,
    body.print-bulletin-only #printOnlyBulletin .bulletin-table {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        display: table !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        visibility: visible !important;
        width: 100% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-table th:nth-child(1),
    body.print-bulletin-only #printOnlyBulletin .bulletin-table td:nth-child(1) {
        width: 25% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-table th:nth-child(2),
    body.print-bulletin-only #printOnlyBulletin .bulletin-table td:nth-child(2) {
        width: 4% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-table th:nth-child(3),
    body.print-bulletin-only #printOnlyBulletin .bulletin-table td:nth-child(3) {
        text-align: center !important;
        width: 13% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-table th:nth-child(4),
    body.print-bulletin-only #printOnlyBulletin .bulletin-table td:nth-child(4) {
        text-align: center !important;
        width: 6% !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-table th:nth-child(5),
    body.print-bulletin-only #printOnlyBulletin .bulletin-table td:nth-child(5) {
        width: 52% !important;
    }
    body.print-bulletin-only #printOnlyBulletin thead {
        display: table-header-group !important;
        visibility: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin tbody {
        display: table-row-group !important;
        visibility: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin tr {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        display: table-row !important;
        padding: 0 !important;
        visibility: visible !important;
        width: auto !important;
    }
    body.print-bulletin-only #printOnlyBulletin th,
    body.print-bulletin-only #printOnlyBulletin td {
        border: 1px solid #2d3748 !important;
        display: table-cell !important;
        font-size: 8.8px !important;
        padding: 3px 5px !important;
        vertical-align: top !important;
        visibility: visible !important;
        width: auto !important;
    }
    body.print-bulletin-only #printOnlyBulletin td::before,
    body.print-bulletin-only #printOnlyBulletin th::before {
        content: none !important;
        display: none !important;
    }
    body.print-bulletin-only #printOnlyBulletin .area-summary-row td {
        background: #e8f3f1 !important;
        border-top: 2px solid #176b5b !important;
        font-weight: 700 !important;
    }
    body.print-bulletin-only #printOnlyBulletin th {
        background: #edf4f6 !important;
        color: #0d1726 !important;
        font-weight: 700 !important;
    }
    body.print-bulletin-only #printOnlyBulletin .area-summary-row strong,
    body.print-bulletin-only #printOnlyBulletin .area-summary-row td:nth-child(3) {
        color: #08705f !important;
    }
    body.print-bulletin-only #printOnlyBulletin .signature-row {
        display: grid !important;
        gap: 30px !important;
        grid-template-columns: 1fr 1fr !important;
        margin-top: 34px !important;
        visibility: visible !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-observations {
        border: 1px solid #2d3748 !important;
        border-top: 0 !important;
        display: block !important;
        min-height: 45px !important;
        padding: 5px 7px !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-bottom {
        border: 1px solid #2d3748 !important;
        border-top: 0 !important;
        display: grid !important;
        font-size: 9px !important;
        gap: 18px !important;
        grid-template-columns: 1fr 1fr !important;
        padding: 12mm 7px 5px !important;
    }
    body.print-bulletin-only #printOnlyBulletin .bulletin-signature {
        border-top: 1px solid #0d1726 !important;
        display: block !important;
        padding-top: 4px !important;
        text-align: center !important;
    }
    body.print-bulletin-only #printOnlyBulletin .signature-row span {
        border-top: 1px solid #0d1726 !important;
        display: block !important;
        padding-top: 4px !important;
        text-align: center !important;
        visibility: visible !important;
    }
}
