:root {
    --primary: #ff6a00;
    --glow-orange: #ff8c42;
    --neon-cyan: #00e5ff;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --border: rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    --bg: #0f1115;
    --card: #171a21;
    --text: #e2e8f0;
    --border: rgba(255, 255, 255, 0.08);
}

body {
    background: var(--bg);
    color: var(--text);
    transition: all 0.25s ease;
}

/* Native number spinners default to light UI and clash with dark theme; values still editable via keyboard */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Themed +/- controls for number inputs (native spinners hidden above) */
.number-stepper {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: var(--card);
    overflow: hidden;
}
.number-stepper > input[type="number"] {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: center;
}
.number-stepper > input[type="number"]:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(255, 106, 0, 0.35) !important;
}
.number-stepper-btn {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: rgba(15, 23, 42, 0.04);
    color: #64748b;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.number-stepper-btn:hover {
    background: rgba(255, 106, 0, 0.14);
    color: #c2410c;
}
.number-stepper-btn:active {
    background: rgba(255, 106, 0, 0.22);
}
.number-stepper-minus {
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}
.number-stepper-plus {
    border-left: 1px solid rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .number-stepper {
    border-color: rgba(255, 255, 255, 0.12);
    background: #0f172a;
}
html[data-theme="dark"] .number-stepper-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}
html[data-theme="dark"] .number-stepper-btn:hover {
    background: rgba(255, 106, 0, 0.18);
    color: #fdba74;
}
html[data-theme="dark"] .number-stepper-minus {
    border-right-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .number-stepper-plus {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.app-wrap {
    min-height: 100vh;
}
.sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 260px;
    height: calc(100vh - 24px);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 12px;
    z-index: 1040;
    transform: translateX(0);
    transition:
        width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease,
        border-radius 0.35s ease;
    display: flex;
    flex-direction: column;
}
.sidebar-collapse-btn {
    position: absolute;
    top: 56px;
    right: -12px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.1);
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15,23,42,0.12);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 4px;
    flex-shrink: 0;
}
.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}
.sidebar-brand-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}
.sidebar-brand-text strong.sidebar-app-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    line-height: 1.15;
    font-weight: 700;
    word-break: break-word;
}
.sidebar-brand-text strong.sidebar-app-name .sidebar-app-name__cict {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.05;
}
.sidebar-brand-text strong.sidebar-app-name .sidebar-app-name__sub {
    display: block;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.28;
    color: #64748b;
    max-width: 100%;
}
html[data-theme="dark"] .sidebar-brand-text strong.sidebar-app-name .sidebar-app-name__sub {
    color: #94a3b8;
}
.sidebar-brand-text small {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,0.45) transparent;
    scrollbar-gutter: stable;
}
.sidebar-nav::-webkit-scrollbar {
    width: 10px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(148,163,184,0.85), rgba(100,116,139,0.85));
    border: 2px solid rgba(255,255,255,0.95);
    border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(100,116,139,0.95), rgba(71,85,105,0.95));
}
.sidebar .nav-link {
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    text-decoration: none;
    transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, padding 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar .nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar .nav-link.active {
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    color: #fff;
    box-shadow: 0 8px 16px rgba(255,106,0,0.26);
}
.sidebar-link-blocking:not(.active) {
    color: #2563eb;
    background: rgba(37,99,235,0.08);
    box-shadow: inset 3px 0 0 rgba(37,99,235,0.45);
}
.sidebar-link-blocking:not(.active):hover {
    color: #1d4ed8;
    background: rgba(37,99,235,0.14);
}
.sidebar-link-blocking.active {
    background: linear-gradient(135deg, #2563eb, #0f766e);
    box-shadow: 0 10px 22px rgba(37,99,235,0.28);
}
.sidebar .nav-link.sidebar-link-blocking:hover {
    color: #1d4ed8;
    background: rgba(37,99,235,0.14);
}
.sidebar .nav-link.sidebar-link-blocking.active:hover {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
}
.sidebar .nav-link:hover {
    background: rgba(255,106,0,0.10);
    color: #ff6a00;
}
.sidebar-drawer-toggle {
    width: 100%;
    border: 0;
    background: transparent;
}
.sidebar-drawer-caret {
    margin-left: auto;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-drawer {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    padding-left: 12px;
    border-left: 1px dashed rgba(15,23,42,0.16);
    margin-left: 11px;
    margin-top: 0;
    transition:
        max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease,
        visibility 0s linear 0.42s,
        margin-top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-drawer.is-open {
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    margin-top: 4px;
    transition:
        opacity 0.32s ease 0.06s,
        visibility 0s linear 0s,
        margin-top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-drawer.is-open + .nav-link,
.sidebar-drawer .sidebar-sub-link + .sidebar-sub-link {
    margin-top: 4px;
}
.sidebar-drawer .sidebar-sub-link {
    font-size: 0.92rem;
    padding-top: 8px;
    padding-bottom: 8px;
}
.sidebar-drawer-toggle[aria-expanded="true"] .sidebar-drawer-caret {
    transform: rotate(180deg);
}
.sidebar-bottom {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.sidebar-theme-toggle {
    border: 0;
    border-radius: 12px;
    background: transparent;
    padding: 10px 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    transition: background-color 0.22s ease, color 0.22s ease, padding 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-theme-toggle:hover {
    background: rgba(255,106,0,0.10);
    color: #ff6a00;
}
.sidebar-switch {
    margin-left: auto;
    width: 38px;
    height: 20px;
    border-radius: 999px;
    background: rgba(100,116,139,0.3);
    position: relative;
    transition: all 0.25s ease;
}
.sidebar-switch-knob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.25s ease;
}
.sidebar-theme-toggle[data-theme-active="dark"] .sidebar-switch {
    background: rgba(255,106,0,0.5);
}
.sidebar-theme-toggle[data-theme-active="dark"] .sidebar-switch-knob {
    left: 20px;
}
.sidebar-property-note {
    padding: 2px 12px 0;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.68;
}
.main-content {
    margin-left: 290px;
    width: calc(100% - 290px);
    padding: 24px;
    background: var(--bg);
    transition:
        margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.25s ease;
}
body.sidebar-collapsed .sidebar,
.sidebar.is-collapsed {
    width: 78px;
    padding-left: 10px;
    padding-right: 10px;
}
body.sidebar-collapsed .sidebar .sidebar-brand,
.sidebar.is-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
body.sidebar-collapsed .sidebar .sidebar-nav,
.sidebar.is-collapsed .sidebar-nav {
    align-items: center;
    padding-right: 0;
    scrollbar-width: none;
    scrollbar-gutter: auto;
}
body.sidebar-collapsed .sidebar .sidebar-nav::-webkit-scrollbar,
.sidebar.is-collapsed .sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.sidebar .sidebar-brand-text,
.sidebar .sidebar-label {
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition:
        max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease 0.04s;
}
.sidebar .sidebar-brand-text {
    max-width: 200px;
}
body.sidebar-collapsed .sidebar .sidebar-brand-text,
body.sidebar-collapsed .sidebar .sidebar-label,
body.sidebar-collapsed .sidebar .sidebar-switch,
.sidebar.is-collapsed .sidebar-brand-text,
.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-switch {
    opacity: 0;
    max-width: 0;
    transition:
        max-width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.18s ease;
}
body.sidebar-collapsed .sidebar .sidebar-switch,
.sidebar.is-collapsed .sidebar-switch {
    overflow: hidden;
    white-space: nowrap;
}
body.sidebar-collapsed .sidebar .nav-link,
body.sidebar-collapsed .sidebar .sidebar-theme-toggle,
.sidebar.is-collapsed .nav-link,
.sidebar.is-collapsed .sidebar-theme-toggle {
    justify-content: center;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    gap: 0;
}
body.sidebar-collapsed .sidebar .nav-link i,
body.sidebar-collapsed .sidebar .sidebar-theme-toggle i,
.sidebar.is-collapsed .nav-link i,
.sidebar.is-collapsed .sidebar-theme-toggle i {
    width: auto;
    margin: 0;
}
body.sidebar-collapsed .sidebar .sidebar-drawer,
.sidebar.is-collapsed .sidebar-drawer {
    display: none !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    pointer-events: none !important;
    transition: max-height 0.32s ease, opacity 0.2s ease, visibility 0s linear 0.32s !important;
}
body.sidebar-collapsed .sidebar .sidebar-drawer-caret,
.sidebar.is-collapsed .sidebar-drawer-caret {
    display: none;
}
body.sidebar-collapsed .sidebar-collapse-btn i,
.sidebar.is-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}
body.sidebar-collapsed .main-content {
    margin-left: 110px;
    width: calc(100% - 110px);
}
body.sidebar-collapsed .sidebar-bottom,
.sidebar.is-collapsed .sidebar-bottom {
    align-items: center;
}
body.sidebar-collapsed .sidebar [title] {
    position: relative;
}
body.sidebar-collapsed .sidebar [title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1100;
}
.topbar, .card, .table, .modal-content { background: var(--card); color: var(--text); border-color: var(--border); }
.topbar {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-2px);
}
.metric-card:hover { transform: translateY(-3px); transition: transform .2s; }
.badge-irregular { background: #ff6a00; color: #fff; }
.badge-regular { background: #198754; color: #fff; }
.badge-available { background: #198754; color: #fff; }
.badge-full { background: #dc3545; color: #fff; }
.badge-overloaded { background: #ff8c42; color: #fff; box-shadow: 0 0 12px rgba(255,140,66,.55); }
.chart-neon { filter: drop-shadow(0 0 6px rgba(255, 140, 66, 0.6)); }

/* SaaS table system */
.app-wrap .card:has(.table),
.app-wrap .admin-section-card:has(.table) {
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.app-wrap .table-responsive {
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 14px;
    overflow: auto;
    background: #fff;
}
.app-wrap .table {
    margin-bottom: 0;
    font-size: 14px;
}
.app-wrap .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 12.5px;
    font-weight: 700;
    border-bottom: 1px solid rgba(15,23,42,0.08);
}
.app-wrap .table td,
.app-wrap .table th {
    padding: 14px 16px;
    vertical-align: middle;
}
.app-wrap .table tbody td {
    color: #1e293b;
    border-top: 1px solid rgba(15,23,42,0.06);
    transition: background-color .18s ease;
}
.app-wrap .table tbody tr:hover td {
    background: rgba(255,106,0,.08);
}
.app-wrap .table .text-muted {
    color: #94a3b8 !important;
}
.app-wrap .table .badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
}
.app-wrap .table .btn.btn-sm {
    border-radius: 9px;
    min-height: 32px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.app-wrap .table .btn.btn-sm:hover {
    transform: translateY(-1px);
}
.app-wrap .table .btn-outline-primary:hover {
    box-shadow: 0 6px 14px rgba(59,130,246,0.28);
}
.app-wrap .table .btn-warning:hover {
    box-shadow: 0 8px 16px rgba(255,106,0,0.35);
}

/* Before DataTables binds: only paint first page of rows (default pageLength is 10 in app.js).
   Avoids a long “flash” of the full tbody while scripts load. */
table.datatable:not(.dataTable) > tbody > tr:nth-child(n + 11) {
    display: none !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: #475569;
}
.app-wrap .dataTables_wrapper .row:first-child {
    margin-bottom: 10px;
}
.app-wrap .dataTables_wrapper .row:last-child {
    margin-top: 10px;
}
.app-wrap .dataTables_wrapper .dataTables_filter {
    margin-bottom: 2px;
}
.dataTables_wrapper .form-control,
.dataTables_wrapper .form-select {
    border-radius: 10px;
    min-height: 38px;
    border-color: rgba(15,23,42,0.12);
}
.dataTables_wrapper .form-control:focus,
.dataTables_wrapper .form-select:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.2);
}
.dataTables_wrapper .dataTables_paginate {
    margin-top: 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 9px !important;
    border: 1px solid rgba(15,23,42,0.12) !important;
    background: #fff !important;
    color: #334155 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(180deg, #ff7a18, #ff4d00) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255,106,0,.12) !important;
    border-color: rgba(255,106,0,0.45) !important;
    color: #9a3412 !important;
}
.dataTables_wrapper td.dataTables_empty {
    text-align: center;
    color: #94a3b8 !important;
    padding: 26px 14px !important;
}
.dataTables_wrapper td.dataTables_empty::before {
    content: "\f4cb";
    font-family: bootstrap-icons;
    display: block;
    font-size: 1.2rem;
    color: #fb923c;
    margin-bottom: 6px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-topbar-term-group {
    display: flex;
    flex-direction: column;
}
.admin-topbar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.admin-muted-label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-topbar-term {
    font-weight: 700;
    font-size: 1rem;
}
.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-global-student-search {
    position: relative;
    min-width: 300px;
}
.admin-global-student-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.admin-global-student-search-input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    padding: 8px 36px 8px 38px;
    font-size: 0.88rem;
    outline: 0;
    font-weight: 600;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.admin-global-student-search-input:focus {
    border-color: rgba(255, 106, 0, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
}
.admin-global-student-search-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(470px, 92vw);
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    padding: 8px;
    z-index: 1050;
}
.admin-global-student-search-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.admin-global-student-search-item .admin-global-student-search-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-global-student-search-item:hover {
    background: #f1f5f9;
    border-color: rgba(255, 106, 0, 0.18);
    color: #0f172a;
    transform: translateY(-1px);
}
.admin-global-student-search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 106, 0, 0.1);
    color: #c2410c;
    font-size: 0.95rem;
    font-weight: 900;
}
.admin-global-student-search-copy {
    min-width: 0;
}
.admin-global-student-search-link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.admin-global-student-search-copy strong,
.admin-global-student-search-copy small {
    display: block;
}
.admin-global-student-search-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    letter-spacing: 0;
}
.admin-global-student-search-copy small {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 3px;
}
.admin-global-student-search-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.admin-global-student-search-primary-action,
.admin-global-student-search-actions button,
.admin-global-student-search-secondary-action {
    border: 1px solid rgba(255, 106, 0, 0.35);
    border-radius: 999px;
    background: rgba(255, 106, 0, 0.08);
    color: #c2410c;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-global-student-search-primary-action {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.34);
    color: #2563eb;
}
.admin-global-student-search-item:hover .admin-global-student-search-primary-action,
.admin-global-student-search-item:hover .admin-global-student-search-secondary-action {
    border-color: rgba(255, 106, 0, 0.72);
    background: #ff6a00;
    color: #fff;
}
.admin-global-student-search-empty {
    padding: 14px;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
}
.student-profile-audit-table td {
    vertical-align: top;
}
.student-profile-audit-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dashboard-student-conflict-summary {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    padding: 10px;
    background: rgba(248, 250, 252, 0.72);
}
.dashboard-student-conflict-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dashboard-student-conflict-row {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left-width: 4px;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}
.dashboard-student-conflict-row.is-critical {
    border-left-color: #ef4444;
}
.dashboard-student-conflict-row.is-warning {
    border-left-color: #f59e0b;
}
.dashboard-student-conflict-row.is-info {
    border-left-color: #38bdf8;
}
.dashboard-student-conflict-name,
.dashboard-student-conflict-counts,
.dashboard-student-conflict-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.dashboard-student-conflict-main {
    min-width: 0;
}
.dashboard-student-conflict-name strong,
.dashboard-student-conflict-main p {
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-student-conflict-name strong {
    max-width: min(540px, 100%);
    white-space: nowrap;
}
.dashboard-student-conflict-main p {
    max-width: 680px;
    white-space: nowrap;
}
.dashboard-student-conflict-name span {
    min-width: 24px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}
.dashboard-student-conflict-counts {
    justify-content: flex-end;
}
.dashboard-student-conflict-counts span {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
}
.dashboard-student-conflict-actions {
    justify-content: flex-end;
}
.dashboard-student-conflict-more {
    padding-left: 4px;
}
@media (max-width: 1199.98px) {
    .dashboard-student-conflict-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .dashboard-student-conflict-counts,
    .dashboard-student-conflict-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 991.98px) {
    .admin-global-student-search {
        min-width: 180px;
        flex: 1 1 180px;
    }
    .admin-topbar {
        flex-wrap: wrap;
        gap: 10px;
    }
    .admin-topbar-right {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}
.admin-theme-btn {
    border-radius: 10px;
    border: 1px solid rgba(255,106,0,0.28);
    color: #c2410c;
    background: #fff7ed;
}
.admin-theme-btn:hover {
    background: #ffedd5;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.15);
}
.admin-user-badge {
    background: #0f172a;
    color: #e2e8f0;
    font-weight: 500;
    border-radius: 10px;
    padding: 8px 10px;
}
.admin-notification-dropdown {
    position: relative;
}
.admin-notification-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,106,0,0.26);
    color: #c2410c;
    background: #fff7ed;
}
.admin-notification-btn:hover {
    color: #9a3412;
    background: #ffedd5;
}
.admin-notification-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    border: 2px solid #fff;
    font-size: .66rem;
    font-weight: 800;
    line-height: 14px;
}
.admin-notification-menu {
    width: min(380px, calc(100vw - 1.5rem));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.1);
    border-radius: 12px;
}
.admin-notification-head,
.admin-notification-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .9rem;
    background: #f8fafc;
}
.admin-notification-head strong,
.admin-notification-head span {
    display: block;
}
.admin-notification-head strong {
    color: #111827;
    font-size: .94rem;
}
.admin-notification-head span {
    color: #64748b;
    font-size: .74rem;
}
.admin-notification-head a,
.admin-notification-foot button {
    border: 0;
    color: #c2410c;
    background: transparent;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}
.admin-notification-list {
    max-height: 330px;
    overflow-y: auto;
}
.admin-notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    padding: .78rem .9rem;
    color: #334155;
    text-decoration: none;
    border-top: 1px solid rgba(15,23,42,.06);
}
.admin-notification-item:hover {
    background: rgba(255,106,0,.06);
    color: #111827;
}
.admin-notification-item.is-unread {
    background: rgba(59,130,246,.06);
}
.admin-notification-item.is-alert {
    background: rgba(255,106,0,.08);
}
.admin-notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #2563eb;
    background: rgba(59,130,246,.12);
}
.admin-notification-item.is-alert .admin-notification-icon {
    color: #c2410c;
    background: rgba(255,106,0,.14);
}
.admin-notification-item strong,
.admin-notification-item small {
    display: block;
}
.admin-notification-item strong {
    color: inherit;
    font-size: .84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-notification-item small {
    margin-top: .14rem;
    color: #64748b;
    font-size: .74rem;
    line-height: 1.35;
}
.admin-notification-empty {
    padding: 1.2rem;
    color: #64748b;
    text-align: center;
    font-size: .84rem;
}
html[data-theme="dark"] .admin-notification-btn {
    color: #fdba74;
    border-color: rgba(251,146,60,.36);
    background: rgba(251,146,60,.12);
}
html[data-theme="dark"] .admin-notification-count {
    border-color: #171a21;
}
html[data-theme="dark"] .admin-notification-menu {
    border-color: rgba(148,163,184,.18);
    background: #111827;
}
html[data-theme="dark"] .admin-notification-head,
html[data-theme="dark"] .admin-notification-foot {
    background: #0f172a;
}
html[data-theme="dark"] .admin-notification-head strong,
html[data-theme="dark"] .admin-notification-item,
html[data-theme="dark"] .admin-notification-item:hover {
    color: #e5e7eb;
}
html[data-theme="dark"] .admin-notification-head span,
html[data-theme="dark"] .admin-notification-item small,
html[data-theme="dark"] .admin-notification-empty {
    color: #94a3b8;
}
html[data-theme="dark"] .admin-notification-item {
    border-top-color: rgba(148,163,184,.12);
}
html[data-theme="dark"] .admin-notification-item.is-unread {
    background: rgba(59,130,246,.12);
}
html[data-theme="dark"] .admin-notification-item.is-alert {
    background: rgba(251,146,60,.12);
}
html[data-theme="dark"] .admin-notification-icon {
    color: #93c5fd;
    background: rgba(59,130,246,.18);
}

.admin-section-card {
    padding: 20px;
    margin-bottom: 25px;
}
.admin-section-title {
    font-size: 1.25rem;
    font-weight: 700;
}
.admin-section-subtext {
    color: #64748b;
    font-size: 0.92rem;
}
.admin-input {
    min-height: 44px;
    border-radius: 12px;
    border-color: rgba(15,23,42,0.12);
    transition: all 0.2s ease;
}
.admin-input:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.2);
}
.admin-btn-primary {
    background: linear-gradient(180deg, #ff7a18, #ff4d00);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 11px;
    padding: 10px 16px;
    transition: all .2s ease;
}
.admin-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255,106,0,0.35);
    color: #fff;
}
.admin-btn-outline {
    border-radius: 10px;
    border: 1px solid rgba(255,106,0,0.35);
    color: #c2410c;
    background: transparent;
}
.admin-btn-outline:hover {
    background: rgba(255,106,0,0.08);
    color: #9a3412;
}
.user-permission-panel {
    display: grid;
    gap: .75rem;
    margin-top: .35rem;
    padding: .9rem;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 10px;
    background: rgba(248, 250, 252, .78);
}
.user-permission-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.user-permission-head strong,
.user-permission-head span {
    display: block;
}
.user-permission-head strong {
    color: #111827;
    font-size: .92rem;
}
.user-permission-head span,
.user-permission-note {
    color: #64748b;
    font-size: .78rem;
}
.user-permission-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
}
.user-permission-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: .45rem;
    min-height: 3.3rem;
    padding: .56rem .62rem;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}
.user-permission-item .form-check-input {
    margin-top: .2rem;
}
.user-permission-item strong,
.user-permission-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-permission-item strong {
    color: #1f2937;
    font-size: .8rem;
    line-height: 1.2;
}
.user-permission-item small {
    color: #64748b;
    font-size: .7rem;
}
html[data-theme="dark"] .user-permission-panel {
    border-color: rgba(148, 163, 184, .18);
    background: rgba(15, 23, 42, .42);
}
html[data-theme="dark"] .user-permission-head strong,
html[data-theme="dark"] .user-permission-item strong {
    color: #e5e7eb;
}
html[data-theme="dark"] .user-permission-head span,
html[data-theme="dark"] .user-permission-note,
html[data-theme="dark"] .user-permission-item small {
    color: #94a3b8;
}
html[data-theme="dark"] .user-permission-item {
    border-color: rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .7);
}
@media (max-width: 1200px) {
    .user-permission-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .user-permission-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .user-permission-head {
        flex-direction: column;
    }

    .user-permission-grid {
        grid-template-columns: 1fr;
    }
}
.settings-page {
    display: grid;
    gap: .9rem;
}
.settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.settings-head h1 {
    margin: 0 0 .2rem;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}
.settings-head p {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
}
.settings-status-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2rem;
    padding: .38rem .7rem;
    border: 1px solid rgba(255, 106, 0, .24);
    border-radius: 999px;
    color: #c2410c;
    background: rgba(255, 247, 237, .95);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.settings-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
