:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #17202a;
    --muted: #667085;
    --line: #d7dde5;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #315f9f;
    --green: #168a4a;
    --yellow: #b7791f;
    --red: #c53030;
    --shadow: 0 18px 45px rgba(22, 32, 42, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    height: 100dvh;
    background: linear-gradient(180deg, #102525 0%, #17202a 100%);
    color: white;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    object-fit: contain;
}
.brand strong { display: block; line-height: 1.15; }
.brand small { display: block; color: #b7c9c3; margin-top: 2px; }

nav {
    display: grid;
    gap: 6px;
    padding-bottom: 22px;
}
nav a {
    color: #dce8e4;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 650;
}
nav a.active, nav a:hover {
    background: rgba(15, 118, 110, .95);
    color: #fff;
    text-decoration: none;
}

.shell {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

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

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
h2 { font-size: 1.1rem; }

.button, button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 750;
    cursor: pointer;
    min-height: 42px;
}
.button.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: .82rem;
}
.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.button.danger {
    background: #fff2f2;
    border-color: #e6a7a7;
    color: #a61b1b;
}
.button.danger:hover {
    background: #fee2e2;
}
.button:hover, button:hover { filter: brightness(.98); text-decoration: none; }

.grade-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 20px rgba(22, 32, 42, .08);
}
.grade-save-bar span { color: var(--muted); font-size: .84rem; }

.attendance-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.attendance-row-save {
    margin-top: 7px;
    padding: 6px 9px;
    width: auto;
}

.classroom-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}
.classroom-hero h2 { margin: 2px 0 8px; }
.classroom-profile {
    min-width: 220px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: #f8faf8;
    border-radius: 8px;
}
.classroom-profile strong,
.classroom-profile span { display: block; }
.classroom-profile span { color: var(--muted); margin-top: 4px; }
.subject-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #cfd8d3;
    border-radius: 7px;
    background: #f7faf8;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}
.subject-pill:hover {
    border-color: var(--green);
    background: #eef7f1;
}
.classroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}
.classroom-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    display: grid;
    gap: 10px;
}
.classroom-card h3 { margin: 0; font-size: 1.05rem; }
.classroom-card p { margin: 0; color: var(--muted); }
.classroom-card small { color: var(--muted); }
.subject-tag {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 6px;
    background: #edf5ef;
    color: #17633b;
    font-weight: 800;
    font-size: .78rem;
}

.csv-backup-list { display: flex; flex-wrap: wrap; gap: 9px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.table-actions form { margin: 0; }
.audit-details > summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    color: var(--ink);
}
.audit-details > summary span { color: var(--muted); font-size: .84rem; }
.audit-details[open] > summary { margin-bottom: 16px; }
.student-print-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 20px 0 0;
    border: 1px solid var(--line);
}
.student-print-data div { padding: 12px; border-bottom: 1px solid var(--line); }
.student-print-data div:nth-child(odd) { border-right: 1px solid var(--line); }
.student-print-data .full { grid-column: 1 / -1; border-right: 0; }
.student-print-data dt { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.student-print-data dd { margin: 4px 0 0; line-height: 1.45; }
.student-print-data .print-data-section {
    border-right: 0;
    background: #eef3f1;
    color: var(--ink);
    padding: 9px 12px;
}
.form-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding: 18px 0 4px;
}
.form-section-title strong { font-size: 1rem; color: var(--ink); }
.form-section-title span { color: var(--muted); font-size: .82rem; }
.form-submit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.form-submit-actions .primary { min-width: 190px; }

