:root {
    --icst-bg: #091a36;
    --icst-bg-soft: #10264d;
    --icst-surface: #122d59;
    --icst-card: #0f2345;
    --icst-primary: #f4c20d;
    --icst-primary-strong: #d9a400;
    --icst-text: #e9f0ff;
    --icst-muted: #c4d2ee;
    --icst-border: #284879;
}

*,
*::before,
*::after {
    transition: all 0.25s ease;
}

body {
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--icst-text);
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 216, 77, 0.08), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(60, 120, 255, 0.1), transparent 38%),
        linear-gradient(145deg, var(--icst-bg), #08142c 65%);
    min-height: 100vh;
}

.site-title,
.site-brand {
    font-family: "Times New Roman", Times, serif !important;
}

.site-brand .site-brand-i,
.site-title .site-brand-i,
.site-title em.site-brand-i {
    color: #F9DB0F !important;
    font-style: italic !important;
    font-weight: 700;
}

.site-brand .site-brand-rest {
    font-style: normal;
    font-weight: 700;
}

.text-body {
    color: var(--icst-text);
}

.text-dark {
    color: #111111 !important;
}

.text-black {
    color: #000000 !important;
}

.text-muted,
.text-secondary,
small.text-muted {
    color: var(--icst-muted) !important;
}

h1, h2, h3, h4, h5, h6,
.fw-bold, .fw-semibold {
    color: #f7fbff;
}

.container-fluid,
.container {
    max-width: 1320px;
}

.nav-modern {
    background: linear-gradient(110deg, #07162f, #0f2a55 60%, #13366a);
    border-bottom: 1px solid rgba(255, 216, 77, 0.2);
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
}

.brand-logo {
    max-height: 32px;
    width: auto;
    display: block;
}

.brand-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe98f 0%, var(--icst-primary-strong) 70%);
    box-shadow: 0 0 16px rgba(255, 216, 77, 0.8);
}

.nav-modern .navbar-brand {
    color: #fff;
    letter-spacing: 0.01em;
    font-family: "Times New Roman", Times, serif;
}

.nav-modern .nav-link {
    color: rgba(233, 240, 255, 0.9);
    font-weight: 500;
}

.nav-modern .nav-link:hover {
    color: var(--icst-primary);
}

.user-chip {
    background: linear-gradient(180deg, #fff3b0, #ffd54f);
    border: 1px solid rgba(184, 134, 11, 0.5);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    color: #1a1a1a;
}

.nav-avatar,
.nav-avatar-placeholder {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.nav-avatar {
    object-fit: cover;
    border: 1px solid rgba(255, 216, 77, 0.5);
}

.nav-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 216, 77, 0.22);
    border: 1px solid rgba(255, 216, 77, 0.45);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.user-chip .nav-avatar-placeholder {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: #111;
}

.user-chip .nav-avatar {
    border-color: rgba(0, 0, 0, 0.22);
}

.message-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
}

.message-icon svg {
    width: 16px;
    height: 16px;
}

.receipt-dropdown {
    min-width: 280px;
    border: 1px solid var(--icst-border);
    background: #0d2247;
    color: var(--icst-text);
}

.receipt-dropdown .dropdown-header {
    color: #ffe58a;
}

.receipt-dropdown .dropdown-item-text,
.receipt-dropdown .dropdown-item {
    color: var(--icst-text);
}

.receipt-dropdown .dropdown-item:hover {
    background: rgba(255, 216, 77, 0.12);
}

.receipt-dropdown .dropdown-divider {
    border-color: rgba(173, 192, 232, 0.25);
}

.card,
.panel-card,
.stat-card {
    border-radius: 1rem;
    border: 1px solid var(--icst-border);
    background: linear-gradient(150deg, rgba(18, 45, 89, 0.95), rgba(12, 32, 66, 0.95));
    box-shadow: 0 14px 36px rgba(2, 10, 28, 0.45);
    color: var(--icst-text);
}

.card .list-group-item {
    background: transparent;
    color: var(--icst-text);
    border-color: rgba(173, 192, 232, 0.16);
}

.dropdown-menu {
    background: #0d2247;
    border: 1px solid var(--icst-border);
}

.dropdown-item,
.dropdown-item-text {
    color: #e9f0ff !important;
}

.dropdown-header,
.dropdown-menu .text-muted,
.dropdown-menu small,
.dropdown-menu span,
.dropdown-menu a,
.dropdown-menu li {
    color: #ffffff !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(244, 194, 13, 0.16);
    color: #ffffff !important;
}

.panel-card .card-body {
    padding: 1.15rem 1.2rem;
}

.glass-card {
    backdrop-filter: blur(10px);
}

.hero-card {
    border: 1px solid rgba(255, 216, 77, 0.2);
    background:
        linear-gradient(145deg, rgba(20, 48, 94, 0.95), rgba(12, 30, 60, 0.96));
}

.section-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.section-subtitle {
    color: var(--icst-muted);
}

.btn-modern,
.btn {
    border-radius: 0.75rem;
}

.btn-primary {
    background: linear-gradient(120deg, var(--icst-primary), var(--icst-primary-strong));
    border-color: var(--icst-primary-strong);
    color: #0f2244;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(241, 191, 0, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(120deg, #f7cf3a, #e2af00);
    border-color: #c79400;
    color: #0c1c3a;
}

.btn-outline-primary {
    border-color: rgba(244, 194, 13, 0.75);
    color: #ffdf6c;
}

.btn-outline-primary:hover {
    background: rgba(244, 194, 13, 0.2);
    color: #ffffff;
    border-color: rgba(244, 194, 13, 0.95);
}

.btn-outline-secondary {
    border-color: rgba(196, 210, 238, 0.5);
    color: #dbe6ff;
}

.btn-outline-secondary:hover {
    background: rgba(196, 210, 238, 0.12);
    color: #ffffff;
    border-color: rgba(196, 210, 238, 0.8);
}

.table-modern thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f2d86f;
    border-bottom: 1px solid rgba(255, 216, 77, 0.24);
}

.table-modern tbody tr {
    border-color: rgba(173, 192, 232, 0.12);
}

.table-modern tbody tr:hover {
    background: rgba(255, 216, 77, 0.08);
}

.table {
    color: var(--icst-text);
}

.table td,
.table th {
    color: #e9f0ff;
}

.table .text-muted {
    color: #c7d4ef !important;
}

/* Explicit readable table style for "My Classes" sections */
.table-myclasses thead th {
    color: #1a2d50 !important;
    background: #f5f5f5 !important;
}

.table-myclasses tbody td {
    color: #0f1f38 !important;
    background: #ffffff !important;
}

.table-myclasses tbody tr:hover td {
    background: #fafafa !important;
}

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

.table-myclasses td:last-child {
    min-width: 220px;
}

.table-myclasses .class-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.table-myclasses .class-actions form {
    margin: 0;
}

/* Requested high contrast for teacher history/archive tables */
.table-blacktext thead th {
    color: #1a2d50 !important;
    background: #f5f5f5 !important;
}

.table-blacktext tbody td {
    color: #0f1f38 !important;
    background: #ffffff !important;
}

.table-blacktext tbody tr:hover td {
    background: #fafafa !important;
}

.table-blacktext .text-muted,
.table-blacktext small,
.table-blacktext .small {
    color: #3f557a !important;
}

.table-blacktext .nav-avatar-placeholder {
    background: #d7e4fb !important;
    border-color: #9fb7e4 !important;
    color: #15325f !important;
}

/* Readability fixes for white/light areas */
.bg-white,
.bg-light,
.bg-white *,
.bg-light * {
    color: #102447 !important;
}

.bg-white .text-muted,
.bg-light .text-muted,
.bg-white small.text-muted,
.bg-light small.text-muted {
    color: #4f6488 !important;
}

