:root {
    color-scheme: light;
    --ui-primary: #2563eb;
    --ui-primary-strong: #1d4ed8;
    --ui-primary-soft: #eff6ff;
    --ui-secondary: #3b82f6;
    --ui-success: #16a34a;
    --ui-success-soft: #dcfce7;
    --ui-warning: #f59e0b;
    --ui-warning-soft: #fef3c7;
    --ui-danger: #dc2626;
    --ui-danger-soft: #fee2e2;
    --ui-info: #7c3aed;
    --ui-info-soft: #f3e8ff;
    --ui-background: #f8fafc;
    --ui-surface: #ffffff;
    --ui-border: #e2e8f0;
    --ui-text: #1e293b;
    --ui-text-secondary: #64748b;
    --ui-muted: #64748b;
    --ui-sidebar: #1e3a5f;
    --ui-radius: 14px;
    --ui-shadow: 0 3px 14px rgb(29 48 68 / 5%);
    --ui-focus: 0 0 0 3px rgb(37 99 235 / 18%);
    font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body.app-body {
    min-width: 320px;
    margin: 0;
    background: var(--ui-background);
    color: var(--ui-text);
    font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ui-primary);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--ui-primary-strong);
}

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

:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus) !important;
}

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

.app-sidebar {
    position: sticky;
    z-index: 1025;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #365579;
    background: var(--ui-sidebar);
    padding: 18px 12px 14px;
    transition: width 180ms ease, transform 180ms ease;
}

.app-brand {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 11px;
    margin: 0 5px 18px;
    color: #fff;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--ui-primary);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.app-brand-copy,
.app-profile-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.35;
}

.app-brand-copy strong {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.app-brand-copy small {
    margin-top: 4px;
    color: #c0d0e3;
    font-size: 9px;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

.app-navigation {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 3px 8px 0;
    scrollbar-color: #7190b4 transparent;
    scrollbar-width: thin;
}

.app-nav-section {
    --nav-section-accent: #8fbfe8;
    --nav-section-accent-soft: rgb(143 191 232 / 14%);
    min-width: 0;
    padding: 2px 0 4px;
}

.app-nav-section:nth-of-type(2) { --nav-section-accent: #9bc6ed; --nav-section-accent-soft: rgb(155 198 237 / 14%); }
.app-nav-section:nth-of-type(3) { --nav-section-accent: #a7cfed; --nav-section-accent-soft: rgb(167 207 237 / 14%); }
.app-nav-section:nth-of-type(4) { --nav-section-accent: #9fd5e8; --nav-section-accent-soft: rgb(159 213 232 / 14%); }
.app-nav-section:nth-of-type(5) { --nav-section-accent: #a8c8f2; --nav-section-accent-soft: rgb(168 200 242 / 14%); }
.app-nav-section:nth-of-type(6) { --nav-section-accent: #9bbbe3; --nav-section-accent-soft: rgb(155 187 227 / 14%); }
.app-nav-section:nth-of-type(7) { --nav-section-accent: #b0cae8; --nav-section-accent-soft: rgb(176 202 232 / 14%); }

.app-nav-section + .app-nav-section {
    border-top: 1px solid rgb(219 234 254 / 15%);
}

.app-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 8px 4px;
    padding: 4px 7px;
    border-radius: 6px;
    color: var(--nav-section-accent);
    background: linear-gradient(90deg, var(--nav-section-accent-soft), transparent 88%);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.app-nav-group::before {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border-radius: 50%;
    background: var(--nav-section-accent);
    content: "";
}

.app-nav-section.is-active .app-nav-group {
    color: #e0f2fe;
    background: linear-gradient(90deg, rgb(96 165 250 / 22%), transparent 88%);
}

.app-nav-section.is-active .app-nav-group::before {
    background: #7dd3fc;
}

.app-nav-section-links {
    display: grid;
    gap: 1px;
}

.app-nav-link {
    display: flex;
    position: relative;
    min-height: 39px;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    color: #e2eaf5;
    padding: 8px 10px;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease;
}

.app-nav-link:hover {
    background: rgb(219 234 254 / 14%);
    color: #fff;
}

.app-nav-link.is-active {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #bfdbfe;
}

.app-nav-link.is-unavailable {
    min-height: 32px;
    justify-content: space-between;
    gap: 7px;
    color: #c0d0e3;
    cursor: not-allowed;
    padding-block: 5px;
}

.app-nav-link.is-unavailable:hover {
    background: transparent;
    color: #e2eaf5;
}

.app-nav-badge {
    flex: 0 0 auto;
    border: 1px solid #7894b5;
    border-radius: 999px;
    padding: 2px 6px;
    color: #e2eaf5;
    font-size: 9px;
}

.ui-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.app-nav-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
    opacity: 0.9;
}

.app-nav-link.is-active .app-nav-icon {
    opacity: 1;
}

.app-nav-label {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    border-top: 1px solid #557294;
    color: #e2eaf5;
    margin-top: 20px;
    padding: 16px 8px 2px;
    font-size: 12px;
    white-space: nowrap;
}

.app-mobile-logout {
    display: none;
}

.app-mobile-logout button {
    border: 0;
    background: transparent;
    color: #e2eaf5;
    padding: 4px;
    font-size: 11px;
}

.app-mobile-logout button:hover {
    color: #fca5a5;
}

.app-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--ui-success);
    box-shadow: 0 0 0 3px var(--ui-success-soft);
}

.app-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    z-index: 1010;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--ui-border);
    background: rgb(255 255 255 / 94%);
    padding: 12px clamp(18px, 3vw, 42px);
    backdrop-filter: blur(12px);
}

.app-topbar-start,
.app-topbar-actions,
.app-profile {
    display: flex;
    min-width: 0;
    align-items: center;
}

.app-topbar-start {
    gap: 15px;
}

.app-topbar-actions {
    gap: 20px;
}

.app-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface);
    color: var(--ui-secondary);
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-icon-button:hover {
    border-color: #cbd5df;
    background: #f7f9fb;
    color: var(--ui-primary);
}

.app-menu-toggle {
    font-size: 16px;
}

.app-breadcrumb {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--ui-muted);
    font-size: 12px;
}

.app-breadcrumb a {
    overflow: hidden;
    color: var(--ui-text-secondary);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-breadcrumb strong {
    overflow: hidden;
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-search {
    display: flex;
    width: min(300px, 28vw);
    height: 38px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--ui-muted);
    padding: 0 10px;
}

.app-search > span {
    font-size: 19px;
    line-height: 1;
}

.app-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ui-text);
    font-size: 12px;
}

.app-search input:focus {
    box-shadow: none !important;
}