.settings-overview-card,
.settings-section,
.settings-actions {
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.settings-overview-card {
    padding: .82rem .9rem;
}
.settings-overview-card span,
.settings-overview-card strong {
    display: block;
}
.settings-overview-card span {
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.settings-overview-card strong {
    margin-top: .2rem;
    color: #111827;
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-form {
    display: grid;
    gap: .85rem;
}
.settings-section {
    display: grid;
    grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
}
.settings-section-copy {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.settings-section-copy i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(255, 106, 0, .22);
    border-radius: 8px;
    color: #ea580c;
    background: rgba(255, 247, 237, .95);
    font-size: 1rem;
}
.settings-section-copy h2 {
    margin: 0 0 .2rem;
    color: #111827;
    font-size: .98rem;
    font-weight: 800;
}
.settings-section-copy p {
    margin: 0;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.45;
}
.settings-field .form-label {
    color: #334155;
    font-size: .82rem;
    font-weight: 700;
}
.settings-field .form-text {
    color: #64748b;
    font-size: .76rem;
}
.settings-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
.settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
}
.settings-actions strong,
.settings-actions span {
    display: block;
}
.settings-actions strong {
    color: #111827;
    font-size: .9rem;
}
.settings-actions span {
    color: #64748b;
    font-size: .78rem;
}
html[data-theme="dark"] .settings-head h1,
html[data-theme="dark"] .settings-overview-card strong,
html[data-theme="dark"] .settings-section-copy h2,
html[data-theme="dark"] .settings-actions strong {
    color: #f8fafc;
}
html[data-theme="dark"] .settings-head p,
html[data-theme="dark"] .settings-overview-card span,
html[data-theme="dark"] .settings-section-copy p,
html[data-theme="dark"] .settings-field .form-text,
html[data-theme="dark"] .settings-actions span {
    color: #94a3b8;
}
html[data-theme="dark"] .settings-status-pill,
html[data-theme="dark"] .settings-section-copy i {
    color: #fdba74;
    border-color: rgba(251, 146, 60, .28);
    background: rgba(251, 146, 60, .12);
}
html[data-theme="dark"] .settings-overview-card,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .settings-actions {
    border-color: rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .74);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .22);
}
html[data-theme="dark"] .settings-field .form-label {
    color: #e2e8f0;
}
@media (max-width: 1100px) {
    .settings-overview-grid,
    .settings-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-section {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .settings-head,
    .settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-overview-grid,
    .settings-grid-3 {
        grid-template-columns: 1fr;
    }
}
.notifications-page {
    display: grid;
    gap: .9rem;
}
.notifications-head,
.notifications-send-card,
.notifications-list-card {
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.notifications-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}
.notifications-head h1,
.notifications-send-copy h2,
.notifications-list-head h2 {
    margin: 0 0 .2rem;
    color: #111827;
    font-weight: 800;
}
.notifications-head h1 {
    font-size: 1.35rem;
}
.notifications-head p,
.notifications-send-copy p,
.notifications-list-head p {
    margin: 0;
    color: #64748b;
    font-size: .86rem;
}
.notifications-send-card {
    display: grid;
    grid-template-columns: minmax(210px, .32fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
}
.notifications-send-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, .6fr);
    gap: .75rem;
}
.notifications-send-body,
.notifications-send-actions {
    grid-column: 1 / -1;
}
.notifications-send-actions {
    display: flex;
    justify-content: flex-end;
}
.notifications-list-card {
    overflow: hidden;
}
.notifications-list-head {
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(15,23,42,.08);
}
.notifications-list {
    display: grid;
}
.notification-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: flex-start;
    padding: .95rem 1rem;
    border-top: 1px solid rgba(15,23,42,.06);
}
.notification-row:first-child {
    border-top: 0;
}
.notification-row.is-unread {
    background: rgba(59,130,246,.05);
}
.notification-row.is-alert {
    background: rgba(255,106,0,.07);
}
.notification-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: #2563eb;
    background: rgba(59,130,246,.12);
}
.notification-row.is-alert .notification-row-icon {
    color: #c2410c;
    background: rgba(255,106,0,.14);
}
.notification-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}
.notification-row-title strong {
    color: #111827;
}
.notification-row-title span {
    padding: .18rem .45rem;
    border-radius: 999px;
    color: #475569;
    background: rgba(148,163,184,.16);
    font-size: .7rem;
    font-weight: 800;
}
.notification-row.is-alert .notification-row-title span {
    color: #c2410c;
    background: rgba(255,106,0,.12);
}
.notification-row-main p {
    margin: .3rem 0;
    color: #334155;
    font-size: .88rem;
    line-height: 1.45;
}
.notification-row-main small {
    color: #64748b;
}
.notification-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem;
}
.notifications-empty {
    display: grid;
    justify-items: center;
    gap: .25rem;
    padding: 2rem 1rem;
    color: #64748b;
    text-align: center;
}
.notifications-empty i {
    color: #fb923c;
    font-size: 1.6rem;
}
.notifications-empty strong {
    color: #111827;
}
html[data-theme="dark"] .notifications-head,
html[data-theme="dark"] .notifications-send-card,
html[data-theme="dark"] .notifications-list-card {
    border-color: rgba(148,163,184,.16);
    background: rgba(15,23,42,.74);
    box-shadow: 0 14px 32px rgba(0,0,0,.22);
}
html[data-theme="dark"] .notifications-head h1,
html[data-theme="dark"] .notifications-send-copy h2,
html[data-theme="dark"] .notifications-list-head h2,
html[data-theme="dark"] .notification-row-title strong,
html[data-theme="dark"] .notifications-empty strong {
    color: #f8fafc;
}
html[data-theme="dark"] .notifications-head p,
html[data-theme="dark"] .notifications-send-copy p,
html[data-theme="dark"] .notifications-list-head p,
html[data-theme="dark"] .notification-row-main small,
html[data-theme="dark"] .notifications-empty {
    color: #94a3b8;
}
html[data-theme="dark"] .notifications-list-head,
html[data-theme="dark"] .notification-row {
    border-color: rgba(148,163,184,.12);
}
html[data-theme="dark"] .notification-row.is-unread {
    background: rgba(59,130,246,.11);
}
html[data-theme="dark"] .notification-row.is-alert {
    background: rgba(251,146,60,.11);
}
html[data-theme="dark"] .notification-row-main p {
    color: #cbd5e1;
}
@media (max-width: 900px) {
    .notifications-send-card,
    .notifications-send-form {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .notifications-head,
    .notification-row {
        grid-template-columns: 1fr;
    }

    .notifications-head,
    .notification-row-actions {
        align-items: stretch;
        justify-content: flex-start;
    }
}
.subject-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.subject-radio-btn {
    border-radius: 10px;
    min-width: 70px;
    border-color: rgba(15,23,42,0.12);
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.subject-radio-btn:hover {
    background: #f8fafc;
    border-color: rgba(15,23,42,0.22);
    color: #0f172a;
}
.btn-check:checked + .subject-radio-btn {
    color: #9a3412;
    background: rgba(255,106,0,0.12);
    border-color: rgba(255,106,0,0.5);
    box-shadow: inset 0 0 0 1px rgba(255,106,0,0.18);
}
.table-responsive {
    border-radius: 12px;
}

/* --- Table row actions (primary + secondary + overflow) --- */
.table-actions-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}
.table-actions--start {
    justify-content: flex-start;
}
.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0.35rem 0.7rem;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.2;
    transition: transform 0.15s ease, box-shadow 0.18s ease, background-color 0.15s ease,
        border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.table-action-btn.btn-sm {
    min-height: 34px;
    padding: 0.28rem 0.55rem;
    font-size: 0.8rem;
}
.table-action-btn:hover:not(:disabled):not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.table-action-primary {
    border: none;
    background: linear-gradient(180deg, #ff7a18, #ff4d00);
    color: #fff !important;
}
.table-action-primary:hover:not(:disabled):not(.disabled) {
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(255, 106, 0, 0.38);
}
.table-action-primary:disabled,
.table-action-primary.disabled {
    opacity: 0.55;
    pointer-events: none;
    box-shadow: none;
}
.table-action-secondary {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: var(--card);
    color: var(--text) !important;
}
.table-action-secondary:hover:not(:disabled):not(.disabled) {
    border-color: rgba(255, 106, 0, 0.45);
    background: rgba(255, 106, 0, 0.07);
    color: var(--text) !important;
    box-shadow: 0 4px 14px rgba(255, 106, 0, 0.12);
}
.table-action-overflow-toggle {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: #64748b;
    min-width: 36px;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.table-action-overflow-toggle:hover:not(:disabled) {
    border-color: rgba(255, 106, 0, 0.35);
    color: #c2410c;
    background: rgba(255, 106, 0, 0.08);
}
.table-action-overflow-toggle.dropdown-toggle::after {
    display: none;
}
.table-actions-dropdown .dropdown-menu {
    min-width: 13rem;
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
}
.table-actions-dropdown .dropdown-item {
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.45rem 0.65rem;
}
.table-actions-dropdown .dropdown-item:hover,
.table-actions-dropdown .dropdown-item:focus {
    background: rgba(255, 106, 0, 0.1);
}
.table-actions-dropdown .dropdown-item.text-danger:hover,
.table-actions-dropdown .dropdown-item.text-danger:focus {
    background: rgba(220, 53, 69, 0.12);
}
html[data-theme="dark"] .table-action-secondary {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .table-action-overflow-toggle {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}
html[data-theme="dark"] .table-action-overflow-toggle:hover:not(:disabled) {
    color: #fdba74;
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-menu {
    background: #252830;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-item {
    color: #cbd5e1;
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-item:hover,
html[data-theme="dark"] .table-actions-dropdown .dropdown-item:focus {
    color: #f1f5f9;
    background: rgba(255, 106, 0, 0.12);
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-item.text-danger {
    color: #f87171 !important;
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-item.text-danger:hover,
html[data-theme="dark"] .table-actions-dropdown .dropdown-item.text-danger:focus {
    color: #fecaca !important;
    background: rgba(220, 53, 69, 0.18);
}
html[data-theme="dark"] .table-actions-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.08);
}
@media (max-width: 575.98px) {
    .table-action-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    .table-action-btn {
        position: relative;
    }
}

/* Dark mode: scrollbars (Firefox scrollbar-color + WebKit + native UI hint) */
html[data-theme="dark"] {
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.42) #141a23;
}
html[data-theme="dark"] *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
html[data-theme="dark"] *::-webkit-scrollbar-track {
    background: #141a23;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 8px;
    border: 2px solid #141a23;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.48);
}
html[data-theme="dark"] *::-webkit-scrollbar-corner {
    background: #141a23;
}

/*
 * App shell uses html[data-theme="dark"], not data-bs-theme — Bootstrap’s color-mode
 * utilities (.text-muted, .text-body-secondary) stay tuned for light backgrounds.
 * Normalize muted copy + form labels across the admin UI.
 */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-body-secondary {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .text-secondary {
    color: #a8b3c4 !important;
}
html[data-theme="dark"] .form-text {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .form-label {
    color: #e2e8f0;
}
html[data-theme="dark"] .form-label.text-muted,
html[data-theme="dark"] label.form-label.text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(190%);
    opacity: 0.86;
}
html[data-theme="dark"] .btn-close:hover,
html[data-theme="dark"] .btn-close:focus {
    opacity: 1;
    filter: invert(1) grayscale(100%) brightness(220%);
}
html[data-theme="dark"] .modal-header .btn-close {
    border-radius: 10px;
    background-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .modal-header .btn-close:hover,
html[data-theme="dark"] .modal-header .btn-close:focus {
    background-color: rgba(255,106,0,0.16);
}
html[data-theme="dark"] .main-content .form-control {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .main-content .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}
html[data-theme="dark"] .modal-content .form-control,
html[data-theme="dark"] .modal-content textarea.form-control {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .modal-content .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}
html[data-theme="dark"] .main-content .input-group-text {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .main-content .admin-btn-outline {
    color: #fdba74 !important;
    border-color: rgba(251, 146, 60, 0.45) !important;
}
html[data-theme="dark"] .main-content .admin-btn-outline:hover {
    color: #ffedd5 !important;
    background: rgba(255, 106, 0, 0.1) !important;
}

html[data-theme="dark"] .main-content {
    background: #0f1115;
}
html[data-theme="dark"] .sidebar {
    background: #151922;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .sidebar-drawer {
    border-left-color: rgba(255,255,255,0.14);
}
html[data-theme="dark"] .sidebar-brand-text small,
html[data-theme="dark"] .sidebar .nav-link,
html[data-theme="dark"] .sidebar-theme-toggle,
html[data-theme="dark"] .sidebar-collapse-btn {
    color: #cbd5e1;
}
html[data-theme="dark"] .sidebar .nav-link:hover,
html[data-theme="dark"] .sidebar-theme-toggle:hover {
    color: #ff6a00;
    background: rgba(255,106,0,0.14);
}
html[data-theme="dark"] .sidebar-bottom {
    border-top-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .sidebar-property-note {
    color: #64748b;
    opacity: 0.75;
}
html[data-theme="dark"] .sidebar-nav {
    scrollbar-color: #2a3442 #141a23;
}
html[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2c3644, #232c39);
    border-color: #141a23;
}
html[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-track {
    background: #141a23;
}
html[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #344152, #293444);
}
html[data-theme="dark"] .sidebar-collapse-btn {
    background: #111827;
    border-color: rgba(255,255,255,0.15);
}
html[data-theme="dark"] .sidebar-switch {
    background: rgba(148,163,184,0.35);
}
html[data-theme="dark"] .sidebar-switch-knob {
    background: #e2e8f0;
}
html[data-theme="dark"] .sidebar-theme-toggle[data-theme-active="dark"] .sidebar-switch {
    background: rgba(255,106,0,0.5);
}
html[data-theme="dark"] .sidebar-theme-toggle[data-theme-active="dark"] .sidebar-switch-knob {
    left: 20px;
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .table {
    background: #171a21;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .admin-global-student-search-input {
    background: #111827;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.24);
}
html[data-theme="dark"] .admin-global-student-search-input:focus {
    background: #0f172a;
    border-color: rgba(255, 106, 0, 0.55);
}
html[data-theme="dark"] .admin-global-student-search-menu {
    background: #151922;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}
html[data-theme="dark"] .admin-global-student-search-item {
    color: #e2e8f0;
}
html[data-theme="dark"] .admin-global-student-search-item:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(255, 106, 0, 0.28);
    color: #fff;
}
html[data-theme="dark"] .admin-global-student-search-avatar {
    background: rgba(255,106,0,0.18);
    color: #fdba74;
}
html[data-theme="dark"] .admin-global-student-search-copy small,
html[data-theme="dark"] .admin-global-student-search-empty {
    color: #94a3b8;
}
html[data-theme="dark"] .admin-global-student-search-primary-action {
    background: rgba(59,130,246,0.16);
    border-color: rgba(96,165,250,0.34);
    color: #93c5fd;
}
html[data-theme="dark"] .admin-global-student-search-actions button {
    background: rgba(255,106,0,0.14);
    color: #fdba74;
}
html[data-theme="dark"] .admin-global-student-search-item:hover .admin-global-student-search-primary-action,
html[data-theme="dark"] .admin-global-student-search-actions button:hover {
    background: #ff6a00;
    color: #fff;
}
html[data-theme="dark"] .dashboard-student-conflict-summary {
    background: rgba(15, 23, 42, 0.36);
    border-color: rgba(148, 163, 184, 0.16);
}
html[data-theme="dark"] .dashboard-student-conflict-row {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .dashboard-student-conflict-row.is-critical {
    border-left-color: #f87171;
}
html[data-theme="dark"] .dashboard-student-conflict-row.is-warning {
    border-left-color: #fbbf24;
}
html[data-theme="dark"] .dashboard-student-conflict-row.is-info {
    border-left-color: #38bdf8;
}
html[data-theme="dark"] .dashboard-student-conflict-name span {
    background: #e2e8f0;
    color: #0f172a;
}
html[data-theme="dark"] .dashboard-student-conflict-counts span {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}
html[data-theme="dark"] .admin-muted-label,
html[data-theme="dark"] .admin-section-subtext {
    color: #94a3b8;
}
html[data-theme="dark"] .admin-theme-btn {
    background: #172036;
    color: #fdba74;
    border-color: rgba(251,146,60,0.45);
}
html[data-theme="dark"] .admin-user-badge {
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.08);
}
html[data-theme="dark"] .admin-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .admin-input.form-select,
html[data-theme="dark"] .dataTables_wrapper .form-select {
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.16);
    padding-right: 2.3rem;
    background-color: #0f172a;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e2e8f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
html[data-theme="dark"] .admin-input::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] .subject-radio-btn {
    border-color: rgba(255,255,255,0.16);
    color: #cbd5e1;
    background: #0f172a;
}
html[data-theme="dark"] .subject-radio-btn:hover {
    border-color: rgba(255,255,255,0.24);
    background: #172036;
    color: #e2e8f0;
}
html[data-theme="dark"] .btn-check:checked + .subject-radio-btn {
    color: #fdba74;
    background: rgba(251,146,60,0.16);
    border-color: rgba(251,146,60,0.5);
    box-shadow: inset 0 0 0 1px rgba(251,146,60,0.2);
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 44px;
    border-radius: 12px !important;
    border-color: rgba(15,23,42,0.12) !important;
    padding: 6px 8px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #ff6a00 !important;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.2);
}
.select2-dropdown {
    border-radius: 10px !important;
    border-color: rgba(15,23,42,0.12) !important;
    overflow: hidden;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(255,106,0,0.15) !important;
    color: #9a3412 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(255,106,0,0.12) !important;
    border-color: rgba(255,106,0,0.2) !important;
    color: #9a3412 !important;
    border-radius: 999px !important;
    padding: 2px 10px 2px 22px !important;
    font-weight: 600;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    left: 8px !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
    margin-top: 0 !important;
    border-right: 0 !important;
    color: inherit !important;
    opacity: 0.75;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    opacity: 1;
    background: transparent !important;
}
.select2-container--default .select2-results__option--disabled {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option--disabled {
    color: #64748b !important;
}
html[data-theme="dark"] .select2-dropdown {
    background: #111827 !important;
    border-color: rgba(255,255,255,0.16) !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option {
    color: #e2e8f0 !important;
    background: transparent !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(251,146,60,0.24) !important;
    color: #fff7ed !important;
}
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-search--inline .select2-search__field {
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #94a3b8 !important;
}
.assign-warning {
    border: 1px solid rgba(249,115,22,0.35);
    background: rgba(249,115,22,0.12);
    color: #b45309;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.82rem;
}
.assign-block-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.assign-block-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(15,23,42,0.1);
    border-radius: 10px;
    background: rgba(15,23,42,0.03);
    padding: 8px 10px;
}
.assign-block-meta-item small {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}
.assign-block-meta-item strong {
    font-size: 0.86rem;
    color: #0f172a;
    font-weight: 700;
}
.assign-chip {
    border: 1px solid rgba(255,106,0,0.22);
    background: rgba(255,106,0,0.12);
    color: #c2410c;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.assign-chip:hover {
    background: rgba(255,106,0,0.2);
}
html[data-theme="dark"] .assign-warning {
    border-color: rgba(251,146,60,0.35);
    background: rgba(251,146,60,0.16);
    color: #fdba74;
}
html[data-theme="dark"] .assign-block-meta-item {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.06);
}
html[data-theme="dark"] .assign-block-meta-item small {
    color: #94a3b8;
}
html[data-theme="dark"] .assign-block-meta-item strong {
    color: #f1f5f9;
}
html[data-theme="dark"] .assign-chip {
    border-color: rgba(251,146,60,0.35);
    background: rgba(255,106,0,0.22);
    color: #fdba74;
}
html[data-theme="dark"] .assign-chip span[aria-hidden="true"],
html[data-theme="dark"] .blocking-chip span[aria-hidden="true"] {
    color: #fff7ed;
    font-weight: 900;
    opacity: 1;
}
html[data-theme="dark"] #assignBlockClear {
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    color: #f8fafc;
}
html[data-theme="dark"] #assignBlockClear:hover,
html[data-theme="dark"] #assignBlockClear:focus {
    border-color: rgba(251,146,60,0.45);
    background: rgba(255,106,0,0.16);
    color: #fff7ed;
}
.assign-block-existing-heading {
    letter-spacing: 0.04em;
    color: #64748b;
}
.assign-block-existing-empty {
    color: #64748b;
}
html[data-theme="dark"] .assign-block-existing-heading {
    color: #94a3b8;
}
html[data-theme="dark"] .assign-block-existing-empty {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .select2-container .select2-selection--single,
html[data-theme="dark"] .select2-container .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown {
    background: #0f172a !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__rendered,
html[data-theme="dark"] .select2-results__option {
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .app-wrap .card:has(.table),
html[data-theme="dark"] .app-wrap .admin-section-card:has(.table) {
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .app-wrap .table-responsive {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .app-wrap .table thead th {
    color: #cbd5e1;
    background: #1e293b;
    border-bottom-color: rgba(255,255,255,0.09);
}
html[data-theme="dark"] table.dataTable tbody tr,
html[data-theme="dark"] table.dataTable tbody tr.odd,
html[data-theme="dark"] table.dataTable tbody tr.even {
    background-color: transparent !important;
}
html[data-theme="dark"] .app-wrap .table tbody td,
html[data-theme="dark"] table.dataTable tbody tr td,
html[data-theme="dark"] table.dataTable tbody tr th {
    color: #e2e8f0 !important;
    background: #1e293b !important;
    border-color: rgba(255,255,255,0.08) !important;
}
html[data-theme="dark"] .app-wrap .table tbody tr:hover td,
html[data-theme="dark"] table.dataTable tbody tr:hover td,
html[data-theme="dark"] table.dataTable tbody tr:hover th {
    background: rgba(255,106,0,.14) !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_info,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter label {
    color: #cbd5e1;
}
html[data-theme="dark"] .dataTables_wrapper .form-control,
html[data-theme="dark"] .dataTables_wrapper .form-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .app-wrap .table .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] #blockStudentListModal .table-responsive {
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] #blockStudentListModal .table thead th {
    color: #cbd5e1;
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] #blockStudentListModal .table tbody td {
    color: #e2e8f0 !important;
    background: #0f172a !important;
    border-color: rgba(255,255,255,0.08) !important;
}
html[data-theme="dark"] #blockStudentListModal .table tbody tr:hover td {
    background: rgba(255,106,0,0.12) !important;
}
html[data-theme="dark"] #blockStudentListModal .table .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #cbd5e1 !important;
    border-color: rgba(255,255,255,0.12) !important;
    background: #0f172a !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* DataTables uses Bootstrap pagination (.page-link). App theme is html[data-theme="dark"], not data-bs-theme, so Bootstrap keeps light pagination — override here. */
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul.pagination .page-link {
    color: #e2e8f0 !important;
    background-color: #1e293b !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul.pagination .page-item.active .page-link {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul.pagination .page-item.disabled .page-link {
    color: #64748b !important;
    background-color: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    opacity: 0.95;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul.pagination .page-item:not(.disabled):not(.active) .page-link:hover {
    color: #f8fafc !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(251, 146, 60, 0.35) !important;
}

@media (max-width: 991.98px) {
    .main-content {
        padding: 16px;
    }
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .admin-sidebar-mobile-btn {
        margin-bottom: 6px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-120%);
    }
    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }
    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-collapse-btn {
        display: none;
    }
    .table-responsive {
        overflow-x: auto;
    }
}

.public-hero {
    background: linear-gradient(120deg, #ff7a18, #ff4d00);
    color: #fff;
    border-radius: 20px;
}

.public-landing {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, #fff7ed, #ffe0cc);
    padding-bottom: 40px;
}

.public-bg-shape {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.public-bg-shape-left {
    top: -90px;
    left: -110px;
    background: #ff8c42;
}

.public-bg-shape-right {
    right: -100px;
    bottom: -100px;
    background: #ff4d00;
}

.public-landing .container {
    position: relative;
    z-index: 1;
}

.public-hero.container {
    padding-top: 80px;
    padding-bottom: 60px;
    text-align: center;
}

.public-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.public-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: #64748b;
    font-size: 1.07rem;
}

.public-theme-toggle {
    position: absolute;
    top: 24px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.public-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.public-search-card {
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    padding: 20px;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-search-card:hover,
.public-results-card:hover {
    transform: translateY(-2px);
}

.public-search-input {
    border-radius: 12px;
    min-height: 48px;
    border-color: rgba(15, 23, 42, 0.14);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.public-search-input:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.3);
}

.public-btn-search {
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.public-btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(255, 106, 0, 0.35);
    color: #fff;
}

.public-btn-login {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 122, 24, 0.45);
    color: #b45309;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.public-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(180, 83, 9, 0.15);
    background: #fff;
    color: #92400e;
}

.public-results-card {
    margin-top: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    padding: 20px;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-results-table {
    margin-bottom: 0;
}

.public-results-table th,
.public-results-table td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.public-results-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.03);
}

.public-results-table tbody tr:hover {
    background: rgba(255, 106, 0, 0.1);
}

.public-empty-state {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    padding: 16px 6px;
}

html[data-theme="dark"] .public-landing {
    background: #0f172a;
}

html[data-theme="dark"] .public-hero h1,
html[data-theme="dark"] .public-theme-toggle {
    color: #e2e8f0;
}

html[data-theme="dark"] .public-hero p,
html[data-theme="dark"] .public-empty-state {
    color: #94a3b8;
}

html[data-theme="dark"] .public-theme-toggle {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .public-search-card,
html[data-theme="dark"] .public-results-card {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(255, 122, 24, 0.12);
}

html[data-theme="dark"] .public-search-input {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

html[data-theme="dark"] .public-search-input::placeholder {
    color: #94a3b8;
}

html[data-theme="dark"] .public-btn-login {
    background: #0f172a;
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.5);
}

html[data-theme="dark"] .public-btn-login:hover {
    background: #172036;
}

html[data-theme="dark"] .public-results-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.08);
}

@media (max-width: 991.98px) {
    .public-theme-toggle {
        right: 20px;
    }
}

@media (max-width: 767.98px) {
    .public-hero.container {
        padding-top: 72px;
        padding-bottom: 44px;
    }

    .public-hero h1 {
        font-size: 2.2rem;
    }

    .public-hero p {
        font-size: 0.98rem;
    }

    .public-search-card .row > div {
        width: 100%;
    }
}

/* Public Landing v2 */
.public-landing-v2 {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    background:
      radial-gradient(circle at 10% 10%, rgba(255,106,0,.15), transparent 30%),
      radial-gradient(circle at 90% 90%, rgba(255,122,24,.15), transparent 30%),
      #f8fafc;
}
body.public-splash-active {
    overflow: hidden;
}
.public-splash-screen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05070c;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
.public-splash-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
}
.public-splash-inner {
    width: min(92vw, 760px);
    text-align: center;
    padding: 20px;
}
.public-splash-logo-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto 28px;
    position: relative;
    display: grid;
    place-items: center;
}
.public-splash-binary-orbit {
    position: absolute;
    width: 156px;
    height: 156px;
    overflow: visible;
    animation: splashBinaryOrbitSpin 10s linear infinite;
    pointer-events: none;
}
.public-splash-binary-orbit text {
    fill: rgba(251,146,60,0.95);
    font: 700 8px/1 "Consolas", "Courier New", monospace;
    letter-spacing: 0.08em;
}
.public-splash-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    margin-bottom: 0;
    filter: drop-shadow(0 0 12px rgba(255,106,0,0.45));
    position: relative;
    z-index: 1;
}
.public-splash-inner h2 {
    margin: 0 0 6px;
    font-size: clamp(1.1rem, 2.1vw, 1.8rem);
    color: #e2e8f0;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.public-splash-inner p {
    margin: 0 0 18px;
    color: #fb923c;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.85rem;
    font-weight: 700;
}
.public-splash-loader {
    width: min(78vw, 560px);
    height: 7px;
    margin: 0 auto;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    overflow: hidden;
}
.public-splash-loader span {
    display: block;
    width: 28%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a18, #ff4d00);
    animation: splashLoadMove 1.2s ease-in-out infinite;
}
@keyframes splashLoadMove {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(360%); }
}
@keyframes splashBinaryOrbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.public-landing-v2::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 22px 22px;
    z-index: 0;
}
.public-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
}
.public-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px max(20px, env(safe-area-inset-right)) 64px max(20px, env(safe-area-inset-left));
    position: relative;
    z-index: 1;
    min-width: 0;
}
.public-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 10px 16px;
    min-width: 0;
}
.public-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}
.public-nav-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    background: transparent;
    padding: 0;
}
.public-nav-title {
    font-weight: 600;
    color: #0f172a;
    min-width: 0;
    font-size: clamp(0.78rem, 2.1vw, 0.95rem);
    line-height: 1.25;
}
.public-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.public-nav-theme {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.14);
    background: rgba(255,255,255,0.9);
    color: #334155;
    transition: all .2s ease;
}
.public-nav-theme:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15,23,42,0.12);
}
.public-nav-login {
    border-radius: 12px;
    padding: 9px 14px;
    text-decoration: none;
    border: 1px solid rgba(255,106,0,0.3);
    color: #c2410c;
    font-weight: 600;
    background: rgba(255,255,255,0.9);
}
.public-nav-login:hover {
    color: #9a3412;
}

.public-hero-v2 {
    margin-top: 18px;
    border-radius: 26px;
    padding: 48px 34px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,122,24,.95), rgba(255,77,0,.92));
    box-shadow: 0 28px 70px rgba(194,65,12,0.30);
    animation: publicFadeIn .6s ease both;
}
.public-hero-v2::before,
.public-hero-v2::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(120px);
    opacity: 0.35;
}
.public-hero-v2::before {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
    background: rgba(255,255,255,0.9);
}
.public-hero-v2::after {
    width: 250px;
    height: 250px;
    bottom: -60px;
    left: -40px;
    background: rgba(255,255,255,0.5);
}
.public-hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    position: relative;
    z-index: 1;
}
@media (min-width: 768px) {
    .public-hero-inner {
        grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.85fr);
        gap: 28px 40px;
    }
}
.public-hero-main {
    min-width: 0;
}
.public-hero-term {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15,23,42,0.22);
    margin-bottom: 16px;
}
.public-hero-v2 h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}
.public-hero-main p {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
    max-width: 42em;
}
.public-hero-aside {
    border-radius: 16px;
    padding: 16px 18px;
    background: rgba(15,23,42,0.22);
    border: 1px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}
.public-hero-aside-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.82);
    margin-bottom: 12px;
}
.public-hero-aside-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}
.public-hero-aside-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.public-hero-aside-list i {
    flex-shrink: 0;
    font-size: 1.05rem;
    opacity: 0.95;
    margin-top: 1px;
}
.public-hero-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.public-hero-chips span {
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.24);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    padding: 6px 12px;
}

.public-search-wrap {
    margin-top: -38px;
    position: relative;
    z-index: 5;
    animation: publicFloatIn .7s ease both;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-v2 {
    min-height: auto;
    padding: 1.28rem 1.55rem;
    border-radius: 8px;
    margin-bottom: .7rem;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-inner {
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .public-landing-v2:not(.teacher-roster-public) .public-hero-inner {
        grid-template-columns: minmax(0, 1.35fr) minmax(260px, .75fr);
    }
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-v2 h1 {
    max-width: 44rem;
    margin-bottom: .5rem;
    font-size: clamp(1.75rem, 3.5vw, 2.55rem);
    line-height: 1.05;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-main p {
    max-width: 44rem;
    margin-bottom: 0;
    font-size: .95rem;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-aside {
    max-width: 28rem;
    justify-self: end;
    padding: .78rem .95rem;
    border-radius: 8px;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-aside-list {
    gap: .55rem;
}

.public-landing-v2:not(.teacher-roster-public) .public-hero-aside-list li {
    font-size: .86rem;
}

.public-landing-v2:not(.teacher-roster-public) .public-search-wrap {
    margin-top: -.35rem;
}
.public-lookup-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2.1fr);
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}
.public-lookup-left,
.public-lookup-right {
    min-width: 0;
}
.public-lookup-hero {
    border-radius: 14px;
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    padding: 14px 14px 12px;
    box-shadow: 0 8px 22px rgba(255,106,0,0.2);
    margin-bottom: 10px;
}
.public-lookup-hero h1 {
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
}
.public-lookup-hero p {
    margin: 0;
    color: rgba(255,255,255,0.92);
    font-size: 0.82rem;
}
.public-search-card-v2 {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 16px 34px rgba(15,23,42,.12);
    backdrop-filter: blur(10px);
    min-width: 0;
}
.public-search-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 36px 90px rgba(15,23,42,.18);
}
.public-input-wrap {
    position: relative;
}
.public-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.public-search-input-v2 {
    height: 50px;
    border-radius: 12px;
    border-color: rgba(15,23,42,0.12);
}
.public-input-wrap .public-search-input-v2 {
    padding-left: 38px;
}
.public-search-input-v2:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,.23), 0 0 24px rgba(255,106,0,.28);
}
.public-btn-search-v2,
.public-btn-login-v2 {
    border-radius: 12px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.public-btn-search-v2 {
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    border: none;
    color: #fff;
    padding: 0 20px;
    min-width: 130px;
}
.public-btn-search-v2:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255,106,0,.35);
}
.public-btn-login-v2 {
    border: 1px solid rgba(255,106,0,.25);
    background: rgba(255,255,255,.85);
    color: #b45309;
    text-decoration: none;
    padding: 0 16px;
}

.public-results-card-v2 {
    margin-top: 14px;
    border-radius: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.public-lookup-right {
    min-height: 520px;
}
.public-student-card-list {
    display: grid;
    gap: 12px;
}
.public-results-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.public-results-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}
.public-empty-state-v2 {
    text-align: center;
    padding: 18px 14px;
}
.public-empty-state-compact {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.public-empty-state-v2 i {
    font-size: 2rem;
    color: #fb923c;
    animation: publicBounce 0.8s ease;
}
.public-empty-state-v2 h4 {
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 8px;
}
.public-empty-state-v2 p {
    color: #64748b;
    margin: 0;
}
.public-summary-card {
    border-radius: 16px;
    background: rgba(15,23,42,0.03);
    padding: 14px;
    margin-bottom: 16px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.public-summary-card small {
    display: block;
    color: #64748b;
    font-size: .75rem;
    margin-bottom: 4px;
}
.public-summary-card strong {
    color: #0f172a;
    font-size: .95rem;
}
.public-status-badge,
.public-block-badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .78rem;
    font-weight: 700;
}
.public-status-badge { background: rgba(34,197,94,.16); color: #15803d; }
.public-block-badge { background: rgba(255,106,0,.14); color: #c2410c; }

.public-results-table-v2 th,
.public-results-table-v2 td {
    padding-top: 0.92rem;
    padding-bottom: 0.92rem;
}
.public-results-table-v2 tbody tr:nth-child(even) {
    background: #fafafa;
}
.public-results-table-v2 tbody tr:hover {
    background: rgba(255,106,0,.05);
}
.public-student-card {
    border-radius: 14px;
    background: rgba(15,23,42,0.03);
    border: 1px solid rgba(15,23,42,0.08);
    padding: 14px;
}
.public-student-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.public-student-card-head h4 {
    margin: 0;
    font-size: 1.08rem;
    color: #0f172a;
}
.public-student-meta-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 10px;
}
.public-student-meta-grid small,
.public-student-subjects small {
    display: block;
    color: #64748b;
    font-size: .75rem;
    margin-bottom: 4px;
}
.public-student-meta-grid strong {
    color: #0f172a;
    font-size: .95rem;
}
.public-subject-section {
    margin-top: 10px;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(15,23,42,0.03);
    border-radius: 10px;
    padding: 10px;
}
.public-subject-section-head {
    margin-bottom: 8px;
}
.public-subject-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.public-subject-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, max-content));
    gap: 6px;
}
.public-subject-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .78rem;
    font-weight: 600;
    background: rgba(2,132,199,0.12);
    color: #0c4a6e;
}
.public-subject-chip--load {
    background: rgba(2,132,199,0.12);
    color: #0c4a6e;
}
.public-subject-section--blocked {
    border-color: rgba(255,106,0,0.2);
    background: rgba(255,106,0,0.05);
}
.public-subject-chip--blocked {
    background: rgba(255,106,0,0.14);
    color: #9a3412;
    border: 1px solid rgba(234,88,12,0.28);
}
.public-subject-chip--with-block {
    align-items: flex-start;
    flex-direction: column;
    gap: .12rem;
    min-width: 6.8rem;
    border-radius: 12px;
    padding: 7px 10px;
}
.public-subject-chip--with-block strong {
    line-height: 1.1;
}
.public-subject-chip--with-block small {
    max-width: 11rem;
    color: inherit;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: .82;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.public-subject-empty {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
}
.public-block-schedule-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15,23,42,0.08);
}
.public-block-schedule-wrap .public-subject-section-head {
    margin-bottom: 8px;
}
.public-block-schedule-thumb-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(248,250,252,0.9);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.public-block-schedule-thumb-wrap:hover {
    box-shadow: 0 8px 22px rgba(15,23,42,0.12);
    transform: translateY(-1px);
}
.public-block-schedule-thumb-img-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    font: inherit;
    color: inherit;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}
.public-block-schedule-thumb-img-btn:focus-visible {
    outline: 2px solid #ea580c;
    outline-offset: -2px;
}
.public-block-schedule-thumb-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 8px 12px;
    background: rgba(241,245,249,0.95);
    color: #475569;
    border-top: 1px solid rgba(15,23,42,0.08);
    font-size: 0.82rem;
    font-weight: 600;
}
.public-block-schedule-thumb-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}
.public-block-schedule-footer-download {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    border: 1px solid rgba(15,23,42,0.14);
    background: #e2e8f0;
    color: #334155;
}
.public-block-schedule-footer-download:hover {
    background: #cbd5e1;
    color: #0f172a;
}
.public-block-schedule-modal-content .modal-body {
    background: rgba(248,250,252,0.6);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 220px);
    padding: 12px;
    text-align: center;
}
.public-block-schedule-modal-img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: top;
    margin: 0 auto;
}
.public-block-schedule-img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: #fff;
}

.public-feature-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.public-feature-card {
    border-radius: 16px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
    padding: 16px;
    transition: all .2s ease;
}
.public-feature-card:hover {
    transform: translateY(-2px);
}
.public-feature-card i {
    color: #ff6a00;
    font-size: 1.2rem;
}
.public-feature-card h5 {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 1rem;
}
.public-feature-card p {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
}

@keyframes publicFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes publicBounce {
    0% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
@keyframes publicFloatIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

html[data-theme="dark"] .public-landing-v2 {
    background:
      radial-gradient(circle at top left, rgba(255,106,0,.16), transparent 35%),
      radial-gradient(circle at bottom right, rgba(255,122,24,.16), transparent 35%),
      #0f172a;
}
html[data-theme="dark"] .public-landing-v2::after {
    background-image: radial-gradient(rgba(148,163,184,0.08) 1px, transparent 1px);
}
html[data-theme="dark"] .public-grid-overlay {
    opacity: 0.08;
}
html[data-theme="dark"] .public-nav,
html[data-theme="dark"] .public-search-card-v2,
html[data-theme="dark"] .public-results-card-v2,
html[data-theme="dark"] .public-feature-card {
    background: rgba(30,41,59,.82);
    border-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] .public-hero-v2 {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}
html[data-theme="dark"] .public-lookup-hero {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}
html[data-theme="dark"] .public-nav-title,
html[data-theme="dark"] .public-results-head h3,
html[data-theme="dark"] .public-empty-state-v2 h4,
html[data-theme="dark"] .public-summary-card strong {
    color: #e2e8f0;
}
html[data-theme="dark"] .public-nav-theme,
html[data-theme="dark"] .public-btn-login-v2 {
    background: rgba(15,23,42,.8);
    border-color: rgba(255,255,255,.12);
    color: #e2e8f0;
}
html[data-theme="dark"] .public-nav-logo {
    background: transparent;
}
html[data-theme="dark"] .public-search-input-v2 {
    background: #0f172a;
    border-color: rgba(255,255,255,.1);
    color: #e2e8f0;
}
html[data-theme="dark"] .public-search-input-v2::placeholder,
html[data-theme="dark"] .public-empty-state-v2 p,
html[data-theme="dark"] .public-feature-card p,
html[data-theme="dark"] .public-summary-card small {
    color: #94a3b8;
}
html[data-theme="dark"] .public-summary-card {
    background: rgba(148,163,184,0.08);
}
html[data-theme="dark"] .public-student-card {
    background: rgba(148,163,184,0.08);
    border-color: rgba(148,163,184,0.22);
}
html[data-theme="dark"] .public-student-card-head h4,
html[data-theme="dark"] .public-student-meta-grid strong {
    color: #e2e8f0;
}
html[data-theme="dark"] .public-student-meta-grid small,
html[data-theme="dark"] .public-student-subjects small,
html[data-theme="dark"] .public-subject-empty {
    color: #94a3b8;
}
html[data-theme="dark"] .public-subject-chip {
    background: rgba(56,189,248,0.16);
    color: #bae6fd;
}
html[data-theme="dark"] .public-subject-chip--load {
    background: rgba(56,189,248,0.16);
    color: #bae6fd;
}
html[data-theme="dark"] .public-subject-section--blocked {
    border-color: rgba(255,106,0,0.35);
    background: rgba(255,106,0,0.08);
}
html[data-theme="dark"] .public-subject-chip--blocked {
    background: rgba(255,106,0,0.18);
    color: #fed7aa;
    border-color: rgba(251,146,60,0.45);
}
html[data-theme="dark"] .public-subject-section {
    background: rgba(15,23,42,0.65);
    border-color: rgba(148,163,184,0.22);
}
html[data-theme="dark"] .public-block-schedule-wrap {
    border-top-color: rgba(148,163,184,0.2);
}
html[data-theme="dark"] .public-block-schedule-thumb-wrap {
    background: rgba(15,23,42,0.75);
    border-color: rgba(148,163,184,0.28);
}
html[data-theme="dark"] .public-block-schedule-img {
    background: #0f172a;
}
html[data-theme="dark"] .public-block-schedule-thumb-footer {
    background: rgba(15,23,42,0.9);
    color: #94a3b8;
    border-top-color: rgba(148,163,184,0.22);
}
html[data-theme="dark"] .public-block-schedule-footer-download {
    background: rgba(30,41,59,0.95);
    border-color: rgba(148,163,184,0.35);
    color: #e2e8f0;
}
html[data-theme="dark"] .public-block-schedule-footer-download:hover {
    background: rgba(51,65,85,0.95);
    color: #f8fafc;
}
html[data-theme="dark"] .public-block-schedule-modal-content .modal-body {
    background: rgba(15,23,42,0.55);
}
html[data-theme="dark"] .public-block-schedule-modal-content .modal-header,
html[data-theme="dark"] .public-block-schedule-modal-content .modal-footer {
    border-color: rgba(148,163,184,0.2);
}
html[data-theme="dark"] .public-status-badge {
    background: rgba(34,197,94,.2);
    color: #bbf7d0;
}
html[data-theme="dark"] .public-block-badge {
    background: rgba(255,106,0,.2);
    color: #fdba74;
}
html[data-theme="dark"] .public-results-table-v2 tbody tr:nth-child(even) {
    background: rgba(148,163,184,.06);
}

@media (max-width: 991.98px) {
    .public-search-card-v2 {
        grid-template-columns: 1fr auto;
    }
    .public-summary-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .public-student-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .public-empty-state-compact {
        min-height: 220px;
    }
}
@media (max-width: 767.98px) {
    .public-wrapper {
        padding-top: 20px;
        padding-bottom: max(56px, env(safe-area-inset-bottom));
    }
    .public-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    .public-hero-v2 {
        padding: 34px 20px;
        border-radius: 18px;
    }
    .public-hero-main p {
        font-size: 0.92rem;
        word-wrap: break-word;
    }
    .public-search-wrap {
        margin-top: -22px;
    }
    .public-search-card-v2 {
        grid-template-columns: 1fr;
    }
    .public-btn-search-v2,
    .public-btn-login-v2 {
        width: 100%;
    }
    .public-results-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .public-results-card-v2 {
        border-radius: 18px;
        padding: 14px;
    }
    .public-summary-card {
        grid-template-columns: 1fr;
    }
    .public-student-meta-grid {
        grid-template-columns: 1fr;
    }
    .public-student-card-list {
        max-height: none;
    }
    .public-empty-state-compact {
        min-height: 180px;
    }
    .public-empty-state-v2 {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .public-feature-grid {
        grid-template-columns: 1fr;
    }
    .public-subject-list {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr));
    }
    .public-block-schedule-modal-content .modal-body {
        max-height: calc(100dvh - 200px);
    }
}