.flash {
    margin: 0 0 16px;
    border-radius: 8px;
    padding: 12px 14px;
    background: #e8f5ee;
    color: #14532d;
    border: 1px solid #b7dfc7;
}
.flash.error {
    background: #fff0f0;
    color: #9b1c1c;
    border-color: #f0b8b8;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(22, 32, 42, .04);
}
.filters.compact { margin-top: 8px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.optional {
    color: #8a94a2;
    font-size: .76rem;
    font-weight: 600;
}
.support-copy {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 18px;
}
.field-note {
    display: grid;
    gap: 4px;
    align-content: center;
    min-height: 68px;
    border: 1px solid #bcded8;
    border-radius: 8px;
    background: #edf8f6;
    color: var(--primary-dark);
    padding: 10px 12px;
}
.field-note span {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(15, 118, 110, .16);
    border-color: var(--primary);
}
textarea { resize: vertical; }

.hint {
    background: #edf7f6;
    border: 1px solid #c9e5e5;
    color: #275b5b;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 650;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.metric-link {
    color: inherit;
    text-decoration: none;
    display: block;
}
.metric-link article {
    height: 100%;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.metric-link:hover article,
.metric-link:focus-visible article {
    border-color: var(--primary);
    box-shadow: 0 10px 24px rgba(24, 73, 75, .13);
    transform: translateY(-2px);
}
.virtual-director-widget {
    position: fixed;
    left: 14px;
    bottom: 18px;
    z-index: 200;
    width: 70px;
}
.virtual-director-widget.open {
    width: min(286px, calc(100vw - 28px));
}
.virtual-director-trigger {
    width: 66px;
    height: 66px;
    border: 1px solid rgba(95, 99, 99, .24);
    background: #fff;
    color: #233134;
    border-radius: 999px;
    box-shadow: 0 14px 36px rgba(24, 73, 75, .18);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}
.virtual-director-widget.open .virtual-director-trigger {
    width: 100%;
    height: auto;
    border-radius: 16px;
    padding: 8px 12px 8px 8px;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}
.virtual-director-trigger > span:not(.virtual-director-avatar-wrap) {
    display: none;
}
.virtual-director-widget.open .virtual-director-trigger > span:not(.virtual-director-avatar-wrap) {
    display: inline;
}
.virtual-director-avatar-wrap {
    position: relative;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
}
.virtual-director-avatar {
    width: 54px;
    height: 54px;
    display: block;
    border-radius: 50%;
}
.virtual-director-logo {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #fff;
    object-fit: contain;
}
.virtual-director-panel {
    display: none;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid rgba(95, 99, 99, .22);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(24, 73, 75, .18);
}
.virtual-director-widget.open .virtual-director-panel { display: grid; gap: 8px; }
.virtual-director-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.virtual-director-panel-head strong {
    color: #26383b;
    font-size: .9rem;
}
.virtual-director-minimize {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(95, 99, 99, .24);
    background: #f5f8f7;
    color: #233134;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}
.virtual-director-minimize:hover {
    background: #e9f1ee;
}
.virtual-director-panel label {
    font-size: .82rem;
    font-weight: 850;
    color: #26383b;
}
.virtual-director-panel textarea {
    min-height: 74px;
    resize: vertical;
}
.virtual-director-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.virtual-director-panel small {
    color: #667579;
    line-height: 1.35;
}
.print-school-header,
.print-only {
    display: none;
}
.permission-grid {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.permission-grid legend {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
    padding: 0 6px;
}
.settings-users {
    align-items: start;
}
.settings-users > form > .panel-head span,
.settings-users > section > .panel-head span {
    display: none;
}
.user-capacity {
    margin: 0;
    padding: 10px 12px;
    border-left: 4px solid var(--primary);
    background: #edf8f6;
    color: #35575a;
    font-size: .84rem;
}
.certificate-footer {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
}
.certificate-footer p,
.certificate-footer span {
    margin: 0;
}
.certificate-signature {
    width: min(320px, 100%);
    margin: 172px auto 0;
    padding-top: 8px;
    border-top: 1px solid currentColor;
    text-align: center;
    font-weight: 700;
}
.formal-certificate {
    padding: 14px 7%;
}
.formal-certificate h3 {
    margin: 8px 0 20px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: underline;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
}
.formal-certificate p {
    margin: 14px 0;
    font-size: 1.02rem;
    line-height: 1.65;
    text-align: justify;
}
.formal-certificate .table-wrap {
    border: 0;
    overflow: visible;
}
.formal-certificate.one-semester-grades {
    padding: 10px 5%;
}
.formal-certificate.one-semester-grades h3 {
    margin-bottom: 10px;
    font-size: 1.28rem;
}
.formal-certificate.one-semester-grades p {
    margin: 8px 0;
    font-size: .96rem;
    line-height: 1.42;
}
.formal-certificate.one-semester-grades th,
.formal-certificate.one-semester-grades td {
    padding: 5px 7px;
    font-size: .9rem;
}
.metrics article, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.metrics article {
    padding: 18px;
    display: grid;
    gap: 8px;
    border-top: 4px solid var(--primary);
}
.metrics span, .panel-head span { color: var(--muted); font-size: .86rem; font-weight: 650; }
.metrics strong { font-size: 2rem; }
.metrics small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 650;
}
.range-references {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.range-reference {
    padding: 18px;
    display: grid;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.range-reference > span {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 650;
}
.range-line {
    display: grid;
    grid-template-columns: 104px 1fr;
    align-items: center;
    gap: 8px;
    border-left: 5px solid var(--line);
    border-radius: 7px;
    background: #f8fafc;
    padding: 7px 9px;
    color: var(--ink);
    line-height: 1.25;
}
.range-line.green { border-left-color: var(--green); }
.range-line.yellow { border-left-color: var(--yellow); }
.range-line.red { border-left-color: var(--red); }
.range-line.neutral { border-left-color: #7b8794; }
.range-line b {
    color: var(--muted);
    font-size: .72rem;
}
.range-line em {
    color: var(--ink);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.panel { padding: 18px; margin-bottom: 18px; }
.panel::before {
    content: "";
    display: block;
    height: 3px;
    margin: -18px -18px 15px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 14px;
}

.chart {
    width: 100%;
    height: 280px;
    display: block;
}

.report-explanation {
    display: grid;
    gap: 5px;
    border-left: 5px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: #edf3fb;
    color: #29496f;
    padding: 13px 16px;
    margin-bottom: 18px;
}
.report-explanation span {
    color: #53677e;
    font-size: .88rem;
}
.report-charts .panel { min-width: 0; }
.chart-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .86rem;
}
.chart-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.risk-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.risk-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: var(--ink);
    display: grid;
    gap: 5px;
}
.risk-card:hover {
    text-decoration: none;
    background: #f8fafc;
}
.risk-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.risk-card.green { border-left-color: var(--green); }
.risk-card.yellow { border-left-color: var(--yellow); }
.risk-card.red { border-left-color: var(--red); }
.risk-card.neutral { border-left-color: #7b8794; }
.risk-card span {
    min-height: 0;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 750;
}
.risk-card strong {
    font-size: 1.75rem;
    line-height: 1;
}
.risk-card em {
    color: var(--muted);
    font-size: .72rem;
    font-style: normal;
    font-weight: 750;
}
.risk-card small {
    color: var(--muted);
    font-size: .74rem;
}
.risk-chart { height: 160px; margin-top: 8px; }
.monthly-risk-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 10px 0 12px;
}
.legacy-monthly-dashboard,
.risk-list-panel { display: none !important; }
.risk-list-panel.is-visible { display: block !important; }
.risk-overview .panel,
.grade-overview .panel {
    display: grid;
    align-content: start;
    gap: 8px;
}
.risk-overview .risk-cards,
.grade-overview .risk-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.risk-overview .risk-chart,
.grade-overview .risk-chart {
    display: block;
    height: 170px;
    margin-top: 0;
}
.grade-overview .risk-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grade-overview .risk-card {
    padding: 10px;
    gap: 4px;
}
.grade-overview .risk-card span {
    min-height: 0;
}
.grade-overview .risk-chart {
    height: 180px;
}
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
    background: #7b8794;
}
.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }
.status-dot.neutral { background: #7b8794; }
.risk-list-panel .panel-head > div { display: grid; gap: 5px; }
.risk-filters { box-shadow: none; background: #f8fafc; }
.risk-list-total {
    margin: 12px 0 0;
    color: var(--muted);
    text-align: right;
}
.grade-student-list {
    display: grid;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.grade-table-wrap {
    max-height: 72vh;
}
.grade-lines {
    display: grid;
    gap: 10px;
}
.subject-key {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin: 8px 0 12px;
}
.subject-key span,
.grade-calculated {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 850;
    padding: 7px 9px;
}
section.panel:has(.grade-lines) .panel-head span + span {
    display: none;
}
.grade-line {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}
.grade-line-student {
    flex: 0 0 130px;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
}
.grade-line-student strong {
    line-height: 1.22;
}
.grade-line-student small {
    color: var(--muted);
    font-weight: 800;
}
.grade-line-notes {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 2px;
}
.grade-strip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}
.grade-strip-final {
    align-self: stretch;
}
.grade-strip-title {
    align-self: center;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}
.grade-subject-averages {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}
.grade-subject-chip {
    display: grid;
    grid-template-columns: auto minmax(90px, auto) auto;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 9px;
    white-space: nowrap;
    font-weight: 850;
}
.grade-subject-chip b {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}
.grade-subject-chip strong {
    color: var(--ink);
    font-size: 1rem;
}
.grade-table {
    min-width: 1450px;
}
.grade-table th,
.grade-table td {
    padding: 8px;
}
.grade-table th:first-child,
.grade-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    width: 180px;
    min-width: 180px;
}
.grade-table td:first-child {
    background: #fff;
}
.grade-table th:first-child {
    background: #1f2933;
}
.grade-table th.semester-heading {
    text-align: center;
    background: #334155;
}
.grade-student-cell {
    display: grid;
    gap: 6px;
}
.grade-student-cell strong {
    display: block;
    line-height: 1.25;
}
.grade-student-cell small {
    color: var(--muted);
    font-weight: 750;
}
.grade-save-form .button {
    width: 100%;
    min-height: 32px;
}
.grade-average {
    white-space: nowrap;
    font-weight: 800;
    text-align: center;
}
.grade-student-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 13px 15px;
    min-width: 980px;
}
.grade-student-head,
.grade-student-footer,
.semester-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.grade-student-head > div {
    display: grid;
    gap: 4px;
}
.grade-student-head > div span,
.semester-title span {
    color: var(--muted);
    font-size: .82rem;
}
.semester-block {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.grade-semesters {
    display: grid;
    grid-template-columns: repeat(2, minmax(420px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.grade-fields {
    display: grid;
    grid-template-columns: repeat(8, minmax(58px, 1fr));
    gap: 5px;
    margin-top: 8px;
}
.grade-fields label {
    text-align: center;
    font-size: .74rem;
}
.grade-input {
    width: 42px;
    min-width: 42px;
    text-align: center;
    font-weight: 800;
    font-size: .9rem;
    padding: 7px 2px;
    min-height: 36px;
}
.grade-student-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.grade-student-footer > span {
    font-size: 1rem;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
.delete-student-form {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
}
.swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.swatch.present { background: var(--green); }
.swatch.absent { background: var(--red); }

.table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.grid > *, .panel { min-width: 0; }
.table-wrap.wide { max-height: 68vh; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
    background: #fff;
}
th, td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
tr.new-record td {
    background: #e7f6ef;
    animation: record-highlight 2.8s ease-out;
}
@keyframes record-highlight {
    from { background: #b9ead2; }
    to { background: #e7f6ef; }
}
th {
    background: #1f2933;
    color: #fff;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 0;
}
td small { display: block; color: var(--muted); margin-top: 2px; }
.muted { color: var(--muted); font-size: .82rem; }
.solution-inline-form {
    display: grid;
    grid-template-columns: minmax(130px, .35fr) minmax(220px, 1fr) auto;
    gap: 8px;
    align-items: start;
}
.solution-inline-form textarea { min-height: 42px; }

.attendance-table th:first-child,
.attendance-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    min-width: 210px;
}
.attendance-table th:first-child { background: #f0f3ef; z-index: 2; }
.attendance-table th:first-child { background: #1f2933; }
.attendance-table select {
    min-width: 54px;
    padding: 7px;
}

.dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .78rem;
    font-style: normal;
    font-weight: 800;
}
.dot.green { background: #dcfce7; color: var(--green); }
.dot.yellow { background: #fef3c7; color: var(--yellow); }
.dot.red { background: #fee2e2; color: var(--red); }
.dot.neutral { background: #eef2f7; color: #526070; }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    border-radius: 999px;
    padding: 4px 8px;
    background: #eef2f7;
    color: #526070;
    font-weight: 800;
    font-size: .78rem;
}
.pill.yes { background: #dcfce7; color: var(--green); }

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
}

.month-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 14px;
    margin-bottom: 4px;
}
.month-tabs a {
    flex: 0 0 auto;
    border-radius: 8px;
    background: #2f3a45;
    color: #fff;
    padding: 11px 18px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(22, 32, 42, .12);
}
.month-tabs a.active {
    background: var(--primary);
}
.report-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
}
.report-mode-tabs a {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 14px;
    font-weight: 850;
}
.report-mode-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.course-tabs {
    padding-bottom: 8px;
}
.course-tabs a {
    background: #eef4f8;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}
.course-tabs a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.rules article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f9fafb;
}
.rules strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.rules span { color: var(--muted); font-weight: 650; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-shell {
    max-width: 1040px;
    margin: 0 auto;
}
.record-search { margin-bottom: 20px; }
.search-grow { flex: 1 1 360px; }
.search-summary {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
    margin: 0 0 10px;
}
.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 28px;
}
.student-form { padding: 24px; }
.check {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 9px;
    color: var(--ink);
}
.check input { width: auto; }
.ticket input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.ticket-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ticket {
    width: fit-content;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
    padding: 9px 12px;
}
.ticket:has(input:checked) {
    border-color: var(--primary);
    background: #e8f5f3;
    color: var(--primary-dark);
}
.ticket:has(input:checked)::after {
    content: "Marcado";
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 800;
}

.situation-picker {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.situation-picker summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    cursor: pointer;
    background: #f4f7f8;
    color: var(--ink);
    font-weight: 800;
}
.situation-picker summary span {
    color: var(--muted);
    font-size: .82rem;
}
.situation-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    max-height: 340px;
    overflow-y: auto;
}
.situation-options label {
    min-height: 44px;
    background: #fff;
    padding: 10px 12px;
    font-size: .82rem;
}
.situation-options label:has(input:checked) {
    background: #e7f3df;
    color: #254a2b;
}
.situation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.situation-tags span {
    border: 1px solid #b9d6ac;
    border-radius: 999px;
    background: #e7f3df;
    color: #254a2b;
    padding: 7px 10px;
    font-size: .8rem;
    font-weight: 800;
}

.inline {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline input { max-width: 150px; padding: 7px; }
.link-button {
    border: 0;
    background: transparent;
    color: var(--accent);
    min-height: auto;
    padding: 0;
}

.profile {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}
.profile h2 { font-size: 1.6rem; margin-bottom: 8px; }
.profile p { margin: 4px 0; color: var(--muted); }
.history-only-profile p:nth-of-type(n+3),
.history-only-profile .profile-stats {
    display: none;
}
.student-record-actions {
    display: flex;
    gap: 10px;
    margin: -6px 0 18px;
    padding: 0;
}
.student-record-actions .button {
    min-width: 180px;
    justify-content: center;
}
.profile-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}
.profile-stats span {
    display: grid;
    gap: 4px;
    min-width: 110px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.profile-stats strong { font-size: 1.4rem; }
.academic-history .panel-head {
    align-items: end;
}
.history-year-filter {
    display: flex;
    align-items: end;
    gap: 8px;
}
.history-year-filter label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 750;
}
.history-year-filter select {
    min-width: 110px;
}
.history-attendance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.history-stat {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--line);
    border-left: 5px solid #7b8794;
    border-radius: 8px;
    background: #f8fafc;
}
.history-stat.green { border-left-color: var(--green); }
.history-stat.yellow { border-left-color: var(--yellow); }
.history-stat.red { border-left-color: var(--red); }
.history-stat span,
.history-stat small { color: var(--muted); }
.history-stat strong { font-size: 1.45rem; }
.history-general-average td {
    border-top: 2px solid var(--ink);
    background: #f8fafc;
}
.history-records-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.history-record-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.history-record-group h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.note {
    border-left: 4px solid var(--primary);
    background: #f8fbfb;
    padding: 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
}
.note p { margin: 6px 0 0; color: #3d4852; }
.note-actions {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0;
}

.specific-report-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}
.specific-reports-layout {
    display: flex;
    flex-direction: column;
}
.specific-general-builder { order: 10; }
.specific-general-message { order: 11; }
.specific-general-output { order: 12; }
.specific-search-panel { order: 20; }
.specific-individual-builder { order: 30; }
.specific-individual-message { order: 31; }
.specific-individual-output { order: 32; }
.specific-report-options .ticket {
    width: auto;
    justify-content: flex-start;
}
.report-option-periods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}
.report-option-period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, .8fr);
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
}
.report-option-period.certificate-option-wide {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .8fr) minmax(190px, .9fr);
}
.report-option-period .ticket {
    width: auto;
    border: 0;
    background: transparent;
    padding: 6px;
}
.report-option-period select {
    min-width: 0;
}
.report-option {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    font-weight: 750;
}
.specific-report-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfb;
    margin-bottom: 14px;
}
.specific-report-header strong {
    width: 100%;
    font-size: 1.2rem;
}
.certificate-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 2px solid #f2c500;
}
.certificate-brand img {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    object-fit: contain;
}
.certificate-brand strong {
    display: block;
    font-size: 1.25rem;
    color: #34373b;
}
.certificate-brand span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}
.report-block {
    display: grid;
    gap: 10px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--line);
}
.report-block h3,
.report-block h4 {
    margin: 0;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
        height: auto;
        padding: 10px 14px;
        gap: 9px;
        border-bottom: 4px solid var(--primary);
        overflow: visible;
        scrollbar-gutter: auto;
    }
    .sidebar .brand-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
    .sidebar nav {
        display: flex;
        gap: 6px;
        padding-bottom: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .sidebar nav a {
        flex: 0 0 auto;
        padding: 8px 10px;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 5px;
        font-size: .82rem;
        white-space: nowrap;
    }
    .shell {
        margin-left: 0;
        padding: 18px;
    }
    .virtual-director-widget {
        left: 14px;
        bottom: 14px;
    }
    .grid.two { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    .topbar, .profile { align-items: stretch; flex-direction: column; }
    .topbar-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topbar-actions .signed-user { grid-column: 1 / -1; }
    .topbar-actions form,
    .topbar-actions .button { width: 100%; }
    .topbar-actions form:last-child { grid-column: 1 / -1; }
    .grid.two, .form-grid { grid-template-columns: 1fr; }
    .panel { padding: 14px; }
    .filters { display: grid; grid-template-columns: 1fr; }
    .button, button { width: 100%; }
    .inline { align-items: stretch; flex-direction: column; }
    .inline input { max-width: none; }
    .profile-stats { align-items: stretch; }
    .student-record-actions { flex-direction: column; }
    .student-record-actions .button { width: 100%; }
    .academic-history .panel-head,
    .history-year-filter { align-items: stretch; flex-direction: column; }
    .history-attendance { grid-template-columns: 1fr; }
    .history-records-grid { grid-template-columns: 1fr; }
    .report-option-period,
    .report-option-period.certificate-option-wide { grid-template-columns: 1fr; }
    .situation-options { grid-template-columns: 1fr; }
    .risk-cards { grid-template-columns: 1fr; }
    .range-references { grid-template-columns: 1fr; }
    .risk-overview .risk-cards,
    .grade-overview .risk-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .risk-overview .risk-chart,
    .grade-overview .risk-chart {
        display: block;
        height: 145px;
    }
    .risk-overview .panel,
    .grade-overview .panel {
        padding: 10px;
    }
    .risk-overview .panel::before,
    .grade-overview .panel::before {
        margin: -10px -10px 10px;
    }
    .risk-overview .panel-head,
    .grade-overview .panel-head {
        margin-bottom: 8px;
    }
    .risk-overview .panel-head h2,
    .grade-overview .panel-head h2 {
        font-size: .95rem;
    }
    .risk-overview .panel-head span,
    .grade-overview .panel-head span {
        font-size: .72rem;
    }
    .risk-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .risk-card span { min-height: 0; }
    .risk-card small { grid-column: 1 / -1; }
    .grade-table { min-width: 1320px; }
    .grade-table th:first-child,
    .grade-table td:first-child {
        width: 128px;
        min-width: 128px;
    }
    .grade-line {
        display: flex;
        gap: 8px;
        padding: 8px;
    }
    .grade-line-student {
        flex-basis: 92px;
        min-width: 92px;
    }
    .grade-line-student {
        padding: 7px;
    }
    .grade-line-student strong {
        font-size: .76rem;
    }
    .grade-input {
        width: 38px;
        min-width: 38px;
    }
    .grade-strip-title {
        font-size: .7rem;
    }
}

@media print {
    .sidebar, .topbar, .filters, .button, button { display: none !important; }
    .virtual-director-widget { display: none !important; }
    .shell { margin: 0; padding: 0; }
    html, body { background: #fff; margin: 0 !important; }
    @page { size: Letter portrait; margin: 0; }
    @page student-list-report { size: Letter landscape; margin: 0; }
    .panel, .metrics article { box-shadow: none; break-inside: avoid; }
    body.print-general-report .shell > *,
    body.print-individual-report .shell > * { display: none !important; }
    body.print-general-report .shell > .specific-reports-layout,
    body.print-individual-report .shell > .specific-reports-layout {
        display: block !important;
    }
    body.print-general-report .specific-reports-layout > *,
    body.print-individual-report .specific-reports-layout > * {
        display: none !important;
    }
    body.print-general-report .specific-general-output,
    body.print-individual-report .specific-individual-output {
        display: block !important;
        border: 0;
        padding: 14mm 16mm;
        margin: 0;
    }
    body.print-general-report .specific-general-output .panel-head,
    body.print-general-report .specific-general-output .table-wrap,
    body.print-individual-report .specific-individual-output .panel-head,
    body.print-individual-report .specific-individual-output .table-wrap {
        display: block !important;
    }
    body.print-general-report .specific-general-output .table-wrap,
    body.print-individual-report .specific-individual-output .table-wrap {
        overflow: visible;
        border: 0;
    }
    body.print-general-report .specific-general-output table,
    body.print-individual-report .specific-individual-output table { min-width: 0; }
    body.print-risk-list .shell > * { display: none !important; }
    body.print-risk-list .shell > #risk-list {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-risk-list #risk-list .panel-head { display: flex !important; }
    body.print-risk-list #risk-list .table-wrap {
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-risk-list #risk-list table { min-width: 0; }
    body.print-risk-list #risk-list a { color: #000; text-decoration: none; }
    body.print-dashboard-students .shell > * { display: none !important; }
    body.print-dashboard-students .shell > #student-status-list {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-dashboard-students #student-status-list .panel-head,
    body.print-dashboard-students #student-status-list .table-wrap,
    body.print-dashboard-students #student-status-list .print-school-header {
        display: flex !important;
    }
    body.print-dashboard-students #student-status-list .table-wrap {
        display: block !important;
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-dashboard-students #student-status-list table { min-width: 0; }
    body.print-student-list .shell > * { display: none !important; }
    body.print-student-list .shell > #student-list {
        display: block !important;
        border: 0;
        padding: 11.5mm;
        margin: 0;
        page: student-list-report;
    }
    body.print-student-list #student-list .table-wrap,
    body.print-student-list #student-list .print-school-header {
        display: flex !important;
    }
    body.print-student-list #student-list .print-school-header {
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
        border-bottom: 2px solid #f2c500;
        padding-bottom: 10px;
    }
    body.print-student-list #student-list .print-school-header img {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        object-fit: contain;
    }
    body.print-student-list #student-list .print-school-header strong {
        font-size: 16pt;
        line-height: 1.1;
    }
    body.print-student-list #student-list .student-list-report-title {
        display: block !important;
        margin: 14px 0 12px;
    }
    body.print-student-list #student-list .student-list-report-title h1 {
        margin: 0 0 6px;
        font-size: 16pt;
        text-transform: uppercase;
        letter-spacing: 0;
    }
    body.print-student-list #student-list .student-list-report-title p {
        margin: 4px 0;
        color: #1f2937;
        font-size: 9pt;
    }
    body.print-student-list #student-list .panel-head {
        display: none !important;
    }
    body.print-student-list #student-list form,
    body.print-student-list #student-list .no-print {
        display: none !important;
    }
    body.print-student-list #student-list .table-wrap {
        display: block !important;
        overflow: visible;
        border: 0;
    }
    body.print-student-list #student-list table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
        font-size: 7.5pt;
    }
    body.print-student-list #student-list th,
    body.print-student-list #student-list td {
        border: 1px solid #cbd5e1;
        padding: 3px 4px;
        line-height: 1.2;
    }
    body.print-student-list #student-list th {
        background: #eef3f2 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        white-space: nowrap;
    }
    body.print-pickup-list .shell > * { display: none !important; }
    body.print-pickup-list .shell > #pickup-list {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-pickup-list #pickup-list .panel-head,
    body.print-pickup-list #pickup-list .table-wrap,
    body.print-pickup-list #pickup-list .print-school-header {
        display: flex !important;
    }
    body.print-pickup-list #pickup-list form { display: none !important; }
    body.print-pickup-list #pickup-list .table-wrap {
        display: block !important;
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-pickup-list #pickup-list table { min-width: 0; }
    body.print-dashboard-repetition .shell > * { display: none !important; }
    body.print-dashboard-repetition .shell > #dashboard-repetition-list {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-dashboard-repetition #dashboard-repetition-list .panel-head,
    body.print-dashboard-repetition #dashboard-repetition-list .table-wrap,
    body.print-dashboard-repetition #dashboard-repetition-list .print-school-header {
        display: flex !important;
    }
    body.print-dashboard-repetition #dashboard-repetition-list .table-wrap {
        display: block !important;
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-dashboard-repetition #dashboard-repetition-list form,
    body.print-dashboard-repetition #dashboard-repetition-list .field-note { display: none !important; }
    body.print-dashboard-repetition #dashboard-repetition-list table { min-width: 0; }
    body.print-pie-evidence .shell > * { display: none !important; }
    body.print-pie-evidence .shell > #pie-evidence-history {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-pie-evidence #pie-evidence-history .panel-head,
    body.print-pie-evidence #pie-evidence-history .table-wrap,
    body.print-pie-evidence #pie-evidence-history .print-school-header {
        display: flex !important;
    }
    body.print-pie-evidence #pie-evidence-history .table-wrap {
        display: block !important;
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-pie-evidence #pie-evidence-history table { min-width: 0; }
    body.print-action-history .shell > * { display: none !important; }
    body.print-action-history .shell > #action-history-print {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-action-history #action-history-print .panel-head,
    body.print-action-history #action-history-print .table-wrap,
    body.print-action-history #action-history-print .print-school-header,
    body.print-action-history #action-history-print .print-only {
        display: flex !important;
    }
    body.print-action-history #action-history-print .table-wrap {
        display: block !important;
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-action-history #action-history-print table { min-width: 0; }
    body.print-action-history #action-history-print th:last-child,
    body.print-action-history #action-history-print td:last-child { display: none; }
    body.print-global-actions .shell > * { display: none !important; }
    body.print-global-actions .shell > #global-action-history,
    body.print-global-actions .shell > #solution-list {
        display: block !important;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
    body.print-global-actions #global-action-history .panel-head,
    body.print-global-actions #global-action-history .table-wrap,
    body.print-global-actions #global-action-history .print-school-header,
    body.print-global-actions #solution-list .panel-head,
    body.print-global-actions #solution-list .table-wrap,
    body.print-global-actions #solution-list .print-school-header { display: block !important; }
    body.print-global-actions #global-action-history table,
    body.print-global-actions #solution-list table { min-width: 0; }
    body.print-global-actions #solution-list th:last-child,
    body.print-global-actions #solution-list td:last-child { display: none; }
    body.print-academic-history .shell > * { display: none !important; }
    body.print-academic-history .shell > .academic-history {
        display: block !important;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
    body.print-academic-history .academic-history .panel-head,
    body.print-academic-history .academic-history .history-attendance,
    body.print-academic-history .academic-history .table-wrap,
    body.print-academic-history .academic-history .history-records-grid,
    body.print-academic-history .academic-history .print-school-header { display: block !important; }
    body.print-academic-history .history-export-actions,
    body.print-academic-history .history-year-filter { display: none !important; }
    body.print-student-sheet .shell > * { display: none !important; }
    body.print-student-sheet .shell > .student-print-sheet {
        display: block !important;
        border: 0;
        box-shadow: none;
        padding: 14mm 16mm;
    }
    body.print-student-sheet .student-print-sheet .print-school-header { display: flex !important; }
    body.print-student-sheet .student-print-data { font-size: 9.5pt; }
    body.print-student-sheet .student-print-data div { break-inside: avoid; padding: 8px 10px; }
    body.print-student-sheet .student-print-data .print-data-section {
        background: #eef3f1 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .print-school-header {
        align-items: center;
        gap: 12px;
        margin-bottom: 18px;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
    }
    .print-school-header img { width: 58px; height: 58px; object-fit: contain; }
    .print-school-header div { display: grid; gap: 3px; }
    .print-school-header strong { font-size: 1.15rem; }
    .print-only { margin: 0 0 16px; }
    .formal-certificate {
        min-height: 0;
        padding: 12px 6%;
        break-inside: avoid;
    }
    .formal-certificate h3 { font-size: 18pt; margin: 12px 0 20px; }
    .formal-certificate p { font-size: 11.5pt; line-height: 1.6; }
    body.print-individual-report .specific-individual-output .certificate-brand {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    body.print-individual-report .formal-certificate.one-semester-grades {
        padding: 6px 4%;
    }
    body.print-individual-report .formal-certificate.one-semester-grades h3 {
        font-size: 15pt;
        margin: 8px 0 10px;
    }
    body.print-individual-report .formal-certificate.one-semester-grades p {
        font-size: 10pt;
        line-height: 1.3;
        margin: 8px 0;
    }
    body.print-individual-report .formal-certificate.one-semester-grades th,
    body.print-individual-report .formal-certificate.one-semester-grades td {
        font-size: 8.5pt;
        padding: 4px 5px;
    }
    body.print-individual-report .specific-individual-output .certificate-footer {
        margin-top: 18px;
        padding-top: 10px;
        break-inside: avoid;
    }
    body.print-individual-report .specific-individual-output .certificate-signature {
        margin-top: 168px;
    }
    body.print-individual-report .formal-certificate table {
        border: 0;
        border-collapse: collapse;
    }
    body.print-individual-report .formal-certificate th,
    body.print-individual-report .formal-certificate td {
        border: 0;
        border-bottom: 1px solid #cbd5e1;
    }
    body.print-pie-dashboard .shell > * { display: none !important; }
    body.print-pie-dashboard .shell > #pie-monthly-dashboard {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-pie-dashboard #pie-monthly-dashboard .panel-head,
    body.print-pie-dashboard #pie-monthly-dashboard .month-tabs,
    body.print-pie-dashboard #pie-monthly-dashboard .table-wrap {
        display: block !important;
    }
    body.print-pie-dashboard #pie-monthly-dashboard .month-tabs {
        display: none !important;
    }
    body.print-pie-dashboard #pie-monthly-dashboard .table-wrap {
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-pie-dashboard #pie-monthly-dashboard table { min-width: 0; }
    body.print-pie-dashboard #pie-monthly-dashboard a { color: #000; text-decoration: none; }
    body.print-general-dashboard .shell > * { display: none !important; }
    body.print-general-dashboard .shell > #general-monthly-dashboard {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-general-dashboard #general-monthly-dashboard .panel-head,
    body.print-general-dashboard #general-monthly-dashboard .month-tabs,
    body.print-general-dashboard #general-monthly-dashboard .table-wrap {
        display: block !important;
    }
    body.print-general-dashboard #general-monthly-dashboard .month-tabs {
        display: none !important;
    }
    body.print-general-dashboard #general-monthly-dashboard .table-wrap {
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-general-dashboard #general-monthly-dashboard table { min-width: 0; }
    body.print-general-dashboard #general-monthly-dashboard a { color: #000; text-decoration: none; }
    body.print-monthly-dashboard .shell > * { display: none !important; }
    body.print-monthly-dashboard .shell > #monthly-dashboard {
        display: block !important;
        border: 0;
        padding: 0;
        margin: 0;
    }
    body.print-monthly-dashboard #monthly-dashboard .panel-head,
    body.print-monthly-dashboard #monthly-dashboard .month-tabs,
    body.print-monthly-dashboard #monthly-dashboard .report-mode-tabs,
    body.print-monthly-dashboard #monthly-dashboard .monthly-filters,
    body.print-monthly-dashboard #monthly-dashboard .table-wrap {
        display: block !important;
    }
    body.print-monthly-dashboard #monthly-dashboard .month-tabs,
    body.print-monthly-dashboard #monthly-dashboard .report-mode-tabs,
    body.print-monthly-dashboard #monthly-dashboard .monthly-filters {
        display: none !important;
    }
    body.print-monthly-dashboard #monthly-dashboard .table-wrap {
        overflow: visible;
        border: 1px solid #999;
    }
    body.print-monthly-dashboard #monthly-dashboard table { min-width: 0; }
    body.print-monthly-dashboard #monthly-dashboard a { color: #000; text-decoration: none; }
}