.bg-white a,
.bg-light a {
    color: #0294d8 !important;
}

.bg-white .form-control,
.bg-white .form-select,
.bg-light .form-control,
.bg-light .form-select {
    background: #ffffff !important;
    color: #102447 !important;
    border-color: #c8d7f2 !important;
}

.bg-white .form-control::placeholder,
.bg-light .form-control::placeholder {
    color: #748cb3 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--icst-text);
    background: rgba(255, 255, 255, 0.02);
}

.form-control,
.form-select {
    border-radius: 0.7rem;
    border-color: rgba(173, 192, 232, 0.25);
    background: rgba(10, 26, 52, 0.85);
    color: #ffffff !important;
}

.form-label,
label {
    color: #e4eeff;
}

.form-control::placeholder {
    color: #9cb2dd;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(255, 216, 77, 0.75);
    box-shadow: 0 0 0 0.2rem rgba(255, 216, 77, 0.15);
    background: rgba(13, 32, 62, 0.95);
    color: #fff;
}

.form-select option {
    background-color: #ffffff !important;
    color: #102447 !important;
}

.bg-white .form-select option,
.bg-light .form-select option {
    background-color: #ffffff !important;
    color: #102447 !important;
}

.bloom-distribution-box,
.bloom-distribution-box * {
    color: #102447 !important;
}

.bloom-distribution-box .form-control,
.bloom-distribution-box .form-select {
    background: #ffffff !important;
    color: #102447 !important;
    border-color: #c8d7f2 !important;
}

.bloom-distribution-box .form-label {
    color: #1a2d50 !important;
}

.teacher-shell .form-select option,
.teacher-shell .form-control,
.teacher-shell .form-select,
.student-shell .form-control,
.student-shell .form-select {
    color: #111111 !important;
    background: #ffffff !important;
}

.teacher-shell .form-select option,
.student-shell .form-select option,
body.admin-pages .form-select option,
.body-light-ui .form-select option {
    background-color: #ffffff !important;
    color: #102447 !important;
}

.text-bg-primary {
    background-color: #0294d8 !important;
    color: #ffffff !important;
}

.text-bg-secondary {
    background-color: #455978 !important;
    color: #eef4ff !important;
}

.text-bg-success {
    background-color: #1f8b54 !important;
    color: #ecfff4 !important;
}

.text-bg-danger {
    background-color: #a83547 !important;
    color: #ffeef1 !important;
}

.badge-soft {
    background: rgba(244, 194, 13, 0.2);
    color: #ffe083;
    border: 1px solid rgba(244, 194, 13, 0.55);
}

.badge.text-bg-warning {
    background-color: #d9a400 !important;
    color: #0f2244 !important;
}

.text-warning {
    color: #ffcf4d !important;
}

.badge.text-bg-info {
    background-color: #03b1fc !important;
    color: #f2f7ff !important;
}

.alert {
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ecf3ff;
}

.alert-success {
    background: rgba(40, 167, 69, 0.18);
    color: #d4ffdf;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #ffd6db;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #fff2bf;
}

.alert-info {
    background: rgba(13, 202, 240, 0.16);
    color: #d7f8ff;
}

.modern-alert-stack {
    position: fixed;
    top: 84px;
    right: 16px;
    z-index: 2000;
    width: min(92vw, 380px);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.modern-alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.85rem;
    padding: 0.78rem 0.95rem;
    box-shadow: 0 14px 30px rgba(2, 10, 28, 0.45);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    animation: modernAlertIn 220ms ease forwards;
}

.modern-alert.is-leaving {
    animation: modernAlertOut 220ms ease forwards;
}

.modern-alert__icon {
    font-size: 1rem;
    line-height: 1.2;
    margin-top: 1px;
}

.modern-alert__body {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.modern-alert__close {
    background: transparent;
    border: 0;
    color: inherit;
    opacity: 0.85;
    font-size: 1rem;
    line-height: 1;
    padding: 0.1rem 0.2rem;
}

.modern-alert__close:hover {
    opacity: 1;
    transform: scale(1.05);
}

.modern-alert__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.65);
    transform-origin: left center;
    animation: modernAlertProgress linear forwards;
}

.modern-alert.alert-success {
    background: linear-gradient(140deg, rgba(23, 112, 66, 0.92), rgba(20, 77, 51, 0.92));
    color: #eafff2;
}

.modern-alert.alert-danger {
    background: linear-gradient(140deg, rgba(137, 35, 52, 0.94), rgba(95, 24, 38, 0.94));
    color: #ffeff2;
}

.modern-alert.alert-warning {
    background: linear-gradient(140deg, rgba(173, 125, 10, 0.94), rgba(127, 89, 0, 0.94));
    color: #fff7df;
}

.modern-alert.alert-info {
    background: linear-gradient(140deg, rgba(27, 95, 128, 0.94), rgba(20, 67, 91, 0.94));
    color: #e8f8ff;
}

@keyframes modernAlertIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modernAlertOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

@keyframes modernAlertProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.sidebar-card {
    position: sticky;
    top: 1rem;
}

.student-shell .student-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.student-header-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Strong readability overrides for key dashboards */
.student-shell,
.teacher-shell {
    color: #eef4ff;
}

.student-shell .section-title,
.teacher-shell .section-title,
.student-shell h1,
.student-shell h2,
.student-shell h3,
.student-shell h4,
.student-shell h5,
.student-shell h6,
.teacher-shell h1,
.teacher-shell h2,
.teacher-shell h3,
.teacher-shell h4,
.teacher-shell h5,
.teacher-shell h6 {
    color: #f7fbff;
}

.student-shell p,
.student-shell li,
.student-shell td,
.student-shell th,
.teacher-shell p,
.teacher-shell li,
.teacher-shell td,
.teacher-shell th {
    color: #e6efff;
}

.student-shell .text-muted,
.teacher-shell .text-muted,
.student-shell .section-subtitle,
.teacher-shell .section-subtitle {
    color: #c9d7f1 !important;
}

.student-shell .table-modern thead th,
.teacher-shell .table-modern thead th {
    color: #ffe082;
}

.student-shell .table-modern tbody tr:hover,
.teacher-shell .table-modern tbody tr:hover {
    background: rgba(255, 216, 77, 0.12);
}

.student-shell .form-label,
.teacher-shell .form-label {
    color: #edf4ff;
}

.student-shell .badge.text-bg-info,
.teacher-shell .badge.text-bg-info {
    background-color: #0294d8 !important;
    color: #f3f8ff !important;
}

.student-shell .badge.text-bg-warning,
.teacher-shell .badge.text-bg-warning {
    background-color: #d8a200 !important;
    color: #0f2448 !important;
}

.student-sidebar-col .panel-card {
    overflow: hidden;
}

.student-header-meta .badge {
    padding: 0.45rem 0.65rem;
}

.student-sidebar .student-nav-btn {
    text-align: left;
    border-radius: 0.7rem;
    font-weight: 600;
}

.student-sidebar .student-nav-btn.btn-primary {
    color: #13274d;
}

.student-join-card {
    border: 1px dashed rgba(255, 216, 77, 0.35);
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 216, 77, 0.5);
}

.profile-avatar-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 216, 77, 0.12);
    color: #ffe58a;
    font-weight: 600;
    border: 3px dashed rgba(255, 216, 77, 0.5);
}

.sidebar-receipt-box {
    font-size: 0.82rem;
    line-height: 1.35;
    max-height: 170px;
}

.stat-card {
    border: 1px solid rgba(255, 216, 77, 0.18);
}

.stat-card h6 {
    color: #c7d7fa;
    margin-bottom: 0.4rem;
}

.stat-card h2 {
    color: #fff1b5;
    margin: 0;
    font-weight: 800;
}