@media (max-width: 575.98px) {
    .public-wrapper {
        padding: 16px max(14px, env(safe-area-inset-left)) max(48px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
    }
    .public-nav {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
        padding: 12px 14px;
    }
    .public-nav-brand {
        gap: 10px;
    }
    .public-nav-logo {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }
    .public-nav-title {
        font-size: 0.72rem;
        line-height: 1.28;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
    .public-nav-actions {
        justify-content: flex-end;
        width: 100%;
    }
    .public-hero-v2 {
        padding: 22px 16px 24px;
        margin-top: 8px;
    }
    .public-hero-term {
        font-size: 0.72rem;
        padding: 5px 10px;
        margin-bottom: 12px;
    }
    .public-hero-v2 h1 {
        font-size: clamp(1.35rem, 6.5vw, 1.85rem);
        margin-bottom: 10px;
    }
    .public-search-wrap {
        margin-top: -14px;
    }
    .public-search-card-v2 {
        border-radius: 12px;
        padding: 10px;
    }
    .public-search-input-v2 {
        font-size: 16px;
    }
    .public-btn-search-v2 {
        min-width: 0;
        min-height: 48px;
    }
    .public-results-card-v2 {
        padding: 12px;
        border-radius: 16px;
    }
    .public-results-head h3 {
        font-size: 1.05rem;
    }
    .public-student-card {
        padding: 12px;
        border-radius: 12px;
    }
    .public-student-card-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .public-student-card-head h4 {
        font-size: 1rem;
        word-break: break-word;
    }
    .public-block-badge {
        max-width: 100%;
        white-space: normal;
        text-align: left;
    }
    .public-feature-card {
        padding: 14px;
        border-radius: 14px;
    }
    .public-feature-card p {
        font-size: 0.84rem;
        word-wrap: break-word;
    }
    .public-block-schedule-thumb-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .public-block-schedule-thumb-hint {
        justify-content: center;
        text-align: center;
    }
    .public-block-schedule-footer-download {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    .public-splash-inner {
        padding: 16px max(16px, env(safe-area-inset-left)) 20px max(16px, env(safe-area-inset-right));
    }
    .public-splash-inner h2 {
        font-size: clamp(0.95rem, 4.2vw, 1.35rem);
    }
}

/* Blocks module enhancements */
.blocks-create-card {
    border-radius: 22px;
    padding: 16px;
}
.blocks-create-form-compact .form-label {
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.blocks-create-form-compact .admin-input,
.blocks-create-form-compact .form-select,
.blocks-create-form-compact .form-control {
    min-height: 44px;
}
.blocks-create-form-compact small.text-muted {
    display: block;
    margin-top: 4px;
    line-height: 1.3;
}
.blocks-auto-name-check {
    margin-top: 6px;
}
.blocks-auto-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}
.blocks-auto-row-wide {
    width: 100%;
}
.blocks-auto-row .blocks-auto-name-check {
    margin-top: 0;
}
.blocks-name-preview {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: #f97316;
    font-weight: 700;
}
.blocks-create-form-compact .is-readonly-input {
    background: #f8fafc;
    opacity: 0.8;
    cursor: not-allowed;
    border-color: rgba(148,163,184,0.48);
}
.blocks-create-card .admin-btn-primary,
.blocks-create-card .admin-btn-outline {
    min-height: 46px;
}
.schedule-day-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(48px, 1fr));
    gap: 8px;
}
.schedule-day-chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 1px solid rgba(15,23,42,0.14);
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.schedule-day-chip:hover {
    border-color: rgba(255,106,0,0.38);
    background: rgba(255,106,0,0.06);
    color: #c2410c;
}
.schedule-day-input:focus-visible + .schedule-day-chip {
    box-shadow: 0 0 0 3px rgba(255,106,0,0.2);
}
.schedule-day-input:checked + .schedule-day-chip {
    border-color: #ea580c;
    background: #fff7ed;
    color: #c2410c;
    box-shadow: inset 0 0 0 1px rgba(234,88,12,0.22);
}
.schedule-selected-state {
    border: 1px dashed rgba(148,163,184,0.45);
    border-radius: 10px;
    padding: 12px 14px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.88rem;
    background: rgba(15,23,42,0.02);
}
.schedule-conflict-assistant {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(34,197,94,0.24);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(34,197,94,0.08);
    color: #15803d;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
}
.schedule-conflict-assistant.is-warning {
    border-color: rgba(249,115,22,0.42);
    background: rgba(249,115,22,0.1);
    color: #c2410c;
}
#scheduleModalFeedback.alert-warning {
    border-color: rgba(249,115,22,0.42);
    background: rgba(249,115,22,0.1);
    color: #c2410c;
}
.schedule-conflict-assistant.is-muted {
    border-color: rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.02);
    color: #64748b;
}
.conflict-assistant-table {
    width: max-content;
    min-width: 1320px;
    table-layout: fixed;
}
.conflict-assistant-table th:nth-child(1),
.conflict-assistant-table td:nth-child(1) {
    width: 90px;
}
.conflict-assistant-table th:nth-child(2),
.conflict-assistant-table td:nth-child(2) {
    width: 180px;
}
.conflict-assistant-table th:nth-child(3),
.conflict-assistant-table td:nth-child(3) {
    width: 230px;
}
.conflict-assistant-table th:nth-child(4),
.conflict-assistant-table td:nth-child(4),
.conflict-assistant-table th:nth-child(5),
.conflict-assistant-table td:nth-child(5) {
    width: 320px;
}
.conflict-assistant-table th:nth-child(6),
.conflict-assistant-table td:nth-child(6) {
    width: 260px;
}
.conflict-assistant-table td {
    white-space: normal;
}
.conflict-assistant-table td:nth-child(1),
.conflict-assistant-table td:nth-child(2),
.conflict-assistant-table td:nth-child(6) {
    white-space: nowrap;
}
.schedule-import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.schedule-import-card .table-responsive {
    max-height: 560px;
}
.schedule-image-assistant-preview {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: rgba(15,23,42,0.02);
}
.schedule-image-assistant-preview img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 10px;
    background: #0f172a;
}
.schedule-image-assistant-table {
    max-height: 520px;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.schedule-image-assistant-table table {
    min-width: 920px;
}
.schedule-image-assistant-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.schedule-image-paste-zone {
    min-height: 74px;
    border: 1px dashed rgba(148,163,184,0.45);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15,23,42,0.02);
    cursor: text;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.schedule-image-paste-zone:focus,
.schedule-image-paste-zone:hover {
    border-color: rgba(255,106,0,0.55);
    background: rgba(255,106,0,0.05);
    box-shadow: 0 0 0 3px rgba(255,106,0,0.1);
    outline: none;
}
.schedule-image-paste-zone.has-image {
    border-style: solid;
    border-color: rgba(34,197,94,0.45);
    background: rgba(34,197,94,0.08);
}
.schedule-image-paste-zone i {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,106,0,0.12);
    color: #c2410c;
    font-size: 1.1rem;
    flex: 0 0 auto;
}
.schedule-image-paste-zone strong,
.schedule-image-paste-zone span {
    display: block;
}
.schedule-image-paste-zone span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 2px;
}
.schedule-ocr-raw {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(15,23,42,0.02);
}
.schedule-ocr-raw summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
}
.schedule-ocr-raw pre {
    margin: 8px 0 0;
    max-height: 180px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 0.75rem;
}
.subject-schedule-modal-content .modal-body {
    max-height: min(760px, calc(100vh - 150px));
    overflow: hidden;
}
.subject-schedule-modal-content #scheduleSelectedTableWrap {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: hidden;
}
.subject-schedule-modal-content .schedule-day-picker {
    grid-template-columns: repeat(4, minmax(54px, 1fr));
}
.schedule-row-editor-list {
    display: grid;
    gap: 12px;
    max-height: min(320px, 38vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-gutter: stable;
}
.schedule-row-editor {
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 10px;
    padding: 12px;
    background: rgba(15,23,42,0.18);
}
.schedule-row-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.schedule-row-editor-head strong {
    font-size: 0.86rem;
}
.schedule-remove-row-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.subject-schedule-modal-content {
    background: #111827;
    color: #e2e8f0;
}
.subject-schedule-modal-content .modal-header {
    border-bottom-color: rgba(255,255,255,0.12);
}
.subject-schedule-modal-content .modal-body {
    padding: 20px;
}
#subjectScheduleModal .modal-dialog {
    max-width: min(1500px, calc(100vw - 24px));
    margin-top: 12px;
    margin-bottom: 12px;
}
#subjectScheduleModal .modal-content {
    max-height: calc(100vh - 24px);
}
.subject-schedule-modal-grid {
    align-items: stretch;
    min-height: 0;
}
.subject-schedule-modal-grid > [class*="col-"] {
    min-height: 0;
}
#blockSubjectScheduleForm {
    max-height: min(680px, calc(100vh - 190px));
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}
.subject-schedule-table-panel {
    border-left: 1px solid rgba(255,255,255,0.12);
    padding-left: 22px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.subject-schedule-filter {
    max-width: 320px;
    min-height: 38px;
}
.subject-schedule-modal-content .form-label,
.subject-schedule-modal-content .admin-section-title {
    color: #e2e8f0;
}
.subject-schedule-modal-content #scheduleSelectedTableWrap {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: #0f172a;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(560px, calc(100vh - 265px));
}
.subject-schedule-modal-content table.app-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.subject-schedule-modal-content table.app-table th,
.subject-schedule-modal-content table.app-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}
.subject-schedule-modal-content table.app-table thead th {
    background: #0b1220;
    color: #e2e8f0;
}
.subject-schedule-modal-content table.app-table tbody td {
    background: #111827;
    color: #e2e8f0;
    vertical-align: top;
}
.subject-schedule-modal-content table.app-table th:nth-child(1),
.subject-schedule-modal-content table.app-table td:nth-child(1) {
    width: 28%;
}
.subject-schedule-modal-content table.app-table th:nth-child(2),
.subject-schedule-modal-content table.app-table td:nth-child(2) {
    width: 13%;
}
.subject-schedule-modal-content table.app-table th:nth-child(3),
.subject-schedule-modal-content table.app-table td:nth-child(3) {
    width: 17%;
}
.subject-schedule-modal-content table.app-table th:nth-child(4),
.subject-schedule-modal-content table.app-table td:nth-child(4) {
    width: 9%;
}
.subject-schedule-modal-content table.app-table th:nth-child(5),
.subject-schedule-modal-content table.app-table td:nth-child(5) {
    width: 10%;
}
.subject-schedule-modal-content table.app-table th:nth-child(6),
.subject-schedule-modal-content table.app-table td:nth-child(6) {
    width: 13%;
}
.subject-schedule-modal-content table.app-table th:nth-child(7),
.subject-schedule-modal-content table.app-table td:nth-child(7) {
    width: 9%;
}
.subject-schedule-modal-content .table-actions {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}
.subject-schedule-modal-content .table-actions form {
    display: block !important;
    flex: 0 0 auto;
}
.subject-schedule-modal-content .table-action-btn {
    width: 36px;
    height: 34px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 9px;
}
.subject-schedule-modal-content .table-action-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.subject-schedule-modal-content .table-action-btn i {
    margin: 0;
    font-size: 0.95rem;
}
.subject-schedule-modal-content .btn-action-danger {
    border-color: rgba(248,113,113,0.38);
    color: #fecaca;
    background: rgba(248,113,113,0.08);
}
.subject-schedule-modal-content .btn-action-danger:hover {
    color: #fff;
    background: rgba(220,38,38,0.85);
}
.subject-schedule-modal-content .badge-table-sm {
    display: inline-flex;
    min-width: 42px;
    justify-content: center;
}
html[data-theme="light"] .subject-schedule-modal-content {
    background: #fff;
    color: #0f172a;
}
html[data-theme="light"] .subject-schedule-modal-content .modal-header {
    border-bottom-color: rgba(15,23,42,0.12);
}
html[data-theme="light"] .subject-schedule-table-panel {
    border-left-color: rgba(15,23,42,0.12);
}
html[data-theme="light"] .subject-schedule-modal-content .form-label,
html[data-theme="light"] .subject-schedule-modal-content .admin-section-title {
    color: #0f172a;
}
html[data-theme="light"] .schedule-row-editor {
    background: #f8fafc;
    border-color: rgba(15,23,42,0.1);
}
html[data-theme="light"] .subject-schedule-modal-content #scheduleSelectedTableWrap {
    border-color: rgba(15,23,42,0.1);
    background: #fff;
}
html[data-theme="light"] .subject-schedule-modal-content table.app-table thead th {
    background: #f8fafc;
    color: #0f172a;
}
html[data-theme="light"] .subject-schedule-modal-content table.app-table tbody td {
    background: #fff;
    color: #0f172a;
}
html[data-theme="light"] .subject-schedule-modal-content .btn-action-danger {
    border-color: rgba(220,38,38,0.28);
    color: #b91c1c;
    background: rgba(254,226,226,0.65);
}
.block-roster-schedule-list {
    margin-bottom: 12px;
}
.schedule-preview-item--compact {
    border: 1px solid rgba(148,163,184,0.28);
    background: rgba(15,23,42,0.03);
}
.schedule-preview-item--compact span {
    color: #64748b;
    font-size: 0.78rem;
}
/* Block type: radio choices — visually distinct from primary action buttons */
.block-type-choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.block-type-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.14);
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.block-type-choice-card:hover {
    border-color: rgba(15,23,42,0.22);
    background: #fff;
}
.block-type-choice-card .form-check-input {
    flex-shrink: 0;
    margin-top: 0.35rem;
    margin-left: 0;
    float: none;
    width: 1.1em;
    height: 1.1em;
    border-width: 2px;
    cursor: pointer;
}
.block-type-choice-card .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(255,106,0,0.2);
}
.block-type-choice-card .form-check-input:checked {
    background-color: #ea580c;
    border-color: #ea580c;
}
.block-type-choice-card:has(.form-check-input:checked) {
    border-color: rgba(255,106,0,0.45);
    background: rgba(255,106,0,0.06);
    box-shadow: inset 0 0 0 1px rgba(255,106,0,0.12);
}
.block-type-choice-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    justify-content: center;
}
.block-type-choice-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: #0f172a;
    letter-spacing: 0.01em;
}
.block-type-choice-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
}
.block-type-choice-desc code {
    font-size: 0.68rem;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(15,23,42,0.06);
    color: #475569;
}
@media (max-width: 575.98px) {
    .block-type-choice-group {
        grid-template-columns: 1fr;
    }
}
.create-block-btn {
    min-width: 140px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(255,106,0,0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.create-block-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(255,106,0,0.3);
}
.blocks-target-wrap {
    overflow: visible;
    transition: max-height 0.22s ease, opacity 0.22s ease, transform 0.22s ease, margin 0.22s ease;
    max-height: 130px;
    opacity: 1;
    transform: translateY(0);
}
.blocks-target-collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}
.blocks-addon-mode {
    border: 1px solid rgba(255,106,0,0.35);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 0 20px rgba(255,106,0,0.15);
}
.blocks-addon-visible .admin-input {
    border-color: rgba(255,106,0,0.45);
}
.blocks-target-wrap {
    position: relative;
}
.blocks-target-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(100% + 4px);
    z-index: 1065;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.12);
    background: #fff;
    box-shadow: 0 14px 30px rgba(15,23,42,0.16);
}
.blocks-target-option {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(15,23,42,0.06);
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    font-size: 0.9rem;
    color: #0f172a;
}
.blocks-target-option:last-child {
    border-bottom: 0;
}
.blocks-target-option:hover {
    background: rgba(255,106,0,0.08);
}
.blocks-target-option.is-active {
    background: rgba(255, 106, 0, 0.14);
}
.blocks-insights-card {
    padding: 12px !important;
}
.blocks-insights-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.blocks-insights-toggle {
    padding: 3px 8px !important;
    font-size: .78rem !important;
}
.blocks-insight-panel {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    padding: 9px 10px;
    background: rgba(15,23,42,0.018);
    box-shadow: none;
}
.blocks-insight-title {
    margin: 0 0 6px;
    font-size: .86rem;
    font-weight: 800;
}
.blocks-insight-item {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(15,23,42,0.1);
    font-size: 0.82rem;
    line-height: 1.2;
}
.blocks-insight-item:last-child {
    border-bottom: 0;
}
.blocks-insight-grid .blocks-insight-panel-card {
    border-radius: 8px;
    padding: 9px 10px;
}
.blocks-insight-item-actionable {
    grid-template-columns: minmax(58px, .9fr) minmax(112px, 1fr) auto auto auto;
    align-items: center;
}
.blocks-insight-reason {
    color: #92400e;
    font-weight: 700;
}
.blocks-insight-item-simple {
    grid-template-columns: 1fr auto;
    align-items: center;
}
.blocks-insight-action {
    color: #c2410c;
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
}
.blocks-insight-action:hover {
    color: #9a3412;
    text-decoration: underline;
}
.blocks-insight-more {
    display: inline-flex;
    margin-top: 5px;
    color: #c2410c;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}
.blocks-insight-more:hover {
    color: #9a3412;
    text-decoration: underline;
}
.blocks-insight-note {
    margin-top: 5px;
    color: #64748b;
    font-size: .76rem;
    line-height: 1.25;
}
.blocks-insight-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.blocks-insight-btn {
    min-height: 30px;
    padding: 4px 8px !important;
    font-size: .78rem !important;
}
.blocks-overloaded-badge {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.14);
}
#assignSubjectsSelect option:disabled {
    color: #94a3b8;
    background: #f1f5f9;
}