.app-search kbd {
    border: 1px solid #e1e6eb;
    border-radius: 4px;
    background: #fff;
    color: var(--ui-muted);
    padding: 0 5px;
    font-size: 10px;
}

.app-profile {
    gap: 10px;
}

.app-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 1px solid #dce5ed;
    border-radius: 50%;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    font-size: 12px;
    font-weight: 700;
}

.app-profile-copy strong {
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 600;
}

.app-profile-copy small {
    color: var(--ui-muted);
    font-size: 10px;
}

.app-logout-form {
    margin-left: 2px;
}

.app-logout-button {
    border: 0;
    background: transparent;
    color: var(--ui-secondary);
    padding: 5px 0 5px 6px;
    font-size: 11px;
    white-space: nowrap;
}

.app-logout-button:hover {
    color: var(--ui-danger);
}

.app-content {
    width: min(100%, 1660px);
    flex: 1;
    margin-inline: auto;
    padding: clamp(22px, 3vw, 42px);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--ui-border);
    color: var(--ui-muted);
    margin: 0 clamp(22px, 3vw, 42px);
    padding: 16px 0 20px;
    font-size: 11px;
}

.app-sidebar-backdrop {
    display: none;
}

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

.app-page-heading h1,
.app-content h1.h3 {
    margin: 0;
    color: var(--ui-text);
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.35;
}

.app-page-heading p,
.app-content > .mb-4 > p,
.app-content .text-secondary {
    color: var(--ui-text-secondary) !important;
}

.app-page-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.app-content .card {
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow) !important;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-content .card:hover {
    border-color: #d4dee7;
}

.app-content .card-body {
    padding: clamp(18px, 2vw, 24px);
}

.app-content .card h2,
.app-content .card .h5,
.app-content .card .h6 {
    color: var(--ui-text);
    font-weight: 650;
}

.app-content .btn,
.app-login .btn {
    min-height: 38px;
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.app-content .btn:hover,
.app-login .btn:hover {
    transform: translateY(-1px);
}

.app-content .btn:active,
.app-login .btn:active {
    transform: translateY(0);
}

.app-content .btn-primary,
.app-login .btn-primary {
    border-color: var(--ui-primary);
    background: var(--ui-primary);
}

.app-content .btn-primary:hover,
.app-login .btn-primary:hover {
    border-color: var(--ui-primary-strong);
    background: var(--ui-primary-strong);
}

.app-content .btn-outline-primary {
    border-color: #c4d2df;
    color: var(--ui-primary);
}

.app-content .btn-outline-primary:hover {
    border-color: var(--ui-primary);
    background: var(--ui-primary-soft);
    color: var(--ui-primary-strong);
}

.app-content .form-label,
.app-login .form-label {
    margin-bottom: 6px;
    color: #344457;
    font-size: 12px;
    font-weight: 600;
}

.ui-required-label::after {
    color: var(--ui-danger);
    content: " *";
}

.app-content .form-control,
.app-content .form-select,
.app-login .form-control {
    min-height: 42px;
    border: 1px solid #dce3ea;
    border-radius: 9px;
    background-color: #fff;
    color: var(--ui-text);
    padding: 9px 12px;
    font-size: 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.app-content textarea.form-control {
    min-height: auto;
}

.app-content .form-control::placeholder,
.app-login .form-control::placeholder {
    color: #9aa5b1;
}

.app-content .form-control:focus,
.app-content .form-select:focus,
.app-login .form-control:focus {
    border-color: #8da9c1;
    box-shadow: var(--ui-focus);
}

.app-content .form-control:disabled,
.app-content .form-select:disabled {
    background: #f2f4f6;
    color: #8995a4;
}

.app-content .form-check-input {
    border-color: #c5ced8;
}

.app-content .form-check-input:checked {
    border-color: var(--ui-primary);
    background-color: var(--ui-primary);
}

/* Selected courses are shown in green so the assignment is easy to review. */
.app-content input[name="course_id[]"].form-check-input:checked {
    border-color: #198754;
    background-color: #198754;
}

.app-content input[name="course_id[]"].form-check-input[title="มอบหมายแล้ว"] {
    border-color: #198754;
}

.app-content input[name="course_id[]"].form-check-input:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.app-content input[name="course_id[]"].form-check-input:disabled + .form-check-label {
    opacity: 1;
    color: var(--ui-text-secondary);
}

.student-selection-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.student-selection-tools .form-control {
    flex: 1 1 100%;
}

.student-selection-list {
    display: grid;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface);
}

.student-selection-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    cursor: pointer;
}

.student-selection-item > span {
    flex: 1 1 auto;
}

.student-selection-item + .student-selection-item {
    border-top: 1px solid var(--ui-border);
}

.student-selection-item:hover {
    background: var(--ui-primary-soft);
}

.student-selection-item[hidden] {
    display: none;
}

.student-selection-item .form-check-input {
    flex: 0 0 auto;
    margin: 0;
    margin-top: 4px;
}

.student-selection-item.is-already-assigned {
    background: var(--ui-background);
    color: var(--ui-text-secondary);
}

.student-selection-item input:disabled {
    cursor: not-allowed;
}

.student-actions {
    min-width: 104px;
}

.student-actions > summary {
    list-style: none;
}

.student-actions > summary::-webkit-details-marker {
    display: none;
}

.student-action-list {
    display: grid;
    gap: 10px;
    width: min(100%, 360px);
    min-width: 260px;
    padding: 12px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.student-action-item {
    min-width: 0;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: var(--ui-background);
}

.student-action-item .form-control,
.student-action-item .form-select {
    min-width: 0;
}

.ui-required-marker {
    color: var(--ui-danger);
}

.app-content .alert,
.app-login .alert {
    border: 1px solid transparent;
    border-radius: 11px;
    margin-bottom: 20px;
    padding: 13px 16px;
    font-size: 13px;
}

.app-content .alert-danger,
.app-login .alert-danger {
    border-color: #f0d4d4;
    background: var(--ui-danger-soft);
    color: #813333;
}

.app-content .alert-warning {
    border-color: #efdfbb;
    background: var(--ui-warning-soft);
    color: #76510e;
}

.app-content .alert-info {
    border-color: #d5e5ee;
    background: var(--ui-info-soft);
    color: #315d76;
}

.app-content .table-responsive {
    border-radius: 9px;
}

.app-content .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ui-text);
    --bs-table-hover-bg: #f6f8fa;
    margin: 0;
    font-size: 12px;
    vertical-align: middle;
}

.app-content .table > :not(caption) > * > * {
    border-bottom-color: #edf0f3;
    padding: 12px 13px;
}

.user-teacher-link-form {
    min-width: 280px;
}

.user-role-editor {
    min-width: 220px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
}

.user-role-editor legend {
    float: none;
    width: auto;
    margin: 0;
    padding: 0 4px;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 700;
}

