:root {
    --ink: #18231f;
    --muted: #66716c;
    --line: #dfe5e1;
    --surface: #ffffff;
    --canvas: #f3f6f3;
    --green: #176b52;
    --green-strong: #0f5842;
    --green-soft: #e8f3ee;
    --orange: #d96832;
    --orange-soft: #fff0e8;
    --blue: #315f85;
    --blue-soft: #eaf1f7;
    --red: #b8413b;
    --red-soft: #fcecea;
    --yellow: #8b6814;
    --yellow-soft: #fff7d9;
    --shadow: 0 16px 40px rgba(24, 35, 31, 0.10);
    --radius: 8px;
    font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
    color: var(--ink);
    letter-spacing: 0;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--canvas);
}

body,
button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    color: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

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

svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 16px;
    font-weight: 700;
}

.brand-lockup--light {
    color: #ffffff;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 7px;
    background: var(--orange);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button[aria-busy="true"] svg {
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(49, 95, 133, 0.22);
    outline-offset: 1px;
}

.button--primary {
    background: var(--green);
    color: #ffffff;
}

.button--primary:hover {
    background: var(--green-strong);
}

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

.button--secondary:hover,
.button--ghost:hover {
    border-color: #9db2a8;
    background: var(--green-soft);
}

.button--ai {
    border-color: #b9cce0;
    background: var(--blue-soft);
    color: #244f73;
}

.button--ai:hover {
    border-color: var(--blue);
    background: #dae8f3;
}

.button--danger-outline {
    border-color: #d7aaa6;
    background: #ffffff;
    color: var(--red);
}

.button--danger-outline:hover {
    border-color: var(--red);
    background: var(--red-soft);
}

.button--ghost {
    border-color: transparent;
    background: transparent;
}

.button--block {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    border-color: #aebbb4;
    color: var(--ink);
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: #34423c;
    font-size: 12px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0 12px;
    border: 1px solid #ccd6d0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
}

.field input,
.field select {
    height: 44px;
}

.field textarea {
    min-height: 104px;
    padding-top: 11px;
    padding-bottom: 11px;
    line-height: 1.5;
    resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: #a6b7ae;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green);
    outline: 3px solid rgba(23, 107, 82, 0.12);
}

.input-with-icon {
    position: relative;
}

.input-with-icon > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    color: #7c8983;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-with-icon input {
    padding-left: 42px;
}

.input-with-action input {
    padding-right: 52px;
}

.input-with-action .icon-button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 22px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.55;
}

.alert--error {
    border-color: #ebc0bc;
    background: var(--red-soft);
    color: #8c2e29;
}

.alert--success {
    border-color: #badbcf;
    background: var(--green-soft);
    color: var(--green-strong);
}

.alert--warning {
    border-color: #e7ca8b;
    background: #fff8e8;
    color: #744f0b;
}

/* Login */

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 24px;
    background: #e8ede9;
}

.login-page form {
    width: min(1120px, 100%);
}

.login-shell {
    display: grid;
    min-height: min(720px, calc(100vh - 48px));
    grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
    overflow: hidden;
    border: 1px solid #d6dfda;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-context {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 42px 48px 32px;
    background: #173c32;
    color: #ffffff;
}

.login-context__body {
    display: flex;
    max-width: 540px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 44px 0;
}

.login-context .eyebrow {
    color: #a9d7c7;
}

.login-context h1 {
    max-width: 470px;
    margin: 0 0 34px;
    font-size: 42px;
    font-weight: 600;
    line-height: 1.16;
}

.login-context__foot {
    margin: 0;
    color: #a8beb6;
    font-size: 11px;
}

.schedule-snapshot {
    width: min(470px, 100%);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.07);
}

.schedule-snapshot__meta,
.schedule-snapshot__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.schedule-snapshot__meta {
    margin-bottom: 17px;
    color: #dcebe5;
    font-size: 12px;
}

.schedule-snapshot__meta strong {
    color: #ffc29f;
}

.schedule-snapshot__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 32px;
    gap: 5px;
}

.schedule-snapshot__grid span {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
}

.schedule-snapshot__grid .is-filled {
    border-color: rgba(169, 215, 199, 0.42);
    background: rgba(87, 159, 133, 0.32);
}

.schedule-snapshot__grid .is-accent {
    border-color: rgba(255, 171, 124, 0.45);
    background: rgba(217, 104, 50, 0.34);
}

.schedule-snapshot__footer {
    margin-top: 15px;
    color: #a8beb6;
    font-size: 10px;
}

.login-form-area {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 48px;
}

.login-form-wrap {
    width: min(380px, 100%);
}

.login-heading {
    margin-bottom: 32px;
}

.login-heading h2 {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.25;
}

.login-heading > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-form-wrap .field {
    margin-bottom: 19px;
}

.login-form-wrap .field input {
    height: 50px;
}

.login-form-wrap .button--block {
    min-height: 50px;
    margin-top: 8px;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 20px 0 0;
    color: #7b8781;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

.security-note svg {
    width: 15px;
    height: 15px;
    color: var(--green);
}

/* Account */

.account-page {
    min-height: 100vh;
    padding: 28px;
    background: var(--canvas);
}

.account-shell {
    width: min(960px, 100%);
    margin: 0 auto;
}

.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 72px;
}

.account-header .button--ghost {
    min-height: 42px;
}

.password-panel {
    width: min(620px, 100%);
    margin: 0 auto;
    padding: 36px 0;
    border-top: 3px solid var(--green);
}

.password-panel__heading {
    display: flex;
    gap: 17px;
    margin-bottom: 30px;
}

.section-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 6px;
    background: var(--green-soft);
    color: var(--green);
}

.password-panel h1 {
    margin: 0 0 8px;
    font-size: 27px;
}

.password-panel__heading p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.password-fields {
    display: grid;
    gap: 18px;
}

.password-policy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 26px;
}

.password-policy span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    color: var(--muted);
    font-size: 10px;
}

/* Application shell */

.app-page {
    min-height: 100vh;
    background: var(--canvas);
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 26px 18px;
    background: #173c32;
    color: #ffffff;
    z-index: 20;
}

.sidebar-nav {
    margin: 46px 0 24px;
}

.sidebar-nav .sidebar-link + .sidebar-link {
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    border-radius: 6px;
    color: #bfd1ca;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.sidebar-link.is-active {
    box-shadow: inset 3px 0 0 var(--orange);
}

.sidebar-context {
    display: flex;
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    flex-direction: column;
    gap: 5px;
}

.sidebar-context > span:first-child {
    color: #9fb8af;
    font-size: 9px;
    text-transform: uppercase;
}

.sidebar-context strong {
    font-size: 12px;
}

.status-dot {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: #b8cec6;
    font-size: 9px;
}

.status-dot i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ccfa9;
    box-shadow: 0 0 0 3px rgba(108, 207, 169, 0.13);
}

.app-main {
    min-width: 0;
}

.topbar {
    display: flex;
    height: 70px;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
}