html[data-theme="dark"] .blocks-addon-mode {
    border-color: rgba(251,146,60,0.4);
    box-shadow: 0 0 0 3px rgba(251,146,60,0.12);
}
html[data-theme="dark"] .blocks-target-suggestions {
    background: #0f172a;
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .blocks-target-option {
    color: #e2e8f0;
    border-bottom-color: rgba(255,255,255,0.06);
}
/* Subtitle lines inside suggestion buttons use .text-muted — default is too dark on #0f172a */
html[data-theme="dark"] .blocks-target-option .text-muted,
html[data-theme="dark"] #assignBlockSuggest .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .blocks-target-option.is-active .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .blocks-target-option .fw-semibold {
    color: #f8fafc;
}
html[data-theme="dark"] .blocks-target-option:hover {
    background: rgba(255,106,0,0.16);
}
html[data-theme="dark"] .blocks-target-option.is-active {
    background: rgba(251, 146, 60, 0.22);
}
html[data-theme="dark"] .block-type-choice-card {
    background: #111827;
    border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .block-type-choice-card:hover {
    border-color: rgba(255,255,255,0.18);
    background: #151d2e;
}
html[data-theme="dark"] .block-type-choice-card:has(.form-check-input:checked) {
    border-color: rgba(251,146,60,0.45);
    background: rgba(251,146,60,0.08);
    box-shadow: inset 0 0 0 1px rgba(251,146,60,0.15);
}
html[data-theme="dark"] .block-type-choice-title {
    color: #e2e8f0;
}
html[data-theme="dark"] .block-type-choice-desc {
    color: #94a3b8;
}
html[data-theme="dark"] .block-type-choice-desc code {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}
html[data-theme="dark"] .block-type-choice-card .form-check-input:checked {
    background-color: #ea580c;
    border-color: #ea580c;
}
html[data-theme="dark"] .blocks-name-preview {
    color: #fdba74;
}
html[data-theme="dark"] .schedule-day-chip {
    background: #111827;
    border-color: rgba(255,255,255,0.12);
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-day-chip:hover {
    background: rgba(251,146,60,0.1);
    border-color: rgba(251,146,60,0.42);
    color: #fdba74;
}
html[data-theme="dark"] .schedule-day-input:checked + .schedule-day-chip {
    background: rgba(251,146,60,0.16);
    border-color: #fb923c;
    color: #fed7aa;
    box-shadow: inset 0 0 0 1px rgba(251,146,60,0.22);
}
html[data-theme="dark"] .schedule-selected-state {
    border-color: rgba(255,255,255,0.14);
    background: rgba(148,163,184,0.04);
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-conflict-assistant {
    border-color: rgba(34,197,94,0.34);
    background: rgba(34,197,94,0.14);
    color: #86efac;
}
html[data-theme="dark"] .schedule-conflict-assistant.is-warning {
    border-color: rgba(249,115,22,0.38);
    background: rgba(249,115,22,0.14);
    color: #fdba74;
}
html[data-theme="dark"] .schedule-conflict-assistant.is-muted {
    border-color: rgba(255,255,255,0.14);
    background: rgba(148,163,184,0.04);
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-preview-item--compact {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.05);
}
html[data-theme="dark"] .schedule-preview-item--compact span {
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-image-assistant-preview,
html[data-theme="dark"] .schedule-image-assistant-table {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .schedule-image-paste-zone {
    border-color: rgba(255,255,255,0.16);
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .schedule-image-paste-zone:focus,
html[data-theme="dark"] .schedule-image-paste-zone:hover {
    border-color: rgba(251,146,60,0.55);
    background: rgba(251,146,60,0.1);
}
html[data-theme="dark"] .schedule-image-paste-zone.has-image {
    border-color: rgba(34,197,94,0.48);
    background: rgba(34,197,94,0.12);
}
html[data-theme="dark"] .schedule-image-paste-zone i {
    background: rgba(251,146,60,0.18);
    color: #fdba74;
}
html[data-theme="dark"] .schedule-image-paste-zone span {
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-ocr-raw {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .schedule-ocr-raw summary {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocks-create-card .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] #createBlockModal .text-muted {
    color: #e2e8f0 !important;
}
html[data-theme="dark"] #createBlockModal code.user-select-all {
    color: #fde68a;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #updateBlockModal .text-muted {
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .blocks-create-form-compact .is-readonly-input {
    background: #111827;
    border-color: rgba(148,163,184,0.32);
}
html[data-theme="dark"] .blocks-insight-panel {
    background: rgba(148,163,184,0.06);
    border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .blocks-insight-panel h6 {
    color: #f1f5f9;
}
html[data-theme="dark"] .blocks-insight-panel .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .blocks-insight-item {
    color: #e2e8f0;
    border-bottom-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .blocks-insight-action {
    color: #fdba74;
}
html[data-theme="dark"] .blocks-insight-reason {
    color: #fed7aa;
}
html[data-theme="dark"] .blocks-insight-more {
    color: #fdba74;
}
html[data-theme="dark"] .blocks-insight-note {
    color: #94a3b8;
}
html[data-theme="dark"] .blocks-overloaded-badge {
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18);
}
html[data-theme="dark"] .blocks-create-card,
html[data-theme="dark"] .blocks-create-card .fw-semibold,
html[data-theme="dark"] .blocks-create-card .form-label,
html[data-theme="dark"] .blocks-create-card .admin-section-title,
html[data-theme="dark"] .blocks-create-card .admin-section-subtext {
    color: #e2e8f0;
}
html[data-theme="dark"] #assignPreviewText,
html[data-theme="dark"] #assignBlockMetaText {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .admin-table thead th {
    color: #e2e8f0;
}
html[data-theme="dark"] .admin-table tbody td {
    color: #dbe4f3;
}
html[data-theme="dark"] .admin-table .text-muted {
    color: #b8c3d6 !important;
}
html[data-theme="dark"] #assignSubjectsSelect option:disabled {
    color: #64748b;
    background: #111827;
}

@media (max-width: 991.98px) {
    .subject-schedule-modal-content .modal-body {
        height: calc(100vh - 132px);
        overflow-y: auto;
    }
    .subject-schedule-modal-grid {
        height: auto;
    }
    #blockSubjectScheduleForm {
        max-height: none;
        overflow: visible;
    }
    .schedule-row-editor-list {
        max-height: 340px;
    }
    .subject-schedule-table-panel {
        border-left: 0;
        border-top: 1px solid rgba(148,163,184,0.24);
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-top: 16px;
    }
    .subject-schedule-filter {
        max-width: 100%;
    }
    .schedule-day-picker {
        grid-template-columns: repeat(4, minmax(54px, 1fr));
    }
    .blocks-insight-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .blocks-insight-item-actionable,
    .blocks-insight-item-simple {
        grid-template-columns: 1fr;
    }
    .blocks-insight-actions {
        grid-template-columns: 1fr;
    }
    .blocks-create-form-compact .form-label {
        margin-bottom: 0.35rem;
    }
    .create-block-btn {
        width: 100%;
    }
    .blocks-auto-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Blocking module enhancements */
.blocking-step-card {
    border-radius: 12px;
    --blocking-workbench-height: 812px;
}
.blocking-conflict-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(249,115,22,0.32);
    border-radius: 12px;
    background: rgba(249,115,22,0.08);
    padding: 10px 12px;
}
.blocking-conflict-strip-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #9a3412;
    font-size: 0.86rem;
}
.blocking-conflict-strip-copy i,
.blocking-conflict-strip-copy strong {
    color: #c2410c;
}
.blocking-conflict-strip-copy span {
    color: #64748b;
    font-weight: 600;
}
.blocking-workbench-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.blocking-student-search {
    min-height: 44px;
    font-size: 0.95rem;
}
.blocking-student-dropdown {
    position: absolute;
    z-index: 20;
    margin-top: 6px;
    width: min(420px, 100%);
    max-height: 260px;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid rgba(15,23,42,0.12);
    background: #111827;
    box-shadow: 0 14px 30px rgba(0,0,0,0.3);
    padding: 6px;
}
.blocking-student-option {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #e2e8f0;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.blocking-student-option:hover {
    background: rgba(255,106,0,0.18);
    color: #fff;
}
.blocking-student-summary {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15,23,42,0.02);
}
.blocking-student-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(59,130,246,0.12);
    color: #2563eb;
    font-size: 1.15rem;
}
.blocking-student-profile {
    min-width: 0;
    flex: 1 1 auto;
}
.blocking-student-profile strong,
.blocking-student-profile span,
.blocking-student-term small,
.blocking-student-term strong {
    display: block;
}
.blocking-student-profile strong {
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.blocking-student-profile span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 2px;
}
.blocking-student-term {
    flex: 0 0 auto;
    text-align: right;
}
.blocking-student-summary small {
    display: block;
    color: #64748b;
    font-size: 0.7rem;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blocking-student-term strong {
    font-size: 0.84rem;
}
.blocking-student-status-badge {
    flex: 0 0 auto;
    font-size: 0.84rem;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 8px;
    font-weight: 800;
}
.blocking-mode-hint {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,106,0,0.08);
    color: #9a3412;
    font-size: 0.9rem;
}
.blocking-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 8px;
}
.blocking-blocks-empty-state {
    grid-column: 1 / -1;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px dashed rgba(15, 23, 42, 0.22);
    background: rgba(15, 23, 42, 0.03);
}
.blocking-blocks-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 106, 0, 0.12);
    color: #c2410c;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.blocking-blocks-empty-title {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0f172a;
}
.blocking-blocks-empty-text {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0;
    line-height: 1.45;
}
.blocking-block-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    text-align: left;
    padding: 10px 11px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    color: #0f172a;
}
.blocking-block-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}
.blocking-block-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.25;
    text-align: left;
}
.blocking-block-card-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    margin-bottom: 6px;
}
.blocking-block-card-load {
    color: #475569;
    font-weight: 600;
}
.blocking-block-card-status {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blocking-block-status--ok { color: #15803d; }
.blocking-block-status--warn { color: #b45309; }
.blocking-block-status--full { color: #b91c1c; }
.blocking-block-card-foot {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    padding-top: 5px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.blocking-block-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,106,0,0.45);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.blocking-block-card.selected {
    border-color: rgba(255,106,0,0.85);
    box-shadow: 0 0 0 3px rgba(255,106,0,0.2), 0 8px 22px rgba(255,106,0,0.12);
}
.blocking-block-card-view {
    min-width: 64px;
}
html[data-theme="dark"] .blocking-block-card-view,
html[data-theme="dark"] .blocking-block-card-view:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.45);
}
html[data-theme="dark"] .blocking-block-card-view:hover {
    background: rgba(255, 255, 255, 0.08);
}
html[data-theme="light"] .blocking-block-card-view {
    color: var(--bs-body-color);
}
.blocking-capacity-popup,
.blocking-leave-popup {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.blocking-capacity-popup.is-visible,
.blocking-leave-popup.is-visible {
    display: flex;
}
.blocking-capacity-popup-backdrop,
.blocking-leave-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.54);
}
.blocking-capacity-popup-panel,
.blocking-leave-popup-panel {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.blocking-leave-popup-panel {
    border-color: rgba(249, 115, 22, 0.34);
}
.blocking-capacity-popup-body,
.blocking-leave-popup-body {
    display: flex;
    gap: 14px;
    padding: 20px;
}
.blocking-capacity-modal-icon,
.blocking-leave-modal-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    font-size: 1.25rem;
}
.blocking-leave-modal-icon {
    background: rgba(249, 115, 22, 0.13);
    color: #ea580c;
}
.blocking-capacity-modal-copy,
.blocking-leave-modal-copy {
    min-width: 0;
}
.blocking-capacity-modal-kicker,
.blocking-leave-modal-kicker {
    margin: 0 0 4px;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.blocking-leave-modal-kicker {
    color: #c2410c;
}
.blocking-capacity-popup-title,
.blocking-leave-popup-title {
    color: #0f172a;
    margin: 0;
    font-weight: 800;
    line-height: 1.25;
}
.blocking-capacity-modal-text,
.blocking-leave-modal-text {
    margin: 8px 0 0;
    color: #475569;
    line-height: 1.5;
}
.blocking-capacity-popup-footer,
.blocking-leave-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 12px 20px 16px;
}
.blocking-subject-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    min-height: 116px;
    background: rgba(15,23,42,0.01);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.blocking-subject-panel {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    flex: 1 1 auto;
    height: var(--blocking-workbench-height);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.blocking-section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.blocking-section-label span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}
.blocking-subject-toolbar {
    position: relative;
    top: auto;
    z-index: 1;
    background: inherit;
    padding-bottom: 8px;
}
.blocking-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.blocking-subject-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,0.55) transparent;
}
.blocking-subject-list::-webkit-scrollbar {
    width: 10px;
}
.blocking-subject-list::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}
.blocking-subject-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(148,163,184,0.9), rgba(100,116,139,0.9));
    border: 2px solid rgba(255,255,255,0.95);
    border-radius: 999px;
}
.blocking-subject-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(100,116,139,0.95), rgba(71,85,105,0.95));
}
.blocking-subject-list .row {
    --bs-gutter-x: 0.75rem;
    margin-left: 0;
    margin-right: 0;
}
.blocking-subject-list .row > [class*="col-"] {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}
.blocking-subject-group-title {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    margin: 8px 0 6px;
}
.blocking-subject-main {
    flex: 1;
    min-width: 0;
}
.blocking-subject-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    line-height: 1.1;
}
.blocking-subject-title-row strong {
    color: #0f172a;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}
.blocking-subject-title-badges-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.blocking-subject-title {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
}
.blocking-subject-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0;
}
.subject-chip,
.blocking-subject-badges .badge {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}
.subject-chip {
    color: #334155;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
}
.blocking-ai-badge {
    border: 1px solid rgba(59,130,246,0.36);
    background: rgba(59,130,246,0.1);
    color: #1d4ed8;
    white-space: nowrap;
    position: absolute;
    top: 10px;
    right: 12px;
}
.blocking-subject-badges .badge {
    padding: 0.2rem 0.65rem;
}
.blocking-capacity-line {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.blocking-capacity-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.35);
    overflow: hidden;
}
.blocking-capacity-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
}
.blocking-capacity-bar > .capacity-green { background: #22c55e; }
.blocking-capacity-bar > .capacity-orange { background: #f97316; }
.blocking-capacity-bar > .capacity-red { background: #ef4444; }
.blocking-capacity-line small {
    font-weight: 700;
    color: #475569;
    min-width: 54px;
    text-align: right;
}
.blocking-capacity-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 5px 10px;
    margin-top: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.blocking-capacity-counts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    min-width: 0;
}
.blocking-subject-actions {
    align-self: center;
}
.blocking-subject-card.is-selected {
    border-color: rgba(255,106,0,0.85);
    box-shadow: 0 0 0 3px rgba(255,106,0,0.16), 0 10px 22px rgba(255,106,0,0.08);
    background: rgba(255,106,0,0.04);
}
.blocking-subject-card.is-suggested {
    border-color: rgba(59,130,246,0.45);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.blocking-subject-card.is-suggested .blocking-subject-title-row {
    padding-right: 96px;
}
.blocking-subject-card.is-disabled {
    opacity: 0.6;
}
.blocking-already-selected {
    color: #b45309;
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
    text-align: right;
}
.blocking-load-more-wrap {
    text-align: center;
    padding-top: 8px;
}
.blocking-empty-state {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    color: #64748b;
    font-weight: 600;
    margin-top: 8px;
}
.blocking-subject-card:hover {
    border-color: rgba(255,106,0,0.35);
    background: rgba(255,106,0,0.03);
    transform: translateY(-1px);
}
.blocking-reason-select {
    min-width: 135px;
}
.blocking-subject-meta {
    margin-top: 4px;
    color: #64748b;
    font-weight: 500;
}
.blocking-chip-box {
    min-height: 72px;
    max-height: 112px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    background: rgba(15,23,42,0.01);
    overflow-y: auto;
}
.blocking-chip {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255,106,0,0.12);
    color: #c2410c;
    animation: blockingChipIn 0.2s ease;
    border: 0;
}
.blocking-selected-tray {
    position: sticky;
    top: 86px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15,23,42,0.02);
    padding: 12px;
    gap: 12px;
    height: var(--blocking-workbench-height);
    overflow: hidden;
}
.blocking-assignment-row {
    align-items: stretch;
    --bs-gutter-x: 1rem;
}
.blocking-subject-column {
    display: flex;
    flex-direction: column;
}
.blocking-preview-column {
    display: flex;
    align-self: stretch;
    padding-top: 26px;
}
.blocking-preview-column .blocking-selected-tray {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.blocking-tray-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    padding: 10px;
}
.blocking-tray-section--selected {
    flex: 0 0 auto;
}
.blocking-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.blocking-preview-column .blocking-schedule-preview {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#blockingSchedulePreviewBox {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.blocking-preview-column .blocking-selected-tray > .d-flex.justify-content-lg-end {
    margin-top: auto !important;
    padding-top: 16px;
}
.blocking-save-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 4px;
}
.blocking-save-actions .btn {
    width: 100%;
    min-height: 44px;
}
.blocking-irregular-schedule-upload summary {
    cursor: pointer;
    color: #64748b;
    font-weight: 800;
    font-size: 0.82rem;
    list-style: none;
}
.blocking-irregular-schedule-upload summary::-webkit-details-marker {
    display: none;
}
.blocking-review-card {
    margin-top: -10px;
}
.blocking-review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.blocking-review-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(148,163,184,0.28);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(148,163,184,0.08);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
.blocking-review-status.is-complete {
    border-color: rgba(34,197,94,0.28);
    background: rgba(34,197,94,0.08);
    color: #15803d;
}
.blocking-review-status.is-incomplete {
    border-color: rgba(249,115,22,0.34);
    background: rgba(249,115,22,0.1);
    color: #c2410c;
}
.blocking-review-status.is-muted {
    border-color: rgba(148,163,184,0.28);
    background: rgba(148,163,184,0.08);
    color: #64748b;
}
.blocking-review-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.blocking-review-item {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: rgba(15,23,42,0.02);
}
.blocking-review-item small {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 3px;
}
.blocking-review-item strong {
    display: block;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.blocking-review-note {
    margin-top: 8px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}
.blocking-action-footer {
    position: sticky;
    bottom: 12px;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.86);
    box-shadow: 0 18px 42px rgba(15,23,42,0.18);
    backdrop-filter: blur(14px);
}
.blocking-action-footer-copy,
.blocking-action-footer-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.blocking-action-footer-copy strong,
.blocking-action-footer-copy span {
    min-width: 0;
    font-weight: 800;
}
.blocking-action-footer-copy span:not(.blocking-footer-step) {
    color: #64748b;
    font-size: 0.82rem;
}
.blocking-action-footer-copy .blocking-subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    max-width: min(720px, 100%);
}
.blocking-action-footer-copy .review-subject-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.blocking-action-footer-copy .review-subject-chip.selected {
    color: #0f5132;
    background: #d1fae5;
    border-color: #86efac;
}
.blocking-action-footer-copy .review-subject-chip.muted {
    color: #475569;
    background: rgba(148,163,184,0.12);
    border-color: rgba(148,163,184,0.24);
}
.blocking-footer-step {
    color: #c2410c;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
@keyframes blockingChipIn {
    from { transform: translateY(4px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

html[data-theme="dark"] .blocking-student-summary,
html[data-theme="dark"] .blocking-subject-card,
html[data-theme="dark"] .blocking-review-item {
    border-color: rgba(255,255,255,0.08);
    background: rgba(148,163,184,0.05);
}
html[data-theme="dark"] .blocking-conflict-strip {
    border-color: rgba(249,115,22,0.34);
    background: rgba(249,115,22,0.12);
}
html[data-theme="dark"] .blocking-conflict-strip-copy,
html[data-theme="dark"] .blocking-conflict-strip-copy i,
html[data-theme="dark"] .blocking-conflict-strip-copy strong {
    color: #fdba74;
}
html[data-theme="dark"] .blocking-conflict-strip-copy span,
html[data-theme="dark"] .blocking-section-label span {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-student-avatar {
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
}
html[data-theme="dark"] .blocking-student-profile strong,
html[data-theme="dark"] .blocking-subject-title-row strong {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-student-profile span,
html[data-theme="dark"] .blocking-subject-title {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-ai-badge {
    border-color: rgba(96,165,250,0.42);
    background: rgba(59,130,246,0.18);
    color: #bfdbfe;
}
html[data-theme="dark"] .blocking-subject-panel {
    background: transparent;
    border-color: transparent;
}
html[data-theme="dark"] .blocking-subject-group-title,
html[data-theme="dark"] .blocking-empty-state {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-subject-list {
    scrollbar-color: #2a3442 #141a23;
}
html[data-theme="dark"] .blocking-subject-list::-webkit-scrollbar-track {
    background: #141a23;
}
html[data-theme="dark"] .blocking-subject-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2c3644, #232c39);
    border-color: #141a23;
}
html[data-theme="dark"] .blocking-subject-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #344152, #293444);
}
html[data-theme="dark"] .blocking-subject-badges .badge {
    background: rgba(148,163,184,0.16) !important;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.14) !important;
}
html[data-theme="dark"] .blocking-subject-badges .badge.text-bg-success {
    background: rgba(34,197,94,0.22) !important;
    color: #bbf7d0 !important;
    border-color: rgba(34,197,94,0.42) !important;
}
html[data-theme="dark"] .blocking-subject-badges .badge.text-bg-warning {
    background: rgba(251,191,36,0.24) !important;
    color: #fde68a !important;
    border-color: rgba(251,191,36,0.42) !important;
}
html[data-theme="dark"] .blocking-subject-badges .badge.text-bg-danger {
    background: rgba(239,68,68,0.24) !important;
    color: #fecaca !important;
    border-color: rgba(239,68,68,0.42) !important;
}
html[data-theme="dark"] .blocking-capacity-line small {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-capacity-breakdown {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-already-selected {
    color: #fdba74;
}
html[data-theme="dark"] .blocking-student-dropdown {
    border-color: rgba(255,255,255,0.1);
    background: #0b1220;
}
html[data-theme="dark"] .blocking-mode-hint {
    background: rgba(255,106,0,0.18);
    color: #fdba74;
}
html[data-theme="dark"] .blocking-blocks-empty-state {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(148, 163, 184, 0.06);
}
html[data-theme="dark"] .blocking-blocks-empty-icon {
    background: rgba(251, 146, 60, 0.18);
    color: #fdba74;
}
html[data-theme="dark"] .blocking-blocks-empty-title {
    color: #f1f5f9;
}
html[data-theme="dark"] .blocking-blocks-empty-text {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-block-card {
    background: #1b2130;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .blocking-block-card-name {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-block-card-load {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-block-status--ok { color: #86efac; }
html[data-theme="dark"] .blocking-block-status--warn { color: #fcd34d; }
html[data-theme="dark"] .blocking-block-status--full { color: #fca5a5; }
html[data-theme="dark"] .blocking-block-card-foot {
    color: #94a3b8;
    border-top-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .blocking-block-card:hover {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .blocking-block-card.selected {
    border-color: rgba(251, 146, 60, 0.75);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.18), 0 10px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .blocking-capacity-popup-backdrop,
html[data-theme="dark"] .blocking-leave-popup-backdrop {
    background: rgba(0, 0, 0, 0.62);
}
html[data-theme="dark"] .blocking-capacity-popup-panel,
html[data-theme="dark"] .blocking-leave-popup-panel {
    background: #171d29;
    border-color: rgba(248, 113, 113, 0.42);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.62);
}
html[data-theme="dark"] .blocking-leave-popup-panel {
    border-color: rgba(251, 146, 60, 0.46);
}
html[data-theme="dark"] .blocking-capacity-modal-icon {
    background: rgba(248, 113, 113, 0.16);
    color: #fca5a5;
}
html[data-theme="dark"] .blocking-leave-modal-icon {
    background: rgba(251, 146, 60, 0.16);
    color: #fdba74;
}
html[data-theme="dark"] .blocking-capacity-modal-kicker {
    color: #fca5a5;
}
html[data-theme="dark"] .blocking-leave-modal-kicker {
    color: #fdba74;
}
html[data-theme="dark"] .blocking-capacity-popup-title,
html[data-theme="dark"] .blocking-leave-popup-title {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-capacity-modal-text,
html[data-theme="dark"] .blocking-leave-modal-text {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-capacity-popup-footer,
html[data-theme="dark"] .blocking-leave-popup-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .blocking-chip-box {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .blocking-selected-tray,
html[data-theme="dark"] .blocking-tray-section {
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .blocking-selected-tray {
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .blocking-tray-section {
    background: rgba(15,23,42,0.26);
}
html[data-theme="dark"] .blocking-selected-tray .text-muted,
html[data-theme="dark"] .blocking-step-card .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .blocking-chip {
    background: rgba(255,106,0,0.22);
    color: #fdba74;
}
html[data-theme="dark"] .blocking-review-status {
    border-color: rgba(148,163,184,0.24);
    background: rgba(148,163,184,0.12);
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-review-status.is-complete {
    border-color: rgba(34,197,94,0.34);
    background: rgba(34,197,94,0.14);
    color: #86efac;
}
html[data-theme="dark"] .blocking-review-status.is-incomplete {
    border-color: rgba(249,115,22,0.42);
    background: rgba(249,115,22,0.16);
    color: #fdba74;
}
html[data-theme="dark"] .blocking-review-status.is-muted {
    border-color: rgba(148,163,184,0.24);
    background: rgba(148,163,184,0.12);
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-action-footer {
    border-color: rgba(255,255,255,0.12);
    background: rgba(17,24,39,0.9);
    box-shadow: 0 18px 48px rgba(0,0,0,0.42);
}
html[data-theme="dark"] .blocking-action-footer-copy strong {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-action-footer-copy span:not(.blocking-footer-step),
html[data-theme="dark"] .blocking-irregular-schedule-upload summary {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-action-footer-copy .blocking-subject-list {
    gap: 6px;
}
html[data-theme="dark"] .blocking-action-footer-copy .review-subject-chip.selected {
    color: #d1fae5;
    background: rgba(110,231,183,0.16);
    border-color: rgba(110,231,183,0.32);
}
html[data-theme="dark"] .blocking-action-footer-copy .review-subject-chip.muted {
    color: #94a3b8;
    background: rgba(148,163,184,0.14);
    border-color: rgba(148,163,184,0.28);
}
html[data-theme="dark"] .blocking-footer-step {
    color: #fdba74;
}
html[data-theme="dark"] .blocking-review-item small,
html[data-theme="dark"] .blocking-review-note {
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-review-item strong {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-subject-meta {
    color: #cbd5e1;
}

.blocking-schedule-tools,
.blocking-suggestion-box,
.blocking-preference-panel,
.blocking-conflict-override {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15,23,42,0.02);
}
.blocking-preference-panel--collapsible {
    padding: 0;
    overflow: hidden;
}
.blocking-preference-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    color: #0f172a;
    font-weight: 800;
    list-style: none;
}
.blocking-preference-summary::-webkit-details-marker {
    display: none;
}
.blocking-preference-summary::after {
    content: "+";
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(148,163,184,0.28);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 900;
}
.blocking-preference-panel--collapsible[open] .blocking-preference-summary {
    border-bottom: 1px solid var(--border);
}
.blocking-preference-panel--collapsible[open] .blocking-preference-summary::after {
    content: "-";
}
.blocking-preference-panel--collapsible > .row {
    padding: 12px;
}
.blocking-free-day-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.blocking-free-day-btn {
    min-width: 48px;
    font-weight: 700;
}
.blocking-time-request {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}
.blocking-time-request-input {
    min-width: 0;
}
.blocking-preference-check {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.blocking-sda-badge {
    background: #0f766e;
    color: #fff;
}
.blocking-suggestion-box.is-ok {
    border-color: rgba(34,197,94,0.35);
}
.blocking-suggestion-box.is-applied {
    border-color: rgba(34,197,94,0.5);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.blocking-suggestion-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.blocking-suggestion-schedule-preview .schedule-grid-wrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.blocking-suggestion-schedule-preview .schedule-grid {
    font-size: 0.64rem;
}
.blocking-suggestion-schedule-preview .schedule-grid th,
.blocking-suggestion-schedule-preview .schedule-grid td {
    height: 24px;
}
.blocking-suggestion-box.is-warning,
.blocking-conflict-warning {
    border-color: rgba(249,115,22,0.45);
    background: rgba(249,115,22,0.1);
}
.blocking-conflict-warning {
    border: 1px solid rgba(249,115,22,0.45);
    border-radius: 10px;
    padding: 10px;
    color: #9a3412;
    font-weight: 700;
    font-size: 0.82rem;
}
.schedule-grid-wrap {
    width: 100%;
    overflow-x: auto;
}
.schedule-grid-empty {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px;
    color: #64748b;
    font-weight: 600;
}
.schedule-grid {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.72rem;
}
.schedule-grid th,
.schedule-grid td {
    border: 1px solid rgba(148,163,184,0.32);
    height: 30px;
    padding: 3px;
    vertical-align: top;
}
.schedule-grid thead th,
.schedule-grid tbody th {
    background: rgba(15,23,42,0.05);
    font-weight: 700;
    white-space: nowrap;
}
.schedule-grid-event {
    min-height: 100%;
    border-radius: 7px;
    padding: 5px 6px;
    color: #0f172a;
    line-height: 1.15;
    overflow: hidden;
}
.schedule-grid-event strong,
.schedule-grid-event span,
.schedule-grid-event small {
    display: block;
}
.schedule-grid-event small {
    opacity: 0.86;
}
.schedule-grid-event--1 { background: #fed7aa; }
.schedule-grid-event--2 { background: #bbf7d0; }
.schedule-grid-event--3 { background: #bfdbfe; }
.schedule-grid-event--4 { background: #fde68a; }
.schedule-grid-event--5 { background: #fecaca; }
.schedule-grid-event--6 { background: #ddd6fe; }
.schedule-grid-event--7 { background: #a7f3d0; }
.schedule-grid-event--8 { background: #fbcfe8; }
.student-schedule-grid {
    min-width: 980px;
    border: 2px solid #020617;
    background: #fff;
    color: #020617;
    font-size: 0.68rem;
}
.student-schedule-grid th,
.student-schedule-grid td {
    border-color: #020617;
    height: 28px;
    padding: 2px;
}
.student-schedule-grid thead th {
    background: #020617;
    color: #fff;
    text-align: center;
    font-size: 0.92rem;
}
.student-schedule-grid tbody th {
    width: 112px;
    background: #fff;
    color: #020617;
    font-weight: 500;
    text-align: center;
    font-size: 0.62rem;
}
.student-schedule-grid tbody tr:nth-child(odd) td {
    background-image: linear-gradient(to bottom, transparent calc(100% - 1px), rgba(2,6,23,0.18) calc(100% - 1px));
}
.student-schedule-grid .schedule-grid-event-cell {
    padding: 0;
    background: #ff0;
}
.student-schedule-event {
    min-height: 100%;
    height: 100%;
    border-radius: 0;
    border: 1px solid #020617;
    background: #ff0;
    color: #020617;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    text-align: center;
    font-weight: 700;
}
.student-schedule-event-main,
.student-schedule-event-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 3px;
}
.student-schedule-event-main {
    border-right: 1px solid #020617;
}
.student-schedule-event + .student-schedule-event {
    margin-top: 2px;
}
.student-schedule-event strong,
.student-schedule-event span,
.student-schedule-event small {
    color: #020617;
    font-size: 0.58rem;
    line-height: 1.05;
}
.student-schedule-event strong {
    font-size: 0.62rem;
}
.student-schedule-event-meta small + small {
    border-top: 1px solid #020617;
    margin-top: 2px;
    padding-top: 3px;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap {
    max-height: 390px;
    overflow: auto;
    border-radius: 8px;
}
.schedule-summary-preview {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.schedule-summary-status {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.82rem;
    font-weight: 800;
}
.schedule-summary-status.is-ok {
    border: 1px solid rgba(34,197,94,0.26);
    background: rgba(34,197,94,0.08);
    color: #15803d;
}
.schedule-summary-status.is-warning {
    border: 1px solid rgba(249,115,22,0.34);
    background: rgba(249,115,22,0.1);
    color: #c2410c;
}
.schedule-summary-list {
    display: grid;
    align-content: start;
    gap: 7px;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}
.schedule-summary-day {
    position: sticky;
    top: 0;
    z-index: 1;
    margin-top: 2px;
    padding: 2px 0;
    background: var(--card);
}
.schedule-summary-day span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(148,163,184,0.14);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.schedule-summary-item {
    display: grid;
    grid-template-columns: minmax(118px, 0.38fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    min-height: 72px;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 10px;
    background: rgba(15,23,42,0.02);
    overflow: hidden;
}
.schedule-summary-time {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 8px;
    background: rgba(255,106,0,0.1);
    color: #9a3412;
    overflow: visible;
}
.schedule-summary-item--2 .schedule-summary-time { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.schedule-summary-item--3 .schedule-summary-time { background: rgba(34,197,94,0.12); color: #15803d; }
.schedule-summary-item--4 .schedule-summary-time { background: rgba(168,85,247,0.12); color: #7e22ce; }
.schedule-summary-item--5 .schedule-summary-time { background: rgba(14,165,233,0.12); color: #0369a1; }
.schedule-summary-item--6 .schedule-summary-time { background: rgba(234,179,8,0.14); color: #854d0e; }
.schedule-summary-item.is-conflict {
    border-color: rgba(239,68,68,0.62);
    box-shadow: inset 3px 0 0 #ef4444;
}
.schedule-summary-item.is-conflict .schedule-summary-time {
    background: rgba(239,68,68,0.14);
    color: #b91c1c;
}
.schedule-summary-conflict {
    color: #b91c1c !important;
    font-weight: 900 !important;
}
.schedule-summary-time strong,
.schedule-summary-subject strong {
    line-height: 1.12;
}
.schedule-summary-time span,
.schedule-summary-subject span,
.schedule-summary-subject small {
    display: block;
    line-height: 1.25;
}
.schedule-summary-time span {
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: anywhere;
}
.schedule-summary-subject {
    min-width: 0;
    padding: 9px 10px 9px 0;
    align-self: center;
}
.schedule-summary-subject strong {
    display: block;
    color: #0f172a;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}
.schedule-summary-subject span {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
}
.schedule-summary-subject small {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
}
#studentSchedulePreviewModal .schedule-grid-wrap {
    max-height: none;
}
.schedule-preview-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.schedule-preview-item {
    border-radius: 9px;
    padding: 8px 10px;
    color: #0f172a;
}
.schedule-preview-item strong,
.schedule-preview-item span,
.schedule-preview-item small {
    display: block;
}
html[data-theme="dark"] .blocking-schedule-tools,
html[data-theme="dark"] .blocking-suggestion-box,
html[data-theme="dark"] .blocking-preference-panel,
html[data-theme="dark"] .blocking-conflict-override {
    border-color: rgba(255,255,255,0.12);
    background: rgba(148,163,184,0.04);
}
html[data-theme="dark"] .blocking-conflict-warning {
    color: #fdba74;
    background: rgba(249,115,22,0.16);
}
html[data-theme="dark"] .blocking-preference-summary {
    color: #f8fafc;
}
html[data-theme="dark"] .blocking-preference-summary::after {
    border-color: rgba(255,255,255,0.16);
    color: #cbd5e1;
}
html[data-theme="dark"] .blocking-preference-panel--collapsible[open] .blocking-preference-summary {
    border-bottom-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .schedule-grid-empty {
    border-color: rgba(255,255,255,0.12);
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-summary-status.is-ok {
    border-color: rgba(34,197,94,0.34);
    background: rgba(34,197,94,0.14);
    color: #86efac;
}
html[data-theme="dark"] .schedule-summary-status.is-warning {
    border-color: rgba(249,115,22,0.38);
    background: rgba(249,115,22,0.14);
    color: #fdba74;
}
html[data-theme="dark"] .schedule-summary-item {
    border-color: rgba(255,255,255,0.1);
    background: rgba(148,163,184,0.05);
}
html[data-theme="dark"] .schedule-summary-day {
    background: #151922;
}
html[data-theme="dark"] .schedule-summary-day span {
    background: rgba(148,163,184,0.14);
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-summary-time {
    background: rgba(251,146,60,0.16);
    color: #fdba74;
}
html[data-theme="dark"] .schedule-summary-item--2 .schedule-summary-time { background: rgba(59,130,246,0.18); color: #bfdbfe; }
html[data-theme="dark"] .schedule-summary-item--3 .schedule-summary-time { background: rgba(34,197,94,0.16); color: #86efac; }
html[data-theme="dark"] .schedule-summary-item--4 .schedule-summary-time { background: rgba(168,85,247,0.18); color: #d8b4fe; }
html[data-theme="dark"] .schedule-summary-item--5 .schedule-summary-time { background: rgba(14,165,233,0.18); color: #bae6fd; }
html[data-theme="dark"] .schedule-summary-item--6 .schedule-summary-time { background: rgba(234,179,8,0.16); color: #fde68a; }
html[data-theme="dark"] .schedule-summary-item.is-conflict {
    border-color: rgba(248,113,113,0.7);
    box-shadow: inset 3px 0 0 #f87171;
}
html[data-theme="dark"] .schedule-summary-item.is-conflict .schedule-summary-time {
    background: rgba(248,113,113,0.18);
    color: #fecaca;
}
html[data-theme="dark"] .schedule-summary-conflict {
    color: #fecaca !important;
}
html[data-theme="dark"] .schedule-summary-subject strong {
    color: #f8fafc;
}
html[data-theme="dark"] .schedule-summary-subject span,
html[data-theme="dark"] .schedule-summary-subject small {
    color: #cbd5e1;
}
html[data-theme="dark"] .schedule-grid th,
html[data-theme="dark"] .schedule-grid td {
    border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .schedule-grid thead th,
html[data-theme="dark"] .schedule-grid tbody th {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}
html[data-theme="dark"] .student-schedule-grid {
    border-color: #020617;
    background: #fff;
    color: #020617;
}
html[data-theme="dark"] .student-schedule-grid th,
html[data-theme="dark"] .student-schedule-grid td {
    border-color: #020617;
}
html[data-theme="dark"] .student-schedule-grid thead th {
    background: #020617;
    color: #fff;
}
html[data-theme="dark"] .student-schedule-grid tbody th {
    background: #fff;
    color: #020617;
}
html[data-theme="dark"] .student-schedule-grid .schedule-grid-event-cell,
html[data-theme="dark"] .student-schedule-event {
    background: #ff0;
    color: #020617;
}

/*
 * Schedule preview polish: theme tokens keep warnings, success, and actions distinct
 * while preserving the existing dark SaaS shell and a readable light mode.
 */
.blocking-schedule-preview {
    --schedule-surface: #ffffff;
    --schedule-surface-soft: #f8fafc;
    --schedule-border: rgba(15,23,42,0.1);
    --schedule-text: #0f172a;
    --schedule-muted: #64748b;
    --schedule-success: #5fbf7a;
    --schedule-success-bg: rgba(95,191,122,0.12);
    --schedule-success-border: rgba(95,191,122,0.36);
    --schedule-warning-bg: #fff7ed;
    --schedule-warning-border: rgba(180,83,9,0.28);
    --schedule-warning-text: #92400e;
    --schedule-action: #f97316;
    --schedule-action-strong: #ea580c;
}
html[data-theme="dark"] .blocking-schedule-preview {
    --schedule-surface: #171b24;
    --schedule-surface-soft: #111722;
    --schedule-border: rgba(226,232,240,0.1);
    --schedule-text: #f8fafc;
    --schedule-muted: #a7b3c4;
    --schedule-success-bg: rgba(95,191,122,0.13);
    --schedule-success-border: rgba(95,191,122,0.42);
    --schedule-warning-bg: #3a2416;
    --schedule-warning-border: rgba(251,191,36,0.28);
    --schedule-warning-text: #fde68a;
}
.blocking-preview-column .blocking-schedule-preview {
    border-color: var(--schedule-border);
    background: linear-gradient(180deg, var(--schedule-surface), var(--schedule-surface-soft));
    padding: 14px;
    box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}
html[data-theme="dark"] .blocking-preview-column .blocking-schedule-preview {
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}
.schedule-preview-head {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.schedule-preview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.schedule-preview-title-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff7ed;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 8px 22px rgba(249,115,22,0.26);
    flex: 0 0 auto;
}
.schedule-preview-title label {
    color: var(--schedule-text);
    line-height: 1.1;
}
.schedule-preview-title small {
    display: block;
    margin-top: 3px;
    color: var(--schedule-muted);
    font-size: 0.73rem;
    font-weight: 700;
}
.schedule-preview-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.blocking-preview-action {
    border-color: var(--schedule-border);
    background: rgba(148,163,184,0.08);
    color: var(--schedule-muted);
    font-weight: 800;
}
.blocking-preview-action:hover,
.blocking-preview-action:focus {
    border-color: rgba(249,115,22,0.28);
    background: rgba(249,115,22,0.1);
    color: var(--schedule-action-strong);
    transform: translateY(-1px);
}
html[data-theme="dark"] .blocking-preview-action:hover,
html[data-theme="dark"] .blocking-preview-action:focus {
    color: #fed7aa;
}
.blocking-conflict-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(180,83,9,0.28);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff7ed;
    color: #92400e;
    box-shadow: 0 10px 26px rgba(180,83,9,0.1);
    line-height: 1.45;
}
.blocking-conflict-warning i {
    margin-top: 2px;
    color: #d97706;
    flex: 0 0 auto;
}
html[data-theme="dark"] .blocking-conflict-warning {
    border-color: rgba(251,191,36,0.28);
    background: #3a2416;
    color: #fde68a;
    box-shadow: 0 14px 32px rgba(0,0,0,0.24);
}
html[data-theme="dark"] .blocking-conflict-warning i {
    color: #fbbf24;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap,
.schedule-summary-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,0.55) transparent;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap::-webkit-scrollbar,
.schedule-summary-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap::-webkit-scrollbar-track,
.schedule-summary-list::-webkit-scrollbar-track {
    background: transparent;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap::-webkit-scrollbar-thumb,
.schedule-summary-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(100,116,139,0.48);
    background-clip: padding-box;
}
.blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap::-webkit-scrollbar-thumb:hover,
.schedule-summary-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(249,115,22,0.66);
}
.schedule-summary-preview {
    gap: 12px;
}
.schedule-summary-status {
    border-radius: 14px;
    padding: 12px;
    min-height: 58px;
}
.schedule-summary-status.is-ok {
    border-color: var(--schedule-success-border);
    background:
        radial-gradient(circle at 16px 16px, rgba(95,191,122,0.18), transparent 48px),
        var(--schedule-success-bg);
    color: #166534;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24), 0 0 20px rgba(95,191,122,0.1);
}
.schedule-summary-status.is-warning {
    border-color: var(--schedule-warning-border);
    background: var(--schedule-warning-bg);
    color: var(--schedule-warning-text);
}
html[data-theme="dark"] .schedule-summary-status.is-ok {
    color: #b7f7c8;
}
html[data-theme="dark"] .schedule-summary-status.is-warning {
    color: var(--schedule-warning-text);
}
.schedule-summary-status-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255,255,255,0.58);
}
.schedule-summary-status.is-ok .schedule-summary-status-icon {
    color: #2f8f52;
    border: 1px solid rgba(95,191,122,0.32);
}
.schedule-summary-status.is-warning .schedule-summary-status-icon {
    color: #d97706;
    border: 1px solid rgba(217,119,6,0.34);
}
html[data-theme="dark"] .schedule-summary-status-icon {
    background: rgba(255,255,255,0.07);
}
.schedule-summary-status-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.schedule-summary-status-copy strong {
    color: inherit;
    font-size: 0.92rem;
    line-height: 1.15;
}
.schedule-summary-status-copy small {
    color: var(--schedule-muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
}
.schedule-summary-list {
    gap: 10px;
    padding-right: 6px;
}
.schedule-summary-day {
    background: linear-gradient(180deg, var(--schedule-surface), rgba(255,255,255,0));
    padding: 4px 0;
}
html[data-theme="dark"] .schedule-summary-day {
    background: linear-gradient(180deg, var(--schedule-surface), rgba(23,27,36,0));
}
.schedule-summary-day span {
    border: 1px solid var(--schedule-border);
    background: rgba(100,116,139,0.1);
    color: var(--schedule-muted);
    letter-spacing: 0.04em;
}
.schedule-summary-item {
    position: relative;
    grid-template-columns: minmax(122px, 0.36fr) minmax(0, 1fr);
    gap: 0;
    min-height: 88px;
    border-color: var(--schedule-border);
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 8px 22px rgba(15,23,42,0.07);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.schedule-summary-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #fb923c;
}
.schedule-summary-type-lab::before { background: #38bdf8; }
.schedule-summary-type-lec::before { background: #fb923c; }
.schedule-summary-type-rle::before { background: #a78bfa; }
.schedule-summary-type-ol::before,
.schedule-summary-type-online::before { background: #5fbf7a; }
.schedule-summary-item:hover {
    border-color: rgba(249,115,22,0.32);
    box-shadow: 0 14px 30px rgba(15,23,42,0.1);
    transform: translateY(-2px);
}
html[data-theme="dark"] .schedule-summary-item {
    border-color: var(--schedule-border);
    background: rgba(255,255,255,0.045);
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
}
html[data-theme="dark"] .schedule-summary-item:hover {
    border-color: rgba(251,146,60,0.34);
    background: rgba(255,255,255,0.065);
}
.schedule-summary-time {
    justify-content: center;
    gap: 6px;
    margin: 10px 0 10px 12px;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    padding: 10px;
    background: rgba(249,115,22,0.1);
    color: #9a3412;
}
.schedule-summary-time strong {
    color: inherit;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.schedule-summary-time span {
    color: inherit;
    font-size: 0.72rem;
}
.schedule-summary-subject {
    padding: 12px 12px 12px 14px;
}
.schedule-summary-subject-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.schedule-summary-subject strong {
    color: var(--schedule-text);
    font-size: 0.94rem;
}
.schedule-summary-subject span {
    color: var(--schedule-muted);
    font-size: 0.78rem;
}
.schedule-summary-subject small {
    color: var(--schedule-muted);
    margin-top: 6px;
}
.schedule-summary-type-pill {
    display: inline-flex !important;
    align-items: center;
    border: 1px solid var(--schedule-border);
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(100,116,139,0.1);
    color: var(--schedule-text) !important;
    font-size: 0.66rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    flex: 0 0 auto;
}
.schedule-summary-item.is-conflict {
    border-color: rgba(248,113,113,0.72);
    box-shadow: inset 4px 0 0 #ef4444, 0 12px 28px rgba(239,68,68,0.12);
}
.schedule-summary-item.is-conflict .schedule-summary-time {
    background: rgba(239,68,68,0.12);
    color: #b91c1c;
}
.schedule-summary-conflict {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #b91c1c !important;
}
html[data-theme="dark"] .schedule-summary-conflict,
html[data-theme="dark"] .schedule-summary-item.is-conflict .schedule-summary-time {
    color: #fecaca !important;
}
.blocking-preview-column .blocking-selected-tray {
    gap: 14px;
}
.blocking-conflict-override {
    padding: 10px 12px;
}
.blocking-conflict-override .form-check {
    min-height: 0;
    margin-bottom: 0;
}
.blocking-conflict-override .form-control {
    min-height: 38px;
}
.blocking-preview-column .blocking-conflict-warning {
    margin-top: 12px !important;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.35;
}
.blocking-preview-column .blocking-schedule-preview {
    flex: 1 1 240px;
    min-height: 0;
}
.blocking-save-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 8px;
}
.blocking-irregular-schedule-upload {
    flex: 0 0 auto;
}
.schedule-summary-day {
    position: static;
    z-index: auto;
    margin: 4px 0 0;
    padding: 0;
}
.schedule-summary-list {
    gap: 12px;
}
.schedule-summary-item {
    grid-template-columns: minmax(136px, 0.34fr) minmax(0, 1fr);
    min-height: 82px;
    overflow: hidden;
}
.schedule-summary-time {
    min-width: 0;
    margin: 8px 0 8px 12px;
    padding: 9px 10px;
}
.schedule-summary-time strong,
.schedule-summary-time span {
    max-width: 100%;
}
.schedule-summary-subject {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.blocking-save-premium {
    border: 0;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 45%, #ea580c 100%);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(249,115,22,0.28), inset 0 1px 0 rgba(255,255,255,0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.blocking-save-premium:hover,
.blocking-save-premium:focus {
    color: #fff;
    transform: translateY(-2px);
    filter: saturate(1.05);
    box-shadow: 0 16px 34px rgba(249,115,22,0.36), inset 0 1px 0 rgba(255,255,255,0.28);
}
.blocking-save-premium:disabled {
    transform: none;
    box-shadow: none;
    filter: grayscale(0.18);
}
/* Subject picker cards receive the same clean elevation and interaction language as the preview. */
.blocking-subject-card {
    border-radius: 12px;
    border-color: rgba(148,163,184,0.2);
    background: rgba(255,255,255,0.78);
    box-shadow: 0 8px 20px rgba(15,23,42,0.05);
}
.blocking-subject-card:hover {
    box-shadow: 0 14px 28px rgba(15,23,42,0.09);
}
html[data-theme="dark"] .blocking-subject-card {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.045);
    box-shadow: 0 12px 26px rgba(0,0,0,0.2);
}
html[data-theme="dark"] .blocking-subject-card:hover {
    border-color: rgba(251,146,60,0.34);
    background: rgba(255,255,255,0.065);
}

@media (max-width: 991.98px) {
    .blocking-conflict-strip,
    .blocking-action-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .blocking-schedule-preview #blockingSchedulePreviewBox .schedule-grid-wrap {
        min-height: 320px;
        max-height: 420px;
    }
    .blocking-student-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .blocking-review-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .blocking-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blocking-subject-list {
        max-height: 420px;
    }
    .blocking-subject-panel,
    .blocking-subject-list,
    #blockingSchedulePreviewBox,
    .schedule-summary-preview {
        flex: initial;
        height: auto;
        min-height: 0;
    }
    .blocking-subject-panel,
    .blocking-selected-tray {
        height: auto;
        overflow: visible;
    }
    .blocking-preview-column {
        padding-top: 0;
    }
    .blocking-chip-box {
        max-height: none;
    }
    .schedule-summary-list {
        max-height: 300px;
    }
    .blocking-selected-tray {
        position: static;
        min-height: 0;
    }
    .blocking-save-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 767.98px) {
    .blocking-student-summary,
    .blocking-review-grid {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
    }
    .blocking-subject-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .blocking-filter-grid {
        grid-template-columns: 1fr;
    }
    .blocking-subject-list {
        max-height: 360px;
    }
    .blocking-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .blocking-panel-heading .btn,
    .blocking-save-actions .btn {
        width: 100%;
    }
    .schedule-summary-item {
        grid-template-columns: 1fr;
    }
    .schedule-summary-subject {
        padding: 0 10px 10px;
    }
    .blocking-student-term {
        text-align: left;
    }
    .blocking-action-footer {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        border-radius: 16px;
    }
    .main-content {
        padding-bottom: 110px;
    }
}

/* Auth login page */
.auth-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    background:
      radial-gradient(circle at 16% 18%, rgba(255,106,0,0.18), transparent 30%),
      radial-gradient(circle at 82% 78%, rgba(37,99,235,0.15), transparent 32%),
      #f8fafc;
    overflow: hidden;
}
.auth-login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.auth-grid {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 34px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.auth-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 4px;
}
.auth-logo {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    object-fit: contain;
    background: rgba(255,255,255,0.82);
    padding: 10px;
    margin-bottom: 18px;
    box-shadow: 0 16px 36px rgba(15,23,42,0.12);
}
.auth-branding h1 {
    font-size: clamp(2rem, 3.2vw, 2.85rem);
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.08;
}
.auth-branding p {
    color: #64748b;
    max-width: 500px;
    font-size: 1rem;
    line-height: 1.55;
}
.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: grid;
    gap: 8px;
    color: #334155;
}
.auth-feature-list i {
    color: #ff6a00;
    margin-right: 7px;
}
.auth-card {
    width: 100%;
    border-radius: 22px;
    padding: 30px;
    background: #fff;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 24px 70px rgba(15,23,42,0.14);
    transition: transform .2s ease;
}
.auth-card:hover {
    transform: translateY(-2px);
}
.auth-card-head h4 {
    margin-bottom: 4px;
    font-weight: 700;
}
.auth-card-head p {
    color: #64748b;
    margin-bottom: 16px;
}
.auth-input-wrap {
    position: relative;
}
.auth-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.auth-input {
    height: 50px;
    border-radius: 12px;
    padding-left: 36px;
}
.auth-input:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.2), 0 0 20px rgba(255,106,0,0.15);
}
/* Login: hide browser-native password reveal/clear; only the explicit "Show password" button is used */
.auth-login-page #loginPasswordInput::-ms-reveal,
.auth-login-page #loginPasswordInput::-ms-clear {
    display: none;
}
.auth-login-page #loginPasswordInput::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
    width: 0;
    height: 0;
    margin: 0;
}
.auth-login-btn {
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    color: #fff;
    font-weight: 700;
    transition: all .2s ease;
}
.auth-login-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255,106,0,0.35);
}
.auth-form-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.auth-toggle-pass,
.auth-theme-toggle {
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.12);
    background: #fff;
    color: #475569;
    min-height: 32px;
}
.auth-toggle-pass {
    padding-inline: 12px;
}
.auth-theme-toggle {
    width: 34px;
    padding-inline: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.auth-divider {
    margin: 16px 0 12px;
    border-top: 1px solid rgba(15,23,42,0.08);
}
.auth-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,106,0,0.35);
    background: #fff7ed;
    color: #c2410c;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
}
.auth-back-link:hover {
    color: #9a3412;
    background: #ffedd5;
    transform: translateY(-1px);
}
html[data-theme="dark"] .auth-back-link {
    background: rgba(30,41,59,0.9);
    border-color: rgba(251,146,60,0.5);
    color: #fdba74;
}
html[data-theme="dark"] .auth-back-link:hover {
    background: rgba(30,41,59,1);
    color: #fed7aa;
}

html[data-theme="dark"] .auth-login-page {
    background:
      radial-gradient(circle at 16% 18%, rgba(255,106,0,0.16), transparent 30%),
      radial-gradient(circle at 82% 78%, rgba(37,99,235,0.16), transparent 32%),
      #0f172a;
}
html[data-theme="dark"] .auth-login-page::after {
    background-image: radial-gradient(rgba(148,163,184,0.08) 1px, transparent 1px);
}
html[data-theme="dark"] .auth-branding h1,
html[data-theme="dark"] .auth-feature-list,
html[data-theme="dark"] .auth-card {
    color: #e2e8f0;
}
html[data-theme="dark"] .auth-branding p,
html[data-theme="dark"] .auth-card-head p {
    color: #94a3b8;
}
html[data-theme="dark"] .auth-logo {
    background: rgba(15,23,42,0.78);
    box-shadow: 0 18px 42px rgba(0,0,0,0.34);
}
html[data-theme="dark"] .auth-card {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .auth-input {
    background: #0f172a;
    border-color: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
html[data-theme="dark"] .auth-input::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] .auth-toggle-pass,
html[data-theme="dark"] .auth-theme-toggle {
    background: #0f172a;
    border-color: rgba(255,255,255,0.12);
    color: #e2e8f0;
}
html[data-theme="dark"] .auth-divider {
    border-top-color: rgba(255,255,255,0.08);
}

@media (max-width: 991.98px) {
    .auth-grid {
        grid-template-columns: 1fr;
        width: min(520px, 100%);
        gap: 22px;
    }
    .auth-branding {
        align-items: center;
        text-align: center;
    }
    .auth-logo {
        width: 78px;
        height: 78px;
    }
}
@media (max-width: 767.98px) {
    .auth-login-page {
        align-items: flex-start;
        padding: 24px 14px;
    }
    .auth-card {
        padding: 22px;
    }
    .auth-branding h1 {
        font-size: 1.8rem;
    }
    .auth-logo {
        width: 68px;
        height: 68px;
        border-radius: 18px;
    }
}

/* Dashboard decision UI — SaaS control center */
.dashboard-saas {
    width: 100%;
    max-width: none;
}
.dashboard-saas-h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}
.dashboard-kpi-strip .dashboard-kpi-card--compact {
    border-radius: 14px;
}
.dashboard-kpi-card--compact .dashboard-kpi-head {
    margin-bottom: 6px;
}
.dashboard-kpi-card--compact .dashboard-kpi-head small {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
}
.dashboard-kpi-value {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
}
.dashboard-progress--thin {
    height: 4px;
}
.dashboard-pipeline-card .dashboard-pipeline-stat {
    border-radius: 12px !important;
    min-height: 116px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.98));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: dashboardPipelineCardIn 0.45s ease both;
}
.dashboard-pipeline-card .dashboard-pipeline-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 122, 24, 0.25) !important;
}
.dashboard-pipeline-stats {
    row-gap: 0.5rem !important;
}
.dashboard-pipeline-stats > [class*="col-"] {
    position: relative;
}
@media (min-width: 768px) {
    .dashboard-pipeline-stats > [class*="col-"]:not(:last-child)::after {
        content: "\2192";
        position: absolute;
        top: 50%;
        right: -0.45rem;
        transform: translateY(-50%);
        color: rgba(203, 213, 225, 0.3);
        font-size: 0.95rem;
        font-weight: 600;
        pointer-events: none;
        z-index: 2;
    }
}
.dashboard-pipeline-card .dashboard-pipeline-blocking-bar-wrap {
    margin-top: 0.25rem !important;
    padding-top: 0.25rem !important;
}
.dashboard-micro-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
    margin-bottom: 4px;
}
.dashboard-micro-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff7a18, #ff4d00);
}

/* Dashboard subject pressure decision table */
.dashboard-pressure-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.dashboard-pressure-summary-item strong {
    color: #334155;
    margin-right: 4px;
}
.dashboard-pressure-summary-sep {
    opacity: 0.45;
}
.dashboard-pressure-dt-wrap {
    width: 100%;
    overflow-x: hidden;
}
.dashboard-pressure-card table.dashboard-pressure-table {
    table-layout: fixed;
    width: 100% !important;
}
.dashboard-pressure-table td,
.dashboard-pressure-table th {
    padding: 0.55rem 0.75rem !important;
    vertical-align: middle !important;
    overflow-wrap: normal;
    word-break: normal;
}
.dashboard-pressure-table th:first-child,
.dashboard-pressure-table td:first-child {
    width: 26%;
    min-width: 0;
}
.dashboard-pressure-table th:nth-child(2),
.dashboard-pressure-table th:nth-child(3),
.dashboard-pressure-table th:nth-child(4),
.dashboard-pressure-table th:nth-child(5),
.dashboard-pressure-table th:nth-child(6),
.dashboard-pressure-table td:nth-child(2),
.dashboard-pressure-table td:nth-child(3),
.dashboard-pressure-table td:nth-child(4),
.dashboard-pressure-table td:nth-child(5),
.dashboard-pressure-table td:nth-child(6) {
    width: 6%;
}
.dashboard-pressure-table th:nth-child(7),
.dashboard-pressure-table td:nth-child(7) {
    width: 18%;
}
.dashboard-pressure-table th:nth-child(8),
.dashboard-pressure-table td:nth-child(8) {
    width: 12%;
}
.dashboard-pressure-table th:nth-child(9),
.dashboard-pressure-table td:nth-child(9) {
    width: 12%;
}
.dashboard-pressure-table td.text-end,
.dashboard-pressure-table th.text-end {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}
.dashboard-pressure-cohort {
    color: #64748b !important;
    font-size: 0.72rem !important;
    line-height: 1.35;
}
.dashboard-pressure-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
    margin-bottom: 4px;
}
.dashboard-pressure-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    min-width: 0;
    transition: width 0.35s ease;
}
.dashboard-pressure-fill--safe {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}
.dashboard-pressure-fill--warn {
    background: linear-gradient(90deg, #ea580c, #fb923c);
}
.dashboard-pressure-fill--critical {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
}
.dashboard-pressure-fill--neutral {
    background: rgba(148, 163, 184, 0.45);
}
.dashboard-pressure-row--addon td:first-child {
    border-left: 4px solid rgba(249, 115, 22, 0.95);
}
.dashboard-pressure-row--overload td:first-child {
    border-left: 4px solid rgba(239, 68, 68, 0.98);
}
.dashboard-pressure-row--pending td:first-child {
    border-left: 4px solid rgba(251, 146, 60, 0.95);
}
.dashboard-pressure-row--needs-block td:first-child {
    border-left: 4px solid rgba(59, 130, 246, 0.95);
}
.dashboard-pressure-action-cell {
    width: 12%;
    min-width: 0;
}
.dashboard-pressure-action {
    display: grid;
    justify-items: end;
}
.dashboard-pressure-action .btn {
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.72rem;
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
    padding: 0.42rem 0.58rem;
}
@media (max-width: 1199.98px) {
    .dashboard-pressure-table th:nth-child(3),
    .dashboard-pressure-table td:nth-child(3),
    .dashboard-pressure-table th:nth-child(6),
    .dashboard-pressure-table td:nth-child(6) {
        display: none;
    }
    .dashboard-pressure-table th:first-child,
    .dashboard-pressure-table td:first-child {
        width: 28%;
    }
    .dashboard-pressure-table th:nth-child(7),
    .dashboard-pressure-table td:nth-child(7) {
        width: 20%;
    }
    .dashboard-pressure-action-cell {
        width: 16%;
    }
}
@media (max-width: 991.98px) {
    .dashboard-pressure-card table.dashboard-pressure-table,
    .dashboard-pressure-table tbody,
    .dashboard-pressure-table tr,
    .dashboard-pressure-table td {
        display: block;
        width: 100% !important;
    }
    .dashboard-pressure-table thead {
        display: none;
    }
    .dashboard-pressure-table tr {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    }
    .dashboard-pressure-table td,
    .dashboard-pressure-table td.text-end {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.34rem 0 !important;
        text-align: right !important;
        white-space: normal;
    }
    .dashboard-pressure-table td:first-child,
    .dashboard-pressure-table td:nth-child(7),
    .dashboard-pressure-table td:nth-child(9) {
        display: block;
        text-align: left !important;
    }
    .dashboard-pressure-table td::before {
        color: #94a3b8;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .dashboard-pressure-table td:nth-child(2)::before { content: "Demand"; }
    .dashboard-pressure-table td:nth-child(3)::before { content: "Assigned"; }
    .dashboard-pressure-table td:nth-child(4)::before { content: "Pending"; }
    .dashboard-pressure-table td:nth-child(5)::before { content: "Capacity"; }
    .dashboard-pressure-table td:nth-child(6)::before { content: "Remaining"; }
    .dashboard-pressure-table td:nth-child(8)::before { content: "Decision"; }
    .dashboard-pressure-table td:first-child::before,
    .dashboard-pressure-table td:nth-child(7)::before,
    .dashboard-pressure-table td:nth-child(9)::before {
        content: "";
        display: none;
    }
    .dashboard-pressure-action {
        justify-items: start;
        margin-top: 0.25rem;
    }
    .dashboard-pressure-action p {
        text-align: left;
    }
    .dashboard-pressure-action .d-flex {
        justify-content: flex-start !important;
    }
}

:is(.app-wrap, .modal) .badge.badge-decision-available {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
:is(.app-wrap, .modal) .badge.badge-decision-near {
    background: rgba(251, 146, 60, 0.18);
    color: #c2410c;
    border: 1px solid rgba(251, 146, 60, 0.45);
}
:is(.app-wrap, .modal) .badge.badge-decision-full {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
:is(.app-wrap, .modal) .badge.badge-decision-overload {
    background: rgba(239, 68, 68, 0.22);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}
:is(.app-wrap, .modal) .badge.badge-decision-needs-block {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.42);
}
:is(.app-wrap, .modal) .badge.badge-decision-addon {
    background: rgba(249, 115, 22, 0.18);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.48);
}
:is(.app-wrap, .modal) .badge.badge-decision-pending {
    background: rgba(251, 146, 60, 0.2);
    color: #b45309;
    border: 1px solid rgba(251, 146, 60, 0.45);
}

html[data-theme="dark"] .dashboard-pressure-summary {
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
html[data-theme="dark"] .dashboard-pressure-summary-item strong {
    color: #e2e8f0;
}
html[data-theme="dark"] .dashboard-pressure-card .dataTables_scrollBody {
    scrollbar-color: rgba(148, 163, 184, 0.48) #141b26;
}
html[data-theme="dark"] .dashboard-pressure-card .dataTables_scrollBody::-webkit-scrollbar-track {
    background: #141b26;
}
html[data-theme="dark"] .dashboard-pressure-card .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 6px;
}
html[data-theme="dark"] .dashboard-pressure-card .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.58);
}

html[data-theme="dark"] .dashboard-pressure-bar {
    background: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .dashboard-pressure-card .dataTables_scrollHead thead th,
html[data-theme="dark"] .dashboard-pressure-card table.dataTable thead th {
    background: #1e293b !important;
    color: #e2e8f0;
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-available {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-near {
    background: rgba(251, 146, 60, 0.14);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.35);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-full {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-overload {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.42);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-needs-block {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.38);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-addon {
    background: rgba(249, 115, 22, 0.14);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.38);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-decision-pending {
    background: rgba(251, 146, 60, 0.14);
    color: #fcd34d;
    border-color: rgba(251, 146, 60, 0.38);
}

.dashboard-insight-grid .dashboard-insight-card {
    border-radius: 14px;
}
.dashboard-insight-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: rgba(255, 106, 0, 0.1);
    color: #ff6a00;
    font-size: 1.1rem;
}
.dashboard-action-critical .dashboard-insight-card-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.dashboard-action-medium .dashboard-insight-card-icon {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}
.dashboard-action-normal .dashboard-insight-card-icon {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
}
.dashboard-quick-actions-bar .btn {
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 600;
}
.dashboard-secondary-compact {
    border-radius: 14px;
}
.dashboard-list--compact li {
    padding: 6px 10px;
    font-size: 0.88rem;
}
html[data-theme="dark"] .dashboard-pipeline-bar {
    background: rgba(148, 163, 184, 0.12);
}

.dashboard-kpi-card {
    border-radius: 16px;
}
.dashboard-kpi-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.dashboard-kpi-head i {
    color: #ff6a00;
}
.dashboard-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.2);
    overflow: hidden;
}
.dashboard-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dashboard-progress-wrap .dashboard-progress {
    flex: 1;
}
.dashboard-progress-text {
    font-size: 0.75rem;
    color: #64748b;
}
.dashboard-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff7a18, #ff4d00);
}
.kpi-green .dashboard-progress span { background: linear-gradient(90deg, #16a34a, #22c55e); }
.kpi-orange .dashboard-progress span { background: linear-gradient(90deg, #f97316, #fb923c); }
.kpi-red .dashboard-progress span { background: linear-gradient(90deg, #ef4444, #f87171); }
.kpi-neutral .dashboard-progress span { background: linear-gradient(90deg, #64748b, #94a3b8); }

.dashboard-action-card {
    border-left: 4px solid #ff6a00;
}
.dashboard-action-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    height: 100%;
    background: rgba(15,23,42,0.02);
}
.dashboard-action-critical { border-left: 4px solid #ef4444; }
.dashboard-action-medium { border-left: 4px solid #f97316; }
.dashboard-action-normal { border-left: 4px solid #64748b; }
.dashboard-priority-tag {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(15,23,42,0.08);
}
.dashboard-action-critical .dashboard-priority-tag { background: rgba(239,68,68,0.14); color: #b91c1c; }
.dashboard-action-medium .dashboard-priority-tag { background: rgba(249,115,22,0.14); color: #c2410c; }
.dashboard-action-normal .dashboard-priority-tag { background: rgba(100,116,139,0.14); color: #334155; }
.dashboard-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.dashboard-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 10px;
}
.dashboard-list li {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15,23,42,0.03);
}
.dashboard-empty-state {
    background: rgba(15, 23, 42, 0.02);
    border-color: var(--border) !important;
}
.dashboard-chart-wrap {
    position: relative;
    height: 280px;
}
/* Premium dashboard chart containers */
.dashboard-chart-card {
    overflow: hidden;
}
.dashboard-chart-card--solo {
    display: flex;
    flex-direction: column;
}
.dashboard-chart-shell {
    border-radius: 16px;
    padding: 12px;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(241, 245, 249, 0.9) 42%,
        rgba(226, 232, 240, 0.95) 100%
    );
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(15, 23, 42, 0.04),
        0 8px 28px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .dashboard-chart-card .dashboard-saas-h2,
html[data-theme="light"] .dashboard-chart-shell h3 {
    color: #111827;
}
html[data-theme="light"] .dashboard-chart-card .text-muted,
html[data-theme="light"] .dashboard-chart-empty,
html[data-theme="light"] .dashboard-chart-insight {
    color: #475569 !important;
}
html[data-theme="light"] .dashboard-chart-shell {
    border-color: rgba(100, 116, 139, .22);
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, .98) 0%,
        rgba(248, 250, 252, .98) 42%,
        rgba(235, 241, 247, .98) 100%
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .85),
        inset 0 -1px 0 rgba(15, 23, 42, .05),
        0 10px 24px rgba(15, 23, 42, .08);
}
.dashboard-chart-shell--compact {
    max-width: 260px;
    padding: 10px;
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 4px 18px rgba(15, 23, 42, 0.06);
}
.dashboard-chart-wrap--solo {
    height: 200px;
    max-height: 220px;
}
.dashboard-chart-wrap--grid {
    height: 220px;
    max-height: 240px;
}
.dashboard-chart-shell--grid {
    height: 100%;
}
.dashboard-chart-shell--grid .dashboard-chart-empty {
    font-size: 0.85rem;
    padding: 0.75rem;
    text-align: center;
}
.dashboard-chart-empty--compact {
    height: 200px;
    max-height: 220px;
}
.dashboard-insights-card .dashboard-action-list {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}
.dashboard-demand-card .table-responsive {
    max-height: min(420px, 55vh);
    overflow-y: auto;
}
html[data-theme="dark"] .dashboard-demand-card .table-responsive {
    border-radius: 12px;
}
html[data-theme="dark"] .dashboard-chart-shell--compact {
    background: linear-gradient(
        165deg,
        rgba(30, 35, 42, 0.92) 0%,
        rgba(22, 24, 30, 0.94) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 6px 22px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .dashboard-chart-shell {
    background: linear-gradient(
        165deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(15, 23, 42, 0.88) 48%,
        rgba(15, 23, 42, 0.92) 100%
    );
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -12px 40px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(34, 211, 238, 0.06),
        0 12px 40px rgba(0, 0, 0, 0.35);
}
.dashboard-chart-wrap--neon canvas {
    filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.2)) drop-shadow(0 0 22px rgba(251, 146, 60, 0.12));
}
html[data-theme="dark"] .dashboard-chart-wrap--neon canvas {
    filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.28)) drop-shadow(0 0 26px rgba(251, 146, 60, 0.14));
}
.dashboard-chart-wrap--solo.dashboard-chart-wrap--neon canvas {
    filter: none;
}
html[data-theme="dark"] .dashboard-chart-wrap--solo.dashboard-chart-wrap--neon canvas {
    filter: none;
}
.dashboard-chart-wrap--neon-bars canvas {
    filter: drop-shadow(0 0 12px rgba(52, 250, 140, 0.12)) drop-shadow(0 0 18px rgba(148, 163, 184, 0.08));
}
html[data-theme="dark"] .dashboard-chart-wrap--neon-bars canvas {
    filter: drop-shadow(0 0 16px rgba(52, 250, 140, 0.18)) drop-shadow(0 0 22px rgba(148, 163, 184, 0.1));
}
.dashboard-chart-insight {
    font-size: 0.86rem;
    color: #64748b;
}
.chart-glow {
    filter: drop-shadow(0 0 10px rgba(255,106,0,.35));
}
.dashboard-chart-empty {
    height: 280px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: rgba(15,23,42,0.02);
}

.dashboard-pipeline-stat-neutral {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(15, 23, 42, 0.1) !important;
}
.dashboard-pipeline-stat-warn {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(245, 158, 11, 0.45) !important;
}
.dashboard-pipeline-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(51, 65, 85, 0.82);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.dashboard-pipeline-label i {
    color: rgba(51, 65, 85, 0.7);
    font-size: 0.95rem;
}
.dashboard-pipeline-stat-blocked .dashboard-pipeline-label i {
    color: #16a34a;
}
.dashboard-pipeline-value {
    color: #0f172a;
    font-size: clamp(1.75rem, 2vw, 2rem) !important;
    font-weight: 600 !important;
    line-height: 1.05;
}
.dashboard-pipeline-value-success {
    color: #15803d;
}
.dashboard-pipeline-card .dashboard-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.24);
}
.dashboard-pipeline-card .dashboard-progress > span {
    background: linear-gradient(90deg, #ff7a18, #ff9a3d);
    box-shadow: 0 0 10px rgba(255, 115, 0, 0.4);
    transform-origin: left center;
    animation: dashboardPipelineFillIn 0.6s ease;
    transition: width 0.6s ease;
}
.dashboard-pipeline-card .dashboard-pipeline-meta {
    color: rgba(71, 85, 105, 0.88) !important;
    font-size: 0.78rem;
}
.dashboard-pipeline-card .dashboard-pipeline-stat .small.text-muted {
    color: rgba(71, 85, 105, 0.85) !important;
}
@keyframes dashboardPipelineCardIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes dashboardPipelineFillIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

html[data-theme="dark"] .dashboard-action-item,
html[data-theme="dark"] .dashboard-list li {
    border-color: rgba(255,255,255,0.08);
    background: rgba(148,163,184,0.06);
}
html[data-theme="dark"] .dashboard-action-normal {
    border-left-color: #94a3b8;
}
html[data-theme="dark"] .dashboard-empty-state {
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8;
}
html[data-theme="dark"] .dashboard-kpi-card h3 {
    color: #f8fafc;
}
html[data-theme="dark"] .dashboard-kpi-card .text-secondary {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .dashboard-kpi-card .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .dashboard-progress-text {
    color: #94a3b8;
}
html[data-theme="dark"] .dashboard-priority-tag {
    color: #e2e8f0;
    background: rgba(148,163,184,0.2);
}
html[data-theme="dark"] .chart-glow {
    filter: drop-shadow(0 0 14px rgba(0,229,255,.35));
}
html[data-theme="dark"] .dashboard-chart-insight,
html[data-theme="dark"] .dashboard-chart-empty {
    color: #94a3b8;
}
html[data-theme="dark"] .dashboard-chart-empty {
    border-color: rgba(255,255,255,0.08);
    background: rgba(148,163,184,0.06);
}

html[data-theme="dark"] .dashboard-pipeline-stat-neutral {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.08) !important;
}
html[data-theme="dark"] .dashboard-pipeline-stat-neutral .dashboard-pipeline-label {
    color: rgba(226, 232, 240, 0.7);
}
html[data-theme="dark"] .dashboard-pipeline-stat-neutral .dashboard-pipeline-label i {
    color: rgba(226, 232, 240, 0.76);
}
html[data-theme="dark"] .dashboard-pipeline-stat-neutral .dashboard-pipeline-value {
    color: #f8fafc;
}
html[data-theme="dark"] .dashboard-pipeline-stat-neutral .dashboard-pipeline-value-success {
    color: #bbf7d0 !important;
}
html[data-theme="dark"] .dashboard-pipeline-stat-blocked .dashboard-pipeline-label i {
    color: #86efac;
}
html[data-theme="dark"] .dashboard-pipeline-card .dashboard-pipeline-stat .small.text-muted {
    color: rgba(203, 213, 225, 0.84) !important;
}
html[data-theme="dark"] .dashboard-pipeline-card .dashboard-progress {
    background: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .dashboard-pipeline-card .dashboard-pipeline-meta {
    color: rgba(203, 213, 225, 0.74) !important;
}
html[data-theme="dark"] .dashboard-pipeline-stat-warn {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.42) !important;
}
html[data-theme="dark"] .dashboard-pipeline-stat-warn .dashboard-pipeline-label {
    color: #fde68a;
}
html[data-theme="dark"] .dashboard-pipeline-stat-warn .dashboard-pipeline-value {
    color: #fffbeb;
}
html[data-theme="dark"] .courses-manage-card .form-control {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.16);
}
html[data-theme="dark"] .courses-manage-card .form-control::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] .courses-manage-card h5 {
    color: #e2e8f0;
}
html[data-theme="dark"] #studentModal .modal-content {
    background: #171a21;
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] #studentModal .modal-header,
html[data-theme="dark"] #studentModal .modal-footer {
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] #studentModal .modal-title,
html[data-theme="dark"] #studentModal .form-label {
    color: #e2e8f0;
}
html[data-theme="dark"] #studentModal .form-control,
html[data-theme="dark"] #studentModal .form-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.16);
}
html[data-theme="dark"] #studentModal .form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e2e8f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
html[data-theme="dark"] #studentModal .form-control::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] #studentModal .form-control:focus,
html[data-theme="dark"] #studentModal .form-select:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255,106,0,0.25);
}
html[data-theme="dark"] #studentModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

@media (max-width: 767.98px) {
    .dashboard-chart-wrap,
    .dashboard-chart-empty {
        height: 230px;
    }
    .dashboard-chart-wrap--solo,
    .dashboard-chart-empty--compact {
        height: 190px;
    }
    .dashboard-chart-shell--compact {
        max-width: 100%;
    }
    .dashboard-chart-wrap--grid {
        height: 190px;
    }
}

/* =============================================================================
   Unified data-card + app-table (SaaS tables across modules)
   ============================================================================= */
.app-wrap .data-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 1.25rem;
}
.app-wrap .data-card.mb-0 {
    margin-bottom: 0;
}
html[data-theme="dark"] .app-wrap .data-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.data-card-header {
    margin-bottom: 16px;
}
.data-card-header h3,
.data-card-header .data-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.data-card-desc,
.data-card-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    max-width: 52rem;
}
html[data-theme="dark"] .data-card-desc,
html[data-theme="dark"] .data-card-header p {
    color: #94a3b8;
}
.app-wrap .data-card .table-responsive,
.app-wrap .admin-section-card .table-responsive {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: auto;
    background: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
html[data-theme="dark"] .app-wrap .data-card .table-responsive,
html[data-theme="dark"] .app-wrap .admin-section-card .table-responsive {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.app-wrap table.table.app-table,
.app-wrap table.app-table {
    margin-bottom: 0;
    font-size: 0.8125rem;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
}
.app-wrap table.app-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    padding: 9px 12px;
    vertical-align: middle;
}
html[data-theme="dark"] .app-wrap table.app-table thead th {
    background: #111827;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}
.app-wrap table.app-table td,
.app-wrap table.app-table th {
    padding: 11px 12px;
    vertical-align: middle;
    line-height: 1.35;
}
.app-wrap table.app-table tbody td {
    color: #1e293b;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    transition: background-color 0.15s ease;
}
html[data-theme="dark"] .app-wrap table.app-table tbody td {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.06);
    background: transparent;
}
.app-wrap table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.06) !important;
}
html[data-theme="dark"] .app-wrap table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.07) !important;
}

/* Inline row actions (text links + more) — all app-table */
.app-wrap table.app-table .saas-name-cell {
    font-weight: 600;
    color: #0f172a;
    max-width: 28rem;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-name-cell {
    color: #f1f5f9;
}
.app-wrap table.app-table .saas-name-text {
    font-size: 0.8125rem;
}
.app-wrap .saas-subject-code {
    font-weight: 700;
    letter-spacing: 0.03em;
}
.app-wrap table.app-table .saas-secondary-text {
    font-size: 0.8125rem;
    white-space: nowrap;
}
.app-wrap table.app-table .saas-status-cell {
    white-space: nowrap;
}
.app-wrap table.app-table .badge.badge-table-sm,
.modal table.app-table .badge.badge-table-sm {
    padding: 0.1rem 0.42rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 4px;
    line-height: 1.25;
    border-width: 1px;
}
.app-wrap table.app-table .saas-status-dash {
    font-size: 0.75rem;
    color: #94a3b8;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-status-dash {
    color: #94a3b8;
}
.app-wrap table.app-table .saas-actions-col {
    width: 1%;
    min-width: 10.5rem;
}
.app-wrap table.app-table .saas-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0;
    white-space: nowrap;
}
.app-wrap table.app-table .table-actions.action-group,
.app-wrap table.app-table .table-actions {
    flex-wrap: nowrap;
    gap: 6px;
}
.app-wrap table.app-table .saas-inline-action {
    display: inline;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    padding: 2px 0;
    border: 0;
    background: transparent;
    line-height: 1.2;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-inline-action {
    color: #cbd5e1;
}
.app-wrap table.app-table .saas-inline-action:hover {
    color: #ea580c;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.app-wrap table.app-table .saas-inline-action--accent {
    color: #c2410c;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-inline-action--accent {
    color: #fdba74;
}
.app-wrap table.app-table .saas-inline-action--accent:hover {
    color: #ff6a00;
}
.app-wrap table.app-table .saas-inline-sep {
    display: inline-block;
    padding: 0 5px;
    font-size: 0.75rem;
    font-weight: 400;
    color: #cbd5e1;
    user-select: none;
    opacity: 0.85;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-inline-sep {
    color: #475569;
}
.app-wrap table.app-table .saas-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    min-width: 28px;
    padding: 0 0.35rem;
    margin: 0 0 0 1px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.03);
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    box-shadow: none;
}
.app-wrap table.app-table .saas-more-btn:hover {
    border-color: rgba(234, 88, 12, 0.45);
    color: #ea580c;
    background: rgba(255, 106, 0, 0.08);
}
.app-wrap table.app-table .saas-more-btn.dropdown-toggle::after {
    display: none;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-more-btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}
html[data-theme="dark"] .app-wrap table.app-table .saas-more-btn:hover {
    color: #fdba74;
    border-color: rgba(255, 106, 0, 0.35);
    background: rgba(255, 106, 0, 0.1);
}
.app-wrap table.app-table .table-action-btn.btn-sm {
    min-height: 28px;
    padding: 0.22rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 999px;
}
.app-wrap table.app-table a.table-action-primary,
.app-wrap table.app-table a.table-action-primary:visited {
    color: #fff !important;
}
.app-wrap table.app-table a.table-action-primary:hover,
.app-wrap table.app-table a.table-action-primary:focus-visible {
    color: #fff !important;
}
.app-wrap table.app-table .btn-link.saas-inline-action {
    font-weight: 600;
    vertical-align: baseline;
}

.app-wrap table.app-table.table-bordered td,
.app-wrap table.app-table.table-bordered th {
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .app-wrap table.app-table.table-bordered td,
html[data-theme="dark"] .app-wrap table.app-table.table-bordered th {
    border-color: rgba(255, 255, 255, 0.08);
}

/* DataTables (inside data-card or legacy card wrappers) */
.app-wrap .data-card .dataTables_wrapper,
.app-wrap .dataTables_wrapper {
    width: 100%;
    font-size: 13px;
    color: #475569;
}
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper,
html[data-theme="dark"] .app-wrap .dataTables_wrapper {
    color: #94a3b8;
}
.app-wrap .data-card .dataTables_wrapper .dataTables_length,
.app-wrap .data-card .dataTables_wrapper .dataTables_filter,
.app-wrap .data-card .dataTables_wrapper .dataTables_info,
.app-wrap .dataTables_wrapper .dataTables_length,
.app-wrap .dataTables_wrapper .dataTables_filter,
.app-wrap .dataTables_wrapper .dataTables_info {
    color: inherit;
}
.app-wrap .data-card .dataTables_wrapper .form-control,
.app-wrap .data-card .dataTables_wrapper .form-select,
.app-wrap .dataTables_wrapper .form-control,
.app-wrap .dataTables_wrapper .form-select {
    border-radius: 10px;
    min-height: 38px;
    border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper .form-control,
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper .form-select,
html[data-theme="dark"] .app-wrap .dataTables_wrapper .form-control,
html[data-theme="dark"] .app-wrap .dataTables_wrapper .form-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
.app-wrap .data-card .dataTables_wrapper .form-control:focus,
.app-wrap .data-card .dataTables_wrapper .form-select:focus,
.app-wrap .dataTables_wrapper .form-control:focus,
.app-wrap .dataTables_wrapper .form-select:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.22);
}
.app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(180deg, #ff7a18, #ff4d00) !important;
}
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
html[data-theme="dark"] .app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
}
html[data-theme="dark"] .app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current),
html[data-theme="dark"] .app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}
.app-wrap .data-card .dataTables_wrapper .dataTables_paginate .paginate_button,
.app-wrap .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 9px !important;
}
.app-wrap .dataTables_wrapper .dataTables_length,
.app-wrap .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.65rem;
}
.app-wrap table.dataTable.table.app-table > tbody > tr > td,
.app-wrap table.dataTable.table.app-table > thead > tr > th {
    padding: 11px 12px !important;
}

.app-wrap .students-table-responsive {
    overflow-x: hidden !important;
}

.app-wrap #studentsDirectoryTable {
    width: 100% !important;
    table-layout: fixed;
}

.app-wrap #studentsDirectoryTable th:nth-child(1),
.app-wrap #studentsDirectoryTable td:nth-child(1) {
    width: 34%;
}

.app-wrap #studentsDirectoryTable th:nth-child(2),
.app-wrap #studentsDirectoryTable td:nth-child(2) {
    width: 15%;
}

.app-wrap #studentsDirectoryTable th:nth-child(3),
.app-wrap #studentsDirectoryTable td:nth-child(3) {
    width: 11%;
}

.app-wrap #studentsDirectoryTable th:nth-child(4),
.app-wrap #studentsDirectoryTable td:nth-child(4) {
    width: 14%;
}

.app-wrap #studentsDirectoryTable th:nth-child(5),
.app-wrap #studentsDirectoryTable td:nth-child(5) {
    width: 26%;
}

.app-wrap #studentsDirectoryTable th,
.app-wrap #studentsDirectoryTable td {
    overflow: hidden;
}

.app-wrap #studentsDirectoryTable .saas-name-text,
.app-wrap #studentsDirectoryTable .saas-secondary-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .app-wrap .students-table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .app-wrap #studentsDirectoryTable {
        min-width: 760px;
        table-layout: auto;
    }

    .app-wrap #studentsDirectoryTable th,
    .app-wrap #studentsDirectoryTable td {
        overflow: visible;
        white-space: nowrap;
    }

    .app-wrap #studentsDirectoryTable th:nth-child(5),
    .app-wrap #studentsDirectoryTable td:nth-child(5) {
        width: 22%;
    }

    .app-wrap #studentsDirectoryTable .table-action-label {
        display: none;
    }
}

.app-wrap .enrollments-table-responsive {
    overflow-x: hidden !important;
}

.app-wrap #enrollmentsDirectoryTable {
    width: 100% !important;
    table-layout: fixed;
}

.app-wrap #enrollmentsDirectoryTable th:nth-child(1),
.app-wrap #enrollmentsDirectoryTable td:nth-child(1) {
    width: 36%;
}

.app-wrap #enrollmentsDirectoryTable th:nth-child(2),
.app-wrap #enrollmentsDirectoryTable td:nth-child(2) {
    width: 16%;
}

.app-wrap #enrollmentsDirectoryTable th:nth-child(3),
.app-wrap #enrollmentsDirectoryTable td:nth-child(3) {
    width: 14%;
}

.app-wrap #enrollmentsDirectoryTable th:nth-child(4),
.app-wrap #enrollmentsDirectoryTable td:nth-child(4) {
    width: 14%;
}

.app-wrap #enrollmentsDirectoryTable th:nth-child(5),
.app-wrap #enrollmentsDirectoryTable td:nth-child(5) {
    width: 20%;
}

.app-wrap #enrollmentsDirectoryTable th,
.app-wrap #enrollmentsDirectoryTable td {
    overflow: hidden;
}