.year-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr);
    gap: 24px;
    align-items: center;
    padding: 24px;
    margin-bottom: 18px;
    color: #fff;
    background: #263238;
    border-left: 6px solid #f0c419;
}
.year-intro h2 { margin: 4px 0 8px; font-size: clamp(1.35rem, 2vw, 2rem); }
.year-intro p { margin: 0; max-width: 780px; color: #d9e1e3; }
.year-intro .eyebrow { color: #f0c419; }
.year-flow { display: grid; gap: 8px; }
.year-flow span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #536267;
    background: #344247;
}
.year-flow b {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #263238;
    background: #f0c419;
}
.annual-enrollment { margin-top: 18px; }
.enrollment-table { min-width: 980px; }
.enrollment-table td { vertical-align: middle; }
.enrollment-table td:nth-child(2) small { display: block; color: #69777b; margin-top: 3px; }
.compact-ticket { min-height: 36px; padding: 7px 9px; white-space: nowrap; }
.student-match-list { display: grid; gap: 10px; margin-top: 16px; }
.student-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid #d8dfe1;
    background: #f8faf9;
}
.student-match > div { display: grid; gap: 3px; }
.student-match span { color: #667579; font-size: .86rem; }
.inline-enrollment-form { display: flex; align-items: center; gap: 8px; }
.new-student-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

@media (max-width: 760px) {
    .year-intro { grid-template-columns: 1fr; padding: 18px; }
    .student-match, .new-student-callout { align-items: stretch; flex-direction: column; }
    .inline-enrollment-form { align-items: stretch; flex-direction: column; width: 100%; }
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.topbar-actions form { margin: 0; }
.observation-alert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    background: #fff;
    text-decoration: none;
    font-size: .82rem;
}
.observation-alert strong {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
}
.observation-alert.has-alert {
    border-color: #ef4444;
    background: #fff1f2;
    color: #991b1b;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}
.observation-alert.has-alert strong { background: #dc2626; color: #fff; }
.action-entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.signed-user {
    display: grid;
    gap: 2px;
    padding-right: 8px;
    color: #667579;
    font-size: .72rem;
    text-align: right;
}
.signed-user strong { color: #1f2b2f; font-size: .9rem; }

.login-page {
    min-height: 100dvh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #e8eeec;
}
.login-shell {
    width: min(920px, 100%);
    min-height: 540px;
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
    overflow: hidden;
    border: 1px solid #c8d2cf;
    background: #fff;
    box-shadow: 0 24px 60px rgba(18, 40, 43, .18);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 44px;
    color: #fff;
    background: #10282b;
    border-bottom: 6px solid #f0c419;
}
.login-brand img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}
.login-brand h1 {
    margin: 5px 0;
    font-size: 2rem;
    line-height: 1.08;
}
.login-brand p { margin: 0; color: #c7d5d1; }
.login-brand .eyebrow { color: #f0c419; }
.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 54px;
}
.login-panel h2 { margin: 4px 0 8px; font-size: 1.75rem; }
.login-support { margin: 0; color: #667579; line-height: 1.55; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; font-weight: 700; color: #26363a; }
.login-form input { min-height: 48px; font-size: 1rem; }
.login-form .button { min-height: 48px; margin-top: 4px; }

@media (max-width: 760px) {
    .action-entry-grid { grid-template-columns: 1fr; }
    .topbar-actions { align-items: stretch; flex-wrap: wrap; justify-content: flex-start; }
    .signed-user { width: 100%; text-align: left; }
    .login-page { padding: 0; place-items: stretch; }
    .login-shell { min-height: 100dvh; grid-template-columns: 1fr; border: 0; }
    .login-brand { padding: 28px 24px; }
    .login-brand img { width: 72px; height: 72px; }
    .login-brand h1 { font-size: 1.55rem; }
    .login-panel { justify-content: flex-start; padding: 38px 24px; }
}

.ai-director-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.ai-command-center {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    border-top: 5px solid #0f766e;
}
.ai-command-prompts,
.ai-command-actions,
.ai-command-kpis {
    display: grid;
    gap: 10px;
}
.ai-command-prompts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-command-prompts button {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #9fb6b1;
    border-radius: 5px;
    color: #17363a;
    background: #eef6f4;
    font-weight: 800;
    cursor: pointer;
}
.ai-command-prompts button:hover { border-color: #0f766e; background: #e1f0ed; }
.ai-command-actions { grid-template-columns: minmax(0, 260px); }
.ai-command-actions form,
.ai-command-actions .button { width: 100%; margin: 0; text-align: center; }
.ai-command-actions .button:disabled { cursor: not-allowed; opacity: .55; }
.ai-command-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ai-command-kpis article {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 11px 12px;
    border-left: 4px solid #0f766e;
    background: #f3f7f6;
}
.ai-command-kpis span { color: #607175; font-size: .76rem; }
.ai-command-kpis strong { color: #17363a; font-size: 1.35rem; }
.ai-command-charts {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}
.ai-primary-controls {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #cbd8d5;
    border-top: 5px solid #0f766e;
    background: #fff;
    box-shadow: 0 10px 24px rgba(25, 52, 55, .12);
}
.ai-primary-controls form,
.ai-primary-controls .button {
    width: 100%;
    margin: 0;
    text-align: center;
}
.ai-primary-controls .button:disabled { cursor: not-allowed; opacity: .55; }
.ai-primary-charts { margin-bottom: 16px; }
.ai-primary-charts .ai-chart-grid article {
    border: 1px solid #d9e1df;
    background: #f8faf9;
}
.ai-chat-column,
.ai-context-column,
.ai-history-column {
    display: grid;
    gap: 16px;
}
.ai-history-column { display: grid; }
.ai-context-column {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ai-context-column > form { grid-column: 1 / -1; }
.view-ai_director .topbar-actions > form:not(:last-child),
.view-ai_director .topbar-actions > .button,
.view-ai_director .ai-primary-controls,
.view-ai_director .ai-primary-charts,
.view-ai_director .ai-quick-prompts,
.view-ai_director .ai-visual-summary {
    display: none !important;
}
.ai-history {
    padding: 12px;
    max-height: calc(100dvh - 180px);
    overflow-y: auto;
}
.ai-history nav { display: grid; gap: 7px; padding: 0; }
.ai-history nav a {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #d8e1df;
    border-radius: 6px;
    color: #26363a;
    background: #f7faf9;
}
.ai-history nav a:hover,
.ai-history nav a.active {
    border-color: #0f766e;
    color: #17363a;
    background: #e7f3f1;
    text-decoration: none;
}
.ai-history nav strong { font-size: .82rem; line-height: 1.3; }
.ai-history nav span,
.ai-history nav small { color: #68777b; font-size: .7rem; }
.ai-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    color: #fff;
    background: #17363a;
    border-left: 6px solid #f0c419;
}
.ai-heading h2 { margin: 3px 0 7px; font-size: 1.45rem; }
.ai-heading p { margin: 0; color: #d5e1de; }
.ai-heading .eyebrow { color: #f0c419; }
.ai-provider-state {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    font-size: .86rem;
    font-weight: 700;
}
.ai-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-new-chat-inline { margin: 0; }
.ai-heading-actions .button {
    min-height: 34px;
    padding: 7px 10px;
}
.status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
}
.status-light.online { background: #32c879; box-shadow: 0 0 0 4px rgba(50, 200, 121, .14); }
.ai-chat { padding: 0; overflow: hidden; }
.ai-chat {
    display: flex;
    flex-direction: column;
}
.ai-messages { order: 1; }
.ai-report-actions { order: 2; }
.ai-composer { order: 3; }
.ai-quick-prompts { order: 4; }
.ai-visual-summary { order: 5; }
.ai-messages {
    height: min(58vh, 610px);
    min-height: 410px;
    overflow-y: auto;
    padding: 22px;
    background: #f5f8f7;
}
.ai-message {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    max-width: 88%;
    margin-bottom: 18px;
}
.ai-message.user { margin-left: auto; }
.ai-message > div:last-child {
    padding: 13px 15px;
    border: 1px solid #d8e1df;
    background: #fff;
}
.ai-message.user > div:last-child {
    border-color: #31565b;
    color: #fff;
    background: #31565b;
}
.ai-message strong { display: block; margin-bottom: 6px; font-size: .82rem; }
.ai-message-content p {
    margin: 0;
    line-height: 1.58;
    white-space: normal;
    overflow-wrap: anywhere;
}
.ai-message-content p + p { margin-top: 10px; }
.ai-message-content h3,
.ai-message-content h4 {
    margin: 15px 0 7px;
    color: #17363a;
}
.ai-message-content ul,
.ai-message-content ol {
    margin: 7px 0 7px 20px;
    padding: 0;
    line-height: 1.55;
}
.ai-table-wrap {
    max-width: 100%;
    margin: 12px 0;
    overflow-x: auto;
}
.ai-table-wrap table { min-width: 520px; font-size: .8rem; }
.ai-table-wrap th { background: #e7efed; }
.ai-message small { display: block; margin-top: 9px; color: #78858a; }
.ai-message.user small { color: #cbd8d9; }
.ai-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #17363a;
    background: #f0c419;
    font-size: .72rem;
    font-weight: 800;
}
.ai-message.user .ai-avatar { color: #fff; background: #6f8589; }
.ai-quick-prompts {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    border-top: 1px solid #dfe6e4;
    background: #fff;
}
.ai-visual-summary {
    padding: 18px;
    border-top: 1px solid #dfe6e4;
    background: #fff;
}
.ai-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.ai-chart-grid article {
    padding: 14px;
    border: 1px solid #d9e1df;
    background: #f8faf9;
}
.ai-chart-grid h3 { margin: 0 0 12px; font-size: .92rem; }
.ai-distribution-bars { display: grid; gap: 10px; }
.ai-bar-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: .75rem;
}
.ai-bar-track {
    height: 9px;
    overflow: hidden;
    background: #e1e7e5;
}
.ai-bar-track span { display: block; height: 100%; min-width: 2px; }
.ai-bar-track .green { background: #168a4a; }
.ai-bar-track .yellow { background: #b7791f; }
.ai-bar-track .red { background: #c53030; }
.ai-bar-track .neutral { background: #7b8794; }
.ai-quick-prompts button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #c9d5d2;
    border-radius: 4px;
    color: #29494d;
    background: #f7faf9;
    white-space: nowrap;
    cursor: pointer;
}
.ai-report-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid #dfe6e4;
    background: #fff;
}
.ai-report-actions form,
.ai-report-actions .button { width: 100%; margin: 0; text-align: center; }
.ai-report-actions .button:disabled { cursor: not-allowed; opacity: .55; }
.ai-composer {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #dfe6e4;
}
.ai-composer label { font-weight: 700; }
.ai-composer textarea { min-height: 104px; resize: vertical; }
.ai-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.ai-composer-actions span { color: #667579; font-size: .78rem; line-height: 1.4; }
.form-stack { display: grid; gap: 13px; }
.form-stack label { display: grid; gap: 5px; font-weight: 700; }
.ai-data-summary dl { display: grid; gap: 0; margin: 0; }
.ai-data-summary dl div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #e2e8e6;
}
.ai-data-summary dt { color: #617074; }
.ai-data-summary dd { margin: 0; font-weight: 800; }
.ai-data-summary p { margin: 14px 0 0; color: #667579; font-size: .82rem; line-height: 1.5; }
.ai-rules-compact > div:not(.panel-head) {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
}
.ai-rules-compact .dot { min-width: 12px; width: 12px; height: 12px; padding: 0; border-radius: 50%; font-size: 0; }
.ai-rules-compact b { font-size: .82rem; }
.ai-rules-compact small { color: #69777b; }
.ai-rules-compact hr { border: 0; border-top: 1px solid #dfe6e4; margin: 10px 0; }
.full-button { width: 100%; }
.ai-settings .form-grid { align-items: start; }
.ai-security-note {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border-left: 4px solid #168a4a;
    background: #eef8f2;
}
.ai-security-note span { color: #52645f; font-size: .82rem; line-height: 1.45; }
.provider-config {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #d6dfdc;
}
.provider-config legend { padding: 0 6px; font-weight: 800; }
.provider-config label { display: grid; gap: 5px; }
.provider-badge {
    justify-self: start;
    padding: 5px 8px;
    color: #6b7280;
    background: #edf0f2;
    font-size: .75rem;
    font-weight: 700;
}
.provider-badge.ready { color: #12683b; background: #e4f5eb; }

@media (max-width: 1020px) {
    .ai-director-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .ai-context-column { grid-column: 1 / -1; }
    .ai-context-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-context-column > form { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .view-ai_director .sidebar { padding-top: 8px; }
    .view-ai_director .sidebar .brand { display: none; }
    .view-ai_director .shell { padding: 10px; }
    .view-ai_director .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 9px;
    }
    .view-ai_director .topbar .eyebrow,
    .view-ai_director .topbar-actions .signed-user { display: none; }
    .view-ai_director .topbar h1 { margin: 0; font-size: 1.35rem; }
    .view-ai_director .topbar { gap: 8px; }
    .view-ai_director .topbar-actions { display: flex; }
    .view-ai_director .topbar-actions .signed-user { width: auto; }
    .view-ai_director .topbar-actions form:last-child { width: auto; }
    .view-ai_director .topbar-actions form:last-child .button { width: auto; }
    .ai-command-center { gap: 10px; padding: 12px; }
    .ai-command-center > .panel-head { align-items: flex-start; }
    .ai-command-prompts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-command-prompts button { min-height: 48px; padding: 7px; font-size: .76rem; }
    .ai-command-actions { grid-template-columns: 1fr; }
    .ai-command-actions .button { min-height: 44px; padding: 7px 4px; font-size: .72rem; white-space: normal; }
    .ai-command-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-command-kpis article { padding: 8px 9px; }
    .ai-command-kpis strong { font-size: 1.12rem; }
    .ai-director-layout { grid-template-columns: 1fr; }
    .ai-chat-column { order: 1; }
    .ai-history-column { order: 2; }
    .ai-context-column { order: 3; }
    .ai-history { max-height: 260px; }
    .ai-heading { align-items: flex-start; flex-direction: column; }
    .ai-heading-actions { width: 100%; justify-content: flex-start; }
    .ai-heading-actions .ai-new-chat-inline,
    .ai-heading-actions .ai-new-chat-inline .button { width: 100%; }
    .ai-context-column { grid-template-columns: 1fr; }
    .ai-chart-grid { grid-template-columns: 1fr; }
    .ai-report-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-report-actions .button { min-height: 44px; padding: 7px 5px; font-size: .75rem; white-space: normal; }
    .ai-primary-controls {
        position: sticky;
        grid-template-columns: 1fr;
        top: 0;
    }
    .ai-message { max-width: 100%; }
    .ai-messages { min-height: 360px; height: 52vh; padding: 14px; }
    .ai-composer-actions { align-items: stretch; flex-direction: column; }
    .ai-composer-actions .button { width: 100%; }
}

@media print {
    body.print-ai-chat .sidebar,
    body.print-ai-chat .topbar,
    body.print-ai-chat .flash,
    body.print-ai-chat .ai-history-column,
    body.print-ai-chat .ai-context-column,
    body.print-ai-chat .ai-heading,
    body.print-ai-chat .ai-quick-prompts,
    body.print-ai-chat .ai-report-actions,
    body.print-ai-chat .ai-composer {
        display: none !important;
    }
    body.print-ai-chat .shell { margin: 0; padding: 0; }
    body.print-ai-chat .shell > * { display: none !important; }
    body.print-ai-chat .shell > #ai-print-report { display: block !important; }
    body.print-ai-chat .ai-chat-column,
    body.print-ai-chat .ai-chat { display: block !important; border: 0; box-shadow: none; }
    body.print-ai-chat .ai-chat > .print-school-header,
    body.print-ai-chat .ai-chat > .print-only { display: flex !important; }
    body.print-ai-chat .ai-messages {
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 0;
        background: #fff;
    }
    body.print-ai-chat .ai-message { max-width: 100%; break-inside: avoid; }
    body.print-ai-chat .ai-message > div:last-child { border: 1px solid #cbd5d1; color: #17202a; background: #fff; }
    body.print-ai-chat .ai-message.user > div:last-child { border-left: 5px solid #f0c419; }
    body.print-ai-chat .ai-avatar { display: none; }
    body.print-ai-chat .ai-message { grid-template-columns: 1fr; }
    body.print-ai-chat .ai-visual-summary { padding: 16px 0; break-inside: avoid; }
}
.autosave-status {
    align-self: center;
    color: #64748b;
    font-size: .82rem;
    font-weight: 650;
    margin-left: .65rem;
}

.autosave-status[data-state="saving"] { color: #8a5a00; }
.autosave-status[data-state="saved"] { color: #18794e; }
.autosave-status[data-state="error"] { color: #b42318; }