.site-footer {
    border-top: 1px solid rgba(255, 216, 77, 0.25);
    background: linear-gradient(95deg, #07162e, #0d2247);
}

.swal-login-loading-popup {
    text-align: center !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(80, 170, 235, 0.35) !important;
    box-shadow: 0 10px 28px rgba(80, 170, 235, 0.22) !important;
    background: rgba(230, 245, 255, 0.92) !important;
    backdrop-filter: blur(2px);
    border-radius: 12px !important;
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
}

/* One-click submit: keep the button visibly locked while the request is in flight */
button.is-submitting,
input.is-submitting,
form[aria-busy="true"] button[type="submit"],
form[aria-busy="true"] input[type="submit"],
form[aria-busy="true"] button:not([type]) {
    opacity: 0.75;
    cursor: wait !important;
    pointer-events: none;
}

html.is-action-processing,
html.is-action-processing body {
    cursor: wait !important;
}

.swal-login-loading-title,
.swal-login-loading-text {
    text-align: center !important;
    color: #114d7a !important;
}

.swal-login-loading-image {
    margin: 0 auto 0.5rem auto !important;
    width: 68px !important;
    height: 68px !important;
    object-fit: contain;
}

a {
    color: #ffd35e;
}

a:hover {
    color: #ffe7a1;
}

#upcoming,
#history,
#notifications {
    scroll-margin-top: 90px;
}

@media (max-width: 992px) {
    .sidebar-card {
        position: static;
    }

    .student-shell .student-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-header-meta {
        width: 100%;
    }

    .student-header-meta .badge {
        flex: 1 1 auto;
        text-align: center;
    }

    .student-sidebar .student-nav-btn {
        padding: 0.55rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .panel-card .card-body {
        padding: 0.95rem;
    }

    .table-modern thead th {
        font-size: 0.72rem;
    }
}

/* Global fallback: force dark text on any light/white blocks */
.bg-white,
.bg-light,
.bg-white *,
.bg-light * {
    color: #102447 !important;
}

.student-shell .bg-white,
.teacher-shell .bg-white,
.student-shell .bg-light,
.teacher-shell .bg-light,
.student-shell .bg-white *,
.teacher-shell .bg-white *,
.student-shell .bg-light *,
.teacher-shell .bg-light * {
    color: #102447 !important;
}

.bg-white .table td,
.bg-white .table th,
.bg-light .table td,
.bg-light .table th,
.student-shell .bg-white .table td,
.teacher-shell .bg-white .table td,
.student-shell .bg-light .table td,
.teacher-shell .bg-light .table td {
    color: #102447 !important;
}

.bg-white .text-muted,
.bg-light .text-muted,
.student-shell .bg-white .text-muted,
.teacher-shell .bg-white .text-muted {
    color: #4f6488 !important;
}

/* Auth pages: body-light-ui keeps default site background (dark gradient); text tuned in rules below */

.body-light-ui .container-fluid,
.body-light-ui .container {
    color: #111111 !important;
}

/* Override global light heading colors inside admin/auth */
body.body-light-ui h1,
body.body-light-ui h2,
body.body-light-ui h3,
body.body-light-ui h4,
body.body-light-ui h5,
body.body-light-ui h6 {
    color: #0f1f38 !important;
}

.body-light-ui p,
.body-light-ui .card-body p {
    color: #111111 !important;
}

.body-light-ui .text-secondary {
    color: #1a1a1a !important;
}

/* Admin + auth pages: dark text on light panels for readability */
.body-light-ui .panel-card,
.body-light-ui .stat-card,
.body-light-ui .glass-card,
.body-light-ui .hero-card {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #111111 !important;
    box-shadow: 0 8px 28px rgba(15, 40, 80, 0.12) !important;
}

/* Plain .card on admin pages (inherits from .card global dark text) */
.body-light-ui .card:not(.nav-modern) {
    color: #111111 !important;
}

.body-light-ui .panel-card .card-body,
.body-light-ui .stat-card .card-body,
.body-light-ui .glass-card .card-body,
.body-light-ui .hero-card .card-body {
    color: #111111 !important;
}

.body-light-ui .stat-card h2,
.body-light-ui .stat-card h6 {
    color: #0f1f38 !important;
}

.body-light-ui .section-title {
    color: #0f1f38 !important;
}

.body-light-ui .section-subtitle {
    color: #333333 !important;
}

.body-light-ui .form-label,
.body-light-ui label {
    color: #111111 !important;
}

.body-light-ui .form-control,
.body-light-ui .form-select {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #b8c8e6 !important;
}

.body-light-ui .form-control:focus,
.body-light-ui .form-select:focus {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #c9a00a !important;
}

.body-light-ui .form-control::placeholder {
    color: #5a6b85 !important;
}

.body-light-ui .text-muted,
.body-light-ui small.text-muted {
    color: #333333 !important;
}

.body-light-ui .form-select option {
    color: #111111 !important;
}

.body-light-ui .input-group-text {
    background: #e8eef8 !important;
    color: #111111 !important;
    border-color: #b8c8e6 !important;
}

.body-light-ui .table-modern thead th {
    color: #1a2d50 !important;
    border-bottom-color: rgba(26, 45, 80, 0.35) !important;
}

.body-light-ui .table-modern tbody td,
.body-light-ui .table td,
.body-light-ui .table th {
    color: #0f1f38 !important;
}

.body-light-ui .table-modern tbody tr:hover {
    background: rgba(255, 216, 77, 0.12) !important;
}

.body-light-ui .alert {
    color: #0f1f38 !important;
}

.body-light-ui .alert-success {
    background-color: #d4edda !important;
    border-color: #b8d9c2 !important;
    color: #155724 !important;
}

.body-light-ui .alert-danger {
    background-color: #f8d7da !important;
    border-color: #f0b8be !important;
    color: #721c24 !important;
}

.body-light-ui h1,
.body-light-ui h2,
.body-light-ui h3,
.body-light-ui h4,
.body-light-ui h5,
.body-light-ui h6,
.body-light-ui .fw-bold {
    color: #0f1f38 !important;
}

.body-light-ui .lead {
    color: #222222 !important;
}

.body-light-ui .card .list-group-item {
    color: #111111 !important;
}

.body-light-ui .btn-outline-secondary {
    color: #212529 !important;
    border-color: #6c757d !important;
}

.body-light-ui .btn-outline-secondary:hover {
    color: #fff !important;
    background-color: #6c757d !important;
}

.body-light-ui .btn-outline-primary {
    color: #8a6d00 !important;
    border-color: #c9a00a !important;
}

.body-light-ui .btn-outline-primary:hover {
    color: #0f1f38 !important;
    background-color: rgba(244, 194, 13, 0.35) !important;
}

.body-light-ui a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
    color: #0176aa !important;
}

.body-light-ui .table-responsive {
    color: #111111 !important;
}

/* Admin: Teacher Accounts, Latest Students, Students list — force black table & heading text */
.body-light-ui .panel-card h5.fw-bold {
    color: #000000 !important;
}

.body-light-ui table.admin-data-table {
    --bs-table-color: #111111;
    --bs-table-bg: transparent;
    --bs-table-striped-color: #111111;
    --bs-table-active-color: #111111;
    --bs-table-hover-color: #111111;
    color: #111111 !important;
}

.body-light-ui table.admin-data-table thead th {
    color: #000000 !important;
    background-color: #e4eaf6 !important;
    border-bottom: 1px solid #b8c8e6 !important;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
}

.body-light-ui table.admin-data-table tbody td,
.body-light-ui table.admin-data-table tbody th {
    color: #111111 !important;
    background-color: #ffffff !important;
}