.app-wrap #enrollmentsDirectoryTable .saas-name-text,
.app-wrap #enrollmentsDirectoryTable .saas-secondary-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.enrollment-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.enrollment-header-actions .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0.45rem 0.85rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .enrollment-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .enrollment-header-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 992px) {
    .app-wrap .enrollments-table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .app-wrap #enrollmentsDirectoryTable {
        min-width: 760px;
        table-layout: auto;
    }

    .app-wrap #enrollmentsDirectoryTable th,
    .app-wrap #enrollmentsDirectoryTable td {
        overflow: visible;
        white-space: nowrap;
    }

    .app-wrap #enrollmentsDirectoryTable th:nth-child(5),
    .app-wrap #enrollmentsDirectoryTable td:nth-child(5) {
        width: 20%;
    }

    .app-wrap #enrollmentsDirectoryTable .table-action-label {
        display: none;
    }
}

/* Reusable status badges (scoped to app shell) */
.app-wrap .badge.badge-success,
.app-wrap .badge.badge-warning,
.app-wrap .badge.badge-danger,
.app-wrap .badge.badge-info,
.app-wrap .badge.badge-neutral,
.app-wrap .badge.badge-primary {
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.app-wrap .badge.badge-success {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
.app-wrap .badge.badge-warning {
    background: rgba(251, 191, 36, 0.22);
    color: #a16207;
    border: 1px solid rgba(251, 191, 36, 0.45);
}
.app-wrap .badge.badge-danger {
    background: rgba(248, 113, 113, 0.2);
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, 0.4);
}
.app-wrap .badge.badge-info {
    background: rgba(56, 189, 248, 0.18);
    color: #0369a1;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.app-wrap .badge.badge-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.35);
}
.app-wrap .badge.badge-primary {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
html[data-theme="dark"] .app-wrap .badge.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}
html[data-theme="dark"] .app-wrap .badge.badge-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.35);
}
html[data-theme="dark"] .app-wrap .badge.badge-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
}
html[data-theme="dark"] .app-wrap .badge.badge-info {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.3);
}
html[data-theme="dark"] .app-wrap .badge.badge-neutral {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .app-wrap .badge.badge-primary {
    background: rgba(96, 165, 250, 0.15);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.35);
}