.sidebar-toggle {
    display: none;
    margin-right: auto;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-user strong {
    max-width: 180px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user span {
    color: var(--muted);
    font-size: 9px;
}

.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--orange-soft);
    color: #a34a22 !important;
    font-size: 12px !important;
    font-weight: 700;
}

.workspace {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 34px 38px 72px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.25;
}

.page-heading__status {
    display: flex;
    gap: 8px;
}

.status-chip {
    display: inline-flex;
    height: 30px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #bdd8cc;
    border-radius: 5px;
    background: var(--green-soft);
    color: var(--green-strong);
    font-size: 9px;
    font-weight: 700;
}

.status-chip--ai {
    border-color: #c8d7e6;
    background: var(--blue-soft);
    color: #315f85;
}

.status-chip svg {
    width: 14px;
    height: 14px;
}

.workspace-section {
    padding: 30px 0 34px;
    border-top: 1px solid var(--line);
}

.version-table-wrap {
    margin-top: 24px;
}

.version-grid {
    min-width: 1160px;
}

.grid-input--date {
    min-width: 145px;
}

.version-picker {
    min-width: 210px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #ccd6d0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 12px;
}

/* Calculation */

.calculation-heading {
    align-items: end;
}

.batch-picker {
    width: min(430px, 100%);
}

.batch-toolbar {
    display: flex;
    width: min(680px, 58%);
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
}

.batch-toolbar .batch-picker {
    flex: 1;
}

.batch-toolbar .button {
    white-space: nowrap;
}

.batch-picker select {
    min-width: 0;
}

.inline-form {
    display: grid;
    align-items: end;
    gap: 14px;
}

.inline-form--student,
.inline-form--closure {
    grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .65fr) minmax(150px, .72fr) minmax(150px, .72fr) auto;
}

.inline-form--excluded-subject {
    grid-template-columns: minmax(280px, 520px) auto;
    justify-content: start;
}

.excluded-subject-picker {
    width: min(520px, 100%);
}

.form-action {
    margin-bottom: 0;
    white-space: nowrap;
}

.compact-table-wrap {
    margin-top: 22px;
}

.compact-grid {
    min-width: 720px;
}

.result-grid {
    min-width: 1960px;
}

.result-grid td:nth-last-child(-n+3) {
    min-width: 260px;
    white-space: nowrap;
}

.calculation-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
}

.teacher-picker {
    width: min(300px, 32vw);
}

.calculation-actions .button {
    white-space: nowrap;
}

.ai-holiday-actions {
    display: flex;
    min-width: 460px;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
}

.holiday-ai-panel {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto;
    align-items: end;
    gap: 18px;
    margin-bottom: 24px;
    padding: 18px;
    border-top: 1px solid #c8d7e6;
    border-bottom: 1px solid #c8d7e6;
    background: #f4f8fb;
}

.holiday-ai-context {
    min-width: 0;
}

.paste-parse-button {
    margin-top: 10px;
}

.holiday-ai-panel .ai-holiday-actions {
    padding-left: 18px;
    border-left: 1px solid #c8d7e6;
}

.api-key-field {
    width: min(280px, 100%);
}

.api-key-field input {
    height: 42px;
}

.calculation-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
}

.suggestion-band {
    margin-top: 26px;
    padding: 22px 0;
    border-top: 1px solid #bfd1dc;
    border-bottom: 1px solid #bfd1dc;
    background: #f4f8fb;
}

.suggestion-band__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 18px 16px;
}

.suggestion-band__heading > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-band__heading strong {
    font-size: 14px;
}

.suggestion-band__heading span {
    color: var(--muted);
    font-size: 11px;
}

.source-link {
    color: var(--blue);
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.estimate-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-left: 3px solid var(--yellow);
    background: var(--yellow-soft);
    color: #6f5415;
    font-size: 11px;
    line-height: 1.55;
}

.estimate-note svg {
    margin-top: 1px;
}

.empty-state {
    display: flex;
    min-height: 280px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.empty-state > svg {
    width: 34px;
    height: 34px;
}

.icon-button--small {
    width: 34px;
    height: 34px;
    min-height: 34px;
}

.section-heading {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.section-index {
    display: grid;
    width: 34px;
    height: 30px;
    place-items: center;
    border-radius: 5px;
    background: #e4e9e6;
    color: #57635d;
    font-size: 10px;
    font-weight: 700;
}

.section-heading h2 {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.35;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.source-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 14px;
    margin-left: 52px;
}

.upload-zone,
.sample-file {
    display: flex;
    min-height: 94px;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid #ccd6d0;
    border-radius: 7px;
    background: #ffffff;
}

.upload-zone {
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--green);
    background: #fbfdfc;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.upload-zone__icon,
.file-badge {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 6px;
    background: var(--green-soft);
    color: var(--green);
}

.file-badge {
    background: var(--orange-soft);
    color: var(--orange);
}

.upload-zone__copy,
.sample-file > div {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.upload-zone__copy strong,
.sample-file strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-zone__copy span,
.sample-file span {
    color: var(--muted);
    font-size: 9px;
}

.upload-zone .button,
.sample-file .button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 10px;
}

.import-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 17px 0 0 52px;
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 5px;
    color: var(--muted);
    font-size: 9px;
}

.privacy-note svg {
    width: 14px;
    height: 14px;
    color: var(--blue);
}

.inline-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 14px 0 0 52px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.inline-note svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--blue);
    margin-top: 1px;
}

.inline-note--accent {
    padding: 10px 12px;
    border-left: 3px solid var(--blue);
    background: var(--blue-soft);
    color: #31526f;
}

.existing-batches-section .section-heading {
    margin-bottom: 0;
}

.existing-batches-section .table-tools {
    align-items: center;
}

.existing-batches-section .version-picker {
    min-width: 285px;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 24px 52px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
}

.metric {
    min-width: 0;
    padding: 15px 18px;
    border-right: 1px solid var(--line);
}

.metric:last-child {
    border-right: 0;
}

.metric span,
.metric strong {
    display: block;
}

.metric span {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
}

.metric strong {
    font-size: 20px;
}

.metric--warning strong {
    color: var(--orange);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-left: 52px;
}

.field--wide {
    grid-column: span 2;
}

.warning-list {
    margin: 22px 0 0 52px;
    padding: 14px 16px;
    border-left: 3px solid #d3a534;
    background: var(--yellow-soft);
    color: #6f5615;
    font-size: 10px;
    line-height: 1.6;
}

.warning-list strong {
    display: flex;
    align-items: center;
    gap: 7px;
}

.warning-list ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.section-heading--toolbar {
    grid-template-columns: 38px minmax(220px, 1fr) auto;
    align-items: end;
}

.table-tools {
    display: flex;
    align-items: center;
    gap: 9px;
}

.search-box {
    position: relative;
    width: 270px;
}

.search-box svg {
    position: absolute;
    top: 50%;
    left: 11px;
    width: 16px;
    height: 16px;
    color: #7b8781;
    transform: translateY(-50%);
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 11px 0 36px;
    border: 1px solid #ccd6d0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 11px;
}

.table-tools .button {
    min-height: 40px;
    font-size: 10px;
}

