:root {
    --ink: #14202b;
    --muted: #667385;
    --line: #cfdae8;
    --paper: #e7edf7;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-strong: #ffffff;
    --brand: #223c7a;
    --brand-2: #8559d6;
    --brand-3: #16284f;
    --soft: #e1e8f5;
    --danger-soft: #fff1f0;
    --shadow-soft: 0 22px 56px rgba(18, 33, 66, 0.16);
    --shadow-strong: 0 32px 76px rgba(18, 33, 66, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 0% 0%, rgba(133, 89, 214, 0.22), transparent 28rem),
        radial-gradient(circle at 100% 8%, rgba(82, 170, 255, 0.18), transparent 30rem),
        linear-gradient(180deg, #dfe7f4 0%, #d4deee 42%, #dbe3f0 100%);
    font-family: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
    min-height: 100vh;
}

a {
    color: inherit;
}

button,
.button-muted {
    border: 0;
    border-radius: 7px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 700 14px/1.2 "Aptos", "Segoe UI", sans-serif;
    min-height: 42px;
    padding: 10px 18px;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 53, 57, .18);
}

.button-secondary {
    background: var(--brand-2);
}

.button-import {
    border: 0;
    border-radius: 7px;
    background: linear-gradient(135deg, #1d7f63, #2fb07f);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 800 14px/1.2 "Aptos", "Segoe UI", sans-serif;
    min-height: 44px;
    padding: 11px 18px;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(29, 127, 99, .24);
}

.button-import:hover {
    background: linear-gradient(135deg, #176b54, #269a70);
    box-shadow: 0 16px 32px rgba(29, 127, 99, .3);
    transform: translateY(-1px);
}

.button-muted {
    background: #d6dedc;
    color: var(--brand);
    box-shadow: none;
}

.button-print {
    border: 0;
    border-radius: 7px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 700 14px/1.2 "Aptos", "Segoe UI", sans-serif;
    min-height: 42px;
    padding: 10px 18px;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 53, 57, .18);
    transition: all 0.2s ease;
}

.button-print:hover {
    background: var(--brand-3);
    box-shadow: 0 12px 28px rgba(15, 53, 57, .24);
    transform: translateY(-1px);
}

.button-print-secondary {
    background: rgba(255, 255, 255, .78);
    color: var(--brand);
    box-shadow: none;
}

.button-print-secondary:hover {
    background: rgba(255, 255, 255, .94);
    color: var(--brand-3);
    box-shadow: 0 10px 20px rgba(21, 36, 73, 0.10);
}

.button-print svg {
    flex-shrink: 0;
}

input,
select {
    background: #f9f4ec;
    border: 1px solid #b9c4c4;
    border-radius: 6px;
    color: var(--ink);
    font: 15px/1.3 "Aptos", "Segoe UI", sans-serif;
    min-height: 40px;
    padding: 8px 11px;
    width: 100%;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    gap: 6px;
}

.site-header {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(17, 29, 58, .96), rgba(34, 60, 122, .94)),
        radial-gradient(circle at left, rgba(133, 89, 214, .25), transparent 22rem);
    box-shadow: var(--shadow-strong);
    display: flex;
    justify-content: space-between;
    margin: 18px clamp(14px, 3vw, 34px) 0;
    padding: 18px clamp(18px, 4vw, 34px);
    border-radius: 14px;
    gap: 24px;
}

.brand-lockup {
    align-items: center;
    display: flex;
    gap: 16px;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    display: flex;
    flex: 0 0 92px;
    height: 92px;
    justify-content: center;
}

.brand-mark img {
    display: block;
    filter: drop-shadow(0 10px 22px rgba(9, 18, 39, 0.26));
    height: 92px;
    object-fit: contain;
    width: 92px;
}

.brand-copy {
    min-width: 0;
}

.brand-copy h1 {
    color: #f8fbff;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: .01em;
    line-height: .95;
    margin: 0;
}

.brand-copy p {
    color: rgba(248, 251, 255, 0.72);
    font-size: 14px;
    margin: 4px 0 0;
}