/* Unified SaaS semantic badges (tables + cards). Modals sit outside .app-wrap — include .modal */
:is(.app-wrap, .modal) .badge.badge-saas-success {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.32);
}
:is(.app-wrap, .modal) .badge.badge-saas-warning {
    background: rgba(255, 106, 0, 0.12);
    color: #c2410c;
    border: 1px solid rgba(255, 106, 0, 0.35);
}
:is(.app-wrap, .modal) .badge.badge-saas-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
:is(.app-wrap, .modal) .badge.badge-saas-neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.32);
}
:is(.app-wrap, .modal) .badge.badge-saas-addon {
    background: rgba(6, 182, 212, 0.1);
    color: #0e7490;
    border: 1px solid rgba(255, 106, 0, 0.28);
}
:is(.app-wrap, .modal) .badge.badge-saas-block-regular {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.32);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-warning {
    color: #fdba74;
    background: rgba(255, 106, 0, 0.12);
    border-color: rgba(255, 106, 0, 0.32);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.3);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-neutral {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.26);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-addon {
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(255, 106, 0, 0.25);
}
html[data-theme="dark"] :is(.app-wrap, .modal) .badge.badge-saas-block-regular {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.32);
}

/* Enrollment & blocking view modal — wide layout + app-table look outside .app-wrap */
.enrollment-view-modal-dialog {
    max-width: min(1320px, 98vw);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
#viewBlockingModal .modal-body {
    max-height: min(78vh, 900px);
    overflow-y: auto;
}
#viewBlockingModal .enrollment-view-meta-card {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.35) !important;
}
html[data-theme="dark"] #viewBlockingModal .enrollment-view-meta-card {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.22) !important;
}
html[data-theme="dark"] #viewBlockingModal .enrollment-view-meta-card .card-body {
    color: #e2e8f0;
}
#viewBlockingModal .enrollment-view-meta-card--compact .card-body {
    line-height: 1.45;
}
#viewBlockingModal .enrollment-view-meta-inline {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}
#viewBlockingModal .enrollment-view-meta-inline .badge {
    font-weight: 600;
    vertical-align: middle;
}
html[data-theme="dark"] #viewBlockingModal .enrollment-view-meta-inline {
    color: #f1f5f9;
}
html[data-theme="dark"] #viewBlockingModal .modal-content {
    background: #171a21;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
html[data-theme="dark"] #viewBlockingModal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #viewBlockingModal .modal-title {
    color: #f8fafc;
}
html[data-theme="dark"] #viewBlockingModal .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] #viewBlockingModal .fw-semibold {
    color: #f1f5f9;
}
html[data-theme="dark"] #viewBlockingModal ul {
    color: #e2e8f0;
}
html[data-theme="dark"] #viewBlockingModal .alert-secondary {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] #viewBlockingModal .alert-warning {
    background: rgba(251, 146, 60, 0.12);
    color: #fed7aa;
    border-color: rgba(251, 146, 60, 0.35);
}
#viewBlockingModal table.table.app-table,
#viewBlockingModal table.app-table {
    margin-bottom: 0;
    font-size: 0.8125rem;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
}
#viewBlockingModal table.app-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    padding: 9px 12px;
    vertical-align: middle;
}
#viewBlockingModal table.app-table td,
#viewBlockingModal table.app-table th {
    padding: 11px 12px;
    vertical-align: middle;
    line-height: 1.35;
}
#viewBlockingModal table.app-table tbody td {
    color: #1e293b;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}
#viewBlockingModal table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.06) !important;
}
#viewBlockingModal table.app-table td .badge {
    white-space: normal;
    text-align: left;
    max-width: 220px;
    line-height: 1.25;
}
html[data-theme="dark"] #viewBlockingModal table.app-table thead th {
    background: #111827;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #viewBlockingModal table.app-table tbody td {
    background: #121620;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] #viewBlockingModal table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.08) !important;
}
html[data-theme="dark"] #viewBlockingModal .table-responsive {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #121620;
    overflow-x: auto;
}

/* Planned subjects manage modal — wide two-column + dark-mode tables (outside .app-wrap) */
.enrollment-manage-subjects-modal-dialog {
    max-width: min(1400px, 98vw);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
#manageSubjectsModal .modal-body {
    max-height: min(82vh, 960px);
    overflow: hidden;
}
.enrollment-manage-subject-select {
    /* Height follows HTML size="…"; avoid min-height so ~10 rows stay compact */
    min-height: 0;
}
@media (min-width: 992px) {
    #manageSubjectsModal .modal-body > .row {
        height: min(62vh, 720px);
        min-height: 0;
    }
    #manageSubjectsModal .enrollment-manage-subjects-col-left,
    #manageSubjectsModal .enrollment-manage-subjects-col-right {
        max-height: 100%;
        min-height: 0;
    }
    #manageSubjectsModal .enrollment-manage-subjects-col-left {
        display: flex;
        flex-direction: column;
    }
    #manageSubjectsModal .enrollment-manage-add-form {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }
    #manageSubjectsModal #enrollmentManageSubjectPick {
        flex: 1 1 auto;
        min-height: 220px;
        overflow-y: auto;
    }
    #manageSubjectsModal .enrollment-manage-subjects-table-wrap {
        max-height: 100%;
        overflow: auto;
    }
    .enrollment-manage-subject-select {
        min-height: 0;
    }
    html[data-theme="dark"] .enrollment-manage-subjects-col-right {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding-left: 1.5rem;
    }
    .enrollment-manage-subjects-col-right {
        border-left: 1px solid rgba(15, 23, 42, 0.1);
        padding-left: 1.5rem;
    }
}
@media (max-width: 991.98px) {
    #manageSubjectsModal .modal-body {
        overflow-y: auto;
    }
}
html[data-theme="dark"] #manageSubjectsModal .modal-content {
    background: #171a21;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
html[data-theme="dark"] #manageSubjectsModal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #manageSubjectsModal .modal-title {
    color: #f8fafc;
}
html[data-theme="dark"] #manageSubjectsModal .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #manageSubjectsModal .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] #manageSubjectsModal .form-label {
    color: #e2e8f0;
}
html[data-theme="dark"] #manageSubjectsModal .form-text {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] #manageSubjectsModal .form-control,
html[data-theme="dark"] #manageSubjectsModal .form-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] #manageSubjectsModal .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}
html[data-theme="dark"] #manageSubjectsModal .input-group .btn {
    border-color: rgba(251, 146, 60, 0.45);
}
#manageSubjectsModal table.table.app-table,
#manageSubjectsModal table.app-table {
    margin-bottom: 0;
    font-size: 0.8125rem;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
}
#manageSubjectsModal table.app-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    padding: 9px 12px;
    vertical-align: middle;
}
#manageSubjectsModal table.app-table td,
#manageSubjectsModal table.app-table th {
    padding: 11px 12px;
    vertical-align: middle;
    line-height: 1.35;
}
#manageSubjectsModal table.app-table tbody td {
    color: #1e293b;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}
#manageSubjectsModal table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.06) !important;
}
#manageSubjectsModal table.app-table td .badge {
    white-space: normal;
    text-align: left;
    max-width: 220px;
    line-height: 1.25;
}
html[data-theme="dark"] #manageSubjectsModal table.app-table thead th {
    background: #111827;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #manageSubjectsModal table.app-table tbody td {
    background: #121620;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] #manageSubjectsModal table.app-table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.08) !important;
}
html[data-theme="dark"] #manageSubjectsModal .enrollment-manage-subjects-table-wrap {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #121620;
    overflow-x: auto;
}
html[data-theme="dark"] #manageSubjectsModal .enrollment-manage-subjects-col-left {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#manageSubjectsModal .enrollment-manage-meta-card {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.35) !important;
}
#manageSubjectsModal .enrollment-manage-meta-line {
    color: #0f172a;
    font-size: 0.95rem;
}
html[data-theme="dark"] #manageSubjectsModal .enrollment-manage-meta-card {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.22) !important;
}
html[data-theme="dark"] #manageSubjectsModal .enrollment-manage-meta-line {
    color: #f1f5f9;
}

/* Multi-select pick list: readable options + themed scrollbars (dark) */
#manageSubjectsModal select.enrollment-manage-subject-select {
    color-scheme: light;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select {
    color-scheme: dark;
    scrollbar-color: rgba(148, 163, 184, 0.55) #0f172a;
    background: #0f172a;
    color: #f1f5f9;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select option {
    background-color: #0f172a;
    color: #f1f5f9;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select option:disabled {
    background-color: #1e293b;
    color: #64748b;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 6px;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 6px;
    border: 2px solid #0f172a;
}
html[data-theme="dark"] #manageSubjectsModal select.enrollment-manage-subject-select::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Add Enrollment modal — student combobox (real search input) + native multiselect (dark theme) */
#enrollModal .enroll-student-combobox {
    position: relative;
}
#enrollModal .enroll-student-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}
#enrollModal .enroll-student-search-input {
    min-height: 44px;
    border-radius: 12px;
    padding-left: 2.75rem;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2364748b' stroke-width='2'/%3E%3Cpath d='M21 21l-4.35-4.35' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
    flex: 1 1 auto;
}
#enrollModal .enroll-subject-search-input {
    min-height: 42px;
    border-radius: 12px;
    padding-left: 2.65rem;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2364748b' stroke-width='2'/%3E%3Cpath d='M21 21l-4.35-4.35' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
}
#enrollModal .enroll-register-student-btn {
    white-space: nowrap;
}
#enrollModal .enroll-student-clear {
    align-self: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    line-height: 1;
    font-size: 1.35rem;
    font-weight: 400;
    color: #64748b;
    text-decoration: none;
    border: 0;
    background: transparent;
    border-radius: 8px;
}
#enrollModal .enroll-student-clear:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.08);
}
#enrollModal .enroll-student-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 1080;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    scrollbar-color: rgba(100, 116, 139, 0.45) #f1f5f9;
}
#enrollModal .enroll-student-suggest[hidden] {
    display: none !important;
}
#enrollModal .enroll-student-suggest-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    display: block;
    font-size: 0.9375rem;
    color: #0f172a;
}
#enrollModal .enroll-student-suggest-item:hover,
#enrollModal .enroll-student-suggest-item.is-active {
    background: rgba(251, 146, 60, 0.15);
    color: #0f172a;
}
#enrollModal .enroll-student-suggest-sub {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.1rem;
}
#enrollModal .enroll-student-suggest-empty {
    padding: 0.65rem 0.85rem;
    color: #64748b;
    font-size: 0.875rem;
}
#enrollModal .enroll-modal-help {
    color: #475569;
    line-height: 1.45;
}
html[data-theme="dark"] #enrollModal .enroll-modal-help {
    color: #cbd5e1;
}
html[data-theme="dark"] #enrollModal .enroll-student-search-input {
    background-color: #0f172a;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2394a3b8' stroke-width='2'/%3E%3Cpath d='M21 21l-4.35-4.35' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] #enrollModal .enroll-subject-search-input {
    background-color: #0f172a;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2394a3b8' stroke-width='2'/%3E%3Cpath d='M21 21l-4.35-4.35' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] #enrollModal .enroll-student-search-input::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] #enrollModal .enroll-subject-search-input::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] #enrollModal .enroll-student-clear {
    color: #94a3b8;
}
html[data-theme="dark"] #enrollModal .enroll-student-clear:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    scrollbar-color: rgba(148, 163, 184, 0.55) #0f172a;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest-item {
    color: #e2e8f0;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest-item:hover,
html[data-theme="dark"] #enrollModal .enroll-student-suggest-item.is-active {
    background: rgba(251, 146, 60, 0.22);
    color: #fff;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest-sub {
    color: #cbd5e1;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest-empty {
    color: #94a3b8;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest::-webkit-scrollbar {
    width: 10px;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 6px;
}
html[data-theme="dark"] #enrollModal .enroll-student-suggest::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 6px;
    border: 2px solid #0f172a;
}
html[data-theme="dark"] #enrollModal .form-select:not(.select2-hidden-accessible),
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect {
    background: #0f172a;
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect {
    color-scheme: dark;
    scrollbar-color: rgba(148, 163, 184, 0.55) #0f172a;
}
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect option {
    background-color: #0f172a;
    color: #f1f5f9;
}
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect::-webkit-scrollbar {
    width: 10px;
}
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 6px;
}
html[data-theme="dark"] #enrollModal select.enroll-subject-multiselect::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 6px;
    border: 2px solid #0f172a;
}
html[data-theme="dark"] #enrollModal .form-label {
    color: #cbd5e1;
}
html[data-theme="dark"] #enrollModal .form-text {
    color: #cbd5e1;
}
html[data-theme="dark"] #enrollModal .modal-content {
    background: #171a21;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
html[data-theme="dark"] #enrollModal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] #enrollModal .modal-title {
    color: #f8fafc;
}
html[data-theme="dark"] #enrollModal .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Subject / code chips */
span.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(248, 250, 252, 0.95);
    color: #334155;
}
span.subject-chip.subject-chip-pop {
    gap: 6px;
    max-width: 100%;
}
.subject-chip-pop .subject-chip-code {
    font-weight: 700;
}
.subject-chip-pop .subject-chip-counts {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}
.subject-chip-count--regular {
    color: #15803d;
}
.subject-chip-count--irregular {
    color: #c2410c;
}
.blocks-subject-population-cell {
    min-width: 10rem;
}
span.subject-chip-more {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}
html[data-theme="dark"] span.subject-chip {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
html[data-theme="dark"] .subject-chip-count--regular {
    color: #4ade80;
}
html[data-theme="dark"] .subject-chip-count--irregular {
    color: #fb923c;
}
html[data-theme="dark"] span.subject-chip-more {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

/* Action row: one layout name + legacy table-actions */
.action-group,
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.action-group--start,
.table-actions--start {
    justify-content: flex-start;
}
.table-action-btn.btn-action-primary,
.table-action-btn.table-action-primary {
    border: none;
    background: linear-gradient(180deg, #ff7a18, #ff4d00);
    color: #fff !important;
}
.table-action-btn.btn-action-primary:hover:not(:disabled):not(.disabled),
.table-action-btn.table-action-primary:hover:not(:disabled):not(.disabled) {
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(255, 106, 0, 0.38);
}
.table-action-btn.btn-action-secondary,
.table-action-btn.table-action-secondary {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: var(--card);
    color: var(--text) !important;
}
.table-action-btn.btn-action-secondary:hover:not(:disabled):not(.disabled),
.table-action-btn.table-action-secondary:hover:not(:disabled):not(.disabled) {
    border-color: rgba(255, 106, 0, 0.45);
    background: rgba(255, 106, 0, 0.07);
    color: var(--text) !important;
}
.table-action-btn.btn-action-ghost {
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.04);
    color: #64748b;
}
.table-action-btn.btn-action-ghost:hover:not(:disabled) {
    background: rgba(255, 106, 0, 0.1);
    color: #c2410c;
}
.table-action-btn.btn-action-menu,
.table-action-btn.table-action-overflow-toggle {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: #64748b;
}
.table-action-btn.btn-action-menu:hover:not(:disabled),
.table-action-btn.table-action-overflow-toggle:hover:not(:disabled) {
    border-color: rgba(255, 106, 0, 0.35);
    color: #c2410c;
    background: rgba(255, 106, 0, 0.08);
}
html[data-theme="dark"] .table-action-btn.btn-action-secondary,
html[data-theme="dark"] .table-action-btn.table-action-secondary {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .table-action-btn.btn-action-menu,
html[data-theme="dark"] .table-action-btn.table-action-overflow-toggle {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

/* —— Data Analytics module —— */
.analytics-page .analytics-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.analytics-page .analytics-lead {
    max-width: 52rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.analytics-page .analytics-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 106, 0, 0.12);
    color: #c2410c;
    border: 1px solid rgba(255, 106, 0, 0.22);
}
html[data-theme="dark"] .analytics-page .analytics-pill {
    background: rgba(255, 106, 0, 0.14);
    color: #fdba74;
    border-color: rgba(255, 106, 0, 0.28);
}
.analytics-page .analytics-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.analytics-filter-card {
    border-radius: 14px !important;
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="dark"] .analytics-filter-card {
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}
.analytics-metric-card {
    position: relative;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 0.85rem;
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
html[data-theme="dark"] .analytics-metric-card {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(23, 26, 33, 0.92);
}
.analytics-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}
.analytics-metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 0.35rem;
}
.analytics-metric-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 2px 2px 0;
}
.analytics-metric-dot--primary {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.analytics-metric-dot--success {
    background: linear-gradient(180deg, #34d399, #059669);
}
.analytics-metric-dot--warn {
    background: linear-gradient(180deg, #fbbf24, #ea580c);
}
.analytics-metric-dot--danger {
    background: linear-gradient(180deg, #f87171, #dc2626);
}
.analytics-metric-dot--neutral {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}
.analytics-card-glow {
    border-radius: 14px !important;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
html[data-theme="dark"] .analytics-card-glow {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 106, 0, 0.06);
}
.analytics-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.analytics-page .analytics-progress {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .analytics-page .analytics-progress {
    background: rgba(255, 255, 255, 0.08);
}
.analytics-progress-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2.25rem;
    text-align: right;
}
.analytics-alert {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
}
.analytics-alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.analytics-alert--warning {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
    color: var(--text);
}
.analytics-alert--critical {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--text);
}
.analytics-alert--info {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.28);
    color: var(--text);
}
html[data-theme="dark"] .analytics-alert--warning {
    background: rgba(251, 191, 36, 0.1);
}
html[data-theme="dark"] .analytics-alert--critical {
    background: rgba(248, 113, 113, 0.1);
}
html[data-theme="dark"] .analytics-alert--info {
    background: rgba(56, 189, 248, 0.08);
}
.analytics-chart-wrap {
    position: relative;
    height: 240px;
    padding: 0.5rem 0.25rem 0;
}
.analytics-chart-wrap--tall {
    height: 300px;
}
.analytics-chart-wrap--short {
    height: 220px;
}
.analytics-table-compact td,
.analytics-table-compact th {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    vertical-align: middle;
}
.analytics-page .analytics-list .list-group-item {
    border-color: rgba(15, 23, 42, 0.06);
}
html[data-theme="dark"] .analytics-page .analytics-list .list-group-item {
    border-color: rgba(255, 255, 255, 0.08);
}
.analytics-accordion .accordion-item {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .analytics-accordion .accordion-item {
    border-color: rgba(255, 255, 255, 0.1);
}
.analytics-accordion .accordion-button {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Analytics → Intelligence (merged module) */
.analytics-intel-section {
    scroll-margin-top: 1rem;
}
.analytics-analytics-section {
    scroll-margin-top: 1rem;
}
.analytics-intel-card {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: var(--card, #fff);
}
html[data-theme='dark'] .analytics-intel-card {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(23, 30, 41, 0.55);
}
.analytics-intel-card__icon {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
    color: #64748b;
}
.analytics-intel-card--critical .analytics-intel-card__icon {
    color: #dc2626;
}
.analytics-intel-card--warn .analytics-intel-card__icon {
    color: #ea580c;
}
.analytics-intel-card--info .analytics-intel-card__icon {
    color: #0284c7;
}
.analytics-page .nav-tabs-saas .nav-link {
    color: var(--text, #334155);
    border: 1px solid transparent;
}
.analytics-page .nav-tabs-saas .nav-link.active {
    color: #ff6a00;
    border-bottom-color: #ff6a00;
    font-weight: 600;
}
.intel-chart-track {
    flex: 1;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    overflow: hidden;
}
.intel-chart-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.25s ease;
}
.intel-chart-prev {
    background: #64748b;
}
.intel-chart-cur {
    background: linear-gradient(90deg, #ff6a00, #ff8c42);
}
.intel-chart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.intel-chart-label {
    width: 36px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
}
.intel-audit-table td {
    vertical-align: top;
}
.audit-detail-dl dt {
    font-weight: 600;
}
.audit-detail-dl dd {
    margin-bottom: 0.65rem;
}
.audit-detail-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8125rem;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    max-height: 12rem;
    overflow: auto;
    color: var(--text);
}
.audit-detail-muted {
    color: #64748b !important;
}
.audit-detail-ua {
    max-height: 10rem;
}
.intel-detail-dt {
    color: #64748b;
    font-weight: 600;
}
.intel-detail-dd {
    color: var(--text);
}
.intel-detail-subtle {
    color: #64748b;
    font-size: 0.9em;
}
.intel-detail-link {
    color: #ea580c;
    text-decoration: underline;
}
.intel-detail-link:hover {
    color: #ff6a00;
}
.intel-detail-code {
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}
.intel-audit-detail-modal {
    z-index: 1085;
}
.intel-audit-modal-content {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}
.intel-audit-modal-content .modal-header,
.intel-audit-modal-content .modal-footer {
    border-color: var(--border);
}
html[data-theme='dark'] .intel-chart-label {
    color: #94a3b8;
}
html[data-theme='dark'] .audit-detail-pre {
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
}
html[data-theme='dark'] .intel-detail-dt {
    color: #94a3b8;
}
html[data-theme='dark'] .intel-detail-dd {
    color: #e2e8f0;
}

/* —— Standalone 403 access denied (requirePermission) —— */
.access-denied-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 106, 0, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 86%, rgba(14, 165, 233, 0.14), transparent 30rem),
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 48%, #f1f5f9 100%);
    color: #0f172a;
}
html[data-theme='dark'] .access-denied-body {
    background:
        radial-gradient(circle at 20% 7%, rgba(255, 106, 0, 0.18), transparent 28rem),
        radial-gradient(circle at 88% 86%, rgba(14, 165, 233, 0.12), transparent 30rem),
        linear-gradient(135deg, #0b1018 0%, #111827 46%, #070b12 100%);
    color: #e2e8f0;
}
.access-denied-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2.75rem);
    box-sizing: border-box;
}
.access-denied-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 640px;
    padding: clamp(1.25rem, 3.4vw, 1.85rem);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 24px 70px -28px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(12px);
}
html[data-theme='dark'] .access-denied-card {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 28px 80px -24px rgba(0, 0, 0, 0.6);
}
.access-denied-card-glow {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #ff6a00, #fb923c 45%, #38bdf8);
}
.access-denied-brand-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.15rem, 3vw, 1.5rem);
}
.access-denied-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.access-denied-logo {
    border-radius: 10px;
    flex-shrink: 0;
}
.access-denied-app {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #64748b;
    line-height: 1.25;
}
html[data-theme='dark'] .access-denied-app {
    color: #94a3b8;
}
.access-denied-status {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 106, 0, 0.24);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    color: #c2410c;
    background: rgba(255, 106, 0, 0.08);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}