.table-scroll {
    width: 100%;
    overflow: auto;
    border: 1px solid #d7dfda;
    border-radius: 7px 7px 0 0;
    background: #ffffff;
    max-height: 620px;
}

.data-grid {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.data-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 42px;
    padding: 0 9px;
    border-bottom: 1px solid #d5ded8;
    background: #f0f4f1;
    color: #4e5b55;
    font-size: 9px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.data-grid th:nth-child(1) { width: 48px; text-align: center; }
.data-grid th:nth-child(2) { width: 150px; }
.data-grid th:nth-child(3) { width: 125px; }
.data-grid th:nth-child(4) { width: 78px; }
.data-grid th:nth-child(5) { width: 92px; }
.data-grid th:nth-child(6) { width: 86px; }
.data-grid th:nth-child(7) { width: 64px; }
.data-grid th:nth-child(8) { width: 86px; }
.data-grid th:nth-child(9) { width: 190px; }

.data-grid td {
    height: 48px;
    padding: 5px 8px;
    border-bottom: 1px solid #edf0ee;
    background: #ffffff;
    font-size: 10px;
    vertical-align: middle;
}

.data-grid tr:hover td {
    background: #fafcfb;
}

.data-grid tr.has-error td {
    background: #fff9f8;
}

.data-grid td:first-child {
    text-align: center;
}

.grid-input,
.grid-select {
    width: 100%;
    height: 34px;
    min-width: 0;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font-size: 10px;
}

.grid-input:hover,
.grid-select:hover,
.grid-input:focus,
.grid-select:focus {
    border-color: #b8c7bf;
    background: #ffffff;
    outline: none;
}

.row-status {
    display: inline-block;
    max-width: 180px;
    overflow-wrap: anywhere;
    font-size: 9px;
    line-height: 1.45;
}

.row-status--ok {
    color: var(--green);
}

.row-status--error {
    color: var(--red);
}

.save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border: 1px solid #d7dfda;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    background: #ffffff;
}

.save-bar > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.save-bar strong {
    font-size: 11px;
}

.save-bar span {
    color: var(--muted);
    font-size: 9px;
}

/* Database setup */

.setup-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: #eef2ef;
}

.setup-page > form {
    min-height: inherit;
}

.setup-login {
    width: min(520px, calc(100% - 32px));
    margin: 7vh auto;
    overflow: hidden;
    border: 1px solid #d4ddd7;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.setup-login__header,
.setup-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.setup-login__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: #f8faf8;
}

.setup-security-label,
.setup-lock-reminder {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--green-strong);
    font-size: 11px;
    font-weight: 600;
}

.setup-security-label svg,
.setup-lock-reminder svg {
    width: 16px;
    height: 16px;
}

.setup-login__body {
    display: grid;
    gap: 20px;
    padding: 34px;
}

.setup-login__body h1 {
    margin: -8px 0 0;
    font-size: 25px;
    line-height: 1.3;
}

.setup-lead {
    margin: -10px 0 2px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.setup-login__body .alert {
    margin-bottom: 0;
}

.setup-workspace {
    min-height: inherit;
}

.setup-topbar {
    min-height: 70px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.setup-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 42px 34px 72px;
}

.setup-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.setup-heading h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.3;
}

.setup-heading p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.setup-lock-reminder {
    max-width: 230px;
    padding: 10px 12px;
    border: 1px solid #badbcf;
    border-radius: 6px;
    background: var(--green-soft);
}

.setup-section {
    padding: 32px 0 36px;
    border-top: 1px solid var(--line);
}

.setup-section__heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.setup-section__heading h2 {
    margin: 1px 0 5px;
    font-size: 18px;
    line-height: 1.4;
}

.setup-section__heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.section-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 7px;
    background: var(--green-soft);
    color: var(--green);
}

.section-icon--orange {
    background: var(--orange-soft);
    color: #ad4f25;
}