.app-content .table thead th {
    background: #f7f9fb;
    color: #617185;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.app-content .table tbody tr {
    transition: background-color 120ms ease;
}

.app-content .table tbody tr:hover {
    --bs-table-bg: #f7f9fb;
}

.app-content .table tbody tr:last-child > * {
    border-bottom: 0;
}

.ui-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

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

.ui-table-search,
.ui-table-status,
.ui-table-page-size {
    min-height: 36px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ui-text);
    padding: 6px 10px;
    font-size: 12px;
}

.ui-table-grade-filter {
    position: relative;
}

.ui-table-filter-button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ui-text);
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.ui-table-filter-button::-webkit-details-marker {
    display: none;
}

.ui-table-filter-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    padding: 10px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgb(15 23 42 / 12%);
}

.ui-table-filter-option {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
}

.ui-table-filter-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--ui-border);
}

.ui-table-search {
    width: min(280px, 50vw);
}

.ui-table-count,
.ui-table-page-info {
    color: var(--ui-text-secondary);
    font-size: 11px;
    white-space: nowrap;
}

.ui-table-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 13px;
}

.ui-page-button {
    min-width: 32px;
    min-height: 31px;
    border: 1px solid var(--ui-border);
    border-radius: 7px;
    background: #fff;
    color: var(--ui-secondary);
    padding: 3px 8px;
    font-size: 11px;
}

.ui-page-button:hover,
.ui-page-button.is-current {
    border-color: #b8c9d8;
    background: var(--ui-primary-soft);
    color: var(--ui-primary-strong);
}

.ui-page-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.ui-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font: inherit;
    text-align: left;
}

.ui-sort-button:hover {
    color: var(--ui-primary);
}

.ui-sort-indicator {
    color: #9aa6b3;
    font-size: 10px;
}

.ui-status-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    border: 1px solid #e4e9ee;
    border-radius: 999px;
    background: #f5f7f9;
    color: #566679;
    padding: 2px 9px;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.ui-status-badge[data-tone="success"] {
    border-color: var(--ui-success);
    background: var(--ui-success-soft);
    color: #166534;
}

.ui-status-badge[data-tone="warning"] {
    border-color: var(--ui-warning);
    background: var(--ui-warning-soft);
    color: #854d0e;
}

.ui-status-badge[data-tone="danger"] {
    border-color: var(--ui-danger);
    background: var(--ui-danger-soft);
    color: #991b1b;
}

.ui-status-badge[data-tone="info"] {
    border-color: var(--ui-info);
    background: var(--ui-info-soft);
    color: #5b21b6;
}

.app-content .accordion {
    --bs-accordion-border-color: var(--ui-border);
    --bs-accordion-border-radius: 12px;
    --bs-accordion-inner-border-radius: 11px;
    --bs-accordion-btn-focus-box-shadow: var(--ui-focus);
    --bs-accordion-active-bg: #f4f7fa;
    --bs-accordion-active-color: var(--ui-primary-strong);
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
}

.app-content .accordion-item {
    border-color: var(--ui-border);
}

.app-content .accordion-button {
    gap: 12px;
    padding: 15px 18px;
    font-size: 13px;
    font-weight: 650;
}

.app-content .accordion-body {
    padding: 18px;
}

.app-content .font-monospace {
    font-size: 11px;
}

.app-content .text-center.text-secondary.py-4,
.app-content .text-center.text-secondary.py-3 {
    padding: 30px 14px !important;
    color: var(--ui-muted) !important;
}

.app-content .fs-3 {
    color: var(--ui-text);
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: -0.04em;
}

.app-content .row.g-3.mb-4 > [class*="col-"] > .card {
    height: 100%;
}

.app-content .row.g-3.mb-4 > [class*="col-"] > .card .card-body {
    position: relative;
    min-height: 112px;
    padding: 18px 19px;
}

.app-content .row.g-3.mb-4 > [class*="col-"] > .card .small {
    color: var(--ui-text-secondary) !important;
    font-size: 11px;
    font-weight: 600;
}

.app-content .row.g-3.mb-4 > [class*="col-"] > .card .fs-3::after {
    display: block;
    width: 29px;
    height: 3px;
    border-radius: 2px;
    background: #dbe6ee;
    content: "";
    margin-top: 8px;
}

.app-toast-region {
    position: fixed;
    z-index: 1100;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 9px;
    width: min(360px, calc(100vw - 32px));
}

.ui-toast {
    border: 1px solid var(--ui-border);
    border-left: 4px solid var(--ui-info);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 10px 32px rgb(21 41 61 / 14%);
    color: var(--ui-text);
    padding: 13px 16px;
    font-size: 13px;
    animation: ui-toast-in 180ms ease-out both;
}

.ui-toast.is-success {
    border-left-color: var(--ui-success);
}

.ui-toast.is-error {
    border-left-color: var(--ui-danger);
}

.ui-swal-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    border: 0;
    border-radius: 18px;
    padding: 30px 28px 26px;
    background: var(--ui-surface);
    color: var(--ui-text);
    text-align: center;
    box-shadow: 0 24px 72px rgb(15 23 42 / 24%);
    animation: ui-swal-in 180ms ease-out both;
}

.ui-swal-dialog::backdrop {
    background: rgb(15 23 42 / 48%);
    backdrop-filter: blur(2px);
}

.ui-swal-icon {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    margin: 0 auto 16px;
    border: 4px solid currentColor;
    border-radius: 50%;
    font-size: 38px;
    font-weight: 500;
    line-height: 1;
}

.ui-swal-dialog.is-success .ui-swal-icon {
    color: var(--ui-success);
    background: var(--ui-success-soft);
}

.ui-swal-dialog.is-error .ui-swal-icon {
    color: var(--ui-danger);
    background: var(--ui-danger-soft);
}

.ui-swal-dialog.is-warning .ui-swal-icon {
    color: var(--ui-warning);
    background: var(--ui-warning-soft);
}

.ui-swal-dialog.is-info .ui-swal-icon {
    color: var(--ui-info);
    background: var(--ui-info-soft);
}

.ui-swal-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 650;
}

.ui-swal-text {
    margin: 0 0 24px;
    color: var(--ui-text-secondary);
    line-height: 1.6;
}