.body-light-ui table.admin-data-table tbody tr:hover td {
    background-color: #f0f4fc !important;
    color: #000000 !important;
}

/* =============================================================================
   Admin: restore original dark gradient background + dark glass cards (not white)
   Overrides .body-light-ui light panels for body.admin-pages only (load last)
   ============================================================================= */
body.admin-pages {
    color: var(--icst-text) !important;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 216, 77, 0.08), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(60, 120, 255, 0.1), transparent 38%),
        linear-gradient(145deg, var(--icst-bg), #08142c 65%) !important;
    min-height: 100vh;
}

body.admin-pages .container-fluid,
body.admin-pages main.admin-main {
    color: var(--icst-text) !important;
}

body.admin-pages .panel-card,
body.admin-pages .stat-card,
body.admin-pages .glass-card,
body.admin-pages .hero-card {
    background: linear-gradient(150deg, rgba(18, 45, 89, 0.95), rgba(12, 32, 66, 0.95)) !important;
    border: 1px solid var(--icst-border) !important;
    color: var(--icst-text) !important;
    box-shadow: 0 14px 36px rgba(2, 10, 28, 0.45) !important;
}

body.admin-pages .panel-card .card-body,
body.admin-pages .stat-card .card-body,
body.admin-pages .glass-card .card-body {
    color: var(--icst-text) !important;
}

body.admin-pages .stat-card h2,
body.admin-pages .stat-card h6 {
    color: #f7fbff !important;
}

body.admin-pages .section-title {
    color: #fff !important;
}

body.admin-pages .section-subtitle {
    color: var(--icst-muted) !important;
}

body.admin-pages h1,
body.admin-pages h2,
body.admin-pages h3,
body.admin-pages h4,
body.admin-pages h5,
body.admin-pages h6,
body.admin-pages .fw-bold,
body.admin-pages .fw-semibold {
    color: #f7fbff !important;
}

body.admin-pages p,
body.admin-pages .text-secondary,
body.admin-pages .text-muted,
body.admin-pages small {
    color: var(--icst-muted) !important;
}

body.admin-pages .form-label,
body.admin-pages label {
    color: #e4eeff !important;
}

body.admin-pages .form-control,
body.admin-pages .form-select {
    background: rgba(10, 26, 52, 0.85) !important;
    color: #fff !important;
    border-color: rgba(173, 192, 232, 0.25) !important;
}

body.admin-pages .form-control:focus,
body.admin-pages .form-select:focus {
    background: rgba(13, 32, 62, 0.95) !important;
    color: #fff !important;
    border-color: rgba(255, 216, 77, 0.75) !important;
}

body.admin-pages .form-control::placeholder {
    color: #9cb2dd !important;
}

body.admin-pages .input-group-text {
    background: rgba(18, 45, 89, 0.9) !important;
    color: #e9f0ff !important;
    border-color: rgba(173, 192, 232, 0.35) !important;
}

body.admin-pages .table,
body.admin-pages .table td,
body.admin-pages .table th {
    color: #e9f0ff !important;
}

body.admin-pages .table-modern thead th {
    color: #f2d86f !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 216, 77, 0.24) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
}

body.admin-pages table.admin-data-table {
    --bs-table-color: #e9f0ff;
    color: #e9f0ff !important;
}

body.admin-pages table.admin-data-table thead th {
    color: #f2d86f !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 216, 77, 0.24) !important;
}

body.admin-pages table.admin-data-table tbody td,
body.admin-pages table.admin-data-table tbody th {
    color: #e9f0ff !important;
    background: transparent !important;
}

body.admin-pages table.admin-data-table tbody tr:hover td {
    background: rgba(255, 216, 77, 0.08) !important;
    color: #fff !important;
}

body.admin-pages .btn-outline-secondary {
    color: #dbe6ff !important;
    border-color: rgba(196, 210, 238, 0.5) !important;
}

body.admin-pages .btn-outline-secondary:hover {
    color: #fff !important;
}

body.admin-pages .btn-outline-primary {
    color: #ffdf6c !important;
    border-color: rgba(244, 194, 13, 0.75) !important;
}

body.admin-pages a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
    color: #a8c7ff !important;
}

body.admin-pages .alert {
    color: inherit !important;
}

/* Admin sidebar layout */
.admin-layout {
    min-height: calc(100vh - 4rem);
}

.admin-main-with-sidebar .admin-sidebar {
    background: rgba(6, 18, 42, 0.92);
    border-right: 1px solid rgba(40, 72, 121, 0.85);
}

@media (min-width: 992px) {
    .admin-main-with-sidebar .admin-sidebar-inner {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 5rem);
        overflow-y: auto;
    }
}

body.admin-pages .admin-sidebar-heading {
    color: rgba(200, 214, 240, 0.75) !important;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}

body.admin-pages .admin-sidebar-link {
    color: var(--icst-muted) !important;
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
    font-weight: 600;
}

body.admin-pages .admin-sidebar-link:hover {
    color: #fff !important;
    background: rgba(244, 194, 13, 0.1);
}

body.admin-pages .admin-sidebar-link.active {
    color: #fff !important;
    background: rgba(244, 194, 13, 0.18);
    border-left: 3px solid var(--icst-primary);
    padding-left: calc(1rem - 3px);
}

body.admin-pages .admin-content {
    background: transparent;
}