html[data-theme='dark'] .access-denied-status {
    color: #fdba74;
    background: rgba(255, 106, 0, 0.1);
    border-color: rgba(251, 146, 60, 0.3);
}
.access-denied-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 1rem;
}
.access-denied-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.15), rgba(255, 106, 0, 0.06));
    border: 1px solid rgba(255, 106, 0, 0.28);
    color: #ea580c;
    font-size: 1.42rem;
}
html[data-theme='dark'] .access-denied-icon-wrap {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.18), rgba(255, 106, 0, 0.05));
    border-color: rgba(255, 106, 0, 0.35);
    color: #fb923c;
}
.access-denied-kicker {
    margin: 0 0 0.25rem;
    color: #ea580c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
html[data-theme='dark'] .access-denied-kicker {
    color: #fdba74;
}
.access-denied-title {
    font-size: clamp(1.42rem, 3.5vw, 1.82rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem;
    line-height: 1.14;
    color: #0f172a;
}
html[data-theme='dark'] .access-denied-title {
    color: #f8fafc;
}
.access-denied-lead {
    max-width: 34rem;
    font-size: 0.96rem;
    line-height: 1.55;
    color: #475569;
    margin: 0;
}
html[data-theme='dark'] .access-denied-lead {
    color: #94a3b8;
}
.access-denied-info-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.95rem 0;
}
.access-denied-info-grid--single {
    grid-template-columns: minmax(0, 320px);
    justify-content: center;
}
.access-denied-info {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
}
html[data-theme='dark'] .access-denied-info {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(148, 163, 184, 0.12);
}
.access-denied-info-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.3rem;
}
html[data-theme='dark'] .access-denied-info-label {
    color: #94a3b8;
}
.access-denied-info strong {
    display: block;
    color: #0f172a;
    font-size: 0.9rem;
    line-height: 1.25;
}
html[data-theme='dark'] .access-denied-info strong {
    color: #f8fafc;
}
.access-denied-info small {
    display: block;
    margin-top: 0.18rem;
    color: #64748b;
}
html[data-theme='dark'] .access-denied-info small {
    color: #94a3b8;
}
.access-denied-info code {
    display: inline-block;
    max-width: 100%;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    word-break: break-all;
    color: #c2410c;
    background: transparent;
}
html[data-theme='dark'] .access-denied-info code {
    color: #fdba74;
}
.access-denied-help {
    position: relative;
    z-index: 1;
    margin: 0 0 1.25rem;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.5;
}
html[data-theme='dark'] .access-denied-help {
    color: #94a3b8;
}
.access-denied-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.access-denied-actions .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}
.access-denied-foot {
    margin-top: 1.1rem;
    text-align: center;
    letter-spacing: 0.02em;
}
@media (max-width: 575.98px) {
    .access-denied-card {
        border-radius: 14px;
    }
    .access-denied-brand-row,
    .access-denied-hero,
    .access-denied-info-grid {
        grid-template-columns: 1fr;
    }
    .access-denied-brand-row {
        align-items: flex-start;
    }
    .access-denied-status {
        width: fit-content;
    }
    .access-denied-actions .btn {
        width: 100%;
    }
}

/* —— Block roster detail (blocks/detail.php) —— */
.block-detail-page {
    max-width: 960px;
}
.block-detail-title {
    letter-spacing: -0.02em;
}
.block-detail-breadcrumb-link {
    color: inherit;
    font-weight: 500;
}
.block-detail-breadcrumb-link:hover {
    color: #ea580c;
    text-decoration: underline !important;
}
.block-detail-breadcrumb-current {
    color: #334155;
    font-weight: 600;
}
html[data-theme='dark'] .block-detail-title {
    color: #f8fafc;
}
html[data-theme='dark'] .block-detail-breadcrumb-link {
    color: #fdba74;
}
html[data-theme='dark'] .block-detail-breadcrumb-link:hover {
    color: #ffedd5;
}
html[data-theme='dark'] .block-detail-breadcrumb-current {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-detail-toolbar-actions .admin-btn-outline {
    border-color: rgba(255, 106, 0, 0.52);
    color: #fed7aa;
    background: rgba(255, 106, 0, 0.07);
}
html[data-theme='dark'] .block-detail-toolbar-actions .admin-btn-outline:hover {
    background: rgba(255, 106, 0, 0.16);
    color: #fff7ed;
    border-color: rgba(253, 186, 116, 0.65);
}
html[data-theme='dark'] .block-detail-subject-actions .admin-btn-outline {
    border-color: rgba(255, 106, 0, 0.45);
    color: #fdba74;
    background: rgba(255, 106, 0, 0.05);
}
html[data-theme='dark'] .block-detail-subject-actions .admin-btn-outline:hover {
    background: rgba(255, 106, 0, 0.12);
    color: #ffedd5;
    border-color: rgba(253, 186, 116, 0.55);
}
html[data-theme='dark'] .block-detail-accordion .accordion-button {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-detail-accordion .accordion-button.collapsed {
    color: #cbd5e1;
}
html[data-theme='dark'] .block-detail-accordion .accordion-button::after {
    filter: brightness(1.35);
}
.block-detail-empty {
    border-style: dashed;
}
.block-detail-accordion .accordion-item {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.45);
}
html[data-theme='dark'] .block-detail-accordion .accordion-item {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(23, 30, 41, 0.55);
}
.block-detail-accordion .accordion-button {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
    box-shadow: none;
    background: rgba(255, 106, 0, 0.06);
    color: inherit;
}
.block-detail-accordion .accordion-button:not(.collapsed) {
    background: rgba(255, 106, 0, 0.1);
    color: inherit;
    box-shadow: inset 0 -1px 0 rgba(255, 106, 0, 0.2);
}
html[data-theme='dark'] .block-detail-accordion .accordion-button {
    background: rgba(255, 106, 0, 0.08);
}
html[data-theme='dark'] .block-detail-accordion .accordion-button:not(.collapsed) {
    background: rgba(255, 106, 0, 0.12);
}
.block-detail-subject-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    width: 100%;
    min-width: 0;
    padding-right: 0.25rem;
}
.block-detail-subject-line1 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    row-gap: 0.15rem;
    width: 100%;
    min-width: 0;
}
.block-detail-subject-code {
    color: #ea580c;
    font-weight: 700;
}
html[data-theme='dark'] .block-detail-subject-code {
    color: #fb923c;
}
.block-detail-subject-dash {
    opacity: 0.5;
    color: #64748b;
}
html[data-theme='dark'] .block-detail-subject-dash {
    color: #94a3b8;
    opacity: 0.85;
}
.block-detail-subject-title {
    font-weight: 500;
    flex: 1 1 auto;
    min-width: 0;
    color: #1e293b;
}
.block-detail-subject-counts {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-left: 0;
    flex-wrap: wrap;
}
.block-detail-count-reg {
    color: #166534;
    background: rgba(34, 197, 94, 0.14);
    border-radius: 6px;
    padding: 0.12rem 0.45rem;
}
.block-detail-count-irr {
    color: #9a3412;
    background: rgba(251, 146, 60, 0.2);
    border-radius: 6px;
    padding: 0.12rem 0.45rem;
}
.block-detail-count-sep {
    color: #94a3b8;
    font-weight: 500;
    opacity: 0.85;
}
html[data-theme='dark'] .block-detail-subject-title {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-detail-count-reg {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.18);
}
html[data-theme='dark'] .block-detail-count-irr {
    color: #fef08a;
    background: rgba(251, 191, 36, 0.16);
}
html[data-theme='dark'] .block-detail-count-sep {
    color: #cbd5e1;
}
html[data-theme='dark'] .block-detail-accordion .accordion-body .text-muted {
    color: #94a3b8 !important;
}
.block-detail-counts {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.78rem;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 20px;
}
.block-detail-count-total,
.block-detail-count-reg,
.block-detail-count-irr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.4rem 0.95rem;
    letter-spacing: 0.03em;
    min-height: 2rem;
    line-height: 1.1;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: uppercase;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    background-clip: padding-box;
}
.block-detail-count-total {
    color: #0f172a;
    background: #f5fbff;
    border: 1px solid #dbe9ff;
}
.block-detail-count-total:hover {
    transform: translateY(-1px);
    background: #ebf4ff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.block-detail-count-reg {
    color: #0f5132;
    background: #f2faf5;
    border: 1px solid #c7f0d4;
}
.block-detail-count-reg:hover {
    transform: translateY(-1px);
    background: #e8f5ea;
}
.block-detail-count-irr {
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fde9a5;
}
.block-detail-count-irr:hover {
    transform: translateY(-1px);
    background: #fff8d5;
}
.block-detail-group-title {
    color: #0f172a;
}
html[data-theme='dark'] .block-detail-counts {
    color: #cbd5e1;
}
html[data-theme='dark'] .block-detail-count-total {
    color: #cfe8ff;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.22);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
html[data-theme='dark'] .block-detail-count-total:hover {
    background: rgba(56, 189, 248, 0.2);
}
html[data-theme='dark'] .block-detail-count-reg {
    color: #c6f6d5;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.28);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
html[data-theme='dark'] .block-detail-count-reg:hover {
    background: rgba(16, 185, 129, 0.24);
}
html[data-theme='dark'] .block-detail-count-irr {
    color: #fde047;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.26);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
html[data-theme='dark'] .block-detail-count-irr:hover {
    background: rgba(245, 158, 11, 0.22);
}
html[data-theme='dark'] .block-detail-group-title {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-detail-meta-line.text-muted {
    color: #94a3b8 !important;
}
html[data-theme='dark'] .block-detail-empty {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(23, 30, 41, 0.45);
}
html[data-theme='dark'] .block-detail-empty .text-muted {
    color: #94a3b8 !important;
}
.block-detail-accordion .accordion-body {
    padding: 0.85rem 1rem 1rem;
    font-size: 0.86rem;
    max-height: 320px;
    overflow-y: auto;
}
.block-detail-accordion .accordion-body .table-responsive {
    max-height: 260px;
    overflow-y: auto;
}
.block-detail-accordion .accordion-body .table-responsive::-webkit-scrollbar {
    width: 10px;
}
.block-detail-accordion .accordion-body .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}
html[data-theme='dark'] .block-detail-accordion .accordion-body .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.65);
}
.block-detail-group {
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(248, 250, 252, 0.9);
    height: 100%;
}
html[data-theme='dark'] .block-detail-group {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.35);
}
.block-detail-group--regular {
    border-left: 3px solid rgba(34, 197, 94, 0.65);
}
.block-detail-group--irregular {
    border-left: 3px solid rgba(251, 146, 60, 0.75);
}
.block-detail-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
html[data-theme='dark'] .block-detail-group-head {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.block-detail-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
html[data-theme='dark'] .block-detail-group-title {
    color: #94a3b8;
}
.block-detail-student-list li {
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    line-height: 1.35;
}
html[data-theme='dark'] .block-detail-student-list li {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}
.block-detail-student-list li:last-child {
    border-bottom: none;
}
.block-detail-student-list a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}
.block-detail-student-list a:hover {
    color: #ea580c;
    text-decoration: underline;
}
html[data-theme='dark'] .block-detail-student-list a:hover {
    color: #fb923c;
}
.block-detail-print-root {
    position: relative;
    z-index: 1;
}

/* Block roster page — compact registrar-style data view (blocks/detail.php) */
.block-detail-page.block-roster-page {
    max-width: none;
    width: 100%;
}
.block-roster-toolbar {
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    margin-bottom: 0.5rem;
}
.block-roster-toolbar--detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}
.block-roster-toolbar-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
}
.block-roster-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
    margin-top: 0.1rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.block-roster-title-row .block-detail-title,
.block-roster-title-row .block-detail-meta-line {
    white-space: nowrap;
}
.block-roster-title-row .block-detail-title {
    flex: 0 0 auto;
}
.block-roster-title-row .block-roster-title-sep {
    flex: 0 0 auto;
    line-height: 1;
    user-select: none;
}
.block-roster-title-row .block-detail-meta-line {
    flex: 0 0 auto;
}
.block-roster-toolbar-controls-card {
    width: 100%;
    max-width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}
html[data-theme='dark'] .block-roster-toolbar-controls-card {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 2px 10px rgba(0, 0, 0, 0.25);
}
.block-roster-toolbar-controls-inner {
    min-width: 0;
}
.block-roster-block-nav {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 100%;
}
.block-roster-block-nav .form-label {
    margin-bottom: 0;
}
.block-roster-block-nav-label {
    color: #64748b;
    font-weight: 500;
}
html[data-theme='dark'] .block-roster-block-nav-label {
    color: #e2e8f0 !important;
}
/* Search-shaped field (Select2 or native); no chevron — opens like a search box */
.block-roster-block-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    max-width: 100%;
    padding-left: 2.35rem;
    padding-right: 0.35rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.block-roster-block-search-wrap:focus-within {
    border-color: rgba(251, 146, 60, 0.55);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.16);
}
.block-roster-block-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1;
}
html[data-theme='dark'] .block-roster-block-search-icon {
    color: #94a3b8;
}
html[data-theme='dark'] .block-roster-block-search-wrap {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.38);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
html[data-theme='dark'] .block-roster-block-search-wrap:focus-within {
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}
.block-roster-block-search-wrap .form-select.block-roster-block-select {
    border: none;
    background: transparent;
    box-shadow: none;
    padding-left: 0.1rem;
    padding-right: 0.35rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    line-height: 1.3;
    min-height: 2.125rem;
}
.block-roster-block-search-wrap .form-select.block-roster-block-select:focus {
    box-shadow: none;
}
.block-roster-block-search-wrap .select2-container {
    flex: 1;
    min-width: 0;
}
.block-roster-page .block-roster-block-search-wrap .select2-container .select2-selection--single {
    min-height: 2.125rem !important;
    height: 2.125rem !important;
    padding: 0 0.35rem 0 0 !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 0.25rem !important;
}
.block-roster-page .block-roster-block-search-wrap .select2-container--default .select2-selection--single {
    border: none;
    background: transparent;
    box-shadow: none;
}
.block-roster-page .block-roster-block-search-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0.1rem !important;
    padding-right: 0.25rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.3 !important;
    color: #0f172a;
    width: 100%;
}
.block-roster-page .block-roster-block-search-wrap .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}
.block-roster-page .block-roster-block-search-wrap .select2-container--default .select2-selection--single,
.block-roster-page .block-roster-block-search-wrap .select2-container--default.select2-container--open .select2-selection--single,
.block-roster-page .block-roster-block-search-wrap .select2-container--default.select2-container--focus .select2-selection--single {
    border: none !important;
    box-shadow: none !important;
}
html[data-theme='dark'] .block-roster-block-nav .form-select.block-roster-block-select {
    color: #f8fafc;
    background-color: #172033;
    border-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='dark'] .block-roster-block-nav .form-select.block-roster-block-select:focus {
    border-color: rgba(251, 146, 60, 0.65);
    box-shadow: 0 0 0 0.12rem rgba(251, 146, 60, 0.22);
}
html[data-theme='dark'] .block-roster-block-search-wrap .form-select.block-roster-block-select {
    background-color: transparent;
    border-color: transparent;
    color: #f8fafc;
}
html[data-theme='dark'] .block-roster-block-search-wrap .form-select.block-roster-block-select:focus {
    box-shadow: none;
}
.block-roster-page .select2-container {
    z-index: 6;
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-selection--single {
    background-color: #172033;
    border-color: rgba(148, 163, 184, 0.45);
    min-height: 31px;
}
html[data-theme='dark'] .block-roster-block-search-wrap .select2-container--default .select2-selection--single {
    background-color: transparent;
    border-color: transparent;
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fafc;
    line-height: 1.35;
    padding-top: 0.2rem;
}
html[data-theme='dark'] .block-roster-block-search-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fafc;
    line-height: 1.3 !important;
    padding-top: 0 !important;
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #cbd5e1 transparent transparent transparent;
}
html[data-theme='dark'] .block-roster-page .select2-dropdown {
    background-color: #172033;
    border-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0f172a;
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-results__option--selectable {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-roster-page .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: rgba(251, 146, 60, 0.28);
    color: #fff7ed;
}
html[data-theme='dark'] .block-roster-toolbar {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}
.block-roster-block-s2-dropdown.select2-dropdown {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.block-roster-block-s2-dropdown .select2-search--dropdown {
    padding: 0.5rem 0.65rem 0.35rem;
}
.block-roster-block-s2-dropdown .select2-search--dropdown .select2-search__field {
    border-radius: 999px !important;
    padding: 0.45rem 0.85rem !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
}
html[data-theme='dark'] .block-roster-block-s2-dropdown.select2-dropdown {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .block-roster-block-s2-dropdown .select2-search--dropdown .select2-search__field {
    border-color: rgba(148, 163, 184, 0.4) !important;
}
html[data-theme='dark'] .block-roster-toolbar-actions .admin-btn-outline,
html[data-theme='dark'] .block-roster-accordion-controls .admin-btn-outline,
html[data-theme='dark'] .block-roster-acc-side-actions .btn-outline-secondary {
    border-color: rgba(255, 106, 0, 0.45);
    color: #fdba74;
    background: rgba(255, 106, 0, 0.05);
}
html[data-theme='dark'] .block-roster-toolbar-actions .admin-btn-outline:hover,
html[data-theme='dark'] .block-roster-accordion-controls .admin-btn-outline:hover,
html[data-theme='dark'] .block-roster-acc-side-actions .btn-outline-secondary:hover {
    background: rgba(255, 106, 0, 0.12);
    color: #ffedd5;
    border-color: rgba(253, 186, 116, 0.55);
}
.block-roster-list.block-roster-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}
html[data-theme='dark'] .block-roster-list.block-roster-accordion {
    border-top-color: rgba(148, 163, 184, 0.14);
}
.block-roster-acc-item {
    margin: 0;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
html[data-theme='dark'] .block-roster-acc-item {
    border-bottom-color: rgba(148, 163, 184, 0.14);
    background: transparent;
}
.block-roster-acc-item:last-child {
    border-bottom: none;
}
.block-roster-acc-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}
.block-roster-acc-toggle {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: none !important;
    border: none;
    border-radius: 0;
    padding: 0.5rem 0.65rem;
    background: rgba(248, 250, 252, 0.65);
    color: #0f172a;
}
.block-roster-acc-toggle:not(.collapsed) {
    background: rgba(255, 106, 0, 0.08);
    color: #0f172a;
}
html[data-theme='dark'] .block-roster-acc-toggle {
    background: rgba(23, 30, 41, 0.55);
    color: #f1f5f9;
}
html[data-theme='dark'] .block-roster-acc-toggle:not(.collapsed) {
    background: rgba(255, 106, 0, 0.12);
    color: #f8fafc;
}
html[data-theme='dark'] .block-roster-acc-toggle.collapsed {
    color: #e2e8f0;
}
html[data-theme='dark'] .block-roster-acc-toggle::after {
    filter: invert(1) grayscale(100%) brightness(170%);
    opacity: 0.82;
}
html[data-theme='dark'] .block-roster-acc-toggle:hover::after,
html[data-theme='dark'] .block-roster-acc-toggle:focus::after {
    filter: invert(1) grayscale(100%) brightness(220%);
    opacity: 1;
}
.block-roster-acc-side-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.4rem;
    flex-shrink: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(248, 250, 252, 0.5);
}
html[data-theme='dark'] .block-roster-acc-side-actions {
    border-left-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.35);
}
.block-roster-acc-line1 {
    display: block;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.block-roster-acc-countline {
    line-height: 1.2;
    font-weight: 500;
}
.block-roster-acc-body {
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(255, 255, 255, 0.35);
}
html[data-theme='dark'] .block-roster-acc-body {
    border-top-color: rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.25);
}
.block-roster-code {
    color: #ea580c;
    font-weight: 700;
}
html[data-theme='dark'] .block-roster-code {
    color: #fb923c;
}
.block-roster-title {
    font-weight: 600;
}
.block-roster-group {
    margin-top: 0.4rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.block-roster-group:first-of-type {
    margin-top: 0.25rem;
}
.block-roster-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #64748b;
    margin-bottom: 0.2rem;
}
html[data-theme='dark'] .block-roster-group-label {
    color: #94a3b8;
}
.roster-empty-line {
    margin: 0;
    padding: 0.1rem 0 0.15rem;
    font-style: italic;
}
.block-roster-page .roster-table-responsive {
    border-radius: 4px;
    overflow: hidden;
}
.block-roster-page .roster-data-table {
    font-size: 0.8125rem;
}
.block-roster-page .roster-data-table thead th {
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom-width: 1px;
}
.block-roster-page .roster-data-table tbody td {
    padding: 0.42rem 0.45rem;
    min-height: 2.5rem;
    vertical-align: middle;
    line-height: 1.25;
}
.block-roster-page .roster-data-table tbody tr {
    min-height: 2.5rem;
}
.block-roster-page .roster-th-num {
    width: 2.5rem;
}
.block-roster-page .roster-th-mi {
    width: 2.75rem;
}
.block-roster-page .roster-th-firstext {
    min-width: 8rem;
}
.block-roster-page .roster-th-course {
    width: 5.5rem;
}
html[data-theme='dark'] .block-roster-page .roster-data-table tbody td a {
    color: #fdba74;
}
html[data-theme='dark'] .block-roster-page .roster-data-table tbody td a:hover {
    color: #ffedd5;
}
.block-roster-empty {
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme='dark'] .block-roster-empty {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(23, 30, 41, 0.35);
}

/* On-screen roster tables (legacy class names; roster uses roster-data-table) */
.roster-screen-table {
    font-size: 0.82rem;
}
.roster-screen-th-num {
    width: 2.75rem;
}
.roster-screen-th-mi {
    width: 3rem;
}
.roster-screen-th-ext {
    width: 4.25rem;
}
.roster-empty-msg {
    font-style: normal;
}