.ui-swal-confirm {
    min-width: 96px;
    border: 0;
    border-radius: 9px;
    padding: 10px 20px;
    background: var(--ui-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ui-swal-confirm:hover {
    background: #1d4ed8;
}

.ui-swal-confirm.is-danger {
    background: var(--ui-danger);
}

.ui-swal-confirm.is-danger:hover {
    background: #b91c1c;
}

.ui-swal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ui-swal-cancel {
    min-width: 96px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    padding: 9px 20px;
    background: var(--ui-surface);
    color: var(--ui-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ui-swal-cancel:hover {
    background: var(--ui-background);
}

.ui-swal-cancel:focus-visible {
    outline: 3px solid rgb(100 116 139 / 32%);
    outline-offset: 3px;
}

.ui-swal-confirm:focus-visible {
    outline: 3px solid rgb(37 99 235 / 32%);
    outline-offset: 3px;
}

@keyframes ui-swal-in {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ui-loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ui-text-secondary);
    font-size: 12px;
}

.ui-loading-indicator::before {
    width: 14px;
    height: 14px;
    border: 2px solid #d8e0e7;
    border-top-color: var(--ui-primary);
    border-radius: 50%;
    content: "";
    animation: ui-spin 650ms linear infinite;
}

.app-sidebar-collapsed .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
}

.app-sidebar-collapsed .app-sidebar {
    padding-inline: 10px;
}

.app-sidebar-collapsed .app-brand {
    justify-content: center;
    margin-inline: 0;
}

.app-sidebar-collapsed .app-brand-copy,
.app-sidebar-collapsed .app-nav-group,
.app-sidebar-collapsed .app-nav-label,
.app-sidebar-collapsed .app-nav-badge,
.app-sidebar-collapsed .app-sidebar-footer > span:last-child {
    display: none;
}

.app-sidebar-collapsed .app-nav-link.is-unavailable {
    display: none;
}

.app-sidebar-collapsed .app-nav-link {
    justify-content: center;
    padding-inline: 8px;
}

.app-sidebar-collapsed .app-sidebar-footer {
    justify-content: center;
    padding-inline: 4px;
}

.app-sidebar-collapsed .app-nav-link:hover::after {
    position: absolute;
    z-index: 5;
    left: 70px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--ui-shadow);
    color: var(--ui-text);
    content: attr(aria-label);
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
}

.dashboard-welcome {
    display: flex;
    min-height: 175px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 16px;
    background: linear-gradient(105deg, #fff 10%, #f1f6fa 100%);
    padding: clamp(22px, 4vw, 38px);
}

.dashboard-welcome h1 {
    margin: 0 0 7px;
    color: var(--ui-text);
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.dashboard-welcome p {
    margin: 0;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.dashboard-welcome-mark {
    display: grid;
    width: 90px;
    height: 90px;
    flex: 0 0 90px;
    place-items: center;
    border: 1px solid #dce6ee;
    border-radius: 27px;
    background: rgb(255 255 255 / 74%);
    color: var(--ui-primary);
    font-size: 38px;
    font-weight: 700;
}

.dashboard-welcome-mark .ui-icon {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    stroke-width: 1.45;
}

.dashboard-stats > [class*="col-"] > .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgb(29 48 68 / 8%) !important;
}

.dashboard-stat-icon {
    position: absolute;
    top: 16px;
    right: 17px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
}

.dashboard-stat-icon .ui-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.dashboard-stat-icon[data-tone="secondary"] {
    background: #eff6ff;
    color: var(--ui-secondary);
}

.dashboard-stat-icon[data-tone="info"] {
    background: var(--ui-info-soft);
    color: var(--ui-info);
}

.dashboard-stat-icon[data-tone="success"] {
    background: var(--ui-success-soft);
    color: var(--ui-success);
}

.dashboard-stat-icon[data-tone="warning"] {
    background: var(--ui-warning-soft);
    color: #b45309;
}

.dashboard-quick-card .card-body,
.dashboard-setup-card .card-body {
    padding: 24px;
}

.dashboard-section-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dashboard-quick-links {
    display: grid;
}

.dashboard-quick-links a {
    display: grid;
    min-height: 62px;
    grid-template-columns: 36px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #edf0f3;
    color: var(--ui-text);
    padding: 9px 2px;
    text-decoration: none;
    transition: color 140ms ease, padding 140ms ease;
}

.dashboard-quick-links a:hover {
    color: var(--ui-primary);
    padding-inline: 5px;
}

.dashboard-quick-links a > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-quick-links strong {
    font-size: 12px;
    font-weight: 650;
}

.dashboard-quick-links small {
    overflow: hidden;
    color: var(--ui-text-secondary);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-quick-arrow {
    color: var(--ui-text-secondary);
    transition: color 140ms ease, transform 140ms ease;
}

.dashboard-quick-arrow .ui-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}

.dashboard-quick-links a:hover .dashboard-quick-arrow {
    color: var(--ui-primary);
    transform: translateX(2px);
}

.dashboard-quick-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #f2f5f8;
    color: var(--ui-primary);
}

.dashboard-quick-icon .ui-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
}

.dashboard-quick-icon[data-tone="secondary"] {
    background: #eff6ff;
    color: var(--ui-secondary);
}

.dashboard-quick-icon[data-tone="info"] {
    background: var(--ui-info-soft);
    color: var(--ui-info);
}

.dashboard-quick-icon[data-tone="warning"] {
    background: var(--ui-warning-soft);
    color: #b45309;
}

.dashboard-quick-icon[data-tone="success"] {
    background: var(--ui-success-soft);
    color: var(--ui-success);
}

.dashboard-setup-card h2 {
    margin-bottom: 7px;
}

.dashboard-setup-list {
    display: grid;
    gap: 0;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.dashboard-setup-list li {
    position: relative;
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 12px;
}

.dashboard-setup-list li:not(:last-child)::after {
    position: absolute;
    top: 38px;
    left: 14px;
    width: 1px;
    height: 27px;
    background: #e1e7ed;
    content: "";
}

.dashboard-setup-list li > span {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    border: 1px solid #dfe5eb;
    border-radius: 50%;
    background: #f7f9fb;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

.dashboard-setup-list li.is-current > span {
    border-color: #c4d4e2;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
}

.dashboard-setup-list li.is-complete > span {
    border-color: #cce6d6;
    background: var(--ui-success-soft);
    color: var(--ui-success);
}

.dashboard-setup-list li > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-setup-list strong {
    color: var(--ui-text);
    font-size: 11px;
    font-weight: 650;
}

.dashboard-setup-list small {
    color: var(--ui-text-secondary);
    font-size: 10px;
}

.dashboard-setup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #edf0f3;
    padding-top: 16px;
}

.app-login-body {
    min-height: 100vh;
    background: #f3f6fa;
}

.app-login {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(480px, 1fr);
    min-height: 100vh;
    padding: 0;
}

.app-login-showcase {
    position: relative;
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    place-items: center;
    padding: 48px;
    background:
        radial-gradient(ellipse at 50% 110%, rgb(74 132 209 / 38%), transparent 49%),
        linear-gradient(145deg, #1e448d 0%, #173777 54%, #102b60 100%);
    color: #fff;
}

.app-login-showcase::before,
.app-login-showcase::after {
    position: absolute;
    right: -10%;
    bottom: -29%;
    left: -10%;
    height: 48%;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 50% 50% 0 0;
    background: linear-gradient(180deg, rgb(255 255 255 / 5%), transparent 76%);
    content: "";
    transform: rotate(-5deg);
}

.app-login-showcase::after {
    right: -19%;
    bottom: -36%;
    left: -19%;
    height: 51%;
    opacity: 0.65;
    transform: rotate(6deg);
}

.app-login-showcase-content {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    margin-top: -7vh;
    text-align: center;
}

.app-login-cap {
    display: grid;
    width: 116px;
    height: 116px;
    place-items: center;
    margin: 0 auto 28px;
    color: #fff;
}

.app-login-cap svg {
    width: 96px;
    height: 72px;
    filter: drop-shadow(0 12px 12px rgb(4 19 50 / 20%));
}

.app-login-showcase-kicker {
    margin: 0 0 11px;
    color: rgb(219 232 255 / 82%);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.app-login-showcase h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 3.2vw, 48px);
    font-weight: 750;
    line-height: 1.35;
}

.app-login-showcase-description {
    margin: 14px 0 0;
    color: rgb(233 240 255 / 82%);
    font-size: 16px;
    line-height: 1.9;
}

.app-login-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 36px clamp(24px, 5vw, 88px);
}

.app-login-card {
    width: min(100%, 560px);
    border: 1px solid rgb(226 232 240 / 75%);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 24px 70px rgb(30 52 82 / 10%);
    padding: clamp(32px, 4vw, 58px);
}

.app-login-mobile-brand {
    display: none;
}

.app-login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid #edf0f3;
    margin-bottom: 29px;
    padding-bottom: 22px;
}