body.admin-pages .admin-filter-bar .form-label {
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------------
   Mobile / touch (Chrome Android, narrow viewports)
   ------------------------------------------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Prevent full-page horizontal scroll; wide data lives in .table-responsive */
body {
    overflow-x: clip;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

.lab-video-wrap {
    width: 100%;
    max-width: 960px;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.lab-video-player {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    max-height: 480px;
    height: auto;
    background: #000;
    object-fit: contain;
    vertical-align: top;
}

.hero-card .display-5 {
    font-size: clamp(1.35rem, 5vw, 2.5rem);
}

@media (max-width: 575.98px) {
    .container-fluid.px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .table-myclasses td:last-child {
        min-width: 140px;
    }

    .modern-alert-stack {
        right: 8px;
        left: 8px;
        width: auto;
    }
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.nav-modern .navbar-brand {
    min-width: 0;
}

.nav-modern .navbar-brand .site-title,
.nav-modern .navbar-brand .site-brand {
    min-width: 0;
}

html body .nav-modern .navbar-brand .site-brand .site-brand-i {
    color: #F9DB0F !important;
    font-style: italic !important;
}

html body .nav-modern .navbar-brand .site-brand .site-brand-rest {
    color: #00C9FC !important;
}

@media (max-width: 400px) {
    .nav-modern .brand-logo {
        max-height: 26px;
    }

    .receipt-dropdown {
        min-width: auto;
        max-width: min(100vw - 1.5rem, 320px);
    }
}

/* Coarse pointer: slightly larger tap targets */
@media (pointer: coarse) and (max-width: 991.98px) {
    .btn-sm {
        min-height: 2.5rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .nav-modern .navbar-nav .nav-link {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .student-sidebar .student-nav-btn,
    .teacher-shell .btn:not(.btn-sm) {
        min-height: 2.75rem;
    }
}

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

/* -------------------------------------------------------------------------
   White + Blue professional theme override
   ------------------------------------------------------------------------- */
:root {
    /* i-Link logo blue: rgb(3, 177, 252) */
    --icst-bg: #ffffff;
    --icst-bg-soft: #ffffff;
    --icst-surface: #ffffff;
    --icst-card: #ffffff;
    --icst-primary: #03b1fc;
    --icst-primary-strong: #0294d8;
    --icst-text: #111111;
    --icst-muted: #4d5b70;
    --icst-border: #e5e5e5;
}

body,
body.admin-pages,
.body-light-ui {
    color: var(--icst-text) !important;
    background: #ffffff !important;
}

h1, h2, h3, h4, h5, h6,
.fw-bold, .fw-semibold,
.section-title,
.site-title {
    color: #111111 !important;
}

p,
li,
td,
th,
.text-body {
    color: var(--icst-text) !important;
}

.text-muted,
.text-secondary,
small.text-muted,
.section-subtitle {
    color: #4d5b70 !important;
}

.nav-modern {
    background: #ffffff !important;
    border-bottom: 1px solid var(--icst-border) !important;
    box-shadow: 0 4px 14px rgba(3, 177, 252, 0.1) !important;
}

.nav-modern .navbar-brand,
.nav-modern .nav-link,
.nav-modern .navbar-text {
    color: #0294d8 !important;
}

.nav-modern .nav-link:hover,
.nav-modern .nav-link:focus,
.nav-modern .nav-link.active,
.nav-modern .nav-link:active {
    background: #FDF8DC !important;
    color: #25478B !important;
    box-shadow: inset 0 0 0 2px #F9DB0F;
}

.nav-modern .nav-link:active {
    background: #F9DB0F !important;
}

.card,
.panel-card,
.stat-card,
.glass-card,
.hero-card,
body.admin-pages .panel-card,
body.admin-pages .stat-card,
body.admin-pages .glass-card,
body.admin-pages .hero-card {
    background: #ffffff !important;
    border: 1px solid var(--icst-border) !important;
    box-shadow: 0 10px 24px rgba(3, 177, 252, 0.1) !important;
    color: var(--icst-text) !important;
}

.btn-primary,
.btn.btn-primary {
    background: linear-gradient(180deg, #4dc8fd, #03b1fc) !important;
    border-color: #0294d8 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background: #0294d8 !important;
    border-color: #0176aa !important;
}

.btn-outline-primary {
    border-color: #03b1fc !important;
    color: #0294d8 !important;
    background: #ffffff !important;
}

.btn-outline-primary:hover {
    background: #f5f5f5 !important;
    color: #0176aa !important;
    border-color: #0294d8 !important;
}

.btn-outline-secondary {
    border-color: #7dd3fc !important;
    color: #0294d8 !important;
}

.btn-outline-secondary:hover {
    background: #f5f5f5 !important;
    color: #015a85 !important;
    border-color: #4dc8fd !important;
}

.form-control,
.form-select,
.input-group-text {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e0e0e0 !important;
}

.form-control::placeholder {
    color: #6f7f95 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #4dc8fd !important;
    box-shadow: 0 0 0 0.2rem rgba(3, 177, 252, 0.2) !important;
    background: #ffffff !important;
    color: #111111 !important;
}

.table,
.table td,
.table th,
.table-modern tbody td,
.table-modern thead th,
body.admin-pages .table,
body.admin-pages .table td,
body.admin-pages .table th {
    color: #111111 !important;
    border-color: #e5e5e5 !important;
}

.table-modern thead th,
.table-myclasses thead th,
.table-blacktext thead th,
body.admin-pages table.admin-data-table thead th {
    color: #0176aa !important;
    background: #f5f5f5 !important;
    border-bottom: 1px solid #e5e5e5 !important;
}

.table-modern tbody tr:hover,
.table-myclasses tbody tr:hover td,
.table-blacktext tbody tr:hover td,
body.admin-pages table.admin-data-table tbody tr:hover td {
    background: #fafafa !important;
}

.alert {
    border-color: #e5e5e5 !important;
    color: #015a85 !important;
}

.alert-success { background: #eaf8ef !important; color: #246a42 !important; }
.alert-danger { background: #fdeff2 !important; color: #8a2e43 !important; }
.alert-warning { background: #fff7e8 !important; color: #8a651f !important; }
.alert-info { background: #f5f5f5 !important; color: #0176aa !important; }

.dropdown-menu,
.receipt-dropdown {
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    color: #015a85 !important;
}

.dropdown-item,
.dropdown-item-text,
.dropdown-header {
    color: #111111 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: #f5f5f5 !important;
    color: #0176aa !important;
}

body.admin-pages .admin-sidebar,
.admin-main-with-sidebar .admin-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5e5e5 !important;
}

body.admin-pages .admin-sidebar-link {
    color: #0176aa !important;
}

body.admin-pages .admin-sidebar-link:hover {
    background: #f5f5f5 !important;
    color: #015a85 !important;
}

body.admin-pages .admin-sidebar-link.active {
    background: #f0f0f0 !important;
    color: #015a85 !important;
    border-left-color: #03b1fc !important;
}

.site-footer {
    background: #ffffff !important;
    border-top: 1px solid var(--icst-border) !important;
}

/* -------------------------------------------------------------------------
   Final readability hardening for light theme
   ------------------------------------------------------------------------- */
body,
body * {
    color: #111111;
}

/* Keep links clearly visible but still calm */
a,
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
    color: #0294d8 !important;
}

a:hover,
a:focus {
    color: #0176aa !important;
}

/* Force readable text in common content containers */
.card,
.card *,
.panel-card,
.panel-card *,
.stat-card,
.stat-card *,
.hero-card,
.hero-card *,
.table,
.table *,
.list-group-item,
.list-group-item *,
.dropdown-menu,
.dropdown-menu *,
.alert,
.alert *,
.form-label,
label,
small,
.small,
.text-body,
.text-white,
.text-light,
.text-light-emphasis {
    color: #111111 !important;
}

/* Secondary text should still be readable */
.text-muted,
.text-secondary,
small.text-muted,
.section-subtitle {
    color: #4d5b70 !important;
}

/* Navbar text in light theme */
.nav-modern .navbar-brand,
.nav-modern .navbar-brand *,
.nav-modern .nav-link,
.nav-modern .navbar-text,
.nav-modern .navbar-text * {
    color: #0176aa !important;
}

/* Footer readability */
.site-footer,
.site-footer *,
.site-footer small,
.site-footer .text-light,
.site-footer .text-light-emphasis {
    color: #015a85 !important;
}

/* Preserve intentional contrast for action/status UI */
.btn-primary,
.btn-primary *,
.btn-success,
.btn-success *,
.btn-danger,
.btn-danger *,
.btn-dark,
.btn-dark * {
    color: #ffffff !important;
}

.btn-outline-primary,
.btn-outline-primary *,
.btn-outline-secondary,
.btn-outline-secondary *,
.btn-outline-dark,
.btn-outline-dark * {
    color: #0176aa !important;
}

.badge.text-bg-primary,
.badge.text-bg-secondary,
.badge.text-bg-info,
.badge.text-bg-light,
.badge.text-bg-warning,
.badge.text-bg-success,
.badge.text-bg-danger {
    color: #111111 !important;
}

/* -------------------------------------------------------------------------
   User-requested strict override: all fonts black in entire system
   ------------------------------------------------------------------------- */
html,
body,
body *,
body *::before,
body *::after {
    color: #000000 !important;
}

/* -------------------------------------------------------------------------
   Professional full-screen app shell (desktop)
   ------------------------------------------------------------------------- */
:root {
    --app-nav-height: 72px;
}

.container-fluid {
    max-width: 1600px;
}

.app-shell-row {
    min-height: calc(100vh - var(--app-nav-height) - 2rem);
}

/* Lock sidebars on desktop */
.student-sidebar-col,
.teacher-sidebar-col {
    position: sticky;
    top: calc(var(--app-nav-height) + 0.75rem);
    align-self: flex-start;
    height: calc(100vh - var(--app-nav-height) - 1.25rem);
}

.student-sidebar-col .student-sidebar-card,
.teacher-sidebar-col .panel-card,
.admin-main-with-sidebar .admin-sidebar-inner {
    max-height: 100%;
    height: 100%;
    overflow-y: auto;
}

.student-main-col,
.teacher-main-col,
.admin-content {
    min-height: calc(100vh - var(--app-nav-height) - 2rem);
}

.student-shell,
.teacher-shell,
.admin-main {
    padding-bottom: 2rem !important;
}

.student-sidebar .student-nav-btn,
.teacher-sidebar-col .btn {
    text-align: left;
    font-weight: 600;
    border-radius: 0.65rem;
}

.student-sidebar-card,
.teacher-sidebar-col .panel-card {
    border: 1px solid #e5e5e5 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}

.student-main-col > .card,
.teacher-main-col > .card,
.admin-content > .card {
    border-radius: 0.85rem;
}

@media (max-width: 991.98px) {
    .app-shell-row {
        min-height: auto;
    }

    .student-sidebar-col,
    .teacher-sidebar-col,
    .student-sidebar-col .student-sidebar-card,
    .teacher-sidebar-col .panel-card,
    .admin-main-with-sidebar .admin-sidebar-inner {
        position: static;
        top: auto;
        align-self: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .student-main-col,
    .teacher-main-col,
    .admin-content {
        min-height: auto;
    }
}

/* -------------------------------------------------------------------------
   Trustworthy Blue/White system theme + fixed sidebar shell
   ------------------------------------------------------------------------- */
:root {
    --ui-bg: #ffffff;
    --ui-surface: #ffffff;
    --ui-border: #e5e5e5;
    --ui-text: #0f172a;
    --ui-muted: #475569;
    --ui-primary: #00C9FC;
    --ui-primary-600: #00A3CA;
    --ui-primary-50: #E6FAFE;
    --ui-accent: #F9DB0F;
    --ui-accent-soft: #fffce8;
    --ui-info: #4dc8fd;
    --ui-shadow: 0 8px 26px rgba(3, 177, 252, 0.1);
    --ui-radius: 12px;
    --ui-nav-h: 72px;
}

html,
body {
    background: var(--ui-bg) !important;
    color: var(--ui-text) !important;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif !important;
    line-height: 1.5;
}

body,
body *,
body *::before,
body *::after {
    color: var(--ui-text) !important;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.site-title {
    color: #015a85 !important;
    font-weight: 700 !important;
}

p,
li,
td,
th,
label,
.form-label,
.text-body {
    color: var(--ui-text) !important;
}

.text-muted,
.text-secondary,
.section-subtitle,
small,
.small {
    color: var(--ui-muted) !important;
}

.nav-modern {
    background: #ffffff !important;
    border-bottom: 1px solid var(--ui-border) !important;
    box-shadow: 0 3px 14px rgba(3, 177, 252, 0.1) !important;
}

.nav-modern .navbar-brand,
.nav-modern .nav-link,
.nav-modern .navbar-text {
    color: var(--ui-primary) !important;
}

.nav-modern .nav-link:hover,
.nav-modern .nav-link:focus,
.nav-modern .nav-link.active,
.nav-modern .nav-link:active {
    background: #FDF8DC !important;
    color: #25478B !important;
    box-shadow: inset 0 0 0 2px #F9DB0F;
}

.nav-modern .nav-link:active {
    background: #F9DB0F !important;
}

.card,
.panel-card,
.stat-card,
.glass-card,
.hero-card {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    box-shadow: var(--ui-shadow) !important;
}

.btn {
    border-radius: 10px !important;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
}

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

.btn-primary,
.btn.btn-primary {
    background: linear-gradient(180deg, #4dc8fd, var(--ui-primary)) !important;
    border-color: var(--ui-primary) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background: var(--ui-primary-600) !important;
    border-color: var(--ui-primary-600) !important;
    box-shadow: 0 8px 18px rgba(2, 148, 216, 0.28) !important;
}

.btn-outline-primary {
    border-color: var(--ui-primary) !important;
    color: var(--ui-primary) !important;
    background: #ffffff !important;
}

.btn-outline-primary:hover {
    background: #f5f5f5 !important;
    color: var(--ui-primary-600) !important;
    border-color: var(--ui-primary) !important;
}

.btn-outline-secondary {
    border-color: #7dd3fc !important;
    color: #0176aa !important;
}

.btn-outline-secondary:hover {
    background: #f5f5f5 !important;
    border-color: #4dc8fd !important;
}

.form-control,
.form-select,
.input-group-text {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    color: var(--ui-text) !important;
}

.form-control::placeholder {
    color: #70829f !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #4dc8fd !important;
    box-shadow: 0 0 0 0.2rem rgba(3, 177, 252, 0.2) !important;
}

.table,
.table td,
.table th {
    color: var(--ui-text) !important;
    border-color: #e5e5e5 !important;
}

.table-modern thead th,
.table-blacktext thead th,
.table-myclasses thead th,
table.admin-data-table thead th {
    background: #f5f5f5 !important;
    color: var(--ui-primary) !important;
    font-weight: 700 !important;
}

.table-modern tbody tr:hover,
.table-blacktext tbody tr:hover td,
.table-myclasses tbody tr:hover td,
table.admin-data-table tbody tr:hover td {
    background: #fafafa !important;
}

a,
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
    color: var(--ui-primary) !important;
}

a:hover,
a:focus {
    color: var(--ui-info) !important;
}

.alert {
    border-radius: 10px !important;
    border: 1px solid #d1deef !important;
}

.alert-success { background: #ebf8f0 !important; color: #195f39 !important; }
.alert-danger { background: #fdeff2 !important; color: #7f2337 !important; }
.alert-warning { background: #fff8e8 !important; color: #7e5a19 !important; }
.alert-info { background: #f5f5f5 !important; color: #0176aa !important; }

.dropdown-menu,
.receipt-dropdown {
    background: #ffffff !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 24px rgba(20, 56, 112, 0.12) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ui-primary-50) !important;
}

/* Fixed sidebar + independent main scrolling (desktop) */
.app-shell-row {
    display: flex;
    min-height: calc(100vh - var(--ui-nav-h) - 1.25rem);
    max-height: calc(100vh - var(--ui-nav-h) - 1.25rem);
    overflow: hidden;
}

.student-sidebar-col,
.teacher-sidebar-col {
    flex: 0 0 auto;
}

.student-sidebar-col .student-sidebar-card,
.teacher-sidebar-col .panel-card,
.admin-main-with-sidebar .admin-sidebar-inner {
    height: calc(100vh - var(--ui-nav-h) - 1.5rem);
    max-height: calc(100vh - var(--ui-nav-h) - 1.5rem);
    overflow-y: auto;
    position: sticky;
    top: calc(var(--ui-nav-h) + 0.5rem);
    border-left: 3px solid var(--ui-accent) !important;
}

.student-main-col,
.teacher-main-col,
.admin-content {
    min-height: calc(100vh - var(--ui-nav-h) - 1.25rem);
    max-height: calc(100vh - var(--ui-nav-h) - 1.25rem);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-right: 0.25rem;
}

.student-sidebar .student-nav-btn,
.teacher-sidebar-col .btn,
body.admin-pages .admin-sidebar-link {
    text-align: left;
    border-radius: 10px !important;
}

.student-sidebar .student-nav-btn.btn-primary,
.teacher-sidebar-col .btn.btn-primary,
body.admin-pages .admin-sidebar-link.active {
    background: var(--ui-primary) !important;
    border-color: var(--ui-primary) !important;
    color: #ffffff !important;
}

.student-sidebar .student-nav-btn.btn-outline-primary:hover,
.teacher-sidebar-col .btn.btn-outline-primary:hover,
body.admin-pages .admin-sidebar-link:hover {
    background: var(--ui-accent-soft) !important;
}
.site-footer {
    background: #ffffff !important;
    border-top: 1px solid var(--ui-border) !important;
}

/* Prevent layout break / horizontal scrolling */
body {
    overflow-x: hidden !important;
}

.table-responsive {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .app-shell-row {
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .student-sidebar-col .student-sidebar-card,
    .teacher-sidebar-col .panel-card,
    .admin-main-with-sidebar .admin-sidebar-inner,
    .student-main-col,
    .teacher-main-col,
    .admin-content {
        position: static;
        top: auto;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        scroll-behavior: auto;
        padding-right: 0;
    }
}

/* -------------------------------------------------------------------------
   F-pattern layout refinement (global)
   ------------------------------------------------------------------------- */
.container,
.container-fluid,
.admin-content,
.student-main-col,
.teacher-main-col {
    text-align: left !important;
}

/* Constrain long-form reading width for easier left-to-right scanning */
.student-main-col > .card .card-body,
.teacher-main-col > .card .card-body,
.admin-content > .card .card-body,
.hero-card .card-body {
    max-width: 1100px;
}

/* Strong first horizontal scan line (titles + section openers) */
.section-title,
h1,
h2,
h3 {
    letter-spacing: 0;
    margin-bottom: 0.45rem;
}

.section-subtitle,
.card-body > p:first-of-type,
.card-body > .small:first-of-type {
    margin-bottom: 1rem;
}

/* Strong vertical left rail for navigation blocks */
.student-sidebar-card,
.teacher-sidebar-col .panel-card,
.admin-sidebar-inner {
    border-left: 3px solid var(--ui-accent) !important;
}

.badge.text-bg-warning {
    background-color: var(--ui-accent) !important;
    color: #111111 !important;
}

.badge.text-bg-info {
    background-color: var(--ui-info) !important;
    color: #001a36 !important;
}

/* -------------------------------------------------------------------------
   FINAL USER OVERRIDE: make all fonts black across entire system
   ------------------------------------------------------------------------- */
html body,
html body * ,
html body *::before,
html body *::after {
    color: #000000 !important;
}

/* Make action rows align with F-pattern second scan line */
.class-actions,
.d-flex.justify-content-between.align-items-center,
.d-flex.gap-2 {
    row-gap: 0.5rem;
}

/* Tables: keep headers prominent as horizontal scan anchors */
.table-modern thead th,
.admin-data-table thead th {
    font-weight: 700 !important;
}

/* Content rhythm for better scan path */
.card + .card,
.panel-card + .panel-card,
.panel-card + .card {
    margin-top: 1rem;
}

@media (max-width: 991.98px) {
    .student-main-col > .card .card-body,
    .teacher-main-col > .card .card-body,
    .admin-content > .card .card-body,
    .hero-card .card-body {
        max-width: none;
    }
}

/* Force recent notifications + receipt text to black (final override) */
.student-shell .list-group-item,
.student-shell .list-group-item *,
.student-shell .list-group-item .text-muted,
.student-shell .list-group-item .small,
.receipt-dropdown,
.receipt-dropdown *,
.receipt-dropdown .text-muted,
.receipt-dropdown .dropdown-item-text,
.receipt-dropdown .dropdown-header {
    color: #000000 !important;
}

/* -------------------------------------------------------------------------
   ABSOLUTE FINAL GLOBAL TEXT OVERRIDE (entire system)
   ------------------------------------------------------------------------- */
html body,
html body *,
html body *::before,
html body *::after,
html body .text-muted,
html body .text-secondary,
html body .section-subtitle,
html body small,
html body .small,
html body .dropdown-item,
html body .dropdown-item-text,
html body .dropdown-header,
html body .badge,
html body .alert,
html body .form-label,
html body label,
html body p,
html body li,
html body td,
html body th,
html body span,
html body a,
html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6 {
    color: #000000 !important;
}

/* Admin area: ensure light backgrounds + fully visible black text */
body.admin-pages,
body.admin-pages * {
    color: #000000 !important;
}

body.admin-pages,
body.admin-pages .admin-main,
body.admin-pages .admin-content,
body.admin-pages .admin-layout,
body.admin-pages .admin-main-with-sidebar .admin-sidebar,
body.admin-pages .admin-main-with-sidebar .admin-sidebar-inner {
    background-color: #ffffff !important;
}

/* Admin navbar + dropdowns: ensure light background with black text */
body.admin-pages .nav-modern {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5 !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
}

body.admin-pages .nav-modern .navbar-brand,
body.admin-pages .nav-modern .nav-link,
body.admin-pages .nav-modern .navbar-text,
body.admin-pages .nav-modern .btn {
    color: #000000 !important;
}

body.admin-pages .dropdown-menu,
body.admin-pages .receipt-dropdown {
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
}

body.admin-pages .dropdown-item,
body.admin-pages .dropdown-item-text,
body.admin-pages .dropdown-header {
    color: #000000 !important;
}

body.admin-pages .dropdown-item:hover,
body.admin-pages .dropdown-item:focus {
    background: #f5f5f5 !important;
    color: #000000 !important;
}

/* Admin pages: make Create Account + Logs crystal clear */
body.admin-pages .card,
body.admin-pages .panel-card,
body.admin-pages .stat-card,
body.admin-pages .glass-card {
    background: #ffffff !important;
    color: #000000 !important;
}

body.admin-pages .glass-card {
    backdrop-filter: none !important;
}

body.admin-pages .card-body,
body.admin-pages .card-body * {
    color: #000000 !important;
}

body.admin-pages .form-text,
body.admin-pages .form-check-label,
body.admin-pages .input-group-text,
body.admin-pages .form-label,
body.admin-pages label,
body.admin-pages small,
body.admin-pages .small,
body.admin-pages .text-muted,
body.admin-pages .text-secondary,
body.admin-pages .section-subtitle {
    color: #000000 !important;
}

body.admin-pages .table,
body.admin-pages .table * ,
body.admin-pages table.admin-data-table,
body.admin-pages table.admin-data-table * {
    color: #000000 !important;
    background: #ffffff !important;
}

body.admin-pages table.admin-data-table thead th {
    background: #f5f5f5 !important;
    color: #000000 !important;
}

/* Admin: Teachers/Students account tables (force clear rows + actions) */
body.admin-pages table.admin-data-table tbody td,
body.admin-pages table.admin-data-table tbody th {
    background: #ffffff !important;
    color: #000000 !important;
}

body.admin-pages table.admin-data-table tbody tr:hover td,
body.admin-pages table.admin-data-table tbody tr:hover th {
    background: #fafafa !important;
}

body.admin-pages table.admin-data-table a:not(.btn) {
    color: #000000 !important;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.25);
}

body.admin-pages table.admin-data-table a:not(.btn):hover {
    text-decoration-color: rgba(0, 0, 0, 0.55);
}

/* Admin buttons inside tables/forms: keep black text visible */
body.admin-pages .btn-primary,
body.admin-pages .btn.btn-primary {
    background: #fff000 !important; /* logo gold */
    border-color: #0294d8 !important;
    color: #000000 !important;
}

body.admin-pages .btn-primary:hover,
body.admin-pages .btn.btn-primary:hover {
    background: #ffe000 !important;
    border-color: #0294d8 !important;
    color: #000000 !important;
}

body.admin-pages .btn-outline-primary,
body.admin-pages .btn.btn-outline-primary {
    background: #ffffff !important;
    border-color: #0294d8 !important;
    color: #000000 !important;
}

body.admin-pages .btn-outline-primary:hover,
body.admin-pages .btn.btn-outline-primary:hover {
    background: #f5f5f5 !important;
    border-color: #0294d8 !important;
    color: #000000 !important;
}

/* -------------------------------------------------------------------------
   FINAL ADMIN UX OVERRIDE
   Organized layout + comfortable colors + visible hover states
   ------------------------------------------------------------------------- */
body.admin-pages {
    background: #ffffff !important;
}

body.admin-pages .admin-content {
    padding-top: 1rem !important;
}

body.admin-pages .admin-content > .card,
body.admin-pages .admin-content > .panel-card,
body.admin-pages .admin-content .card.panel-card {
    border: 1px solid #d7e1f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(20, 56, 112, 0.08) !important;
    background: #ffffff !important;
}

body.admin-pages .section-title,
body.admin-pages .section-subtitle,
body.admin-pages h1,
body.admin-pages h2,
body.admin-pages h3,
body.admin-pages h4,
body.admin-pages h5,
body.admin-pages h6,
body.admin-pages p,
body.admin-pages .small,
body.admin-pages .text-muted,
body.admin-pages .text-secondary,
body.admin-pages label,
body.admin-pages .form-label {
    color: #111111 !important;
}

/* Sidebar readability and active state */
body.admin-pages .admin-sidebar,
body.admin-pages .admin-sidebar-inner {
    background: #ffffff !important;
    border-right: 1px solid #d7e1f0 !important;
}

body.admin-pages .admin-sidebar-link {
    color: #111111 !important;
    background: transparent !important;
}

body.admin-pages .admin-sidebar-link:hover,
body.admin-pages .admin-sidebar-link:focus {
    background: #edf3ff !important;
    color: #111111 !important;
}

body.admin-pages .admin-sidebar-link.active {
    background: #e2edff !important;
    color: #111111 !important;
    border-left-color: #0294d8 !important;
}

/* Forms */
body.admin-pages .form-control,
body.admin-pages .form-select,
body.admin-pages .input-group-text {
    background: #ffffff !important;
    border-color: #c9d6ea !important;
    color: #111111 !important;
}

body.admin-pages .form-control:focus,
body.admin-pages .form-select:focus {
    border-color: #88a9d8 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 32, 128, 0.12) !important;
    color: #111111 !important;
}

/* Table clarity + hover contrast */
body.admin-pages table,
body.admin-pages table * {
    color: #111111 !important;
}

body.admin-pages table.admin-data-table thead th {
    background: #eaf1ff !important;
    color: #111111 !important;
    border-color: #d4e0f5 !important;
}

body.admin-pages table.admin-data-table tbody td,
body.admin-pages table.admin-data-table tbody th {
    background: #ffffff !important;
    border-color: #e0e8f6 !important;
}

body.admin-pages table.admin-data-table tbody tr:hover td,
body.admin-pages table.admin-data-table tbody tr:hover th {
    background: #fafafa !important;
    color: #111111 !important;
}

/* Buttons with safe hover contrast */
body.admin-pages .btn-primary,
body.admin-pages .btn.btn-primary {
    background: #03b1fc !important;
    border-color: #0294d8 !important;
    color: #ffffff !important;
}

body.admin-pages .btn-primary:hover,
body.admin-pages .btn.btn-primary:hover {
    background: #0294d8 !important;
    border-color: #0176aa !important;
    color: #ffffff !important;
}

body.admin-pages .btn-outline-primary,
body.admin-pages .btn.btn-outline-primary {
    background: #ffffff !important;
    border-color: #03b1fc !important;
    color: #111111 !important;
}

body.admin-pages .btn-outline-primary:hover,
body.admin-pages .btn.btn-outline-primary:hover {
    background: #f5f5f5 !important;
    border-color: #0294d8 !important;
    color: #111111 !important;
}

body.admin-pages .btn-outline-secondary,
body.admin-pages .btn.btn-outline-secondary {
    border-color: #b8c8e1 !important;
    color: #111111 !important;
}

body.admin-pages .btn-outline-secondary:hover,
body.admin-pages .btn.btn-outline-secondary:hover {
    background: #f5f5f5 !important;
    color: #111111 !important;
}

/* Teacher dashboard stats: compact cards to save vertical space */
.teacher-shell .teacher-stats-row .teacher-stat-card .card-body {
    padding: 0.7rem 0.85rem !important;
}

.teacher-shell .teacher-stats-row .teacher-stat-card h6 {
    font-size: 0.78rem !important;
    margin-bottom: 0.2rem !important;
    font-weight: 600 !important;
    line-height: 1.25;
}

.teacher-shell .teacher-stats-row .teacher-stat-card h2 {
    font-size: 1.2rem !important;
    margin: 0 !important;
    line-height: 1.15;
    font-weight: 700 !important;
}

/* Footer: brand + Devz SensiB mark (flex-aligned, compact) */
.site-footer .footer-inner {
    position: relative;
}

.site-footer .footer-inner-content {
    position: relative;
}

.site-footer .site-footer-brand-wrap {
    margin: 0.35rem 0.5rem;
}

.site-footer-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.35rem 0.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer-powered {
        justify-content: flex-end;
        text-align: right;
    }
}

.site-footer-powered-text {
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    line-height: 1.4;
    color: #8eb4d4 !important;
    margin: 0 !important;
    white-space: nowrap;
}

.site-footer-powered-text .site-footer-version {
    margin-left: 0.35rem;
    font-size: inherit !important;
    font-weight: 500 !important;
}

/* Teacher dashboard: amber emphasis (tagline + sidebar hints) */
html body .teacher-shell .teacher-workspace-tagline,
html body .teacher-shell .teacher-accent-yellow {
    color: #ffd54f !important;
}

/* Student dashboard: tagline + navigation heading */
html body .student-shell .student-dashboard-tagline,
html body .student-shell .student-nav-section-title {
    color: #ffd54f !important;
}

/* Footer brand: yellow i, blue -learncst */
html body .site-footer .site-footer-brand .site-brand-i {
    color: #F9DB0F !important;
}

html body .site-footer .site-footer-brand .site-brand-rest {
    color: #03b1fc !important;
}

html body .site-footer .site-footer-tagline {
    color: #0294d8 !important;
}

html body .site-footer .site-footer-powered-text,
html body .site-footer .site-footer-powered-text .site-footer-version {
    color: #8eb4d4 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

body.app-portal .site-footer .site-footer-powered-text,
body.app-portal .site-footer .site-footer-powered-text .site-footer-version {
    color: var(--text-muted, #64748b) !important;
}

/* Light .nav-modern uses white background but markup keeps navbar-dark → white toggler SVG vanishes */
.nav-modern .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.45) !important;
}

.nav-modern .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.12) !important;
}

.nav-modern .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23000000' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.25' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Receipt dropdown: yellow styling for PDF download control only */
html body .nav-modern .receipt-dropdown .receipt-pdf-btn {
    color: #b8860b !important;
    border: 1px solid rgba(201, 160, 0, 0.75) !important;
    background-color: rgba(255, 236, 140, 0.45) !important;
    font-weight: 700;
}

html body .nav-modern .receipt-dropdown .receipt-pdf-btn:hover,
html body .nav-modern .receipt-dropdown .receipt-pdf-btn:focus {
    color: #7a5f00 !important;
    border-color: rgba(160, 120, 0, 0.9) !important;
    background-color: rgba(255, 213, 79, 0.55) !important;
}

/* Navbar user chip (teacher + student): yellow pill, dark text (overrides global black/blue nav rules) */
html body .nav-modern .user-chip {
    background: linear-gradient(180deg, #fff3b0, #ffd54f) !important;
    border: 1px solid rgba(184, 134, 11, 0.5) !important;
    color: #1a1a1a !important;
}

html body .nav-modern .user-chip .text-truncate,
html body .nav-modern .user-chip span {
    color: #1a1a1a !important;
}

html body .nav-modern .user-chip .nav-avatar-placeholder {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    color: #111111 !important;
}

html body .nav-modern .user-chip .nav-avatar {
    border-color: rgba(0, 0, 0, 0.22) !important;
}