.section-icon--blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.setup-metrics {
    display: grid;
    grid-template-columns: 1.6fr repeat(5, minmax(88px, .7fr));
    margin: 26px 0 0 56px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.setup-metrics > div {
    min-width: 0;
    padding: 15px 16px;
    border-right: 1px solid var(--line);
}

.setup-metrics > div:last-child {
    border-right: 0;
}

.setup-metrics dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.setup-metrics dd {
    margin: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setup-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 18px 0 0 56px;
}

.setup-action-row p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.setup-action-row p svg {
    flex: 0 0 auto;
    color: var(--red);
}

.setup-reset-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.setup-reset-confirm {
    max-width: 280px;
    color: var(--red);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.setup-reset-confirm input {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    vertical-align: -3px;
    accent-color: var(--red);
}

.setup-script-paste {
    margin: 28px 0 0 56px;
    padding-top: 26px;
    border-top: 1px dashed #becbc4;
}

.setup-script-paste__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.setup-script-paste__heading h3 {
    margin: 0 0 5px;
    font-size: 15px;
}

.setup-script-paste__heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.setup-script-load-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.field textarea.setup-script-editor {
    min-height: 340px;
    border-color: #aebdb5;
    background: #fbfcfb;
    color: #17221e;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.setup-script-paste__actions {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(260px, 1fr) auto;
    align-items: end;
    gap: 16px;
    margin-top: 16px;
}

.setup-database-target {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding-bottom: 10px;
    color: var(--green-strong);
    font-size: 12px;
    font-weight: 700;
}

.setup-database-target svg {
    width: 17px;
    height: 17px;
}

.setup-section > .setup-database-target {
    margin: 14px 0 0 56px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.setup-script-confirm {
    padding-bottom: 11px;
    color: var(--red);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.setup-script-confirm input {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    vertical-align: -3px;
    accent-color: var(--red);
}

.setup-script-paste__actions .button {
    white-space: nowrap;
}

.setup-admin-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
    align-items: end;
    gap: 16px;
    margin: 26px 0 0 56px;
}

.setup-confirm {
    grid-column: 1 / 3;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.setup-confirm input {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    vertical-align: -3px;
    accent-color: var(--green);
}

.setup-admin-form > .button {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: end;
    white-space: nowrap;
}

.setup-section--log .field {
    margin: 24px 0 0 56px;
}

.field textarea.setup-log {
    min-height: 180px;
    border-color: #263630;
    background: #1e2b27;
    color: #dce8e2;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .setup-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .setup-metrics > div:nth-child(3n) {
        border-right: 0;
    }

    .setup-metrics > div:nth-child(-n+3) {
        border-bottom: 1px solid var(--line);
    }

    .setup-admin-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .setup-confirm,
    .setup-admin-form > .button {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

@media (max-width: 620px) {
    .setup-login {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .setup-login__header,
    .setup-topbar {
        padding-right: 18px;
        padding-left: 18px;
    }

    .setup-security-label,
    .setup-topbar .status-chip {
        display: none;
    }

    .setup-login__body {
        padding: 34px 22px;
    }

    .setup-main {
        padding: 30px 18px 52px;
    }

    .setup-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .setup-heading h1 {
        font-size: 24px;
    }

    .setup-metrics,
    .setup-action-row,
    .setup-script-paste,
    .setup-admin-form,
    .setup-section--log .field {
        margin-left: 0;
    }

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

    .setup-metrics > div,
    .setup-metrics > div:nth-child(3n) {
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }

    .setup-metrics > div:nth-child(2n) {
        border-right: 0;
    }

    .setup-metrics > div:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .setup-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .setup-section > .setup-database-target {
        margin-left: 0;
    }

    .setup-action-row .button {
        width: 100%;
    }

    .setup-reset-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .setup-reset-confirm {
        max-width: none;
    }

    .setup-script-paste__heading {
        align-items: stretch;
        flex-direction: column;
    }

    .setup-script-paste__heading .button {
        width: 100%;
    }

    .setup-script-load-actions {
        width: 100%;
        flex-direction: column;
    }

    .setup-script-paste__actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .setup-script-paste__actions .button {
        width: 100%;
    }

    .setup-admin-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .setup-confirm,
    .setup-admin-form > .button {
        grid-column: auto;
    }

    .setup-admin-form > .button {
        width: 100%;
    }
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        left: 0;
        width: 240px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 18px 0 40px rgba(0, 0, 0, 0.18);
    }

    .sidebar-toggle {
        display: inline-grid;
    }

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

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

    .section-heading--toolbar {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .table-tools {
        grid-column: 2;
        margin-top: 8px;
    }

    .calculation-actions {
        grid-column: 2;
        margin-top: 8px;
    }

    .inline-form--student,
    .inline-form--closure,
    .inline-form--excluded-subject {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inline-form .form-action {
        width: 100%;
    }

    .ai-holiday-actions {
        min-width: 0;
        justify-content: flex-start;
    }

    .holiday-ai-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .holiday-ai-panel .ai-holiday-actions {
        padding-top: 16px;
        padding-left: 0;
        border-top: 1px solid #c8d7e6;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .login-page {
        padding: 0;
    }

    .login-shell {
        min-height: 100vh;
        grid-template-columns: minmax(0, 1fr);
        border: 0;
        border-radius: 0;
    }

    .login-context {
        min-height: 280px;
        padding: 25px 24px;
    }

    .login-context__body {
        padding: 34px 0 10px;
    }

    .login-context h1 {
        margin-bottom: 0;
        font-size: 29px;
    }

    .schedule-snapshot,
    .login-context__foot {
        display: none;
    }

    .login-form-area {
        align-items: start;
        padding: 38px 24px 48px;
    }

    .account-page {
        padding: 20px;
    }

    .account-header {
        margin-bottom: 40px;
    }

    .password-panel {
        padding-top: 28px;
    }

    .topbar {
        height: 62px;
        padding: 0 16px;
    }

    .topbar-user > div {
        display: none;
    }

    .workspace {
        padding: 26px 16px 56px;
    }

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

    .page-heading h1 {
        font-size: 24px;
    }

    .batch-picker {
        width: 100%;
    }

    .batch-toolbar {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .batch-toolbar .button {
        width: 100%;
    }

    .workspace-section {
        padding: 25px 0;
    }

    .source-grid,
    .import-actions,
    .metrics-row,
    .metadata-grid,
    .warning-list,
    .inline-note {
        margin-left: 0;
    }

    .existing-batches-section .section-heading {
        align-items: start;
    }

    .existing-batches-section .table-tools,
    .existing-batches-section .version-picker {
        width: 100%;
        min-width: 0;
    }

    .upload-zone,
    .sample-file {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .upload-zone .button,
    .sample-file .button {
        width: 100%;
    }

    .import-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .privacy-note {
        margin: 3px 0 0;
    }

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

    .metric:nth-child(2) {
        border-right: 0;
    }

    .metric:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }

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

    .field--wide {
        grid-column: auto;
    }

    .section-heading--toolbar {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .table-tools {
        grid-column: 1 / -1;
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .save-bar .button {
        width: 100%;
    }

    .inline-form--student,
    .inline-form--closure,
    .inline-form--excluded-subject {
        grid-template-columns: minmax(0, 1fr);
    }

    .suggestion-band__heading {
        align-items: stretch;
        flex-direction: column;
    }

    .suggestion-band__heading .button {
        width: 100%;
    }

    .version-picker {
        width: 100%;
    }

    .ai-holiday-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .api-key-field,
    .ai-holiday-actions .button {
        width: 100%;
    }

    .paste-parse-button {
        width: 100%;
    }

    .calculation-actions {
        grid-column: 1 / -1;
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-picker,
    .calculation-actions .button {
        width: 100%;
    }

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

/* Student daily report */

.student-report-workspace {
    width: min(1180px, 100%);
}

.student-report-heading {
    align-items: end;
    flex-wrap: wrap;
}

.report-status-badge {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid #cbd5cf;
    border-radius: 5px;
    background: #ffffff;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.report-status-badge--submitted {
    border-color: #b9cce0;
    background: var(--blue-soft);
    color: #244f73;
}

.report-status-badge--returned {
    border-color: #e6cf91;
    background: var(--yellow-soft);
    color: #6f5415;
}

.report-status-badge--published {
    border-color: #badbcf;
    background: var(--green-soft);
    color: var(--green-strong);
}

.report-context-band {
    display: grid;
    grid-template-columns: 1.4fr .7fr .8fr;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #f8faf9;
}

.report-context-band > div {
    display: flex;
    min-width: 0;
    padding: 16px 20px;
    flex-direction: column;
    gap: 5px;
    border-right: 1px solid var(--line);
}

.report-context-band > div:last-child {
    border-right: 0;
}

.report-context-band span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.report-context-band strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-feedback {
    margin: 22px 0 0;
    border-color: #e6cf91;
    background: var(--yellow-soft);
    color: #6f5415;
}

.report-feedback > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-entry-list,
.violation-entry-list,
.report-general-note,
.report-add-button {
    margin-left: 52px;
}

.report-entry-row {
    display: grid;
    grid-template-columns: 72px minmax(150px, .7fr) minmax(220px, 1.25fr) minmax(220px, 1.25fr) 42px;
    align-items: end;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.report-entry-row:first-child,
.violation-entry-row:first-child {
    border-top: 1px solid var(--line);
}

.report-entry-row .field textarea {
    min-height: 74px;
}

.report-period-field input {
    text-align: center;
}

.report-remove-button {
    margin-bottom: 0;
    color: var(--red);
}

.report-add-button {
    margin-top: 16px;
}

.report-general-note {
    max-width: 780px;
    margin-top: 24px;
}

.report-general-note textarea {
    min-height: 84px;
}

.report-add-violation {
    white-space: nowrap;
}

.violation-entry-row {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(320px, 1.5fr) 42px;
    align-items: end;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.report-inline-empty {
    margin-left: 52px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.report-submit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 0;
    border-top: 1px solid #cfd8d2;
    background: var(--canvas);
}

.report-submit-bar > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.report-submit-bar strong {
    font-size: 12px;
}

.report-submit-bar span {
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 980px) {
    .report-entry-row {
        grid-template-columns: 72px minmax(170px, 1fr) 42px;
    }

    .report-entry-row > .field:nth-child(3),
    .report-entry-row > .field:nth-child(4) {
        grid-column: span 3;
    }

    .report-entry-row .report-remove-button {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 760px) {
    .student-report-heading {
        align-items: flex-start;
    }

    .report-context-band {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-context-band > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .report-context-band > div:last-child {
        border-bottom: 0;
    }

    .report-entry-list,
    .violation-entry-list,
    .report-general-note,
    .report-add-button,
    .report-inline-empty {
        margin-left: 0;
    }

    .report-entry-row,
    .violation-entry-row {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .report-entry-row > .field,
    .report-entry-row > .field:nth-child(3),
    .report-entry-row > .field:nth-child(4),
    .violation-entry-row > .field {
        grid-column: 1 / -1;
    }

    .report-entry-row .report-remove-button,
    .violation-entry-row .report-remove-button {
        grid-column: 2;
        grid-row: 1;
    }

    .report-add-button,
    .report-add-violation,
    .report-submit-bar .button {
        width: 100%;
    }

    .report-add-violation {
        grid-column: 1 / -1;
    }

    .report-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Account management and proctor violations */

.account-heading,
.violation-heading {
    align-items: end;
}

.class-management-picker,
.student-report-date-picker {
    width: min(360px, 42vw);
}

.class-create-band {
    display: grid;
    grid-template-columns: minmax(240px, .75fr) minmax(560px, 1.8fr);
    align-items: end;
    gap: 28px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.class-create-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.class-create-heading > svg {
    width: 26px;
    height: 26px;
    color: var(--green);
}

.class-create-heading > div {
    min-width: 0;
}

.class-create-heading h2 {
    margin: 0;
    font-size: 15px;
}

.class-create-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.class-create-form {
    display: grid;
    grid-template-columns: minmax(120px, .65fr) minmax(150px, .75fr) minmax(160px, .8fr) auto;
    align-items: end;
    gap: 12px;
}

.management-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.management-metrics > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border-right: 1px solid var(--line);
}

.management-metrics > div:last-child {
    border-right: 0;
}

.management-metrics span {
    color: var(--muted);
    font-size: 10px;
}

.management-metrics strong {
    font-size: 21px;
}

.student-entry-form,
.account-create-form {
    display: grid;
    align-items: end;
    gap: 12px;
    margin-left: 52px;
}

.student-entry-form {
    grid-template-columns: minmax(120px, .65fr) minmax(220px, 1.3fr) minmax(150px, .7fr) minmax(130px, .6fr) auto;
}

.student-duplicate-warning,
.import-warning-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e7ca8b;
    border-radius: 6px;
    background: #fff8e8;
    color: #60450f;
}

.student-duplicate-warning {
    margin: 16px 0 0 52px;
}

.student-duplicate-warning > svg,
.import-warning-confirmation > svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: #a66d00;
}

.student-duplicate-warning > div:not(.student-warning-actions),
.import-warning-confirmation > div {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.student-duplicate-warning strong,
.import-warning-confirmation strong {
    font-size: 11px;
}

.student-duplicate-warning span,
.import-warning-confirmation label {
    font-size: 10px;
    line-height: 1.55;
}

.student-warning-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.account-create-form--student {
    grid-template-columns: minmax(250px, 1.25fr) minmax(170px, .75fr) minmax(210px, 1fr) minmax(190px, .8fr) auto;
}

.account-create-form--proctor {
    grid-template-columns: minmax(240px, 1.2fr) minmax(180px, .8fr) minmax(220px, 1fr) auto;
}

.check-option {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    color: #34423c;
    font-size: 11px;
    font-weight: 600;
}

.check-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--green);
}

.roster-import-band {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 0 52px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.roster-import-copy {
    display: flex;
    min-width: 260px;
    flex: 1;
    align-items: center;
    gap: 12px;
}

.roster-import-copy > svg {
    width: 24px;
    height: 24px;
    color: var(--green);
}

.roster-import-copy > div,
.import-preview-heading > div,
.violation-save-bar > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.roster-import-copy strong,
.import-preview-heading strong,
.violation-save-bar strong {
    font-size: 12px;
}

.roster-import-copy span,
.import-preview-heading span,
.violation-save-bar span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.roster-import-band input[type="file"] {
    width: min(310px, 31vw);
    font-size: 10px;
}

.roster-import-band--stack {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
}

.roster-import-band--stack .roster-import-copy {
    flex: none;
}

textarea.bulk-student-input {
    width: 100%;
    min-height: 132px;
    padding: 11px 12px;
    border: 1px solid #c2cfc8;
    border-radius: 10px;
    background: #fff;
    font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

textarea.bulk-student-input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(23, 107, 82, 0.12);
}

.roster-import-band--stack .button {
    align-self: flex-start;
}

.log-viewer-wrap {
    margin-top: 16px;
    border: 1px solid #c8d4cd;
    border-radius: 12px;
    background: #10231c;
    overflow: auto;
    max-height: 62vh;
}

pre.log-viewer {
    margin: 0;
    padding: 16px 18px;
    color: #d5e5dd;
    font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre;
    tab-size: 4;
}

.import-preview {
    margin: 20px 0 0 52px;
}

.import-preview-heading,
.violation-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}

.import-warning-confirmation {
    margin-bottom: 12px;
}

.import-warning-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.import-warning-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--green);
}

.import-review-status {
    display: inline-block;
    max-width: 360px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.5;
}

.import-review-status--error {
    color: #9a302a;
}

.import-review-status--warning {
    color: #805500;
}

.import-review-status--ready {
    color: var(--green-strong);
}

.roster-table-wrap {
    margin-top: 22px;
}

.management-grid {
    width: 100%;
    min-width: 940px;
    border-collapse: separate;
    border-spacing: 0;
}

.management-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 12px;
    border-bottom: 1px solid #d5ded8;
    background: #f0f4f1;
    color: #4e5b55;
    font-size: 9px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.management-grid td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0ee;
    background: #ffffff;
    font-size: 10px;
    line-height: 1.45;
    vertical-align: middle;
}

.management-grid tr:hover td {
    background: #fafcfb;
}

.preview-grid {
    min-width: 800px;
}

.preview-grid td:last-child {
    color: var(--red);
}

.button--compact {
    min-height: 32px;
    padding: 0 9px;
    font-size: 9px;
    white-space: nowrap;
}

.grid-password-input {
    width: 190px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #ccd6d0;
    border-radius: 5px;
    font-size: 10px;
}

.grid-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.violation-context-form {
    display: grid;
    width: min(500px, 48vw);
    grid-template-columns: minmax(200px, 1fr) minmax(170px, .8fr);
    gap: 12px;
}

.proctor-entry-list {
    margin-left: 52px;
}

.student-directory {
    margin: 0 0 8px 52px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: #f8fbf9;
}

.student-directory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.student-directory-toolbar > div {
    display: grid;
    gap: 3px;
}

.student-directory-toolbar strong {
    color: var(--ink);
    font-size: 14px;
}

.student-directory-toolbar span {
    color: var(--muted);
    font-size: 12px;
}

.student-directory-search {
    position: relative;
    display: block;
    width: min(300px, 100%);
}

.student-directory-search svg {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transform: translateY(-50%);
}

.student-directory-search input {
    width: 100%;
    height: 38px;
    padding: 0 11px 0 34px;
    border: 1px solid #ccd6d0;
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
}

.student-directory-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 112px;
    overflow-y: auto;
}

.student-directory-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid #d8e2dc;
    border-radius: 5px;
    background: #ffffff;
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.student-directory-item:hover,
.student-directory-item:focus-visible {
    border-color: var(--green);
    background: #f2f8f4;
}

.student-directory-item--added {
    border-color: var(--green);
    background: #eaf6ee;
}

.student-directory-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
}

.student-directory-empty {
    color: var(--muted);
    font-size: 12px;
}

.student-roster-entry {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(360px, 1.4fr) auto;
    align-items: end;
    gap: 14px;
    margin: 0 0 14px 52px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: #f8fbf9;
}

.student-roster-entry-copy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    align-self: center;
}

.student-roster-entry-copy > svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--green);
}

.student-roster-entry-copy > div {
    display: grid;
    gap: 4px;
}

.student-roster-entry-copy strong {
    font-size: 14px;
}

.student-roster-entry-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.student-roster-entry-field textarea {
    min-height: 100px;
}

.proctor-entry-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 90px minmax(135px, .6fr) minmax(300px, 1.5fr) 42px;
    align-items: end;
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
}

.proctor-entry-row + .proctor-entry-row {
    border-top: 0;
    border-bottom: 1px solid var(--line);
}

.proctor-content-field input,
.proctor-content-field textarea {
    min-width: 0;
}

.proctor-content-field textarea {
    min-height: 112px;
}

.proctor-student-search {
    height: 32px !important;
    margin-bottom: 6px;
    padding: 0 9px !important;
    font-size: 12px !important;
}

.proctor-student-field {
    position: relative;
}

.proctor-student-suggestions {
    position: absolute;
    z-index: 20;
    top: 68px;
    right: 0;
    left: 0;
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid #b9c8c0;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(33, 53, 44, .16);
}

.proctor-student-suggestion {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid #e7ece9;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.proctor-student-suggestion:hover,
.proctor-student-suggestion:focus {
    outline: 0;
    background: #edf6f1;
}

.proctor-student-suggestion-empty {
    display: block;
    padding: 10px 11px;
    color: var(--muted);
    font-size: 12px;
}

.violation-save-bar {
    margin: 18px 0 0 52px;
    border-top: 1px solid var(--line);
}

.recent-violation-grid {
    min-width: 1120px;
}

@media (max-width: 1180px) {
    .class-create-band {
        grid-template-columns: minmax(220px, .65fr) minmax(500px, 1.5fr);
    }

    .class-create-form {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .class-create-form .form-action {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .student-entry-form {
        grid-template-columns: minmax(150px, .7fr) minmax(240px, 1.3fr) minmax(160px, .7fr) minmax(130px, .6fr);
    }

    .student-entry-form .form-action {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .account-create-form--student {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .account-create-form--student .form-action {
        justify-self: start;
    }

    .proctor-entry-row {
        grid-template-columns: minmax(220px, 1fr) 90px minmax(140px, .7fr) 42px;
    }

    .student-directory {
        margin-left: 0;
    }

    .student-roster-entry {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        margin-left: 0;
    }

    .student-directory-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .student-directory-search {
        width: 100%;
    }

    .proctor-content-field {
        grid-column: 1 / -1;
    }

    .proctor-entry-row .report-remove-button {
        grid-column: 4;
        grid-row: 1;
    }
}

@media (max-width: 860px) {
    .account-heading,
    .violation-heading {
        align-items: stretch;
    }

    .class-management-picker,
    .violation-context-form,
    .student-report-date-picker {
        width: 100%;
    }

    .class-create-band {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

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

    .management-metrics > div:nth-child(2) {
        border-right: 0;
    }

    .management-metrics > div:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }

    .student-entry-form,
    .account-create-form,
    .roster-import-band,
    .import-preview,
    .student-duplicate-warning,
    .proctor-entry-list,
    .violation-save-bar {
        margin-left: 0;
    }

    .student-entry-form,
    .account-create-form--student,
    .account-create-form--proctor {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .roster-import-band {
        align-items: stretch;
        flex-direction: column;
    }

    .roster-import-band input[type="file"] {
        width: 100%;
    }

    .proctor-entry-row {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .proctor-entry-row > .field,
    .proctor-content-field {
        grid-column: 1 / -1;
    }

    .proctor-entry-row .report-remove-button {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 560px) {
    .management-metrics,
    .class-create-form,
    .student-entry-form,
    .account-create-form--student,
    .account-create-form--proctor,
    .violation-context-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .management-metrics > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .management-metrics > div:last-child {
        border-bottom: 0;
    }

    .student-entry-form .form-action,
    .class-create-form .form-action,
    .account-create-form .form-action,
    .roster-import-band .button,
    .import-preview-heading .button,
    .violation-save-bar .button {
        width: 100%;
    }

    .import-preview-heading,
    .violation-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .student-duplicate-warning {
        flex-wrap: wrap;
    }

    .student-warning-actions {
        width: 100%;
    }

    .student-warning-actions .button {
        flex: 1;
    }

    .section-heading--toolbar .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Administrative sub-navigation and review queues. */
.management-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 26px;
    padding: 4px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.management-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.management-tabs a:hover,
.management-tabs a:focus-visible {
    color: var(--green-strong);
    background: var(--green-soft);
}

.management-tabs a.is-active {
    border-bottom-color: var(--green);
    color: var(--green-strong);
}

.scope-workspace {
    display: grid;
    gap: 22px;
}

.scope-toolbar,
.review-filter-band {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 18px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.scope-summary {
    display: grid;
    gap: 3px;
    min-width: 140px;
    padding-bottom: 8px;
    text-align: right;
}

.scope-summary span,
.review-selected-count {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.scope-summary strong {
    color: var(--green-strong);
    font-size: 18px;
}

.scope-search-field {
    width: min(260px, 100%);
}

table.class-scope-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
    table-layout: fixed;
}

.class-scope-list td {
    padding: 0;
    border: 1px solid var(--line);
    background: #fbfcfb;
    vertical-align: middle;
}

.class-scope-list td:hover {
    border-color: #9cbbae;
    background: var(--green-soft);
}

.class-scope-list input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0 10px 0 0;
    accent-color: var(--green);
}

.class-scope-list label {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    max-width: calc(100% - 34px);
    padding: 8px 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.class-scope-list td:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
}

.scope-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.scope-save-bar > span {
    color: var(--muted);
    font-size: 12px;
}

.review-filter-band {
    grid-template-columns: minmax(180px, .55fr) minmax(280px, 1.45fr) auto auto;
    margin-bottom: 18px;
}

.review-filter-band .button {
    margin-bottom: 1px;
}

.review-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 22px;
}

.review-section + .review-section {
    margin-top: 24px;
}

.review-selected-count {
    align-self: center;
    padding: 7px 10px;
    border: 1px solid var(--line);
    background: #fbfcfb;
    color: var(--green-strong);
    white-space: nowrap;
}

.review-grid {
    min-width: 980px;
}

.review-grid th:nth-child(n),
.review-grid td:nth-child(n) {
    width: auto;
    text-align: left;
}

.review-grid .review-check-column {
    width: 46px;
    text-align: center;
}

.review-check-column input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--green);
}

.review-grid tr.is-selected td {
    background: var(--green-soft);
    box-shadow: inset 0 1px 0 #b9d6c9, inset 0 -1px 0 #b9d6c9;
}

.review-detail {
    display: block;
    max-width: 520px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.review-violation-content {
    display: block;
    min-width: 240px;
    max-width: 520px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    table.class-scope-list {
        table-layout: auto;
    }

    .class-scope-list tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-filter-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .management-tabs {
        margin-right: -18px;
        margin-left: -18px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .scope-toolbar,
    .review-filter-band {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .scope-summary {
        text-align: left;
    }

    .scope-search-field {
        width: 100%;
    }

    .class-scope-list tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .scope-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .scope-save-bar .button,
    .review-filter-band .button {
        width: 100%;
    }

    .review-section .section-heading--toolbar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .review-section .review-selected-count,
    .review-section .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Content moderation workspace. */
.content-review-heading {
    align-items: center;
    margin-bottom: 18px;
}

.review-heading-summary {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.review-heading-summary strong {
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
}

.review-heading-summary small {
    font-size: 10px;
    font-weight: 500;
}

.content-review-page .review-filter-band {
    grid-template-columns: minmax(170px, 230px) minmax(300px, 1fr) auto;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-color: #d7e0db;
    background: #f8faf9;
}

.content-review-page .review-filter-band .field label {
    margin-bottom: 6px;
}

.review-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-filter-actions .button {
    white-space: nowrap;
}

.review-clear-filter {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid #cbd6d0;
    background: #ffffff;
}

.review-queue-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
    padding: 3px;
    border: 1px solid #d4ddd8;
    border-radius: 7px;
    background: #edf1ef;
}

.review-queue-tab {
    display: inline-flex;
    min-width: 168px;
    min-height: 42px;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #5f6c66;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.review-queue-tab:hover,
.review-queue-tab:focus-visible {
    color: var(--ink);
    outline: none;
}

.review-queue-tab.is-active {
    border-color: #cbd6d0;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(24, 35, 31, .08);
    color: var(--green-strong);
}

.review-queue-tab strong {
    display: grid;
    min-width: 24px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    place-items: center;
    border-radius: 11px;
    background: #dfe6e2;
    color: #56615c;
    font-size: 10px;
}

.review-queue-tab.is-active strong {
    background: var(--green-soft);
    color: var(--green-strong);
}

.review-queue-panel {
    display: none;
    padding-top: 18px;
}

.review-queue-panel.is-active {
    display: block;
}

.review-queue-header {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 0 14px;
}

.review-queue-title,
.review-bulk-actions {
    display: flex;
    align-items: center;
    gap: 11px;
}

.review-queue-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #c5d9cf;
    border-radius: 6px;
    background: var(--green-soft);
    color: var(--green-strong);
}

.review-queue-icon--alert {
    border-color: #efd3c7;
    background: var(--orange-soft);
    color: #a34a22;
}

.review-queue-title h2 {
    margin: 0 0 3px;
    font-size: 16px;
    line-height: 1.3;
}

.review-queue-title p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.review-selected-count {
    min-width: 82px;
    padding: 7px 9px;
    border-color: #d5ded9;
    border-radius: 5px;
    text-align: center;
}

.review-table-scroll {
    max-height: 650px;
    border-radius: 6px;
}

.content-review-page .review-grid {
    table-layout: fixed;
}

.content-review-page .review-grid--reports {
    min-width: 980px;
}

.content-review-page .review-grid--violations {
    min-width: 1140px;
}

.content-review-page .review-grid th {
    height: 44px;
    padding: 0 11px;
    background: #f4f7f5;
    color: #5c6862;
    font-size: 9px;
    text-transform: uppercase;
}

.content-review-page .review-grid td {
    height: auto;
    min-height: 58px;
    padding: 11px;
    font-size: 11px;
    line-height: 1.45;
}

.content-review-page .review-grid--reports th:nth-child(1) { width: 44px; }
.content-review-page .review-grid--reports th:nth-child(2) { width: 76px; }
.content-review-page .review-grid--reports th:nth-child(3) { width: 100px; }
.content-review-page .review-grid--reports th:nth-child(4) { width: 160px; }
.content-review-page .review-grid--reports th:nth-child(5) { width: auto; }
.content-review-page .review-grid--reports th:nth-child(6) { width: 140px; }
.content-review-page .review-grid--reports th:nth-child(7) { width: 140px; }
.content-review-page .review-grid--reports th:nth-child(8) { width: 66px; }

.content-review-page .review-grid--violations th:nth-child(1) { width: 44px; }
.content-review-page .review-grid--violations th:nth-child(2) { width: 74px; }
.content-review-page .review-grid--violations th:nth-child(3) { width: 100px; }
.content-review-page .review-grid--violations th:nth-child(4) { width: 170px; }
.content-review-page .review-grid--violations th:nth-child(5) { width: 58px; }
.content-review-page .review-grid--violations th:nth-child(6) { width: 112px; }
.content-review-page .review-grid--violations th:nth-child(7) { width: auto; }
.content-review-page .review-grid--violations th:nth-child(8) { width: 132px; }
.content-review-page .review-grid--violations th:nth-child(9) { width: 140px; }
.content-review-page .review-grid--violations th:nth-child(10) { width: 66px; }

.review-class-chip,
.review-source,
.review-severity {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.review-class-chip {
    border: 1px solid #c5d6ce;
    background: #f2f7f4;
    color: var(--green-strong);
}

.review-person,
.review-content-title {
    display: block;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.review-content-title {
    margin-bottom: 3px;
    font-size: 12px;
}

.content-review-page .review-detail {
    display: -webkit-box;
    max-width: none;
    margin-top: 3px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 10px;
}

.review-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    margin: 0 5px 4px 0;
    color: #53615a;
    font-size: 10px;
    white-space: nowrap;
}

.review-stat strong {
    color: var(--green-strong);
    font-size: 12px;
}

.review-stat--alert strong {
    color: var(--red);
}

.review-severity--reminder {
    background: var(--blue-soft);
    color: var(--blue);
}

.review-severity--minor {
    background: var(--yellow-soft);
    color: #725612;
}

.review-severity--major,
.review-severity--serious {
    background: var(--red-soft);
    color: var(--red);
}

.review-severity--serious {
    box-shadow: inset 0 0 0 1px #edc5c2;
}

.review-source {
    padding: 0;
    color: #4f5e57;
}

.review-nowrap {
    color: #4f5c56;
    white-space: nowrap;
}

.review-period {
    text-align: center;
}

.content-review-page .review-violation-content {
    min-width: 0;
    max-width: none;
    font-size: 11px;
}

.content-review-page .review-grid tr.is-selected td {
    background: #edf7f2;
}

.content-review-page .review-row--approved td {
    background: #f6faf7;
}

.review-approved-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 4px;
    background: var(--green-soft);
    color: var(--green-strong);
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.review-approved-badge svg {
    width: 12px;
    height: 12px;
}

.review-copy-column {
    text-align: center;
}

.review-copy-button {
    position: relative;
}

.review-copy-button.is-copied {
    border-color: var(--green-strong);
    color: var(--green-strong);
}

.review-copy-button.is-copied::after {
    content: "Đã copy";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--ink);
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}

.review-empty-row td {
    height: 180px !important;
    color: var(--muted);
    text-align: center !important;
}

@media (max-width: 900px) {
    .content-review-page .review-filter-band {
        grid-template-columns: minmax(160px, .7fr) minmax(240px, 1.3fr) auto;
    }

    .review-bulk-actions {
        gap: 7px;
    }
}

@media (max-width: 760px) {
    .management-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: visible;
    }

    .management-tabs a {
        min-width: 0;
        justify-content: center;
        padding-right: 7px;
        padding-left: 7px;
    }

    .management-tab-label {
        font-size: 0;
    }

    .management-tab-label::after {
        content: attr(data-short);
        font-size: 11px;
    }

    .content-review-heading {
        align-items: center;
        flex-direction: row;
    }

    .review-heading-summary span,
    .review-heading-summary small {
        display: none;
    }

    .review-heading-summary strong {
        display: grid;
        min-width: 42px;
        height: 34px;
        padding: 0 8px;
        place-items: center;
        border: 1px solid #ccd8d2;
        border-radius: 5px;
        background: #ffffff;
        font-size: 18px;
    }

    .content-review-page .review-filter-band {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    .review-filter-actions .button {
        flex: 1;
    }

    .review-queue-switch {
        display: flex;
        width: 100%;
    }

    .review-queue-tab {
        min-width: 0;
        flex: 1;
    }

    .review-queue-header {
        align-items: stretch;
        flex-direction: column;
    }

    .review-bulk-actions {
        justify-content: space-between;
    }

    .review-bulk-actions .button {
        width: auto;
    }

    .review-table-scroll {
        max-height: none;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .content-review-page .review-grid,
    .content-review-page .review-grid tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .content-review-page .review-grid thead {
        display: none;
    }

    .content-review-page .review-grid tr:not(.review-empty-row) {
        display: grid;
        grid-template-columns: 42px 82px minmax(0, 1fr);
        margin-bottom: 10px;
        border: 1px solid #d7dfda;
        border-radius: 6px;
        background: #ffffff;
        overflow: hidden;
    }

    .content-review-page .review-grid tr:not(.review-empty-row) td {
        display: block;
        min-height: 0;
        padding: 8px 10px;
        border: 0;
        background: transparent;
        text-align: left;
    }

    .content-review-page .review-grid tr:not(.review-empty-row) td:nth-child(1) {
        grid-column: 1;
        grid-row: 1 / span 7;
        padding-top: 12px;
        border-right: 1px solid #edf0ee;
        text-align: center;
    }

    .review-grid--reports td:nth-child(2),
    .review-grid--violations td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .review-grid--reports td:nth-child(3),
    .review-grid--violations td:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right !important; }
    .review-grid--reports td:nth-child(4) { grid-column: 2 / 4; grid-row: 2; }
    .review-grid--reports td:nth-child(5) { grid-column: 2 / 4; grid-row: 3; padding-top: 2px !important; }
    .review-grid--reports td:nth-child(6) { grid-column: 2 / 4; grid-row: 4; }
    .review-grid--reports td:nth-child(7) { grid-column: 2 / 4; grid-row: 5; padding-top: 0 !important; font-size: 9px; }
    .review-grid--reports td:nth-child(8) { grid-column: 2 / 4; grid-row: 6; text-align: right !important; padding-top: 4px !important; }

    .review-grid--violations td:nth-child(4) { grid-column: 2 / 4; grid-row: 2; }
    .review-grid--violations td:nth-child(5) { grid-column: 2; grid-row: 3; }
    .review-grid--violations td:nth-child(5)::before { content: "Tiết "; color: var(--muted); font-size: 9px; }
    .review-grid--violations td:nth-child(6) { grid-column: 3; grid-row: 3; text-align: right !important; }
    .review-grid--violations td:nth-child(7) { grid-column: 2 / 4; grid-row: 4; }
    .review-grid--violations td:nth-child(8) { grid-column: 2 / 4; grid-row: 5; }
    .review-grid--violations td:nth-child(9) { grid-column: 2 / 4; grid-row: 6; padding-top: 0 !important; font-size: 9px; }
    .review-grid--violations td:nth-child(10) { grid-column: 2 / 4; grid-row: 7; text-align: right !important; padding-top: 4px !important; }

    .review-empty-row {
        display: table-row;
    }
}

@media (max-width: 420px) {
    .review-queue-title p {
        display: none;
    }

    .review-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .review-bulk-actions .button,
    .review-selected-count {
        width: 100%;
    }
}

/* ---------------------------------------------------------------------------
   ReportOverview.aspx — daily oversight of reports & violations by class
   --------------------------------------------------------------------------- */

.report-overview-page .review-filter-band {
    grid-template-columns: minmax(150px, 190px) minmax(180px, 260px) auto;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-color: #d7e0db;
    background: #f8faf9;
}

.report-overview-page .review-filter-band .field label {
    margin-bottom: 6px;
}

.report-overview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.report-overview-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.report-overview-metric span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.report-overview-metric strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.report-overview-metric--alert {
    border-color: #e6bcb5;
    background: #fdf5f4;
}

.report-overview-metric--alert strong {
    color: var(--red);
}

.report-overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.report-overview-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 11px;
    border: 1px solid #dbe3de;
    border-radius: 8px;
    background: #ffffff;
}

.report-overview-card.is-missing {
    border-color: #e6bcb5;
    background: #fdf5f4;
}

.report-overview-card.is-approved {
    border-color: #b7d8c6;
    background: #f5faf7;
}

.report-overview-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.report-overview-card-counts {
    color: #53615a;
    font-size: 10px;
}

.report-overview-card-counts strong {
    color: var(--green-strong);
}

.report-status-badge--missing {
    border-color: #e6bcb5;
    background: #fdf5f4;
    color: #9a3b2f;
}

.report-overview-page .review-grid {
    table-layout: fixed;
    min-width: 1040px;
}

.report-overview-page .review-grid--violations {
    min-width: 1180px;
}

.report-overview-page .review-grid td {
    height: auto;
    min-height: 52px;
    padding: 10px 9px;
    vertical-align: top;
    font-size: 11px;
    line-height: 1.45;
}

.report-overview-page .review-grid td:first-child,
.report-overview-page .review-grid td:nth-child(n) {
    text-align: left;
}

.report-overview-page .review-grid .review-detail {
    display: -webkit-box;
    max-width: none;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.report-overview-page .review-row--approved td {
    background: #f6faf7;
}

@media (max-width: 900px) {
    .report-overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-overview-page .review-filter-band {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .report-overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-overview-page .review-filter-band {
        grid-template-columns: minmax(0, 1fr);
    }
}