.app-login-brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-login-brand strong {
    color: var(--ui-text);
    font-size: 13px;
}

.app-login-brand small {
    color: var(--ui-muted);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.app-login-heading {
    margin-bottom: 28px;
    text-align: center;
}

.app-login-heading h1 {
    margin: 0 0 5px;
    color: var(--ui-text);
    font-size: 25px;
    font-weight: 700;
}

.app-login-heading h2 {
    margin: 0 0 6px;
    color: #1b3f7c;
    font-size: 30px;
    font-weight: 750;
}

.app-login-heading p,
.app-login-footnote {
    margin: 0;
    color: var(--ui-text-secondary);
    font-size: 12px;
}

.app-login .form-control {
    min-height: 54px;
    border-color: #d9e2ed;
    border-radius: 11px;
    background: #f8fafc;
    padding-inline: 17px;
    font-size: 15px;
}

.app-login .form-control:focus {
    border-color: #7897c7;
    background: #fff;
    box-shadow: 0 0 0 4px rgb(37 99 235 / 12%);
}

.app-login .form-label {
    margin-bottom: 8px;
    color: #23334a;
    font-size: 14px;
    font-weight: 600;
}

.app-login .btn {
    min-height: 58px;
    margin-top: 4px;
    border-radius: 12px;
}

.app-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    background: linear-gradient(105deg, #1c4591, #102d65) !important;
    box-shadow: 0 10px 22px rgb(24 61 130 / 20%);
    font-size: 17px;
    font-weight: 700;
}

.app-login-submit:hover {
    background: linear-gradient(105deg, #173c81, #0c2556) !important;
}

.app-login-submit svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.app-login-footnote {
    border-top: 1px solid #edf0f3;
    margin-top: 29px;
    padding-top: 19px;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 900px) {
    .app-login {
        grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
    }

    .app-login-showcase {
        padding: 32px;
    }

    .app-login-panel {
        padding: 28px;
    }

    .app-login-card {
        padding: 36px 30px;
    }
}

@media (max-width: 680px) {
    .app-login {
        display: block;
        min-height: 100vh;
        padding: 20px 14px;
        background:
            radial-gradient(ellipse at 50% 0%, rgb(37 99 235 / 11%), transparent 43%),
            #f3f6fa;
    }

    .app-login-showcase {
        display: none;
    }

    .app-login-panel {
        display: flex;
        min-height: calc(100vh - 40px);
        justify-content: center;
        padding: 0;
    }

    .app-login-card {
        align-self: center;
        border-radius: 22px;
        padding: 30px clamp(22px, 7vw, 36px);
    }

    .app-login-mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 28px;
    }

    .app-login-mobile-brand > span:last-child {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .app-login-mobile-brand strong {
        color: var(--ui-text);
        font-size: 13px;
    }

    .app-login-mobile-brand small {
        color: var(--ui-muted);
        font-size: 9px;
        letter-spacing: 0.08em;
    }

    .app-login-heading h2 {
        font-size: 27px;
    }
}

@media (max-width: 360px) {
    .app-login {
        padding-inline: 10px;
    }

    .app-login-card {
        padding-inline: 20px;
    }
}

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

@keyframes ui-toast-in {
    from {
        transform: translateY(7px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 991.98px) {
    .app-shell,
    .app-sidebar-collapsed .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        width: 276px;
        max-width: calc(100vw - 52px);
        box-shadow: 12px 0 34px rgb(23 42 61 / 12%);
        transform: translateX(-105%);
    }

    .app-sidebar-collapsed .app-sidebar {
        padding-inline: 14px;
    }

    .app-sidebar-collapsed .app-brand {
        justify-content: flex-start;
        margin-inline: 5px;
    }

    .app-sidebar-collapsed .app-brand-copy,
    .app-sidebar-collapsed .app-nav-group,
    .app-sidebar-collapsed .app-nav-label,
    .app-sidebar-collapsed .app-nav-badge,
    .app-sidebar-collapsed .app-sidebar-footer > span:last-child {
        display: initial;
    }

    .app-sidebar-collapsed .app-nav-group {
        display: block;
    }

    .app-sidebar-collapsed .app-nav-link {
        justify-content: flex-start;
        padding-inline: 10px;
    }

    .app-sidebar-collapsed .app-sidebar-footer {
        justify-content: flex-start;
        padding-inline: 8px;
    }

    .app-sidebar-collapsed .app-nav-link:hover::after {
        display: none;
    }

    .app-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-sidebar-backdrop {
        position: fixed;
        z-index: 1020;
        inset: 0;
        border: 0;
        background: rgb(18 34 49 / 35%);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .app-sidebar-open .app-sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .app-sidebar-collapsed .app-brand-copy,
    .app-sidebar-collapsed .app-nav-label,
    .app-sidebar-collapsed .app-sidebar-footer > span:last-child {
        display: flex;
    }
}

@media (max-width: 700px) {
    .app-topbar {
        min-height: 62px;
        gap: 10px;
        padding: 10px 14px;
    }

    .app-topbar-start {
        gap: 9px;
    }

    .app-topbar-actions {
        gap: 10px;
    }

    .app-search {
        width: 38px;
        height: 38px;
        justify-content: center;
        border: 0;
        background: transparent;
        padding: 0;
    }

    .app-search:focus-within {
        position: absolute;
        z-index: 2;
        right: 14px;
        width: min(270px, calc(100vw - 120px));
        justify-content: flex-start;
        border: 1px solid var(--ui-border);
        background: #fff;
        padding-inline: 10px;
    }

    .app-search input,
    .app-search kbd {
        display: none;
    }

    .app-search:focus-within input {
        display: block;
    }

    .app-profile {
        gap: 0;
    }

    .app-profile-copy,
    .app-logout-form {
        display: none;
    }

    .app-mobile-logout {
        display: block;
        margin-left: auto;
    }

    .app-content {
        padding: 22px 15px 28px;
    }

    .app-footer {
        flex-direction: column;
        gap: 3px;
        margin-inline: 15px;
        padding-block: 13px 17px;
    }

    .app-page-heading {
        flex-direction: column;
        margin-bottom: 19px;
    }

    .app-content .card-body {
        padding: 17px;
    }

    .app-content .table > :not(caption) > * > * {
        padding: 10px;
    }

    .ui-table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .ui-table-tools-start,
    .ui-table-tools-end {
        justify-content: space-between;
    }

    .ui-table-search {
        width: 100%;
    }

    .app-content .row.g-3.mb-4 > [class*="col-"] > .card .card-body {
        min-height: 98px;
        padding: 14px;
    }

    .app-content .fs-3 {
        font-size: 24px !important;
    }

    .dashboard-welcome {
        min-height: 150px;
        padding: 22px 19px;
    }

    .dashboard-welcome-mark {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 18px;
        font-size: 26px;
    }

    .dashboard-quick-card .card-body,
    .dashboard-setup-card .card-body {
        padding: 18px;
    }
}

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

.grade-report-print {
    min-width: 0;
    margin: 0;
    background: #fff;
    color: #111827;
}

.print-report {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px;
}

.print-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid #1e293b;
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.print-report-logos {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

.print-report-logos img,
.print-report-header > .school-logo {
    width: auto;
    max-width: 120px;
    max-height: 84px;
    object-fit: contain;
}

.print-report-header h1 {
    margin: 0 0 5px;
    font-size: 24px;
}

.print-report-header p {
    margin: 0;
    color: #475569;
}

.print-report-meta {
    display: grid;
    gap: 4px;
    color: #475569;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

.print-report-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

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

.print-report-table th,
.print-report-table td {
    border: 1px solid #cbd5e1;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}

.print-report-table th {
    background: #f1f5f9;
    font-weight: 700;
}

.print-report-table .empty-report {
    padding: 24px;
    color: #64748b;
    text-align: center;
}

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

    .grade-report-print {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-report {
        max-width: none;
        padding: 0;
    }

    .print-report-actions {
        display: none !important;
    }

    .print-report-header {
        break-after: avoid;
    }

    .print-report-table {
        font-size: 9pt;
    }

    .print-report-table thead {
        display: table-header-group;
    }

    .print-report-table tr {
        break-inside: avoid;
    }
}

.app-content .card > .card-header,
.app-content .card > .card-footer {
    border-color: var(--ui-border);
    background: #fbfcfe;
    padding: 14px 20px;
}

.app-content .card > .card-header {
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 650;
}

.app-content .table-responsive:not(.attendance-grid-scroll) {
    overflow: auto;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    background: var(--ui-surface);
}

.app-content .table:not(.attendance-grid) {
    font-size: 13px;
}

.app-content .table:not(.attendance-grid) > :not(caption) > * > * {
    padding: 12px 14px;
}

.app-content .table:not(.attendance-grid) thead th {
    border-bottom: 1px solid #dfe7ef;
    background: #f5f8fc;
    color: #52647a;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.app-content .table:not(.attendance-grid) tbody tr:nth-child(even) > * {
    --bs-table-bg: #fbfcfe;
}

.app-content .table:not(.attendance-grid) tbody tr:hover > * {
    --bs-table-bg: #f2f7fd;
}

.app-content .table .btn {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
}

.app-content .table .form-control,
.app-content .table .form-select {
    min-height: 36px;
    padding-block: 6px;
}

.app-content .form-text,
.app-content .form-check-label {
    color: var(--ui-text-secondary);
    font-size: 12px;
}

.app-content .form-check {
    min-height: 1.35rem;
}

.app-content .form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.16rem;
    cursor: pointer;
}

.app-content .form-check-label {
    cursor: pointer;
}

.app-content .input-group > .form-control,
.app-content .input-group > .form-select,
.app-content .input-group > .btn {
    min-height: 42px;
}

.app-content .input-group-text {
    border-color: #dce3ea;
    background: #f5f8fc;
    color: var(--ui-text-secondary);
    font-size: 13px;
}

.app-content .btn-group .btn,
.app-content .btn-group-vertical .btn {
    min-height: 36px;
}

.app-content .alert-success {
    border-color: #bbebc8;
    background: var(--ui-success-soft);
    color: #166534;
}

.app-content .alert-secondary {
    border-color: var(--ui-border);
    background: #f5f8fc;
    color: #52647a;
}

.app-content .badge {
    border-radius: 7px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
}

.ui-table-tools {
    margin-bottom: 14px;
}

.ui-table-search:focus,
.ui-table-status:focus,
.ui-table-page-size:focus {
    border-color: #8da9c1;
    outline: 0;
    box-shadow: var(--ui-focus);
}

.ui-table-filter-button:focus-visible {
    border-color: #8da9c1;
    outline: 0;
    box-shadow: var(--ui-focus);
}

.ui-table-pagination {
    align-items: center;
}

.user-role-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.user-role-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fbfcfe;
    padding: 12px 14px;
}

.user-role-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    color: var(--ui-text);
    font-size: 14px;
}

.user-role-heading code {
    border-radius: 5px;
    background: #eef3f8;
    color: #5b6d80;
    padding: 2px 6px;
    font-size: 11px;
}

.user-role-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-role-permission {
    display: inline-flex;
    border: 1px solid #dce5ef;
    border-radius: 999px;
    background: #fff;
    color: #52647a;
    padding: 3px 9px;
    font-size: 12px;
    line-height: 1.5;
}

.student-grade-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: #f6f8fc;
    padding: 12px;
}

.student-grade-tabs .student-grade-tab {
    display: flex;
    min-width: 0;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    border: 1px solid #dce5ef;
    border-radius: 9px;
    background: #fff;
    color: #34506e;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.student-grade-tabs .student-grade-tab:hover {
    border-color: #93b4e8;
    background: #f2f7ff;
    color: var(--ui-primary-strong);
}

.student-grade-tabs .student-grade-tab.active {
    border-color: var(--ui-primary);
    background: var(--ui-primary);
    color: #fff;
    box-shadow: 0 3px 9px rgb(37 99 235 / 18%);
}

.student-grade-tabs .student-grade-tab .badge {
    min-width: 30px;
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    background: #f1f5f9 !important;
    color: #52647a !important;
    text-align: center;
}

.student-grade-tabs .student-grade-tab.active .badge {
    border-color: rgb(255 255 255 / 30%);
    background: rgb(255 255 255 / 18%) !important;
    color: #fff !important;
}

@media (max-width: 991.98px) {
    .student-grade-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

@media (max-width: 575.98px) {
    .app-content .card > .card-header,
    .app-content .card > .card-footer {
        padding: 12px 15px;
    }

    .student-grade-tabs {
        gap: 8px;
        padding: 9px;
    }

    .student-grade-tabs .student-grade-tab {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .app-content .table:not(.attendance-grid) > :not(caption) > * > * {
        padding: 9px 10px;
    }

    .app-content .table:not(.attendance-grid) {
        font-size: 12px;
    }

    .app-content .table:not(.attendance-grid) thead th {
        font-size: 11px;
    }

    .app-content form .btn[type="submit"] {
        min-height: 42px;
    }

    .user-role-item {
        padding: 10px;
    }

    .user-role-permissions {
        gap: 5px;
    }
}

@media (max-width: 420px) {
    .student-grade-tabs {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

    html,
    body.app-body {
        min-width: 0 !important;
        background: #fff !important;
        color: #111827 !important;
        font-size: 8pt !important;
    }

    .app-shell,
    .app-main {
        display: block !important;
        min-height: 0 !important;
        background: #fff !important;
    }

    .app-sidebar,
    .app-topbar,
    .app-footer,
    .app-toast-region,
    .attendance-page > .mb-4 > a,
    .attendance-filter,
    .attendance-screen-hint,
    .attendance-print-actions,
    .attendance-grid select {
        display: none !important;
    }

    .app-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .attendance-page .card,
    .attendance-page .card-body,
    .attendance-grid-scroll {
        overflow: visible !important;
        max-height: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .attendance-page .attendance-status-legend {
        gap: 2mm !important;
        margin: 0 0 3mm !important;
    }

    .attendance-page .attendance-status-legend .badge {
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
        color: #111827 !important;
        padding: 1mm 2mm !important;
        font-size: 7pt !important;
    }

    .attendance-grid {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse !important;
        font-size: 6.5pt !important;
    }

    .attendance-grid thead {
        display: table-header-group;
    }

    .attendance-grid tr {
        break-inside: avoid;
    }

    .attendance-grid th,
    .attendance-grid td {
        position: static !important;
        min-width: 0 !important;
        max-width: none !important;
        border: 1px solid #64748b !important;
        background: #fff !important;
        color: #111827 !important;
        padding: 1mm 0.5mm !important;
        text-align: center !important;
    }

    .attendance-grid thead th {
        background: #eaf0f7 !important;
        font-size: 6pt !important;
    }

    .attendance-grid .attendance-student-name {
        min-width: 26mm !important;
        text-align: left !important;
    }

    .attendance-grid .attendance-student-code {
        min-width: 14mm !important;
    }

    .attendance-print-status {
        display: inline !important;
        font-size: 8pt !important;
        font-weight: 600;
    }

    .attendance-grid small {
        color: #334155 !important;
    }

    .attendance-grid .attendance-day-totals th,
    .attendance-grid .attendance-day-totals td {
        position: static !important;
        background: #eaf0f7 !important;
    }

    .attendance-print-signatures {
        display: flex !important;
        justify-content: space-between;
        gap: 20mm;
        margin-top: 8mm;
        padding-inline: 12mm;
        font-size: 8pt;
    }

    .attendance-page .alert {
        break-inside: avoid;
    }
}

.teacher-readiness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.teacher-readiness-badge-mark {
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    border-radius: 999px;
    background: rgb(255 255 255 / 70%);
}

.teacher-readiness-badge[data-status="ready"] {
    background: var(--ui-success-soft);
    color: #166534;
}

.teacher-readiness-badge[data-status="warning"] {
    background: var(--ui-warning-soft);
    color: #92400e;
}

.teacher-readiness-badge[data-status="pending"] {
    background: #e2e8f0;
    color: #334155;
}

.teacher-readiness-badge[data-status="review"] {
    background: var(--ui-info-soft);
    color: #6d28d9;
}

.teacher-readiness-badge[data-status="danger"] {
    background: #fee2e2;
    color: #b91c1c;
}

.teacher-readiness-list {
    display: grid;
    gap: 0.75rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.teacher-readiness-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: #fff;
    padding: 0.75rem 0.9rem;
}

.teacher-readiness-item-mark {
    display: inline-grid;
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 1.4rem;
    place-items: center;
    border-radius: 999px;
    font-weight: 700;
}

.teacher-readiness-item[data-state="done"] .teacher-readiness-item-mark {
    background: var(--ui-success-soft);
    color: #166534;
}

.teacher-readiness-item[data-state="warning"] .teacher-readiness-item-mark {
    background: var(--ui-warning-soft);
    color: #92400e;
}

.teacher-readiness-item[data-state="pending"] .teacher-readiness-item-mark {
    background: #e2e8f0;
    color: #334155;
}

.teacher-readiness-item[data-state="review"] .teacher-readiness-item-mark {
    background: var(--ui-info-soft);
    color: #6d28d9;
}

.teacher-readiness-item strong,
.teacher-readiness-actions-title {
    display: block;
    color: var(--ui-text);
}

.teacher-readiness-item small,
.teacher-readiness-note {
    display: block;
    color: var(--ui-text-secondary);
}

.teacher-readiness-actions {
    margin-top: 1rem;
    border-left: 3px solid var(--ui-border);
    padding-left: 0.9rem;
}

.teacher-readiness-actions ul {
    margin: 0.35rem 0 0;
    padding-left: 1.05rem;
}

.teacher-readiness-actions li + li {
    margin-top: 0.35rem;
}

.teacher-readiness-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1rem;
}

.teacher-readiness-menu .teacher-readiness-actions-title {
    flex: 1 0 100%;
    margin: 0;
}

.teacher-readiness-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.teacher-readiness-cell {
    min-width: 22rem;
}

.teacher-directory-table {
    overflow: hidden;
    border: 1px solid #dbe7f3;
    border-radius: 0.85rem;
}

.teacher-directory-table > :not(caption) > * > * {
    padding: 0.9rem 0.75rem;
    border-bottom-color: #e5edf5;
}

.teacher-directory-table thead th {
    color: #47617f;
    background: #f4f8fc;
    font-weight: 700;
}

.teacher-directory-table th + th,
.teacher-directory-table td + td {
    border-left: 1px solid #e3ebf4;
}

.teacher-directory-table th:nth-child(4),
.teacher-directory-table td:nth-child(4) {
    background-color: #f8fbff;
}

.teacher-directory-table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.teacher-directory-table tbody tr:hover > * {
    background-color: #eef6ff !important;
}

.teacher-directory-table th:nth-child(1),
.teacher-directory-table td:nth-child(1),
.teacher-directory-table th:nth-child(5),
.teacher-directory-table td:nth-child(5),
.teacher-directory-table th:nth-child(6),
.teacher-directory-table td:nth-child(6) {
    text-align: center;
    white-space: nowrap;
}

.teacher-readiness-details {
    margin-top: 0.55rem;
}

.teacher-readiness-details summary {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    cursor: pointer;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 0.3rem 0.65rem;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 0.825rem;
    font-weight: 700;
    list-style: none;
}

.teacher-readiness-details summary::-webkit-details-marker {
    display: none;
}

.teacher-readiness-details summary::before {
    content: "+";
    margin-right: 0.4rem;
    font-size: 1rem;
}

.teacher-readiness-details[open] summary::before {
    content: "−";
}

.teacher-readiness-details-close {
    display: none;
}

.teacher-readiness-details[open] .teacher-readiness-details-open {
    display: none;
}

.teacher-readiness-details[open] .teacher-readiness-details-close {
    display: inline;
}

.teacher-readiness-details-body {
    padding-top: 0.1rem;
}

.dashboard-filter,
.dashboard-kpi,
.dashboard-insights .card {
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    box-shadow: var(--ui-shadow);
}

.dashboard-filter .card-body,
.dashboard-kpi .card-body,
.dashboard-insights .card-body {
    padding: 18px;
}

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

.dashboard-kpi {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgb(29 48 68 / 10%);
}

.dashboard-kpi-label,
.dashboard-kpi small {
    display: block;
    color: var(--ui-text-secondary);
    font-size: 12px;
}

.dashboard-kpi strong {
    display: block;
    margin: 5px 0 8px;
    color: var(--ui-sidebar);
    font-size: 30px;
    line-height: 1.1;
}

.dashboard-kpi .progress {
    height: 7px;
    margin-bottom: 8px;
    background: #edf2f7;
}

.dashboard-grade-chart {
    display: flex;
    height: 220px;
    align-items: end;
    justify-content: space-around;
    gap: 12px;
    padding: 20px 8px 0;
    border-bottom: 1px solid var(--ui-border);
}

.dashboard-grade-bar {
    display: flex;
    height: 100%;
    min-width: 28px;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 5px;
    color: var(--ui-text-secondary);
    font-size: 11px;
}

.dashboard-grade-bar-track {
    display: flex;
    width: 100%;
    max-width: 42px;
    height: 155px;
    align-items: end;
    border-radius: 8px 8px 0 0;
    background: #f1f5f9;
}

.dashboard-grade-bar i {
    display: block;
    width: 100%;
    min-height: 3px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.dashboard-risk-list {
    display: grid;
    gap: 8px;
}

.dashboard-risk-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #fee2e2;
    border-radius: 9px;
    color: var(--ui-text);
    background: #fffafa;
    text-decoration: none;
}

.dashboard-risk-item:hover {
    border-color: #fca5a5;
    background: #fff1f2;
}

.dashboard-risk-item span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-risk-item strong,
.dashboard-risk-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-risk-item strong { font-size: 13px; }
.dashboard-risk-item small { color: var(--ui-text-secondary); font-size: 11px; }
.dashboard-risk-item b { color: var(--ui-danger); font-size: 14px; }
.dashboard-empty-state { padding: 28px 8px; color: var(--ui-text-secondary); text-align: center; }

.assessment-center-hero {
    display: flex;
    min-height: 160px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(120deg, #1e3a5f, #2563eb);
    box-shadow: 0 10px 26px rgb(30 58 95 / 18%);
}

.assessment-center-hero h1 { margin: 5px 0 8px; font-size: clamp(24px, 3vw, 34px); }
.assessment-center-hero p { margin: 0; color: #dbeafe; }
.assessment-center-hero .app-page-eyebrow { color: #bfdbfe; }
.assessment-center-hero-mark { display: grid; width: 78px; height: 78px; place-items: center; border: 1px solid rgb(255 255 255 / 25%); border-radius: 24px; background: rgb(255 255 255 / 12%); }
.assessment-center-hero-mark .ui-icon { width: 40px; height: 40px; }
.assessment-center-heading { margin-bottom: 18px; }
.assessment-center-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.assessment-center-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 12px; min-height: 104px; padding: 16px; border: 1px solid var(--ui-border); border-radius: 12px; color: var(--ui-text); background: var(--ui-surface); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.assessment-center-card:hover { transform: translateY(-2px); border-color: #93c5fd; box-shadow: 0 8px 20px rgb(29 48 68 / 9%); color: var(--ui-primary); }
.assessment-center-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.assessment-center-card strong { font-size: 14px; }
.assessment-center-card small { margin-top: 4px; color: var(--ui-text-secondary); font-size: 11px; line-height: 1.45; }
.assessment-center-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: var(--ui-primary-soft); color: var(--ui-primary); }
.assessment-center-icon[data-tone="success"] { background: var(--ui-success-soft); color: var(--ui-success); }
.assessment-center-icon[data-tone="warning"] { background: var(--ui-warning-soft); color: #b45309; }
.assessment-center-icon[data-tone="info"] { background: var(--ui-info-soft); color: var(--ui-info); }
.assessment-center-icon[data-tone="secondary"] { background: #eff6ff; color: var(--ui-secondary); }
.assessment-center-icon[data-tone="danger"] { background: var(--ui-danger-soft); color: var(--ui-danger); }
.assessment-center-icon .ui-icon { width: 22px; height: 22px; }
.assessment-center-arrow { color: var(--ui-text-secondary); font-size: 20px; }

@media (max-width: 991.98px) { .assessment-center-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .assessment-center-hero { padding: 22px 18px; } .assessment-center-hero-mark { width: 56px; height: 56px; border-radius: 18px; } .assessment-center-grid { grid-template-columns: 1fr; } }

@media (max-width: 991.98px) {
    .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .dashboard-kpi-grid { grid-template-columns: 1fr; }
    .dashboard-grade-chart { gap: 4px; padding-inline: 0; }
}

@media (max-width: 767.98px) {
    .teacher-readiness-cell {
        min-width: 18rem;
    }
}