.brand-kicker {
    color: rgba(248, 251, 255, 0.72);
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.site-header nav a {
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: #f8fbff;
    font-weight: 700;
    padding: 10px 16px;
    text-decoration: none;
}

.site-header nav .button-link {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: #f8fbff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 16px;
}

.page {
    margin: 0 auto;
    max-width: 1240px;
    padding: 28px clamp(18px, 4vw, 56px) 48px;
}

.page-admin {
    max-width: min(1680px, calc(100vw - 24px));
    padding: 24px clamp(12px, 2.5vw, 28px) 40px;
}

.page-attendance-import {
    max-width: min(1880px, calc(100vw - 18px));
    padding: 24px clamp(10px, 1.8vw, 24px) 40px;
}

.site-footer {
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(34, 60, 122, 0.1);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(21, 36, 73, 0.12);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 clamp(18px, 4vw, 56px) 28px;
    padding: 14px 18px;
    backdrop-filter: blur(10px);
}

.site-footer-copy {
    display: grid;
    gap: 4px;
}

.site-footer-copy p {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.site-footer-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.site-footer-meta a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.site-footer-meta a:hover,
.site-footer-brand:hover {
    opacity: .88;
}

.site-footer-brand {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 0;
    text-decoration: none;
}

.site-footer-brand-full {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 42px;
    min-width: 0;
}

.site-footer-brand img {
    display: block;
    height: auto;
    max-width: 113px;
    object-fit: contain;
    width: 100%;
}

.site-footer-brand-fallback {
    color: var(--brand);
    display: none;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.site-footer-brand-full.is-fallback .site-footer-brand-fallback {
    display: inline-block;
}

.eyebrow {
    color: var(--brand-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.hero-card,
.panel,
.course-card,
.flash,
.alert,
.empty-state {
    background: var(--panel);
    border: 1px solid rgba(34, 60, 122, 0.1);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.hero-card {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: clamp(24px, 4vw, 38px);
}

.hero-card.compact {
    align-items: flex-start;
}

.hero-card h2 {
    font-size: clamp(28px, 4vw, 46px);
    line-height: .98;
    margin: 0 0 14px;
}

.hero-card p {
    color: var(--muted);
    font-size: 17px;
    margin: 0;
    max-width: 720px;
}

.metric-grid {
    background: linear-gradient(145deg, #233d7b, #172d57);
    color: #f8fbff;
    border-radius: 12px;
    min-width: 150px;
    padding: 22px;
    text-align: center;
}

.metric-grid strong {
    display: block;
    font-size: 38px;
}

.metric-grid span {
    color: rgba(246, 239, 229, .72);
}

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

.finder-panel,
.dashboard-panel,
.course-card,
.hero-card-dashboard,
.admin-hero {
    box-shadow: 0 24px 58px rgba(21, 36, 73, 0.18);
}

.hero-card-dashboard {
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(245, 249, 255, .90)),
        radial-gradient(circle at top right, rgba(133, 89, 214, .14), transparent 16rem);
}

.hero-main-copy {
    display: grid;
    gap: 16px;
}

.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-side-stack {
    display: grid;
    gap: 14px;
    min-width: min(100%, 360px);
}

.modern-metric-grid {
    text-align: left;
}

.modern-metric-grid strong {
    font-size: 42px;
}

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

.mini-metric-card,
.dashboard-stat-card {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(34, 60, 122, 0.1);
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(21, 36, 73, 0.14);
    overflow: hidden;
    padding: 16px 18px;
    position: relative;
}

.mini-metric-card span,
.dashboard-stat-copy span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.mini-metric-card strong,
.dashboard-stat-copy strong {
    color: var(--ink);
    display: block;
    font-size: 24px;
    line-height: 1;
}

.dashboard-stat-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 22px;
}

.dashboard-stat-grid.compact {
    margin-bottom: 18px;
}

.dashboard-stat-card {
    display: grid;
    gap: 16px;
    min-height: 148px;
}

.dashboard-stat-bar {
    align-self: end;
    background: rgba(34, 60, 122, 0.08);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.dashboard-stat-bar span {
    display: block;
    height: 100%;
    width: 72%;
}

.accent-violet .dashboard-stat-bar span,
.accent-violet.mini-metric-card::before {
    background: linear-gradient(90deg, #8559d6, #b48cff);
}

.accent-sky .dashboard-stat-bar span,
.accent-sky.mini-metric-card::before {
    background: linear-gradient(90deg, #46a3ff, #85d1ff);
}

.accent-amber .dashboard-stat-bar span,
.accent-amber.mini-metric-card::before {
    background: linear-gradient(90deg, #e59c3a, #ffcb6a);
}

.accent-mint .dashboard-stat-bar span,
.accent-mint.mini-metric-card::before {
    background: linear-gradient(90deg, #33b98f, #7ce0bf);
}

.accent-rose .dashboard-stat-bar span,
.accent-rose.mini-metric-card::before {
    background: linear-gradient(90deg, #f06a87, #ffb0c1);
}

.mini-metric-card::before {
    border-radius: 999px;
    content: "";
    display: block;
    height: 6px;
    margin-bottom: 12px;
    width: 52px;
}

.page-home {
    max-width: min(1480px, calc(100vw - 24px));
    padding: 26px clamp(12px, 2.6vw, 34px) 42px;
}

.home-hero {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(280px, 365px);
}

.home-hero-copy {
    align-content: center;
    display: grid;
}

.home-hero-copy h2 {
    margin-bottom: 10px;
}

.home-date {
    font-weight: 700;
    margin-bottom: 24px !important;
}

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

.home-event-card {
    align-content: center;
    background: linear-gradient(145deg, #223c7a, #172d57);
    border-radius: 10px;
    color: #f8fbff;
    display: grid;
    gap: 8px;
    padding: 24px;
}

.home-event-card.is-blocked {
    background: linear-gradient(145deg, #656f78, #46515b);
}

.home-event-card.is-virtual {
    background: linear-gradient(145deg, #276f87, #214879);
}

.home-event-card span {
    color: rgba(248, 251, 255, .72);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.home-event-card strong {
    font-size: 26px;
    line-height: 1.1;
}

.home-event-card small {
    color: rgba(248, 251, 255, .84);
    font-size: 14px;
}

.home-event-card em {
    background: rgba(255, 255, 255, .14);
    border-radius: 5px;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    justify-self: start;
    margin-top: 8px;
    padding: 7px 10px;
}

.home-metric-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(132px, 1fr)) minmax(200px, 1.35fr);
    margin-bottom: 22px;
}

.home-metric-grid .mini-metric-card {
    min-height: 118px;
    padding: 14px 16px;
}

.home-progress-card {
    background: linear-gradient(135deg, #213a75, #152a51);
    border-radius: 10px;
    color: #f8fbff;
    display: grid;
    gap: 6px;
    padding: 17px 18px;
}

.home-progress-card span,
.home-progress-card small {
    color: rgba(248, 251, 255, .76);
    font-size: 13px;
}

.home-progress-card strong {
    font-size: 28px;
}

.home-content-grid {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr);
}

.home-section-heading {
    align-items: center;
}

.home-section-heading h3,
.home-side-column h3 {
    font-size: 21px;
    margin: 0;
}

.home-section-total {
    background: var(--brand);
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    padding: 9px 14px;
}

.home-agenda-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
}

.home-day-switcher {
    background: #edf2f8;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: flex;
    overflow: hidden;
}

.home-day-switcher a {
    border-right: 1px solid var(--line);
    color: var(--brand);
    display: block;
    font-size: 12px;
    font-weight: 800;
    padding: 10px 12px;
    text-decoration: none;
}

.home-day-switcher a:last-child {
    border-right: 0;
}

.home-day-switcher a.is-active,
.home-day-switcher a:hover {
    background: var(--brand);
    color: #fff;
}

.home-agenda {
    border-top: 1px solid var(--line);
    display: grid;
}

.home-agenda-row {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 14px;
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 14px 0;
}

.home-agenda-row > time {
    color: var(--brand);
    font-size: 14px;
    font-weight: 900;
    padding: 12px 8px 0 0;
}

.home-agenda-classes {
    display: grid;
    gap: 9px;
}

.home-class-item {
    align-items: center;
    background: #f5f8fd;
    border: 1px solid rgba(34, 60, 122, .12);
    border-left: 4px solid var(--brand-2);
    border-radius: 7px;
    color: var(--ink);
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    text-decoration: none;
}

.home-class-item.is-blocked {
    border-left-color: #7b8389;
}

.home-class-item > span,
.home-class-item > strong,
.home-class-item > small {
    grid-column: 1;
}

.home-class-item span {
    color: var(--brand-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.home-class-item strong {
    font-size: 15px;
}

.home-class-item small {
    color: var(--muted);
}

.home-class-item em {
    background: #fff2cc;
    border-radius: 5px;
    color: #735b11;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    grid-column: 2;
    grid-row: 1 / span 3;
    padding: 7px 9px;
}

.home-class-item em.is-ready {
    background: #ddf3e4;
    color: #246537;
}

.home-class-item em.is-planned {
    background: #dbeafb;
    color: #18528b;
}

.home-class-item em.is-virtual {
    background: #eadffc;
    color: #6335a8;
}

.home-class-item.is-blocked em {
    background: #e5e8eb;
    color: #59636b;
}

.home-side-column {
    display: grid;
    gap: 18px;
}

.home-side-column .panel {
    margin: 0;
}

.home-alert-group {
    background: #f5f8fd;
    border: 1px solid rgba(34, 60, 122, .1);
    border-radius: 7px;
    display: grid;
    gap: 0;
    margin-top: 12px;
    overflow: hidden;
}

.home-alert-group header {
    align-items: center;
    border-bottom: 1px solid rgba(34, 60, 122, .1);
    display: grid;
    gap: 10px;
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 9px 10px;
}

.home-alert-group header strong {
    color: var(--brand);
    font-size: 22px;
    text-align: center;
}

.home-alert-group header span {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.home-alert-group a {
    border-bottom: 1px solid rgba(34, 60, 122, .08);
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    text-decoration: none;
}

.home-alert-group a:hover {
    background: #edf3fc;
}

.home-alert-group a:last-of-type {
    border-bottom: 0;
}

.home-alert-group b {
    font-size: 13px;
}

.home-alert-group small,
.home-alert-group p {
    color: var(--muted);
    font-size: 12px;
}

.home-alert-group p {
    margin: 0;
    padding: 9px 10px;
}

.home-event-row {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px 0;
}

.home-event-row div {
    display: grid;
    gap: 3px;
}

.home-event-row strong {
    font-size: 14px;
}

.home-event-row span {
    color: var(--muted);
    font-size: 12px;
}

.home-event-row time {
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-hero {
    background:
        linear-gradient(135deg, rgba(255,255,255,.95), rgba(243,247,255,.92)),
        radial-gradient(circle at top right, rgba(133, 89, 214, .16), transparent 18rem);
}

.admin-hero-dashboard {
    align-items: center;
    grid-template-columns: 1fr auto;
}

.hero-side-note {
    align-items: flex-end;
    background: linear-gradient(160deg, #223c7a, #16284f);
    border-radius: 12px;
    color: #f8fbff;
    display: grid;
    gap: 6px;
    min-width: 250px;
    padding: 22px;
    text-align: right;
}

.hero-side-label {
    color: rgba(248, 251, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero-side-note strong {
    font-size: 40px;
    line-height: 1;
}

.hero-side-note small {
    color: rgba(248, 251, 255, 0.72);
    font-size: 13px;
}

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

.filters-wide {
    grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
}

.finder-panel {
    position: relative;
}

.finder {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) minmax(260px, 1.3fr) auto;
}

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

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

.consult-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 22px;
}

.admin-two-col {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.admin-two-col-wide {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
}

.manage-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(420px, .9fr);
}

.manage-stack {
    display: grid;
    gap: 22px;
}

.admin-links-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 22px;
}

.admin-link-card {
    background: rgba(240, 232, 220, .95);
    border: 1px solid rgba(29, 43, 47, .14);
    box-shadow: 0 20px 52px rgba(15, 53, 57, .14);
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 18px;
    text-decoration: none;
}

.admin-link-card strong {
    font-size: 20px;
}

.admin-link-card span {
    color: var(--muted);
}

.admin-page-head {
    align-items: end;
    margin-bottom: 18px;
}

.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.admin-subnav a {
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(34, 60, 122, 0.1);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(21, 36, 73, 0.12);
    text-decoration: none;
}

.admin-subnav a.is-active {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: white;
}

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

.admin-dashboard-grid-refined .dashboard-panel {
    min-height: 320px;
}

.admin-history-layout {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.admin-history-sidebar,
.history-editor-panel {
    padding: 22px;
}

.admin-history-sidebar .stack-form {
    width: 100%;
}

.admin-history-sidebar .stack-form label,
.admin-history-sidebar .stack-form input {
    min-width: 0;
    width: 100%;
}

.admin-history-student-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    max-height: 860px;
    overflow: auto;
    padding-right: 4px;
    width: 100%;
}

.admin-history-student-item {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(34, 60, 122, 0.1);
    border-radius: 10px;
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px;
    width: 100%;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-history-student-list > a.admin-history-student-item {
    display: grid !important;
    text-decoration: none !important;
    width: 100%;
}

.admin-history-student-item strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
}

.admin-history-student-item span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    line-height: 1.25;
}

.admin-history-student-item:hover,
.admin-history-student-item.is-active {
    border-color: rgba(133, 89, 214, 0.26);
    box-shadow: 0 12px 24px rgba(21, 36, 73, 0.08);
    transform: translateY(-1px);
}

.admin-history-main {
    display: grid;
    gap: 18px;
}

.dashboard-panel {
    display: grid;
    grid-column: span 4;
    min-height: 260px;
}

.dashboard-panel-wide {
    grid-column: span 6;
}

.dashboard-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.dashboard-panel-heading {
    align-items: center;
    margin-bottom: 14px;
}

.dashboard-panel-total {
    align-items: center;
    background: linear-gradient(135deg, rgba(34, 60, 122, 0.16), rgba(133, 89, 214, 0.16));
    border-radius: 999px;
    color: var(--brand);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-width: 48px;
    padding: 10px 14px;
}

.dashboard-table {
    min-width: 100%;
}

.dashboard-table th:first-child,
.dashboard-table td:first-child {
    text-align: center;
    white-space: nowrap;
    width: 52px;
}

.dashboard-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.page-admin .panel {
    padding: 16px;
}

.page-admin .hero-card {
    padding: 20px 24px;
}

.page-admin .hero-card h2,
.page-admin .admin-page-head h2 {
    font-size: clamp(32px, 4vw, 48px);
    margin: 0;
}

.page-admin .hero-card p,
.page-admin .admin-page-head p {
    max-width: none;
}

.page-admin input,
.page-admin select {
    font-size: 14px;
    min-height: 36px;
    padding: 6px 10px;
}

.page-admin button,
.page-admin .button-muted {
    border-radius: 6px;
    font-size: 13px;
    min-height: 34px;
    padding: 8px 12px;
}

.page-admin .filters {
    gap: 10px;
}

.page-admin .filters-wide {
    grid-template-columns: minmax(130px, 180px) minmax(120px, 140px) minmax(180px, 1fr) auto;
}

.subjects-filters {
    flex: 1;
    grid-template-columns: minmax(130px, 180px) minmax(110px, 130px) minmax(200px, 260px) minmax(220px, 1fr);
}

.admin-toolbar {
    align-items: end;
    gap: 16px;
}

.admin-toolbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.holiday-year-filter {
    display: block;
    min-width: 150px;
}

.page-admin .data-table {
    min-width: 100%;
    width: 100%;
}

.page-admin .data-table th,
.page-admin .data-table td {
    padding: 6px 8px;
}

.page-admin .data-table th {
    font-size: 13px;
}

.page-admin .data-table td {
    font-size: 14px;
}

.page-admin .data-table input,
.page-admin .data-table select {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 14px;
    width: 100%;
}

.page-admin .data-table input[type="email"] {
    max-width: 200px;
}

.page-admin .data-table input[type="text"] {
    max-width: 180px;
}

.page-admin .data-table td:first-child input {
    max-width: 160px;
}

.page-admin .data-table td:nth-child(2) input {
    max-width: 90px;
}

.page-admin .table-wrap {
    overflow-x: auto;
}

.page-admin .action-cell {
    align-items: center;
    gap: 4px;
    justify-content: flex-start;
    min-width: 240px;
    flex-wrap: nowrap;
}

.page-admin .action-cell form,
.page-admin .action-cell a {
    display: inline-flex;
}

.page-admin .action-cell .button-muted,
.page-admin .action-cell button {
    min-height: 30px;
    padding: 5px 8px;
    white-space: nowrap;
    font-size: 12px;
}

.subjects-table {
    min-width: 100%;
    table-layout: fixed;
    width: 100%;
}

.subjects-table .col-career {
    width: 80px;
}

.subjects-table .col-year {
    width: 60px;
}

.subjects-table .col-subject {
    width: 320px;
}

.subjects-table .col-format {
    width: 160px;
}

.subjects-table .col-teachers {
    width: 180px;
}

.subjects-table .col-count {
    text-align: center;
    width: 70px;
}

.subjects-table .col-actions {
    width: 240px;
}

.subjects-table input[type="text"],
.subjects-table input[type="number"],
.subjects-table select {
    font-size: 12px;
    padding: 4px 6px;
    min-height: 28px;
}

.page-admin .subjects-table td.col-subject input[type="text"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-width: none;
    font-size: 14px;
    font-weight: 500;
}

.page-admin .subjects-table td.col-teachers select {
    font-size: 14px;
    font-weight: 500;
}

.subjects-table .col-year input {
    text-align: center;
}

.subject-format-grid {
    display: grid;
    gap: 0.3rem;
    grid-template-columns: minmax(0, 1fr) 60px;
}

.subject-format-grid input {
    font-size: 11px;
}

.subjects-teacher-text {
    display: block;
    line-height: 1.3;
    white-space: normal;
}

.manage-side-panel .result-heading {
    margin-bottom: 12px;
}

.enrollment-form {
    margin-bottom: 12px;
}

.enrollment-form-wide {
    margin-bottom: 16px;
}

.enrollment-form-grid {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 120px auto;
}

.enrollment-form-grid-wide {
    grid-template-columns: minmax(240px, 1fr) 240px auto;
}

.enrollment-form-grid label {
    min-width: 0;
}

.enrollment-form-actions {
    justify-content: flex-start;
}

.compact-table-wrap {
    overflow-x: auto;
}

.compact-table {
    min-width: 100%;
}

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

.compact-table .col-student {
    width: auto;
}

.compact-table .col-status {
    width: 190px;
}

.compact-table .col-attendance {
    text-align: center;
    width: 64px;
}

.compact-table .col-actions {
    width: 158px;
}

.compact-table td.col-student {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-table td.col-status select {
    max-width: 190px;
}

.compact-table .action-cell {
    min-width: 0;
}

.compact-actions {
    gap: 5px;
    flex-wrap: nowrap;
}

.compact-actions form,
.compact-actions a {
    flex: 0 0 auto;
}

.compact-actions .button-muted,
.compact-actions button {
    min-height: 30px;
    padding: 5px 8px;
}

.enrollment-table {
    min-width: 940px;
}

.enrollment-table .col-student {
    width: auto;
}

.enrollment-table .col-status {
    width: 210px;
}

.enrollment-table .col-status select {
    max-width: 210px;
}

.enrollment-table .col-attendance {
    text-align: center;
    width: 90px;
}

.enrollment-table .col-actions {
    width: 240px;
}

.enrollment-table td.col-student {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-builder-grid {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(140px, 180px) minmax(160px, 220px) auto;
}

.schedule-builder-actions {
    justify-content: flex-start;
}

.admin-slot-picker {
    margin-top: 6px;
}

.page-admin .inline-check {
    white-space: nowrap;
}

.page-admin .pagination {
    margin-top: 14px;
}

.admin-pagination {
    margin-top: 14px;
}

.pagination-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-button,
.page-number,
.page-gap {
    border: 1px solid rgba(29, 43, 47, .14);
    color: var(--ink);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 6px 10px;
    text-decoration: none;
}

.page-button,
.page-number {
    background: rgba(240, 232, 220, .95);
}

.page-number.is-current {
    background: var(--brand);
    color: white;
}

.page-button.is-disabled {
    opacity: .45;
}

.page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.consult-grid h3,
.result-panel h3 {
    margin-top: 0;
}

.compact-suggestions {
    grid-template-columns: 1fr;
}

.result-panel {
    margin-top: 22px;
}

.history-panel {
    margin-top: -4px;
}

.history-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.history-editor-panel .group-title {
    margin-top: 20px;
}

.history-editor-table th,
.history-editor-table td {
    vertical-align: middle;
}

.history-editor-table select,
.history-editor-table input {
    min-height: 38px;
    min-width: 0;
}

.history-status-select {
    border-width: 1px;
    font-weight: 700;
}

.history-status-select.is-aprobada {
    background: #e0f3dd;
    border-color: #9ed08f;
    color: #2d7a3d;
}

.history-status-select.is-en-curso {
    background: #d9ddff;
    border-color: #9ca9ff;
    color: #3544a5;
}

.history-status-select.is-regular {
    background: #fff1c7;
    border-color: #f0ce69;
    color: #8a6a00;
}

.history-status-select.is-equivalencia {
    background: #ead9fb;
    border-color: #c59cf0;
    color: #7a43b4;
}

.history-status-select.is-libre {
    background: #ffd7d1;
    border-color: #ec7e70;
    color: #b52115;
}

.history-status-select.is-sin-estado {
    background: #f7f1e8;
    border-color: #d9c9b3;
    color: var(--muted);
}

.history-editor-actions {
    white-space: nowrap;
    width: 1%;
}

.history-editor-form-bank {
    display: none;
}

.result-heading {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.result-heading h2 {
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1;
    margin: 0 0 10px;
}

.result-count {
    background: var(--brand);
    border-radius: 6px;
    color: white;
    padding: 12px 16px;
    white-space: nowrap;
}

.group-title {
    border-left: 4px solid var(--brand-2);
    margin: 24px 0 12px;
    padding-left: 10px;
}

.suggestions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 18px;
}

.suggestion-card {
    background: linear-gradient(135deg, #f4eadc, #dce8e4);
    border: 1px solid rgba(29, 43, 47, .14);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 4px;
    padding: 14px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.suggestion-card:hover {
    border-color: rgba(22, 74, 91, .35);
    box-shadow: 0 14px 30px rgba(22, 74, 91, .10);
    transform: translateY(-2px);
}

.suggestion-card strong {
    font-size: 17px;
}

.suggestion-card span,
.suggestion-card em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.section-note {
    color: var(--brand-2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    margin: 20px 0 10px;
    text-transform: uppercase;
}

.course-list {
    display: grid;
    gap: 18px;
}

.weekly-calendar-hero {
    align-items: center;
}

.weekly-calendar-filters .filters {
    grid-template-columns: minmax(220px, 1.1fr) minmax(120px, .55fr) minmax(220px, 1fr) auto auto;
}

.weekly-calendar-panel {
    padding: 0;
    overflow: hidden;
}

.weekly-calendar-table-wrap {
    overflow: auto;
}

.weekly-calendar-table {
    display: grid;
    grid-template-columns: 116px repeat(var(--calendar-days), minmax(180px, 1fr));
    min-width: 1180px;
}

.weekly-calendar-corner,
.weekly-calendar-head,
.weekly-calendar-time,
.weekly-calendar-cell {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.weekly-calendar-corner,
.weekly-calendar-head {
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    color: white;
    font-weight: 800;
    min-height: 48px;
    padding: 14px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.weekly-calendar-corner {
    left: 0;
    z-index: 3;
}

.weekly-calendar-time {
    align-items: center;
    background: rgba(34, 60, 122, 0.08);
    color: var(--brand);
    display: flex;
    font-size: 13px;
    font-weight: 900;
    justify-content: center;
    min-height: 110px;
    padding: 10px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.weekly-calendar-cell {
    background: rgba(255, 255, 255, 0.64);
    display: grid;
    gap: 8px;
    min-height: 110px;
    padding: 8px;
}

.weekly-class-card {
    background: linear-gradient(135deg, #f8fbff, #edf4ff);
    border: 1px solid rgba(34, 60, 122, 0.12);
    border-left: 5px solid var(--brand-2);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(21, 36, 73, 0.1);
    color: var(--ink);
    display: grid;
    gap: 4px;
    justify-content: stretch;
    min-height: auto;
    padding: 10px;
    text-decoration: none;
    text-align: left;
    width: 100%;
}

.weekly-class-card:hover {
    border-left-color: var(--brand);
    box-shadow: 0 16px 30px rgba(21, 36, 73, 0.16);
    transform: translateY(-1px);
}

.weekly-class-card[hidden] {
    display: none;
}

.weekly-class-card span,
.weekly-class-card small,
.weekly-class-card em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    line-height: 1.2;
}

.weekly-class-card span {
    color: var(--brand-2);
    font-weight: 900;
    text-transform: uppercase;
}

.weekly-class-card strong {
    font-size: 14px;
    line-height: 1.2;
}

.weekly-class-card em {
    background: rgba(34, 60, 122, 0.1);
    border-radius: 999px;
    color: var(--brand);
    display: inline-flex;
    font-weight: 800;
    justify-self: start;
    padding: 4px 8px;
}

.weekly-calendar-empty {
    min-height: 1px;
}

.weekly-detail-backdrop {
    align-items: center;
    background: rgba(14, 25, 48, 0.52);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 20;
}

.weekly-detail-backdrop[hidden] {
    display: none;
}

.weekly-detail-panel {
    background: var(--panel-strong);
    border: 1px solid rgba(34, 60, 122, 0.16);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    max-height: min(760px, calc(100vh - 40px));
    max-width: 920px;
    overflow: auto;
    padding: 22px;
    width: min(100%, 920px);
}

.weekly-detail-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 16px;
}

.weekly-detail-head h3 {
    font-size: 28px;
    line-height: 1.05;
    margin: 0 0 8px;
}

.weekly-detail-head p:last-child {
    color: var(--muted);
    font-weight: 700;
    margin: 0;
}

.weekly-detail-close {
    flex: 0 0 auto;
}

.weekly-detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
}

.weekly-detail-grid h4 {
    font-size: 18px;
    margin: 0 0 10px;
}

.weekly-detail-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.weekly-detail-list li {
    background: rgba(231, 237, 247, 0.72);
    border: 1px solid rgba(34, 60, 122, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
}

.weekly-detail-students li {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.weekly-detail-students strong {
    font-size: 14px;
    line-height: 1.25;
}

.weekly-detail-students span {
    background: rgba(34, 60, 122, 0.1);
    border-radius: 999px;
    color: var(--brand);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.weekly-detail-empty {
    color: var(--muted);
    font-weight: 700;
}

.focused-list {
    margin-top: 0;
}

.grades-print-panel {
    margin-top: -4px;
}

.history-sheet {
    max-width: 1180px;
}

.history-header {
    grid-template-columns: 1fr minmax(280px, 340px);
}

.history-summary-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 22px;
}

.history-profile {
    margin-top: 22px;
}

.history-profile-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-profile-head h2 {
    font-size: 28px;
    margin: 0 0 6px;
}

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

.history-table td:first-child,
.history-table th:first-child {
    text-align: center;
    width: 54px;
}

.history-table td:nth-child(3),
.history-table th:nth-child(3),
.history-table td:nth-child(4),
.history-table th:nth-child(4),
.history-table td:nth-child(5),
.history-table th:nth-child(5) {
    text-align: center;
    white-space: nowrap;
}

.history-inline-note {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.history-status-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
}

.history-status-badge.aprobada {
    background: #e2f6df;
    color: #1f6e2a;
}

.history-status-badge.en-curso {
    background: #dde6ff;
    color: #3551aa;
}

.history-status-badge.regular {
    background: #fff3c9;
    color: #8c6510;
}

.history-status-badge.equivalencia {
    background: #f0e3ff;
    color: #7a44b2;
}

.history-status-badge.libre {
    background: #ffdede;
    color: #8f211f;
}

.history-status-badge.sin-estado {
    background: #edf1f7;
    color: #516173;
}

.history-profile-notes {
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(34, 60, 122, 0.12);
    border-radius: 10px;
    color: var(--muted);
    margin-top: 12px;
    padding: 12px 14px;
}

.selected-card {
    border-color: rgba(143, 90, 50, .28);
}

.course-card {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr minmax(280px, 360px);
    padding: 22px;
}

.course-card h3 {
    font-size: 24px;
    margin: 10px 0 8px;
}

.muted,
.help-text {
    color: var(--muted);
}

.badge-row,
.slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge,
.slot-list span {
    background: var(--brand);
    border-radius: 5px;
    color: white;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 11px;
}

.badge-soft,
.slot-list span {
    background: #d8e2df;
    color: var(--brand);
}

.course-actions {
    display: grid;
    gap: 12px;
}

.course-actions form {
    background: var(--panel-strong);
    border: 1px solid rgba(29, 43, 47, .13);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.admin-card {
    background: var(--panel-strong);
    border: 1px solid rgba(29, 43, 47, .13);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.admin-card h4 {
    margin: 0;
}

.form-error {
    color: #8d2d1f;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.slot-picker {
    border: 1px solid rgba(29, 43, 47, .13);
    margin: 0;
    padding: 12px;
}

.slot-picker legend {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
}

.checkbox-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.check-tile {
    align-items: center;
    background: #f7f1e8;
    border: 1px solid rgba(29, 43, 47, .14);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
}

.check-tile input {
    min-height: auto;
    padding: 0;
    width: auto;
}

.empty-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.flash,
.alert,
.empty-state {
    margin-bottom: 18px;
    padding: 16px 18px;
}

.empty-state-large {
    color: var(--muted);
    font-size: 17px;
    padding: 28px;
}

.flash {
    background: #ecfdf3;
    border-color: #b7efc5;
}

.alert {
    background: var(--danger-soft);
    border-color: #ffd4d0;
}

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

.data-table,
.print-table {
    border-collapse: collapse;
    width: 100%;
}

.data-table th,
.data-table td,
.print-table th,
.print-table td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    color: white;
}

.print-table th {
    background: var(--brand);
    color: white;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(213, 224, 220, .55);
}

.data-table tbody tr:nth-child(odd) {
    background: rgba(249, 244, 236, .62);
}

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

.action-cell form,
.action-cell a {
    margin: 0;
}

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

.inline-check input {
    min-height: auto;
    padding: 0;
    width: auto;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

.attendance-clear-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.attendance-edit-tools {
    display: grid;
    gap: 12px;
    min-width: min(100%, 320px);
}

.attendance-edit-tools .admin-card {
    margin: 0;
}

.attendance-edit-tools button,
.attendance-edit-tools .button-muted,
.attendance-edit-tools a {
    width: 100%;
}

.attendance-edit-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attendance-status-select.is-present {
    background: #edf7ef;
    border-color: #a9cdb2;
    color: #23462e;
}

.attendance-status-select.is-absent {
    background: #fff0ee;
    border-color: #d7aba4;
    color: #7a2d23;
}

.attendance-status-select.is-justified {
    background: #fff8df;
    border-color: #dcc788;
    color: #6c5720;
}

.attendance-import-upload {
    grid-template-columns: minmax(180px, 260px);
    justify-content: start;
}

.attendance-import-toolbar {
    align-items: end;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(180px, 260px) minmax(240px, 390px) auto;
    position: relative;
    z-index: 2;
}

.attendance-import-subject-picker {
    position: relative;
}

.attendance-import-subject-picker input {
    width: 100%;
}

.attendance-import-subject-results {
    background: #fff;
    border: 1px solid #c9d4e5;
    border-radius: 6px;
    box-shadow: 0 12px 24px rgba(19, 35, 70, .16);
    left: 0;
    max-height: 330px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 12;
}

.attendance-import-subject-results[hidden],
.attendance-import-subject-results a[hidden] {
    display: none;
}

.attendance-import-subject-results a {
    border-bottom: 1px solid #e5eaf2;
    color: #102747;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    text-decoration: none;
}

.attendance-import-subject-results a:last-of-type {
    border-bottom: 0;
}

.attendance-import-subject-results a:hover,
.attendance-import-subject-results a.is-current {
    background: #ecf2fb;
}

.attendance-import-subject-results span {
    color: #526889;
    font-size: 12px;
}

.attendance-import-subject-empty {
    color: #526889;
    margin: 0;
    padding: 12px;
}

.attendance-import-print-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-self: end;
}

.attendance-import-print-actions a {
    min-height: 42px;
}

.attendance-import-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    z-index: 1;
}

.attendance-import-preview {
    min-width: 0;
}

.attendance-import-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.attendance-import-table-wrap {
    max-height: 82vh;
    overflow: auto;
}

.attendance-import-table {
    min-width: max-content;
    table-layout: auto;
}

.attendance-import-table th {
    font-size: 11px;
    line-height: 1.15;
    min-width: 72px;
    padding: 6px 4px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.attendance-import-table th.col-number,
.attendance-import-table th.col-student {
    z-index: 3;
}

.attendance-import-table td {
    font-size: 12px;
    padding: 5px 4px;
    text-align: center;
    vertical-align: middle;
}

.attendance-import-table .col-number {
    left: 0;
    min-width: 40px;
    position: sticky;
    width: 40px;
    z-index: 1;
}

.attendance-import-table .col-student {
    left: 40px;
    min-width: clamp(150px, 14vw, 210px);
    position: sticky;
    text-align: left;
    z-index: 1;
}

.attendance-import-table tbody .col-number,
.attendance-import-table tbody .col-student {
    background: #f8fbff;
}

.attendance-import-table .holiday-head {
    background: linear-gradient(135deg, #6f7678, #555f61) !important;
    color: white !important;
}

.attendance-import-table .virtual-head {
    background: linear-gradient(135deg, #276f87, #214879) !important;
    color: white !important;
}

.attendance-import-table .holiday-mark {
    background: #e1e4e7;
    color: #67717a;
}

.attendance-import-holiday-label,
.attendance-import-disabled-cell {
    display: block;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    margin-top: 3px;
    text-transform: uppercase;
}

.attendance-import-disabled-cell {
    color: #59636b;
    margin: 0;
}

.attendance-import-student-head {
    font-size: 13px !important;
    font-weight: 900;
}

.attendance-import-table .col-student {
    max-width: 210px;
}

.attendance-import-student-cell {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.attendance-import-student-cell span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-import-row-actions {
    display: inline-flex;
    gap: 3px;
}

.attendance-import-row-actions button {
    border-radius: 4px;
    box-shadow: none;
    font-size: 10px;
    min-height: 24px;
    padding: 3px 6px;
}

.attendance-import-table select {
    font-size: 10px;
    min-height: 28px;
    min-width: 72px;
    width: 72px;
    padding: 4px 3px;
}

.attendance-import-table select.is-present {
    background: #edf7ef;
    border-color: #a9cdb2;
    color: #23462e;
}

.attendance-import-table select.is-absent {
    background: #fff0ee;
    border-color: #d7aba4;
    color: #7a2d23;
}

.attendance-import-table select.is-justified {
    background: #fff8df;
    border-color: #dcc788;
    color: #6c5720;
}

.pagination {
    margin-top: 20px;
}

.print-body {
    background: white;
}

.print-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 18px;
}

.print-options {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-right: auto;
}

.print-options .inline-check {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(34, 60, 122, 0.14);
    border-radius: 999px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 12px;
}

.student-print-minimal .print-column-teacher,
.student-print-minimal .print-column-condition,
.student-print-minimal .print-column-attendance,
.student-print-minimal .print-attendance-legend {
    display: none;
}

.student-print-minimal.show-print-teacher .print-column-teacher,
.student-print-minimal.show-print-condition .print-column-condition,
.student-print-minimal.show-print-attendance .print-column-attendance,
.student-print-minimal.show-print-attendance .print-attendance-legend {
    display: table-cell;
}

.student-print-minimal.show-print-attendance .print-attendance-legend {
    display: flex;
}

.toolbar-button {
    border: 0;
    border-radius: 7px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 700 14px/1.2 "Aptos", "Segoe UI", sans-serif;
    min-height: 42px;
    padding: 10px 18px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(15, 53, 57, .15);
    transition: all 0.2s ease;
}

.toolbar-button:hover {
    background: var(--brand-3);
    box-shadow: 0 6px 16px rgba(15, 53, 57, .22);
    transform: translateY(-1px);
}

.toolbar-button svg {
    flex-shrink: 0;
}

.toolbar-button-secondary {
    background: var(--brand-2);
}

.toolbar-button-secondary:hover {
    background: #8f5730;
}

.toolbar-button-muted {
    background: #d6dedc;
    color: var(--brand);
    box-shadow: none;
}

.toolbar-button-muted:hover {
    background: #c5cfcd;
    transform: translateY(-1px);
}

.attendance-sheet {
    background: white;
    margin: 0 auto;
    max-width: 1120px;
    padding: 20px;
}

.monthly-sheet {
    max-width: 100%;
}

.grades-sheet {
    max-width: 100%;
}

.sheet-header.grades-compact-header {
    align-items: center;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) minmax(240px, auto) auto;
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.grades-compact-header .sheet-title-block {
    gap: 14px;
    grid-template-columns: 76px minmax(0, 1fr);
}

.grades-compact-header .sheet-logo img {
    height: 76px;
    width: 76px;
}

.grades-compact-header h1 {
    font-size: 34px;
    line-height: 1.05;
    margin: 0 0 8px;
}

.grades-compact-header .sheet-title-copy p,
.grades-compact-header .sheet-meta p {
    font-size: 14px;
    line-height: 1.25;
}

.grades-compact-header .sheet-meta {
    min-width: 230px;
}

.grades-print-actions {
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    padding: 0;
}

.sheet-header {
    border-bottom: 3px solid var(--brand);
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr minmax(260px, 360px);
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.sheet-header h1 {
    font-size: 30px;
    margin: 0 0 8px;
}

.sheet-title-block {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 84px minmax(0, 1fr);
}

.sheet-title-copy p:last-child {
    margin-bottom: 0;
}

.sheet-logo {
    align-items: center;
    display: flex;
    justify-content: center;
}

.sheet-logo img {
    display: block;
    height: 84px;
    object-fit: contain;
    width: 84px;
}

.monthly-header {
    grid-template-columns: 1fr minmax(360px, 520px);
}

.sheet-meta p {
    margin: 0 0 6px;
}

.print-table th,
.print-table td {
    height: 34px;
}

.print-table .col-number {
    width: 44px;
}

.monthly-table-wrap {
    overflow-x: auto;
}

.monthly-table {
    table-layout: fixed;
    width: 100%;
}

.monthly-table th,
.monthly-table td {
    font-size: 11px;
    line-height: 1.2;
    padding: 5px 3px;
    text-align: center;
    vertical-align: middle;
}

.monthly-table th {
    font-size: 15px;
    font-weight: 700;
}

.monthly-table .col-number {
    width: 28px;
}

.monthly-table .col-student {
    min-width: 200px;
    width: 200px;
}

.monthly-table .col-career {
    min-width: 85px;
    width: 85px;
}

.monthly-table .date-head {
    min-width: 50px;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 2px;
    height: 32px;
}

.monthly-table .time-module-head {
    font-size: 12px;
    min-width: 26px;
    width: 26px;
    font-weight: 600;
    padding: 3px 1px;
    height: 36px;
}

.monthly-table .time-module-head .time-text {
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
}

.monthly-table .time-module-head .module-number {
    font-size: 13px;
    font-weight: 700;
}

.monthly-table .attendance-mark {
    width: 26px;
    min-height: 28px;
}

.monthly-table .student-name {
    text-align: left;
    padding-left: 6px;
    font-size: 14px;
    font-weight: 600;
}

.monthly-table .summary-head {
    min-width: 42px;
    font-size: 14px;
    font-weight: 700;
}

.monthly-table .summary-cell {
    padding: 3px 2px;
    font-size: 11px;
    min-width: 42px;
}

.monthly-table .holiday-head {
    background: linear-gradient(135deg, #7a8283, #5f6869);
}

.monthly-table .virtual-head {
    background: linear-gradient(135deg, #276f87, #214879);
}

.monthly-table .holiday-note {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
    margin-top: 2px;
    text-transform: uppercase;
}

.monthly-table .holiday-mark {
    background: #d7d7d7;
}

.grades-table {
    table-layout: fixed;
    width: 100%;
}

.grades-table th,
.grades-table td {
    font-size: 11px;
    padding: 4px 3px;
    text-align: center;
    vertical-align: middle;
}

.grades-table .grades-number-head {
    width: 36px;
}

.grades-table .grades-student-head {
    width: 260px;
}

.grades-table .grades-career-head {
    width: 72px;
}

.grades-table .grades-student-name {
    text-align: left;
    padding-left: 8px;
}

.grades-table .grades-row-number {
    text-align: center;
}

.grades-table .grades-empty {
    height: 34px;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
}

.signature-row {
    display: grid;
    gap: 26px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 48px;
}

.signature-row div {
    border-top: 1px solid var(--ink);
    padding-top: 8px;
    text-align: center;
}

@media (max-width: 860px) {
    .site-header {
        align-items: stretch;
        display: grid;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .brand-mark {
        flex-basis: 72px;
        height: 72px;
    }

    .brand-mark img {
        height: 72px;
        width: 72px;
    }

    .hero-card,
    .course-card,
    .sheet-header {
        grid-template-columns: 1fr;
    }

    .hero-card {
        align-items: stretch;
        display: grid;
    }

    .home-hero,
    .home-content-grid {
        grid-template-columns: 1fr;
    }

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

    .home-progress-card {
        grid-column: 1 / -1;
    }

    .home-agenda-toolbar {
        align-items: flex-end;
        flex-direction: column-reverse;
    }

    .home-day-switcher a {
        padding: 9px 10px;
    }

    .home-agenda-row {
        grid-template-columns: 1fr;
    }

    .home-agenda-row > time {
        padding-top: 0;
    }

    .home-class-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-class-item em {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }

    .mini-metric-grid,
    .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }

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

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

    .attendance-import-upload,
    .attendance-import-layout {
        grid-template-columns: 1fr;
    }

    .attendance-import-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .attendance-import-print-actions {
        justify-self: start;
    }

    .weekly-calendar-table {
        grid-template-columns: 92px repeat(var(--calendar-days), minmax(160px, 1fr));
        min-width: 1050px;
    }

    .weekly-calendar-time,
    .weekly-calendar-cell {
        min-height: 96px;
    }

    .weekly-detail-head,
    .weekly-detail-grid {
        grid-template-columns: 1fr;
    }

    .weekly-detail-head {
        display: grid;
    }

    .weekly-detail-close {
        width: 100%;
    }

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

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

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

    .admin-two-col,
    .admin-two-col-wide {
        grid-template-columns: 1fr;
    }

    .manage-layout {
        grid-template-columns: 1fr;
    }

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

    .admin-history-layout {
        grid-template-columns: 1fr;
    }

    .site-footer {
        align-items: flex-start;
        display: grid;
        justify-content: stretch;
        margin: 0 18px 24px;
    }

    .site-footer-brand {
        justify-content: flex-start;
        min-width: 0;
    }

    .site-footer-brand img {
        max-width: 90px;
    }

    .dashboard-panel,
    .dashboard-panel-wide {
        grid-column: auto;
    }

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

    .enrollment-form-grid-wide {
        grid-template-columns: 1fr;
    }

    .schedule-builder-grid {
        grid-template-columns: 1fr;
    }

    .result-heading {
        display: grid;
    }

    .history-action-group {
        justify-content: stretch;
    }

    .admin-toolbar-actions {
        justify-content: stretch;
    }

    .finder-actions {
        align-items: stretch;
        display: grid;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm 6mm;
    }

    body {
        background: white;
        color: black;
    }

    .print-toolbar {
        display: none;
    }

    .site-footer,
    .site-header {
        display: none;
    }

    .attendance-sheet {
        max-width: none;
        padding: 0;
        width: 100%;
    }

    .sheet-header {
        margin-bottom: 4mm;
        padding-bottom: 3mm;
    }

    .sheet-header h1 {
        font-size: 16px;
        margin-bottom: 3px;
    }

    .sheet-header .eyebrow {
        font-size: 9px;
    }

    .sheet-header p,
    .sheet-meta p {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .sheet-title-block {
        gap: 8px;
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .sheet-logo img {
        height: 56px;
        width: 56px;
    }

    .monthly-table-wrap {
        overflow: visible;
        page-break-inside: avoid;
    }

    .print-table th {
        background: #e8eef2 !important;
        color: black !important;
    }

    .print-table th,
    .print-table td {
        border-color: #333;
        font-size: 11px;
        padding: 4px 3px;
    }

    .monthly-table {
        width: 100%;
        font-size: 8px;
    }

    .monthly-table th,
    .monthly-table td {
        font-size: 8.5px;
        padding: 2px 1px;
        border: 1px solid #333;
        line-height: 1.1;
    }

    .monthly-table th {
        font-size: 11px;
        font-weight: 700;
    }

    .monthly-table .date-head {
        font-size: 10px;
        padding: 2px;
        font-weight: 700;
        height: 20px;
        white-space: nowrap;
    }

    .monthly-table .time-module-head {
        font-size: 8px;
        padding: 2px 1px;
        font-weight: 600;
        width: 16px;
        max-width: 16px;
        height: 28px;
    }

    .monthly-table .time-module-head .time-text {
        font-size: 7.5px;
        margin-bottom: 1px;
        white-space: nowrap;
        line-height: 1;
    }

    .monthly-table .time-module-head .module-number {
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }

    .monthly-table .col-number {
        width: 16px;
        font-size: 8px;
        padding: 2px 1px;
    }

    .monthly-table .col-student {
        width: 150px;
        font-size: 8px;
    }

    .monthly-table .student-name {
        font-size: 11px;
        font-weight: 600;
        padding-left: 3px;
    }

    .monthly-table .col-career {
        width: 60px;
        font-size: 8px;
    }
    
    .monthly-table .attendance-mark {
        width: 16px;
        padding: 2px 1px;
    }

    .monthly-table .summary-head {
        min-width: 34px;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 1px;
    }

    .monthly-table .summary-cell {
        padding: 2px 1px;
        min-width: 34px;
        font-size: 9px;
    }

    .monthly-table tbody td {
        font-size: 9px;
    }

    .monthly-table tbody tr {
        page-break-inside: avoid;
    }

    .legend-row {
        font-size: 9px;
        margin-top: 4px;
        page-break-inside: avoid;
    }

    .monthly-header {
        grid-template-columns: 1fr 1fr;
        margin-bottom: 4mm;
        padding-bottom: 3mm;
    }

    .sheet-header h1 {
        font-size: 22px;
    }

    .sheet-header p,
    .sheet-meta p,
    .legend-row {
        font-size: 10px;
    }

    .sheet-header {
        break-after: avoid;
    }

    .grades-table th,
    .grades-table td {
        border-color: #333;
        font-size: 8px;
        line-height: 1.05;
        padding: 2px 2px;
    }

    .sheet-header.grades-compact-header {
        border-bottom-width: 2px;
        grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
        margin-bottom: 2mm;
        padding-bottom: 1.5mm;
    }

    .grades-compact-header .sheet-title-block {
        gap: 5px;
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .grades-compact-header .sheet-logo img {
        height: 34px;
        width: 34px;
    }

    .grades-compact-header h1 {
        font-size: 15px;
        line-height: 1;
        margin-bottom: 1px;
    }

    .grades-compact-header .sheet-title-copy p,
    .grades-compact-header .sheet-meta p {
        font-size: 7.5px;
        line-height: 1.05;
        margin-bottom: 1px;
    }

    .grades-compact-header .sheet-meta {
        min-width: 0;
    }

    .grades-table .grades-student-head {
        width: 190px;
    }

    .grades-table .grades-number-head {
        width: 24px;
    }

    .grades-table .grades-career-head {
        width: 48px;
    }

    .grades-table .grades-student-name {
        font-size: 8px;
        padding-left: 3px;
    }

    .grades-table .grades-empty {
        height: 25px;
    }

    .grades-table tbody td {
        height: 25px;
    }

    .grades-table tbody tr {
        page-break-inside: avoid;
    }
}