/* Registrar-style print document (injected into #blockDetailPrintRoot; source in hidden #blockRosterPrintSheet-*) */
.roster-print-doc {
    font-family: 'Times New Roman', Times, serif;
    color: #000;
    background: #fff;
    line-height: 1.3;
}
.roster-print-header {
    margin-bottom: 0.65rem;
}
.roster-print-system {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid #000;
    padding-bottom: 0.35rem;
    margin-bottom: 0.45rem;
}
.roster-print-h1 {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.5rem;
}
.roster-print-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}
.roster-print-meta-table th,
.roster-print-meta-table td {
    border-bottom: 1px solid #bbb;
    padding: 0.2rem 0.35rem 0.2rem 0;
    vertical-align: top;
    text-align: left;
}
.roster-print-meta-table th {
    width: 32%;
    font-weight: 700;
}
.roster-print-countline {
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0.35rem 0 0.5rem;
}
.roster-print-section {
    margin-bottom: 0.55rem;
}
.roster-print-h2 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.25rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #000;
}
.roster-print-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin: 0.2rem 0 0.15rem;
}
.roster-print-data-table th,
.roster-print-data-table td {
    border: 1px solid #000;
    padding: 0.2rem 0.35rem;
    text-align: left;
}
.roster-print-data-table th {
    background: #eee;
    font-weight: 700;
}
.roster-print-col-num {
    width: 2rem;
    text-align: center !important;
}
.roster-print-col-mi {
    width: 2.5rem;
}
.roster-print-col-ext {
    width: 4rem;
}
.roster-print-col-course {
    width: 4.5rem;
}
.roster-print-empty {
    font-size: 0.72rem;
    font-style: italic;
    margin: 0.15rem 0 0.35rem;
}
.roster-print-subdivider {
    border: none;
    border-top: 1px solid #999;
    margin: 0.45rem 0 0.35rem;
}
.roster-print-rule {
    border: none;
    border-top: 1px solid #000;
    margin: 0.65rem 0 0.5rem;
}
.roster-print-sig-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    table-layout: fixed;
}
.roster-print-sig-grid td {
    width: 33.33%;
    vertical-align: bottom;
    padding: 0 0.5rem 0 0;
}
.roster-print-sig-grid td:last-child {
    padding-right: 0;
}
.roster-print-sig-label {
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.roster-print-sig-line {
    border-bottom: 1px solid #000;
    min-height: 2.25rem;
    margin-top: 0.2rem;
}

.roster-print-bundle-subject-h {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0.55rem 0 0.2rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #000;
}
.roster-print-bundle > .roster-print-header + .roster-print-bundle-subject .roster-print-bundle-subject-h {
    margin-top: 0.35rem;
}
.roster-print-bundle-break {
    border: none;
    border-top: 1px dashed #999;
    margin: 0.65rem 0 0.5rem;
}

.roster-print-header--compact {
    margin-bottom: 0.35rem;
}
.roster-print-header--bundle-cover {
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #ccc;
}
.roster-print-header--bundle-subject {
    margin-bottom: 0.25rem;
}
.roster-print-header-main {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.roster-print-header-text {
    flex: 1 1 auto;
    min-width: 0;
}
.roster-print-logo {
    flex: 0 0 auto;
    width: 3.35rem;
    height: 3.35rem;
    object-fit: contain;
}
.roster-print-kicker {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #333;
    margin: 0 0 0.2rem;
}
.roster-print-title-subject {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    line-height: 1.2;
    text-align: left;
}
.roster-print-title-subject--bundle {
    font-size: 0.82rem;
    margin-top: 0.15rem;
}
.roster-print-title-bundle {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    line-height: 1.2;
}
.roster-print-meta-inline {
    font-size: 0.6rem;
    margin: 0;
    line-height: 1.3;
    color: #222;
}
.roster-print-doc--subject-onepage {
    line-height: 1.2;
}
.roster-print-data-table--dense {
    font-size: 0.62rem;
    margin: 0.12rem 0 0.1rem;
}
.roster-print-data-table--dense th,
.roster-print-data-table--dense td {
    padding: 0.1rem 0.22rem;
    line-height: 1.15;
}
.roster-print-empty--tight {
    margin: 0.1rem 0 0.25rem;
}
.roster-print-footer--minimal {
    margin-top: 0.45rem;
}
.roster-print-footer--bundle-end {
    margin-top: 0.65rem;
    padding-top: 0.35rem;
    border-top: 1px solid #000;
}
.roster-print-sig-single {
    max-width: 12rem;
}
.roster-print-sig-single .roster-print-sig-line {
    min-height: 1.65rem;
}
.roster-print-bundle--all > .roster-print-bundle-subject:first-of-type {
    margin-top: 0.15rem;
}
.roster-print-section--split {
    margin-bottom: 0.35rem;
}
.roster-print-h2--split {
    font-size: 0.66rem;
    margin: 0.3rem 0 0.12rem;
    padding-bottom: 0.08rem;
}

@media print {
    @page {
        size: 8.5in 13in;
        margin: 10mm 11mm;
    }
    body * {
        visibility: hidden !important;
    }
    .block-detail-print-root,
    .block-detail-print-root * {
        visibility: visible !important;
    }
    .block-detail-print-root {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        min-height: 100%;
        padding: 8mm 10mm;
        display: block !important;
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.block-roster-print-selected > *:not(.block-detail-print-root) {
        display: none !important;
        visibility: hidden !important;
    }
    body.block-roster-print-selected .block-detail-print-root,
    body.block-roster-print-selected .block-detail-print-root * {
        display: revert;
        visibility: visible !important;
    }
    body.block-roster-print-selected .block-detail-print-root {
        display: block !important;
    }
    .block-detail-print-root .roster-print-doc {
        max-width: 190mm;
        margin: 0 auto;
        font-size: 10pt;
    }
    .block-detail-print-root .roster-print-system {
        font-size: 9pt;
        padding-bottom: 3pt;
        margin-bottom: 5pt;
    }
    .block-detail-print-root .roster-print-h1 {
        font-size: 14pt;
        margin-bottom: 7pt;
    }
    .block-detail-print-root .roster-print-meta-table {
        font-size: 9pt;
        margin-bottom: 8pt;
    }
    .block-detail-print-root .roster-print-meta-table th,
    .block-detail-print-root .roster-print-meta-table td {
        padding: 3pt 6pt 3pt 0;
        border-bottom: 0.5pt solid #999;
    }
    .block-detail-print-root .roster-print-countline {
        font-size: 9pt;
        margin: 0 0 7pt;
    }
    .block-detail-print-root .roster-print-section {
        margin-bottom: 9pt;
        page-break-inside: avoid;
    }
    .block-detail-print-root .roster-print-bundle .roster-print-section {
        page-break-inside: auto;
    }
    .block-detail-print-root .roster-print-bundle-subject:not(.roster-print-bundle-subject--last) {
        page-break-after: always;
    }
    .block-detail-print-root .roster-print-bundle-break {
        display: none;
    }
    .block-detail-print-root .roster-print-h2 {
        font-size: 10pt;
        padding-bottom: 2pt;
        margin-bottom: 4pt;
    }
    .block-detail-print-root .roster-print-data-table {
        font-size: 9pt;
        margin-bottom: 4pt;
    }
    .block-detail-print-root .roster-print-data-table th,
    .block-detail-print-root .roster-print-data-table td {
        border: 0.5pt solid #000;
        padding: 3pt 5pt;
    }
    .block-detail-print-root .roster-print-data-table th {
        background: #e8e8e8 !important;
    }
    .block-detail-print-root .roster-print-empty {
        font-size: 9pt;
        margin-bottom: 6pt;
    }
    .block-detail-print-root .roster-print-rule {
        margin: 10pt 0 8pt;
        border-top-width: 0.75pt;
    }
    .block-detail-print-root .roster-print-sig-grid {
        font-size: 9pt;
    }
    .block-detail-print-root .roster-print-sig-line {
        min-height: 28pt;
    }
    .block-detail-print-root .roster-print-doc--subject-onepage {
        font-size: 8.5pt;
        line-height: 1.12;
    }
    .block-detail-print-root .roster-print-header--compact {
        margin-bottom: 4pt;
    }
    .block-detail-print-root .roster-print-header-main {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8pt;
    }
    .block-detail-print-root .roster-print-logo {
        width: 38pt;
        height: 38pt;
    }
    .block-detail-print-root .roster-print-kicker {
        font-size: 7pt;
        margin-bottom: 2pt;
    }
    .block-detail-print-root .roster-print-title-subject,
    .block-detail-print-root .roster-print-title-bundle {
        font-size: 10pt;
        margin-bottom: 3pt;
    }
    .block-detail-print-root .roster-print-meta-inline {
        font-size: 7.5pt;
    }
    .block-detail-print-root .roster-print-data-table--dense {
        font-size: 7.5pt;
        margin-top: 2pt;
        margin-bottom: 2pt;
    }
    .block-detail-print-root .roster-print-data-table--dense th,
    .block-detail-print-root .roster-print-data-table--dense td {
        padding: 1.5pt 3pt;
        line-height: 1.1;
    }
    .block-detail-print-root .roster-print-footer--minimal {
        margin-top: 5pt;
    }
    .block-detail-print-root .roster-print-sig-single .roster-print-sig-line {
        min-height: 20pt;
    }
    .block-detail-print-root .roster-print-bundle--all .roster-print-header--bundle-cover {
        margin-bottom: 6pt;
        padding-bottom: 4pt;
    }
    .block-detail-print-root .roster-print-section.roster-print-section--split {
        page-break-inside: auto;
        margin-bottom: 5pt;
    }
    .block-detail-print-root .roster-print-h2--split {
        font-size: 8.5pt;
        margin-top: 5pt;
        margin-bottom: 2pt;
    }

    /* Browser “Print” on roster page: show main roster (print root empty) */
    body.block-roster-native-print:not(.block-roster-print-selected) aside.sidebar,
    body.block-roster-native-print:not(.block-roster-print-selected) .sidebar {
        visibility: hidden !important;
        display: none !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .admin-topbar,
    body.block-roster-native-print:not(.block-roster-print-selected) header.topbar.admin-topbar {
        visibility: hidden !important;
        display: none !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .main-content,
    body.block-roster-native-print:not(.block-roster-print-selected) .main-content * {
        visibility: visible !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-detail-print-root {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page {
        max-width: none !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page .accordion-collapse.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-toolbar-actions,
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-accordion-controls,
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-acc-side-actions {
        display: none !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page,
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page .accordion-body,
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page .roster-data-table {
        color: #000 !important;
        -webkit-print-color-adjust: economy;
        print-color-adjust: economy;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-page .accordion-body {
        background: #fff !important;
    }
    body.block-roster-native-print:not(.block-roster-print-selected) .block-roster-acc-toggle::after {
        display: none !important;
    }
}

/* —— Data Analytics (decision-support dashboard) —— */
.main-content.analytics-dash {
    max-width: none;
    width: calc(100% - 290px);
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}
body.sidebar-collapsed .main-content.analytics-dash {
    width: calc(100% - 110px);
}
.analytics-dash,
.analytics-dash-section,
.analytics-dash-filters,
.analytics-dash-chart,
.analytics-dash-table-wrap,
.analytics-dash-irrlist {
    min-width: 0;
    max-width: 100%;
}
.analytics-dash-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}
.analytics-dash-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    color: var(--text);
}
.analytics-dash-lead {
    font-size: 0.8125rem;
    color: #64748b;
}
html[data-theme="dark"] .analytics-dash-lead {
    color: #94a3b8;
}
.analytics-dash-lead a {
    color: var(--primary);
}
.analytics-dash-h2 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.5rem;
}
html[data-theme="dark"] .analytics-dash-h2 {
    color: #94a3b8;
}
.analytics-dash-filters {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}
.analytics-dash-kpi {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: var(--card);
    min-height: 88px;
}
.analytics-dash-kpi__value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.analytics-dash-kpi__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-top: 0.2rem;
}
html[data-theme="dark"] .analytics-dash-kpi__label {
    color: #94a3b8;
}
.analytics-dash-kpi__sub {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}
html[data-theme="dark"] .analytics-dash-kpi__sub {
    color: #94a3b8;
}
.analytics-dash-pipe {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    background: var(--card);
    text-align: center;
}
.analytics-dash-pipe__n {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}
.analytics-dash-pipe__l {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
html[data-theme="dark"] .analytics-dash-pipe__l {
    color: #94a3b8;
}
.analytics-dash-progress__bar {
    height: 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .analytics-dash-progress__bar {
    background: rgba(255, 255, 255, 0.06);
}
.analytics-dash-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.78rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 106, 0, 0.06);
    color: var(--text);
}
html[data-theme="dark"] .analytics-dash-strip {
    background: rgba(255, 106, 0, 0.08);
    color: #e2e8f0;
}
.analytics-dash-chart {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    background: var(--card);
}
.analytics-dash-chart__canvas {
    position: relative;
    height: 140px;
}
.analytics-dash-chart__canvas--short {
    height: 180px;
}
.analytics-dash-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: min(70vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
}
.analytics-dash-table {
    table-layout: fixed;
    width: 100% !important;
}
.analytics-dash-table th:first-child,
.analytics-dash-table td:first-child {
    width: 24%;
}
.analytics-dash-table th:nth-child(2),
.analytics-dash-table th:nth-child(3),
.analytics-dash-table th:nth-child(4),
.analytics-dash-table th:nth-child(5),
.analytics-dash-table th:nth-child(6),
.analytics-dash-table td:nth-child(2),
.analytics-dash-table td:nth-child(3),
.analytics-dash-table td:nth-child(4),
.analytics-dash-table td:nth-child(5),
.analytics-dash-table td:nth-child(6) {
    width: 6%;
}
.analytics-dash-table th:nth-child(7),
.analytics-dash-table td:nth-child(7) {
    width: 16%;
}
.analytics-dash-table th:nth-child(8),
.analytics-dash-table td:nth-child(8) {
    width: 12%;
}
.analytics-dash-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card);
    box-shadow: 0 1px 0 var(--border);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: normal;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}
html[data-theme="dark"] .analytics-dash-table thead th {
    color: #94a3b8;
}
.analytics-dash-table tbody td {
    font-size: 0.8rem;
    vertical-align: middle;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    overflow-wrap: anywhere;
    word-break: normal;
}
.analytics-dash-table td.text-end,
.analytics-dash-table th.text-end {
    white-space: nowrap;
    overflow-wrap: normal;
}
.analytics-dash-table td:last-child {
    font-size: 0.76rem;
    line-height: 1.35;
}
.conflict-assistant-table-wrap {
    position: relative;
    max-height: min(70vh, 520px);
    overflow-x: auto;
    overflow-y: auto;
    overflow-anchor: none;
    background: var(--card);
}
.analytics-dash-table.conflict-assistant-table {
    width: 100% !important;
    min-width: 1320px;
    table-layout: fixed;
}
.analytics-dash-table.conflict-assistant-table th,
.analytics-dash-table.conflict-assistant-table td {
    overflow-wrap: normal;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(1),
.analytics-dash-table.conflict-assistant-table td:nth-child(1) {
    width: 90px;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(2),
.analytics-dash-table.conflict-assistant-table td:nth-child(2) {
    width: 180px;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(3),
.analytics-dash-table.conflict-assistant-table td:nth-child(3) {
    width: 230px;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(4),
.analytics-dash-table.conflict-assistant-table td:nth-child(4),
.analytics-dash-table.conflict-assistant-table th:nth-child(5),
.analytics-dash-table.conflict-assistant-table td:nth-child(5) {
    width: 320px;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(6),
.analytics-dash-table.conflict-assistant-table td:nth-child(6) {
    width: 260px;
}
.analytics-dash-table.conflict-assistant-table th:nth-child(6),
.analytics-dash-table.conflict-assistant-table td:nth-child(6) {
    position: static;
    right: auto;
    background: inherit;
    box-shadow: none;
}
.analytics-dash-table.conflict-assistant-table td:nth-child(4),
.analytics-dash-table.conflict-assistant-table td:nth-child(5) {
    white-space: normal;
    overflow-wrap: anywhere;
}
.analytics-dash-table.conflict-assistant-table td:nth-child(6) {
    white-space: nowrap;
}
.analytics-dash-table.conflict-assistant-table td:nth-child(6) .btn {
    margin-left: 4px;
}
@media (max-width: 1199.98px) {
    .analytics-dash-table th:nth-child(3),
    .analytics-dash-table td:nth-child(3),
    .analytics-dash-table th:nth-child(6),
    .analytics-dash-table td:nth-child(6) {
        display: none;
    }
    .analytics-dash-table th:first-child,
    .analytics-dash-table td:first-child {
        width: 30%;
    }
    .analytics-dash-table th:nth-child(7),
    .analytics-dash-table td:nth-child(7) {
        width: 20%;
    }
}
@media (max-width: 991.98px) {
    .analytics-dash-table-wrap {
        max-height: none;
    }
    .analytics-dash-table,
    .analytics-dash-table tbody,
    .analytics-dash-table tr,
    .analytics-dash-table td {
        display: block;
        width: 100% !important;
    }
    .analytics-dash-table thead {
        display: none;
    }
    .analytics-dash-table tr {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    }
    .analytics-dash-table td,
    .analytics-dash-table td.text-end {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.34rem 0 !important;
        text-align: right !important;
        white-space: normal;
    }
    .analytics-dash-table td:first-child,
    .analytics-dash-table td:nth-child(7),
    .analytics-dash-table td:last-child {
        display: block;
        text-align: left !important;
    }
    .analytics-dash-table td::before {
        color: #94a3b8;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .analytics-dash-table td:nth-child(2)::before { content: "Demand"; }
    .analytics-dash-table td:nth-child(3)::before { content: "Assigned"; }
    .analytics-dash-table td:nth-child(4)::before { content: "Pending"; }
    .analytics-dash-table td:nth-child(5)::before { content: "Capacity"; }
    .analytics-dash-table td:nth-child(6)::before { content: "Remaining"; }
    .analytics-dash-table td:nth-child(8)::before { content: "Status"; }
    .analytics-dash-table td:first-child::before,
    .analytics-dash-table td:nth-child(7)::before,
    .analytics-dash-table td:last-child::before {
        content: "";
        display: none;
    }
}
.analytics-dash-cellbar {
    height: 6px;
    min-width: 48px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .analytics-dash-cellbar {
    background: rgba(255, 255, 255, 0.08);
}
.analytics-dash-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    border: 1px solid transparent;
}
.analytics-dash-badge--green {
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.35);
    background: rgba(34, 197, 94, 0.12);
}
html[data-theme="dark"] .analytics-dash-badge--green {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(34, 197, 94, 0.12);
}
.analytics-dash-badge--orange {
    color: #c2410c;
    border-color: rgba(194, 65, 12, 0.35);
    background: rgba(251, 146, 60, 0.14);
}
html[data-theme="dark"] .analytics-dash-badge--orange {
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.35);
    background: rgba(251, 146, 60, 0.1);
}
.analytics-dash-badge--red {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.35);
    background: rgba(248, 113, 113, 0.12);
}
html[data-theme="dark"] .analytics-dash-badge--red {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
}
.analytics-dash-insight {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: var(--card);
    height: 100%;
}
.analytics-dash-insight__icon {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.35rem;
    display: block;
}
.analytics-dash-insight--warn {
    border-left: 3px solid #f59e0b;
}
.analytics-dash-insight--critical {
    border-left: 3px solid #ef4444;
}
.analytics-dash-insight--info {
    border-left: 3px solid #38bdf8;
}
.analytics-dash-insight--ok {
    border-left: 3px solid #22c55e;
}
.analytics-dash-irrlist {
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: var(--card);
    color: var(--text);
}

/* Analytics: dark mode readability (scoped; fixes Bootstrap .text-muted / tables on dark bg) */
html[data-theme="dark"] .main-content.analytics-dash {
    color: var(--text);
}
html[data-theme="dark"] .analytics-dash .text-muted,
html[data-theme="dark"] .analytics-dash .form-label,
html[data-theme="dark"] .analytics-dash label.form-label {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .analytics-dash .small.text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .analytics-dash-progress .fw-semibold,
html[data-theme="dark"] .analytics-dash-progress .text-muted {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .analytics-dash-insight .fw-semibold {
    color: #f1f5f9;
}
html[data-theme="dark"] .analytics-dash-insight p,
html[data-theme="dark"] .analytics-dash-insight .small {
    color: #cbd5e1;
}
html[data-theme="dark"] .analytics-dash-insight .admin-btn-outline {
    color: #fdba74 !important;
    border-color: rgba(251, 146, 60, 0.5) !important;
}
html[data-theme="dark"] .analytics-dash-insight .admin-btn-outline:hover {
    color: #ffedd5 !important;
    background: rgba(255, 106, 0, 0.12) !important;
}
html[data-theme="dark"] .analytics-dash-table-wrap {
    background: var(--card);
    border-color: var(--border);
}
html[data-theme="dark"] .analytics-dash-table.table tbody td {
    color: #e2e8f0 !important;
    background: var(--card) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] .analytics-dash-table.table.conflict-assistant-table tbody td {
    background: transparent !important;
}
html[data-theme="dark"] .analytics-dash-table.table tbody tr:hover td {
    background: rgba(255, 106, 0, 0.1) !important;
}
html[data-theme="dark"] .analytics-dash-table.table thead th {
    color: #cbd5e1 !important;
    background: var(--card) !important;
    box-shadow: 0 1px 0 var(--border);
}
html[data-theme="dark"] .analytics-dash-table.table .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .analytics-dash-irrlist .text-muted {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .analytics-dash-chart .text-muted {
    color: #94a3b8 !important;
}

/* Public teacher block rosters */
.teacher-roster-public .public-wrapper {
    gap: .85rem;
}

.teacher-roster-public .public-hero-v2 {
    min-height: auto;
    padding: 1.25rem 1.45rem;
    border-radius: 8px;
    margin-bottom: .65rem;
    background:
        linear-gradient(135deg, rgba(255, 106, 0, .94), rgba(214, 72, 8, .92)),
        #f97316;
}

.teacher-roster-public .public-hero-inner {
    align-items: center;
    gap: 1.15rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .75fr);
}

.teacher-roster-public .public-hero-v2 h1 {
    max-width: 44rem;
    margin-bottom: .5rem;
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    line-height: 1.05;
}

.teacher-roster-public .public-hero-main p {
    max-width: 44rem;
    margin-bottom: 0;
    font-size: .95rem;
}

.teacher-roster-public .public-hero-aside {
    max-width: 28rem;
    justify-self: end;
    padding: .78rem .9rem;
    border-radius: 8px;
}

.teacher-roster-public .public-hero-aside-list {
    gap: .55rem;
}

.teacher-roster-public .public-hero-aside-list li {
    font-size: .86rem;
}

.teacher-roster-public .public-search-wrap {
    margin-top: -.35rem;
}

.teacher-roster-search {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 260px) auto;
    border-radius: 8px;
    padding: .75rem;
}

.teacher-roster-year-filter select.public-search-input-v2 {
    cursor: pointer;
    padding-right: 2.25rem;
}

.teacher-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .8rem;
}

.teacher-block-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 7.6rem;
    padding: .9rem;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.teacher-block-card:hover,
.teacher-block-card:focus {
    transform: translateY(-2px);
    border-color: rgba(255, 106, 0, .45);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.teacher-block-card-top {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
}

.teacher-block-card-top strong {
    font-size: 1.05rem;
    line-height: 1.25;
}

.teacher-block-card-top span {
    flex: 0 0 auto;
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.teacher-block-card-top .teacher-block-type--regular {
    color: #047857;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(5, 150, 105, .2);
}

.teacher-block-card-top .teacher-block-type--addon {
    color: #075985;
    background: rgba(14, 165, 233, .12);
    border: 1px solid rgba(14, 165, 233, .24);
}

.teacher-block-card-meta,
.teacher-block-card-count {
    font-size: .86rem;
    line-height: 1.5;
    color: #64748b;
}

.teacher-block-card-count {
    margin-top: auto;
    font-weight: 700;
    color: #334155;
}

.teacher-roster-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}

.teacher-roster-head h3 {
    margin: 0;
    font-weight: 800;
    color: #111827;
}

.teacher-roster-head p {
    margin: .25rem 0 0;
    color: #64748b;
}

.teacher-roster-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.teacher-roster-head-actions .public-block-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    padding: .45rem .75rem;
    border: 1px solid rgba(255, 106, 0, .28);
    border-radius: 8px;
    font-size: .82rem;
    line-height: 1;
    font-weight: 800;
    color: #c2410c;
    background: rgba(255, 106, 0, .1);
}

.teacher-roster-subject-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.teacher-roster-subject {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}

.teacher-roster-subject-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 3.85rem;
    padding: .55rem .8rem;
}

.teacher-roster-subject-actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
}

.teacher-roster-subject-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0;
    border: 0;
    color: #111827;
    background: transparent;
    text-align: left;
}

.teacher-roster-subject-title {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.teacher-roster-subject-toggle strong {
    font-size: .95rem;
}

.teacher-roster-subject-toggle span span {
    font-size: .86rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-roster-counts {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .28rem;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 800;
}

.teacher-roster-count {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: .22rem .48rem;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1;
}

.teacher-roster-count--regular {
    color: #047857;
    border-color: rgba(5, 150, 105, .26);
    background: rgba(16, 185, 129, .12);
}

.teacher-roster-count--irregular {
    color: #b45309;
    border-color: rgba(217, 119, 6, .28);
    background: rgba(245, 158, 11, .13);
}

.teacher-roster-count-sep {
    color: #94a3b8;
    font-weight: 700;
}

.teacher-roster-subject-body {
    display: grid;
    gap: .75rem;
    padding: .8rem .9rem .9rem;
    border-top: 1px solid rgba(15, 23, 42, .1);
}

.teacher-roster-group-title {
    margin-bottom: .4rem;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
}

.teacher-roster-table th,
.teacher-roster-table td {
    font-size: .86rem;
    vertical-align: middle;
}

.teacher-roster-public .teacher-roster-table-wrap {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 6px;
    overflow: hidden;
}

.teacher-roster-public table.teacher-roster-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: transparent;
    margin-bottom: 0;
}

.teacher-roster-public .teacher-roster-table thead th {
    background: #f1f5f9;
    color: #334155;
    border-bottom-color: rgba(15, 23, 42, .1);
}

.teacher-roster-public .teacher-roster-table tbody td {
    color: #1e293b;
    background: transparent;
    border-top-color: rgba(15, 23, 42, .08);
}

.teacher-roster-num {
    width: 3rem;
}

.teacher-roster-mi {
    width: 5rem;
}

.teacher-roster-course {
    width: 7rem;
}

.teacher-roster-print-root {
    display: none;
}

.teacher-roster-print-doc {
    color: #111827;
    background: #fff;
}

.teacher-roster-print-header {
    margin-bottom: 1rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid #cbd5e1;
}

.teacher-roster-print-kicker {
    font-size: .78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.teacher-roster-print-header h1 {
    margin: .2rem 0;
    font-size: 1.35rem;
}

.teacher-roster-print-header p {
    margin: 0;
    color: #475569;
}

.teacher-roster-print-section {
    margin-bottom: 1rem;
}

.teacher-roster-print-section h2 {
    margin: 0 0 .4rem;
    font-size: 1rem;
}

.public-access-wrapper {
    min-height: calc(100vh - 2rem);
}

.public-access-card {
    max-width: 560px;
    margin: 1.25rem auto 0;
    padding: 1.4rem;
}

.public-access-card .public-empty-state-v2 {
    min-height: auto;
    padding: .5rem 0 1rem;
}

.public-access-card .public-empty-state-v2 i {
    margin-bottom: .55rem;
    font-size: 2rem;
}

.public-access-card .public-empty-state-v2 h4 {
    margin-bottom: .35rem;
}

.public-access-card .public-empty-state-v2 p {
    max-width: 30rem;
    margin-inline: auto;
    font-size: .92rem;
}

.public-access-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
}

.public-access-form .public-input-wrap {
    min-height: 3.15rem;
}

.public-access-form .public-btn-search-v2 {
    min-height: 3.15rem;
    padding-inline: 1.25rem;
}

html[data-theme="dark"] .teacher-block-card,
html[data-theme="dark"] .teacher-roster-subject {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .78);
}

html[data-theme="dark"] .teacher-block-card-meta,
html[data-theme="dark"] .teacher-block-card-count,
html[data-theme="dark"] .teacher-roster-head p,
html[data-theme="dark"] .teacher-roster-subject-toggle span span,
html[data-theme="dark"] .teacher-roster-group-title {
    color: #94a3b8;
}

html[data-theme="dark"] .teacher-roster-head h3,
html[data-theme="dark"] .teacher-roster-subject-toggle,
html[data-theme="dark"] .teacher-block-card {
    color: #e5e7eb;
}

html[data-theme="dark"] .teacher-roster-subject-body {
    border-top-color: rgba(148, 163, 184, .18);
}

html[data-theme="dark"] .teacher-block-card-top .teacher-block-type--regular {
    color: #86efac;
    border-color: rgba(74, 222, 128, .22);
    background: rgba(34, 197, 94, .12);
}

html[data-theme="dark"] .teacher-block-card-top .teacher-block-type--addon {
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, .24);
    background: rgba(14, 165, 233, .12);
}

html[data-theme="dark"] .teacher-roster-head-actions .public-block-badge {
    border-color: rgba(251, 146, 60, .32);
    color: #fdba74;
    background: rgba(251, 146, 60, .12);
}

html[data-theme="dark"] .teacher-roster-count--regular {
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, .28);
    background: rgba(16, 185, 129, .13);
}

html[data-theme="dark"] .teacher-roster-count--irregular {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .28);
    background: rgba(245, 158, 11, .13);
}

html[data-theme="dark"] .teacher-roster-count-sep {
    color: #64748b;
}

html[data-theme="dark"] .teacher-roster-public .teacher-roster-table-wrap {
    border-color: rgba(148, 163, 184, .18);
    background: rgba(15, 23, 42, .38);
}

html[data-theme="dark"] .teacher-roster-public .teacher-roster-table thead th {
    color: #cbd5e1;
    background: #111827;
    border-color: rgba(148, 163, 184, .18);
}

html[data-theme="dark"] .teacher-roster-public .teacher-roster-table tbody td {
    color: #e2e8f0;
    background: transparent;
    border-color: rgba(148, 163, 184, .12);
}

html[data-theme="dark"] .teacher-roster-public .teacher-roster-table .text-muted {
    color: #94a3b8 !important;
}

@media (max-width: 720px) {
    .teacher-roster-public .public-hero-v2 {
        padding: 1.1rem;
    }

    .teacher-roster-public .public-hero-inner {
        display: grid;
        grid-template-columns: 1fr;
    }

    .teacher-roster-public .public-hero-aside {
        justify-self: stretch;
        max-width: none;
    }

    .teacher-roster-search,
    .teacher-roster-head {
        display: flex;
        flex-direction: column;
    }

    .teacher-roster-year-filter {
        width: 100%;
    }

    .teacher-roster-head-actions {
        justify-content: flex-start;
    }

    .teacher-roster-subject-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .teacher-roster-subject-actions {
        justify-content: flex-start;
    }

    .teacher-roster-subject-toggle {
        align-items: flex-start;
        flex-direction: column;
    }

    .teacher-roster-counts {
        justify-content: flex-start;
    }

    .public-access-card {
        padding: 1rem;
    }

    .public-access-form {
        grid-template-columns: 1fr;
    }

    .public-access-form .public-btn-search-v2 {
        width: 100%;
    }
}

@media print {
    @page {
        size: 8.5in 13in;
        margin: 10mm 11mm;
    }

    body.teacher-roster-printing > *:not(.teacher-roster-print-root) {
        display: none !important;
    }

    body.teacher-roster-printing .teacher-roster-print-root {
        display: block !important;
        padding: 0;
        background: #fff !important;
        color: #111827 !important;
    }

    body.teacher-roster-printing .teacher-roster-print-root *,
    body.teacher-roster-printing .teacher-roster-print-sheet,
    body.teacher-roster-printing .teacher-roster-print-sheet * {
        display: revert;
        visibility: visible !important;
    }

    body.teacher-roster-printing .teacher-roster-print-doc {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        font-size: 8.5pt;
        line-height: 1.12;
        color: #000 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.teacher-roster-printing .roster-print-header-main {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8pt;
    }

    body.teacher-roster-printing .roster-print-logo {
        display: block !important;
        width: 38pt;
        height: 38pt;
        object-fit: contain;
    }

    body.teacher-roster-printing .roster-print-header--compact {
        margin-bottom: 4pt;
    }

    body.teacher-roster-printing .roster-print-kicker {
        font-size: 7pt;
        margin-bottom: 2pt;
    }

    body.teacher-roster-printing .roster-print-title-subject {
        font-size: 10pt;
        margin-bottom: 3pt;
    }

    body.teacher-roster-printing .roster-print-meta-inline {
        font-size: 7.5pt;
    }

    body.teacher-roster-printing .roster-print-section.roster-print-section--split {
        page-break-inside: auto;
        margin-bottom: 5pt;
    }

    body.teacher-roster-printing .roster-print-h2--split {
        font-size: 8.5pt;
        margin-top: 5pt;
        margin-bottom: 2pt;
    }

    body.teacher-roster-printing .roster-print-data-table {
        width: 100%;
        border-collapse: collapse;
        display: table !important;
        font-size: 7.5pt;
        margin-top: 2pt;
        margin-bottom: 2pt;
    }

    body.teacher-roster-printing .roster-print-data-table thead {
        display: table-header-group !important;
    }

    body.teacher-roster-printing .roster-print-data-table tbody {
        display: table-row-group !important;
    }

    body.teacher-roster-printing .roster-print-data-table tr {
        display: table-row !important;
    }

    body.teacher-roster-printing .roster-print-data-table th,
    body.teacher-roster-printing .roster-print-data-table td {
        display: table-cell !important;
        color: #000 !important;
        background: #fff !important;
        border: 0.5pt solid #000 !important;
        padding: 1.5pt 3pt;
        line-height: 1.1;
    }

    body.teacher-roster-printing .roster-print-data-table th {
        background: #e8e8e8 !important;
    }

    body.teacher-roster-printing .roster-print-footer--minimal {
        margin-top: 5pt;
    }

    body.teacher-roster-printing .roster-print-sig-single .roster-print-sig-line {
        min-height: 20pt;
    }

    body.teacher-roster-printing .teacher-roster-table {
        width: 100%;
        border-collapse: collapse;
        display: table !important;
    }

    body.teacher-roster-printing .teacher-roster-table thead {
        display: table-header-group !important;
    }

    body.teacher-roster-printing .teacher-roster-table tbody {
        display: table-row-group !important;
    }

    body.teacher-roster-printing .teacher-roster-table tr {
        display: table-row !important;
    }

    body.teacher-roster-printing .teacher-roster-table th,
    body.teacher-roster-printing .teacher-roster-table td {
        color: #111827 !important;
        background: #fff !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 10pt;
        padding: .22rem .35rem;
    }
}

.backup-panel {
    display: grid;
    gap: .85rem;
}

.backup-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.backup-status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    padding: .28rem .65rem;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.backup-status-pill--safe {
    color: #86efac;
    border-color: rgba(34, 197, 94, .28);
    background: rgba(22, 163, 74, .12);
}

.backup-status-pill--warn {
    color: #fdba74;
    border-color: rgba(249, 115, 22, .28);
    background: rgba(249, 115, 22, .12);
}

.backup-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.backup-overview-card,
.backup-control-section,
.backup-empty-state {
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .36);
    border-radius: 8px;
}

.backup-overview-card {
    padding: .8rem .9rem;
}

.backup-overview-card span {
    display: block;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.backup-overview-card strong {
    display: block;
    color: #f8fafc;
    font-size: .95rem;
    margin-top: .25rem;
}

.backup-control-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem;
}

.backup-section-copy h2 {
    color: #f8fafc;
    font-size: .98rem;
    margin: 0 0 .2rem;
}

.backup-section-copy p {
    color: #94a3b8;
    font-size: .82rem;
    margin: 0;
}

.backup-action-row,
.backup-restore-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

/* Modal password field with toggle icon */
.modal-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-password-wrapper .form-control {
    flex: 1;
    padding-right: 40px;
}

.modal-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: color 0.15s ease;
}

.modal-password-toggle:hover {
    color: #ff6a00;
}

.modal-password-toggle i {
    display: block;
}

html[data-theme="dark"] .modal-password-toggle {
    color: #94a3b8;
}

html[data-theme="dark"] .modal-password-toggle:hover {
    color: #fdba74;
}

.backup-restore-form {
    min-width: min(100%, 430px);
}

.backup-restore-form .form-control {
    min-width: 240px;
}

.backup-files-card {
    padding: 1rem;
}

.backup-files-table {
    margin-bottom: 0;
}

.backup-file-name {
    color: #e5e7eb;
    font-weight: 700;
}

.backup-empty-state {
    padding: 1.1rem;
}

.backup-empty-state h4 {
    color: #f8fafc;
    font-size: 1rem;
    margin: 0 0 .25rem;
}

.backup-empty-state p {
    color: #94a3b8;
    font-size: .86rem;
    margin: 0 0 .8rem;
}

html[data-theme="light"] .backup-page-head h1,
html[data-theme="light"] .backup-section-copy h2,
html[data-theme="light"] .backup-empty-state h4 {
    color: #111827;
}

html[data-theme="light"] .backup-page-head .text-muted,
html[data-theme="light"] .backup-section-copy p,
html[data-theme="light"] .backup-empty-state p {
    color: #475569 !important;
}

html[data-theme="light"] .backup-overview-card,
html[data-theme="light"] .backup-control-section,
html[data-theme="light"] .backup-empty-state {
    border-color: rgba(100, 116, 139, .2);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

html[data-theme="light"] .backup-overview-card span {
    color: #475569;
}

html[data-theme="light"] .backup-overview-card strong,
html[data-theme="light"] .backup-file-name {
    color: #111827;
}

html[data-theme="light"] .backup-status-pill--safe {
    color: #166534;
    border-color: rgba(22, 101, 52, .24);
    background: rgba(220, 252, 231, .9);
}

html[data-theme="light"] .backup-status-pill--warn {
    color: #9a3412;
    border-color: rgba(234, 88, 12, .28);
    background: rgba(255, 247, 237, .95);
}

html[data-theme="light"] .backup-files-card .data-card-desc,
html[data-theme="light"] .backup-files-table .text-muted {
    color: #475569 !important;
}

@media (max-width: 960px) {
    .backup-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .backup-control-section,
    .backup-restore-form {
        align-items: stretch;
        flex-direction: column;
    }

    .backup-action-row {
        justify-content: flex-start;
    }

    .backup-restore-form .form-control {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .backup-page-head,
    .backup-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .backup-overview-grid {
        grid-template-columns: 1fr;
    }
}

.public-chatbot {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    font-family: inherit;
}

.public-chatbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    border: 1px solid rgba(251, 146, 60, .42);
    border-radius: 999px;
    padding: .62rem .9rem;
    color: #fff7ed;
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
    font-size: .86rem;
    font-weight: 900;
}

.public-chatbot-toggle i {
    font-size: 1rem;
}

.public-chatbot-panel {
    width: min(380px, calc(100vw - 2rem));
    margin-bottom: .65rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 12px;
    background: rgba(15, 23, 42, .96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
    backdrop-filter: blur(14px);
}

.public-chatbot-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .82rem .9rem;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.public-chatbot-head strong,
.public-chatbot-head small {
    display: block;
}

.public-chatbot-head strong {
    color: #f8fafc;
    font-size: .95rem;
}

.public-chatbot-head small {
    color: #94a3b8;
    font-size: .72rem;
    margin-top: .08rem;
}

.public-chatbot-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 8px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, .45);
}

.public-chatbot-body {
    display: flex;
    flex-direction: column;
    gap: .62rem;
    max-height: 260px;
    overflow-y: auto;
    padding: .9rem;
    scrollbar-width: thin;
}

.public-chatbot-msg {
    max-width: 86%;
    border-radius: 12px;
    padding: .66rem .76rem;
    font-size: .84rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.public-chatbot-msg--bot {
    align-self: flex-start;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(30, 41, 59, .76);
}

.public-chatbot-msg--user {
    align-self: flex-end;
    color: #fff7ed;
    background: rgba(249, 115, 22, .88);
}

.public-chatbot-quick {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0 .9rem .78rem;
}

.public-chatbot-quick button {
    border: 1px solid rgba(251, 146, 60, .26);
    border-radius: 999px;
    padding: .32rem .55rem;
    color: #fdba74;
    background: rgba(249, 115, 22, .1);
    font-size: .74rem;
    font-weight: 800;
}

.public-chatbot-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    padding: .78rem .9rem .9rem;
    border-top: 1px solid rgba(148, 163, 184, .16);
    background: rgba(2, 6, 23, .18);
}

.public-chatbot-form .form-control {
    min-height: 42px;
    border-color: rgba(59, 130, 246, .42);
    color: #f8fafc;
    background: rgba(15, 23, 42, .9);
    font-size: .84rem;
    box-shadow: none;
}

.public-chatbot-form .form-control::placeholder {
    color: #94a3b8;
}

.public-chatbot-form .form-control:focus {
    border-color: rgba(249, 115, 22, .72);
    box-shadow: 0 0 0 .18rem rgba(249, 115, 22, .14);
}

.public-chatbot-form .btn {
    min-width: 46px;
    min-height: 42px;
    padding-inline: .75rem;
    border-radius: 12px;
}

html[data-theme="light"] .public-chatbot-panel {
    border-color: rgba(15, 23, 42, .12);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
}

html[data-theme="light"] .public-chatbot-head {
    border-bottom-color: rgba(15, 23, 42, .1);
    background: rgba(248, 250, 252, .86);
}

html[data-theme="light"] .public-chatbot-head strong {
    color: #0f172a;
}

html[data-theme="light"] .public-chatbot-head small {
    color: #64748b;
}

html[data-theme="light"] .public-chatbot-close {
    color: #334155;
    border-color: rgba(15, 23, 42, .12);
    background: #ffffff;
}

html[data-theme="light"] .public-chatbot-body {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

html[data-theme="light"] .public-chatbot-msg--bot {
    color: #1f2937;
    border-color: rgba(15, 23, 42, .12);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

html[data-theme="light"] .public-chatbot-msg--user {
    color: #ffffff;
    background: #ea580c;
}

html[data-theme="light"] .public-chatbot-quick {
    background: #f8fafc;
}

html[data-theme="light"] .public-chatbot-quick button {
    color: #9a3412;
    border-color: rgba(234, 88, 12, .24);
    background: rgba(255, 247, 237, .95);
}

html[data-theme="light"] .public-chatbot-form {
    border-top-color: rgba(15, 23, 42, .1);
    background: #ffffff;
}

html[data-theme="light"] .public-chatbot-form .form-control {
    color: #0f172a;
    border-color: rgba(234, 88, 12, .34);
    background: #ffffff;
}

html[data-theme="light"] .public-chatbot-form .form-control::placeholder {
    color: #64748b;
}

@media (max-width: 560px) {
    .public-chatbot {
        right: .75rem;
        bottom: .75rem;
    }

    .public-chatbot-panel {
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 5rem);
    }

    .public-chatbot-body {
        max-height: min(260px, calc(100vh - 260px));
    }
}
