/* KIU Staff Portal - professional dashboard theme and contrast fixes */
:root {
    --kiu-primary: #080534;
    --kiu-primary-2: #1b1660;
    --kiu-secondary: #f8b270;
    --kiu-accent: #0da604;
    --kiu-danger: #c0392b;
    --kiu-info: #2563eb;
    --kiu-warning: #b76a00;
    --kiu-bg: #f5f7fb;
    --kiu-surface: #ffffff;
    --kiu-surface-soft: #f9fafc;
    --kiu-border: #e3e8f0;
    --kiu-text: #172033;
    --kiu-muted: #5c667a;
    --kiu-sidebar-text: rgba(255, 255, 255, .86);
    --kiu-shadow: 0 18px 45px rgba(8, 5, 52, .09);
    --kiu-shadow-soft: 0 8px 22px rgba(8, 5, 52, .08);
    --kiu-radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(248, 178, 112, .16), transparent 32rem),
        linear-gradient(180deg, #f8fafd 0%, var(--kiu-bg) 100%);
    color: var(--kiu-text);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--kiu-info); }
a:hover { color: var(--kiu-primary-2); }

/* Layout */
#dashboard { min-height: 100vh; }
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--kiu-primary) 0%, #100a43 58%, #070424 100%);
    color: #fff;
    box-shadow: 14px 0 34px rgba(8, 5, 52, .18);
    transition: width .25s ease;
}
.sidebar.collapsed { width: 70px; }
.sidebar-header {
    min-height: 84px;
    padding: 18px 14px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-header img.logo,
.logo { max-height: 58px; object-fit: contain; }
.sidebar-header .menu-text {
    font-size: .88rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: normal;
}
.sidebar.collapsed .sidebar-header { justify-content: center; padding-inline: 8px; }
.sidebar.collapsed .sidebar-header .menu-text { display: none; }
.sidebar-menu-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 18px; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li { margin: 2px 0; padding: 0; }
.menu-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 8px 8px;
    padding: 0 4px;
    color: rgba(226, 232, 240, .72);
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .115em;
    text-transform: uppercase;
    line-height: 1.25;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: default;
}
.menu-section::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255, 255, 255, .13);
}
.menu-section span { display: inline-block; }
.sidebar.collapsed .menu-section {
    justify-content: center;
    height: auto;
    margin: 10px 4px 6px;
    padding: 4px 0 2px;
    text-align: center;
    font-size: 0;
    line-height: 1.1;
    background: transparent !important;
    border-radius: 0;
}
.sidebar.collapsed .menu-section::after { display: none; }
.sidebar.collapsed .menu-section span {
    display: inline-block;
    max-width: 58px;
    color: rgba(226, 232, 240, .56);
    font-size: .47rem;
    font-weight: 800;
    letter-spacing: .035em;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 13px;
    color: var(--kiu-sidebar-text);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-menu a i { flex: 0 0 auto; font-size: 1.3rem; }
.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(248, 178, 112, .23), rgba(255, 255, 255, .12));
    transform: translateX(2px);
}
.sidebar-menu a.active { box-shadow: inset 3px 0 0 var(--kiu-secondary); }
.sidebar.collapsed .sidebar-menu a {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 54px;
    padding: 9px 5px;
    gap: 4px;
    text-align: center;
    font-size: .46rem;
    line-height: 1.1;
}
.sidebar.collapsed .sidebar-menu a .menu-text {
    display: block;
    max-width: 60px;
    color: #d9d6d2;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-menu-container::-webkit-scrollbar { width: 6px; }
.sidebar-menu-container::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 100px; }

.main-content {
    min-height: 100vh;
    margin-left: 250px;
    transition: margin-left .25s ease;
}
.main-content.expanded { margin-left: 70px; }
#page-content,
.container-fluid#page-content {
    color: var(--kiu-text);
    padding: 28px !important;
}

/* Top navigation */
.navbar-custom,
.navbar.navbar-custom {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: 72px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid rgba(227, 232, 240, .9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    backdrop-filter: blur(14px);
}
.toggle-btn,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--kiu-border);
    border-radius: 14px;
    background: #fff;
    color: var(--kiu-primary);
    box-shadow: 0 6px 14px rgba(8,5,52,.06);
}
.toggle-btn i,
.theme-toggle i { font-size: 1.35rem; }
.role-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 48vw;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--kiu-border);
    border-radius: 999px;
    background: #f8fafc;
}
.role-switch a,
.role-switch button,
.role-btn {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--kiu-muted);
    background: transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
}
.role-switch a.active,
.role-switch button.active,
.role-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2));
    box-shadow: 0 8px 18px rgba(8,5,52,.18);
}
.navbar-custom .btn-outline-secondary,
.navbar-custom .dropdown-toggle {
    border-color: var(--kiu-border);
    color: var(--kiu-text);
    background: #fff;
    border-radius: 14px;
    font-weight: 700;
}
.dropdown-menu {
    border: 1px solid var(--kiu-border);
    border-radius: 16px;
    box-shadow: var(--kiu-shadow-soft);
}
.dropdown-item { color: var(--kiu-text); border-radius: 10px; }
.dropdown-item:hover { background: #f3f6fb; color: var(--kiu-primary); }

/* Dashboard content: professional cards + guaranteed readable text */
#page-content h1,
#page-content h2,
#page-content h3,
#page-content h4,
#page-content h5,
#page-content h6,
#page-content p,
#page-content label,
#page-content li,
#page-content td,
#page-content th,
#page-content .form-control-static {
    color: inherit;
}
#page-content .page-title,
#page-content h1,
#page-content h2 { color: #10172a; font-weight: 800; letter-spacing: -.02em; }
#page-content .text-muted,
#page-content small,
#page-content .small { color: var(--kiu-muted) !important; }
.card,
.dashboard-card,
.panel,
.widget,
.stat-card,
.summary-card,
.info-card {
    color: var(--kiu-text);
    background: var(--kiu-surface);
    border: 1px solid rgba(227, 232, 240, .95);
    border-radius: var(--kiu-radius);
    box-shadow: var(--kiu-shadow-soft);
}
#page-content .card,
#page-content .dashboard-card,
#page-content .panel,
#page-content .widget,
#page-content .stat-card,
#page-content .summary-card,
#page-content .info-card {
    color: var(--kiu-text) !important;
    background-color: var(--kiu-surface);
}
.dashboard-card {
    overflow: hidden;
    margin-bottom: 22px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--kiu-shadow);
    border-color: rgba(248, 178, 112, .45);
}
.card-header-custom,
#page-content .card-header-custom,
.dashboard-card > .card-header,
#page-content .card-header {
    border-bottom: 1px solid rgba(227, 232, 240, .9);
    background: linear-gradient(135deg, var(--kiu-primary) 0%, var(--kiu-primary-2) 100%);
    color: #fff !important;
    font-weight: 800;
    padding: 15px 20px;
}
#page-content .card-header h1,
#page-content .card-header h2,
#page-content .card-header h3,
#page-content .card-header h4,
#page-content .card-header h5,
#page-content .card-header h6,
#page-content .card-header p,
#page-content .card-header span,
#page-content .card-header small,
#page-content .card-header .text-muted,
#page-content .card-header-custom h1,
#page-content .card-header-custom h2,
#page-content .card-header-custom h3,
#page-content .card-header-custom h4,
#page-content .card-header-custom h5,
#page-content .card-header-custom h6,
#page-content .card-header-custom p,
#page-content .card-header-custom span,
#page-content .card-header-custom small,
#page-content .card-header-custom .text-muted {
    color: #fff !important;
}
.card-body { color: var(--kiu-text); }
#page-content .card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark) .card-body,
#page-content .dashboard-card .card-body {
    color: var(--kiu-text) !important;
}
#page-content .card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark) :is(h1,h2,h3,h4,h5,h6,p,span,small,label,td,th,li,div).text-white:not(.badge):not(.btn),
#page-content .dashboard-card :is(h1,h2,h3,h4,h5,h6,p,span,small,label,td,th,li,div).text-white:not(.badge):not(.btn) {
    color: var(--kiu-text) !important;
}
#page-content .card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark) .text-white.text-muted,
#page-content .dashboard-card .text-white.text-muted {
    color: var(--kiu-muted) !important;
}

/* Colored statistic cards with consistent contrast */
#page-content .bg-primary,
#page-content .card.bg-primary { background: linear-gradient(135deg, #1d1672, #3124a4) !important; color: #fff !important; }
#page-content .bg-success,
#page-content .card.bg-success { background: linear-gradient(135deg, #087b43, #0da604) !important; color: #fff !important; }
#page-content .bg-info,
#page-content .card.bg-info { background: linear-gradient(135deg, #1557c7, #2f80ed) !important; color: #fff !important; }
#page-content .bg-danger,
#page-content .card.bg-danger { background: linear-gradient(135deg, #a52a23, #d64a3d) !important; color: #fff !important; }
#page-content .bg-secondary,
#page-content .card.bg-secondary { background: linear-gradient(135deg, #475569, #64748b) !important; color: #fff !important; }
#page-content .bg-dark,
#page-content .card.bg-dark { background: linear-gradient(135deg, #111827, #273449) !important; color: #fff !important; }
#page-content .bg-warning,
#page-content .card.bg-warning {
    background: linear-gradient(135deg, #ffcf78, #f8b270) !important;
    color: #2a1a00 !important;
}
#page-content .bg-primary *,
#page-content .bg-success *,
#page-content .bg-info *,
#page-content .bg-danger *,
#page-content .bg-secondary *,
#page-content .bg-dark * { color: #fff !important; }
#page-content .bg-warning * { color: #2a1a00 !important; }
#page-content .badge.bg-warning,
#page-content .text-bg-warning { color: #2a1a00 !important; }

/* Neutral metric tiles */
.metric-card,
.kpi-card,
.stat-tile,
.dashboard-stat {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
    border: 1px solid var(--kiu-border);
    box-shadow: var(--kiu-shadow-soft);
    color: var(--kiu-text) !important;
}
.metric-card::before,
.kpi-card::before,
.stat-tile::before,
.dashboard-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--kiu-primary), var(--kiu-secondary), var(--kiu-accent));
}
.metric-value,
.stat-value,
.kpi-value,
.value { color: #10172a; font-weight: 900; }
.metric-label,
.stat-label,
.kpi-label,
.label { color: var(--kiu-muted); font-weight: 700; }

/* Tables */
.table,
#page-content table { color: var(--kiu-text); }
.table > :not(caption) > * > * { background-color: transparent; color: inherit; }
.table thead th,
.table-custom th,
#page-content table thead th {
    background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2)) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.12) !important;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.table tbody tr { border-color: var(--kiu-border); }
.table tbody tr:hover { background: #f8fafc; }
.table-responsive {
    border: 1px solid var(--kiu-border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

/* Forms */
.form-control,
.form-select,
.input-group-text {
    color: var(--kiu-text);
    background-color: #fff;
    border-color: #d7deea;
    border-radius: 12px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--kiu-secondary);
    box-shadow: 0 0 0 .22rem rgba(248, 178, 112, .22);
}
.form-control-static {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--kiu-border);
    border-radius: 12px;
    background: var(--kiu-surface-soft);
    color: var(--kiu-text) !important;
    font-weight: 650;
}

/* Buttons */
.btn { border-radius: 12px; font-weight: 700; }
.btn-custom-primary,
.btn-primary {
    background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2));
    border-color: var(--kiu-primary-2);
    color: #fff !important;
}
.btn-custom-primary:hover,
.btn-primary:hover { filter: brightness(1.05); color: #fff !important; }
.btn-custom-secondary { background: var(--kiu-secondary); border-color: var(--kiu-secondary); color: #2a1a00 !important; }
.btn-custom-accent { background: var(--kiu-accent); border-color: var(--kiu-accent); color: #fff !important; }
.btn-outline-secondary { color: var(--kiu-text); border-color: #cfd7e6; }
.btn-outline-secondary:hover { background: #f3f6fb; color: var(--kiu-primary); }
.badge { border-radius: 999px; padding: .45em .7em; font-weight: 800; }
.badge-verified { background: var(--kiu-accent); color: #fff; }
.badge-pending { background: var(--kiu-secondary); color: #2a1a00; }


/* Staff profile tabs, compact page tabs, and completion indicators */
#page-content .staff-profile .nav-tabs,
#page-content .staff-profile .nav-pills,
#page-content .profile-page .nav-tabs,
#page-content .profile-page .nav-pills,
#page-content .profile-tabs,
#page-content #profileTabs,
#page-content [id*="profile"][id*="Tabs"],
#page-content [id*="Profile"][id*="Tabs"] {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .35rem;
    border: 1px solid var(--kiu-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3fa 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
#page-content .staff-profile .nav-tabs .nav-item,
#page-content .staff-profile .nav-pills .nav-item,
#page-content .profile-page .nav-tabs .nav-item,
#page-content .profile-page .nav-pills .nav-item,
#page-content .profile-tabs .nav-item,
#page-content #profileTabs .nav-item,
#page-content [id*="profile"][id*="Tabs"] .nav-item,
#page-content [id*="Profile"][id*="Tabs"] .nav-item { margin: 0; }
#page-content .staff-profile .nav-tabs .nav-link,
#page-content .staff-profile .nav-pills .nav-link,
#page-content .profile-page .nav-tabs .nav-link,
#page-content .profile-page .nav-pills .nav-link,
#page-content .profile-tabs .nav-link,
#page-content #profileTabs .nav-link,
#page-content [id*="profile"][id*="Tabs"] .nav-link,
#page-content [id*="Profile"][id*="Tabs"] .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 32px;
    padding: .42rem .72rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #43516b;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: .005em;
    box-shadow: none;
    white-space: nowrap;
}
#page-content .staff-profile .nav-tabs .nav-link:hover,
#page-content .staff-profile .nav-pills .nav-link:hover,
#page-content .profile-page .nav-tabs .nav-link:hover,
#page-content .profile-page .nav-pills .nav-link:hover,
#page-content .profile-tabs .nav-link:hover,
#page-content #profileTabs .nav-link:hover,
#page-content [id*="profile"][id*="Tabs"] .nav-link:hover,
#page-content [id*="Profile"][id*="Tabs"] .nav-link:hover {
    background: #fff;
    color: var(--kiu-primary);
    border-color: rgba(8, 5, 52, .08);
}
#page-content .staff-profile .nav-tabs .nav-link.active,
#page-content .staff-profile .nav-pills .nav-link.active,
#page-content .profile-page .nav-tabs .nav-link.active,
#page-content .profile-page .nav-pills .nav-link.active,
#page-content .profile-tabs .nav-link.active,
#page-content #profileTabs .nav-link.active,
#page-content [id*="profile"][id*="Tabs"] .nav-link.active,
#page-content [id*="Profile"][id*="Tabs"] .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2));
    border-color: rgba(255,255,255,.2);
    box-shadow: 0 7px 16px rgba(8,5,52,.18);
}
#page-content .profile-completion,
#page-content .completion-card,
#page-content [data-profile-completion] {
    border: 1px solid var(--kiu-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    box-shadow: var(--kiu-shadow-soft);
}
#page-content .progress {
    height: .74rem;
    border-radius: 999px;
    overflow: hidden;
    background-color: #e8eef7;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.08);
}
#page-content .progress.progress-lg { height: 1rem; }
#page-content .progress-bar {
    min-width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--kiu-primary), var(--kiu-accent));
    color: #fff !important;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
}
#page-content .completion-percent,
#page-content .profile-completion-percent,
#page-content [data-profile-percent] {
    color: #10172a;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

/* Auth pages */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--kiu-primary) 0%, #18105a 58%, #2d1b75 100%);
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px); }
.auth-hero { display: flex; align-items: center; padding: clamp(28px, 5vw, 72px); color: #fff; }
.auth-hero-inner { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 42px; }
.auth-logo { max-width: 72px; max-height: 72px; object-fit: contain; }
.auth-title { font-size: 1.15rem; font-weight: 900; }
.auth-subtitle { color: rgba(255,255,255,.75); font-weight: 700; }
.auth-h1 { font-size: clamp(2rem, 4vw, 4.5rem); font-weight: 900; letter-spacing: -.04em; color: #fff; }
.auth-lead { max-width: 520px; color: rgba(255,255,255,.78); font-size: 1.1rem; }
.auth-footer-note { display: inline-flex; gap: 8px; align-items: center; color: rgba(255,255,255,.8); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 4vw, 56px); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.auth-card { background: #fff; border: 1px solid rgba(255,255,255,.7); border-radius: 24px; padding: clamp(22px, 4vw, 36px); box-shadow: 0 28px 70px rgba(8,5,52,.22); color: var(--kiu-text); }
.auth-card h4 { color: #10172a; font-weight: 900; }
.small-muted { color: var(--kiu-muted); }
.auth-input .form-label { color: var(--kiu-text); font-weight: 800; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* Dark mode support */
html.dark-mode body,
body.dark-mode {
    --kiu-bg: #0f172a;
    --kiu-surface: #141d2f;
    --kiu-surface-soft: #101827;
    --kiu-border: #273449;
    --kiu-text: #e5e7eb;
    --kiu-muted: #a5b0c2;
    background: linear-gradient(180deg, #0b1020, #111827);
    color: var(--kiu-text);
}
html.dark-mode .navbar-custom,
body.dark-mode .navbar-custom,
html.dark-mode .toggle-btn,
body.dark-mode .toggle-btn,
html.dark-mode .theme-toggle,
body.dark-mode .theme-toggle,
html.dark-mode .dropdown-menu,
body.dark-mode .dropdown-menu {
    background: rgba(20,29,47,.95);
    border-color: var(--kiu-border);
    color: var(--kiu-text);
}
html.dark-mode #page-content .page-title,
html.dark-mode #page-content h1,
html.dark-mode #page-content h2,
body.dark-mode #page-content .page-title,
body.dark-mode #page-content h1,
body.dark-mode #page-content h2 { color: #f8fafc; }
html.dark-mode .card,
html.dark-mode .dashboard-card,
body.dark-mode .card,
body.dark-mode .dashboard-card { background: var(--kiu-surface); border-color: var(--kiu-border); color: var(--kiu-text); }
html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode .input-group-text,
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text { background: #0f172a; border-color: var(--kiu-border); color: var(--kiu-text); }


html.dark-mode #page-content .staff-profile .nav-tabs,
html.dark-mode #page-content .staff-profile .nav-pills,
html.dark-mode #page-content .profile-page .nav-tabs,
html.dark-mode #page-content .profile-page .nav-pills,
html.dark-mode #page-content .profile-tabs,
html.dark-mode #page-content #profileTabs,
html.dark-mode #page-content [id*="profile"][id*="Tabs"],
html.dark-mode #page-content [id*="Profile"][id*="Tabs"],
body.dark-mode #page-content .staff-profile .nav-tabs,
body.dark-mode #page-content .staff-profile .nav-pills,
body.dark-mode #page-content .profile-page .nav-tabs,
body.dark-mode #page-content .profile-page .nav-pills,
body.dark-mode #page-content .profile-tabs,
body.dark-mode #page-content #profileTabs,
body.dark-mode #page-content [id*="profile"][id*="Tabs"],
body.dark-mode #page-content [id*="Profile"][id*="Tabs"] {
    background: #101827;
    border-color: var(--kiu-border);
}
html.dark-mode #page-content .staff-profile .nav-tabs .nav-link,
html.dark-mode #page-content .staff-profile .nav-pills .nav-link,
html.dark-mode #page-content .profile-page .nav-tabs .nav-link,
html.dark-mode #page-content .profile-page .nav-pills .nav-link,
html.dark-mode #page-content .profile-tabs .nav-link,
html.dark-mode #page-content #profileTabs .nav-link,
html.dark-mode #page-content [id*="profile"][id*="Tabs"] .nav-link,
html.dark-mode #page-content [id*="Profile"][id*="Tabs"] .nav-link,
body.dark-mode #page-content .staff-profile .nav-tabs .nav-link,
body.dark-mode #page-content .staff-profile .nav-pills .nav-link,
body.dark-mode #page-content .profile-page .nav-tabs .nav-link,
body.dark-mode #page-content .profile-page .nav-pills .nav-link,
body.dark-mode #page-content .profile-tabs .nav-link,
body.dark-mode #page-content #profileTabs .nav-link,
body.dark-mode #page-content [id*="profile"][id*="Tabs"] .nav-link,
body.dark-mode #page-content [id*="Profile"][id*="Tabs"] .nav-link { color: #cbd5e1; }
html.dark-mode #page-content .staff-profile .nav-tabs .nav-link:hover,
html.dark-mode #page-content .staff-profile .nav-pills .nav-link:hover,
html.dark-mode #page-content .profile-page .nav-tabs .nav-link:hover,
html.dark-mode #page-content .profile-page .nav-pills .nav-link:hover,
html.dark-mode #page-content .profile-tabs .nav-link:hover,
html.dark-mode #page-content #profileTabs .nav-link:hover,
html.dark-mode #page-content [id*="profile"][id*="Tabs"] .nav-link:hover,
html.dark-mode #page-content [id*="Profile"][id*="Tabs"] .nav-link:hover,
body.dark-mode #page-content .staff-profile .nav-tabs .nav-link:hover,
body.dark-mode #page-content .staff-profile .nav-pills .nav-link:hover,
body.dark-mode #page-content .profile-page .nav-tabs .nav-link:hover,
body.dark-mode #page-content .profile-page .nav-pills .nav-link:hover,
body.dark-mode #page-content .profile-tabs .nav-link:hover,
body.dark-mode #page-content #profileTabs .nav-link:hover,
body.dark-mode #page-content [id*="profile"][id*="Tabs"] .nav-link:hover,
body.dark-mode #page-content [id*="Profile"][id*="Tabs"] .nav-link:hover {
    background: #162033;
    color: #fff;
    border-color: var(--kiu-border);
}
html.dark-mode #page-content .profile-completion,
html.dark-mode #page-content .completion-card,
html.dark-mode #page-content [data-profile-completion],
body.dark-mode #page-content .profile-completion,
body.dark-mode #page-content .completion-card,
body.dark-mode #page-content [data-profile-completion] {
    background: var(--kiu-surface);
    border-color: var(--kiu-border);
}
html.dark-mode #page-content .progress,
body.dark-mode #page-content .progress { background-color: #263247; }
html.dark-mode #page-content .completion-percent,
html.dark-mode #page-content .profile-completion-percent,
html.dark-mode #page-content [data-profile-percent],
body.dark-mode #page-content .completion-percent,
body.dark-mode #page-content .profile-completion-percent,
body.dark-mode #page-content [data-profile-percent] { color: #f8fafc; }

/* Responsive */
@media (max-width: 992px) {
    .role-switch { max-width: 38vw; }
    #page-content, .container-fluid#page-content { padding: 22px !important; }
}
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar-header .menu-text { display: none; }
    .sidebar-menu a {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 54px;
        padding: 9px 5px;
        gap: 4px;
        text-align: center;
        font-size: .46rem;
        line-height: 1.1;
    }
    .sidebar-menu a .menu-text {
        display: block;
        max-width: 60px;
        color: #d9d6d2;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .main-content,
    .main-content.expanded { margin-left: 70px; }
    .navbar-custom .container-fluid { gap: 10px; }
    .role-switch { display: none; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-form { min-height: 100vh; }
}
@media (max-width: 576px) {
    #page-content, .container-fluid#page-content { padding: 16px !important; }
    .navbar-custom .dropdown-toggle { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Dashboard welcome/header contrast fix: keep dark-on-dark/white-on-white areas readable */
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(227, 232, 240, .95);
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #10172a !important;
    box-shadow: 0 8px 22px rgba(8, 5, 52, .06);
}
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h1,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h2,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h3,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h4,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h5,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 h6,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h1,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h2,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h3,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h4,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h5,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h6,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 b,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 strong {
    color: #10172a !important;
}
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .text-muted,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 small,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .small {
    color: #647084 !important;
}
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h3,
#page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .h4 {
    font-weight: 900;
    letter-spacing: -.025em;
}

/* If Bootstrap/custom dark containers are used, make muted text readable there too. */
#page-content :is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark, .card-header-custom, .card-header) .text-muted,
#page-content :is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark, .card-header-custom, .card-header) small,
#page-content :is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark, .card-header-custom, .card-header) .small {
    color: rgba(255, 255, 255, .76) !important;
}

/* Compact helper/instruction text so notes do not overpower staff profile pages. */
#page-content .kiu-compact-helper-text,
#page-content .form-text,
#page-content .help-text,
#page-content .helper-text,
#page-content .instruction-text,
#page-content .approval-note,
#page-content .approval-help,
#page-content .section-help,
#page-content .profile-help,
#page-content .alert p,
#page-content .alert small,
#page-content .alert .small {
    font-size: .76rem !important;
    line-height: 1.35 !important;
    letter-spacing: .005em;
}
#page-content .kiu-compact-helper-text,
#page-content .form-text,
#page-content .help-text,
#page-content .helper-text,
#page-content .instruction-text,
#page-content .approval-note,
#page-content .approval-help,
#page-content .section-help,
#page-content .profile-help {
    max-width: 760px;
    color: var(--kiu-muted) !important;
}
#page-content .alert .kiu-compact-helper-text,
#page-content .alert p.kiu-compact-helper-text {
    margin-bottom: 0 !important;
}
html.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2,
body.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 {
    background: linear-gradient(135deg, #141d2f 0%, #101827 100%) !important;
    border-color: var(--kiu-border);
    color: #f8fafc !important;
}
html.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,b,strong),
body.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,b,strong) {
    color: #f8fafc !important;
}
html.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .text-muted,
html.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 small,
html.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .small,
body.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .text-muted,
body.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 small,
body.dark-mode #page-content .d-flex.align-items-center.justify-content-between.flex-wrap.gap-2 .small {
    color: #b9c4d6 !important;
}

/* === KIU final dashboard/profile polish: readable dashboards, compact notes, modern forms/tabs === */
#page-content.kiu-dashboard-ui,
#page-content {
    --kiu-field-h: 38px;
    --kiu-profile-gap: .85rem;
}

/* Dashboard welcome / profile-completion panels */
#page-content .kiu-dashboard-hero,
#page-content .dashboard-hero,
#page-content .welcome-panel,
#page-content .welcome-card,
#page-content .profile-summary-card,
#page-content [class*="welcome-card"],
#page-content [class*="WelcomeCard"] {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 18px 20px !important;
    border: 0 !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at top right, rgba(248, 178, 112, .34), transparent 20rem),
        linear-gradient(135deg, #080534 0%, #17115a 58%, #26327a 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 18px 42px rgba(8, 5, 52, .18) !important;
}
#page-content .kiu-dashboard-hero::before,
#page-content .dashboard-hero::before,
#page-content .welcome-panel::before,
#page-content .welcome-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,.08), transparent 48%);
}
#page-content .kiu-dashboard-hero *,
#page-content .dashboard-hero *,
#page-content .welcome-panel *,
#page-content .welcome-card *,
#page-content .profile-summary-card * {
    color: inherit !important;
}
#page-content .kiu-dashboard-hero .text-muted,
#page-content .kiu-dashboard-hero small,
#page-content .kiu-dashboard-hero .small,
#page-content .dashboard-hero .text-muted,
#page-content .welcome-panel .text-muted,
#page-content .welcome-card .text-muted,
#page-content .profile-summary-card .text-muted {
    color: rgba(255, 255, 255, .76) !important;
    font-size: .74rem !important;
    line-height: 1.28 !important;
}
#page-content .kiu-dashboard-hero .h3,
#page-content .kiu-dashboard-hero .h4,
#page-content .kiu-dashboard-hero h3,
#page-content .kiu-dashboard-hero h4,
#page-content .dashboard-hero .h3,
#page-content .dashboard-hero .h4,
#page-content .welcome-panel .h3,
#page-content .welcome-panel .h4,
#page-content .welcome-card .h3,
#page-content .welcome-card .h4 {
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -.035em;
    margin-bottom: .12rem !important;
}
#page-content .kiu-dashboard-hero .h4,
#page-content .kiu-dashboard-hero h4 { font-size: clamp(1.05rem, 1.4vw, 1.32rem) !important; }
#page-content .kiu-dashboard-hero .h3,
#page-content .kiu-dashboard-hero h3 { font-size: clamp(1.35rem, 2vw, 1.9rem) !important; }

/* Professional page headers across dashboards */
#page-content > .row.mb-4:first-child,
#page-content .page-header,
#page-content .dashboard-page-header {
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 18px !important;
    border: 1px solid rgba(227, 232, 240, .94);
    border-radius: 22px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 10px 26px rgba(8, 5, 52, .06);
    backdrop-filter: blur(12px);
}
#page-content > .row.mb-4:first-child h1,
#page-content > .row.mb-4:first-child h2,
#page-content .page-header h1,
#page-content .page-header h2 {
    margin-bottom: .2rem;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.15;
}
#page-content > .row.mb-4:first-child p,
#page-content .page-header p,
#page-content .dashboard-page-header p {
    margin-bottom: 0;
    font-size: .82rem;
    line-height: 1.35;
}

/* Cards/widgets: keep dashboard text readable and clean */
#page-content .card,
#page-content .dashboard-card,
#page-content .panel,
#page-content .widget,
#page-content .metric-card,
#page-content .stat-card,
#page-content .summary-card,
#page-content .info-card,
#page-content .chart-container {
    border-radius: 20px !important;
    border-color: rgba(224, 231, 242, .96) !important;
    box-shadow: 0 12px 28px rgba(8, 5, 52, .07) !important;
}
#page-content .card-body {
    padding: 1.05rem 1.15rem;
}
#page-content .card h3,
#page-content .card h4,
#page-content .card h5,
#page-content .dashboard-card h3,
#page-content .dashboard-card h4,
#page-content .dashboard-card h5 {
    letter-spacing: -.02em;
}
#page-content .card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark) .text-muted,
#page-content .dashboard-card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark) .text-muted {
    color: #667085 !important;
}
#page-content .bg-primary .text-muted,
#page-content .bg-secondary .text-muted,
#page-content .bg-success .text-muted,
#page-content .bg-danger .text-muted,
#page-content .bg-info .text-muted,
#page-content .bg-dark .text-muted,
#page-content .card-header .text-muted,
#page-content .card-header-custom .text-muted {
    color: rgba(255,255,255,.75) !important;
}
#page-content .bg-warning .text-muted,
#page-content .card.bg-warning .text-muted {
    color: rgba(42, 26, 0, .75) !important;
}

/* Smaller helper/instruction text, including approval notes */
#page-content .kiu-compact-helper-text,
#page-content .form-text,
#page-content .help-text,
#page-content .helper-text,
#page-content .instruction-text,
#page-content .approval-note,
#page-content .approval-help,
#page-content .section-help,
#page-content .profile-help,
#page-content .alert p,
#page-content .alert small,
#page-content .alert .small {
    max-width: 680px;
    font-size: .70rem !important;
    line-height: 1.28 !important;
    font-weight: 600;
    color: #667085 !important;
}
#page-content .alert {
    border-radius: 16px;
    padding: .72rem .9rem;
    border-width: 1px;
    box-shadow: 0 8px 18px rgba(8, 5, 52, .045);
}
#page-content .alert .kiu-compact-helper-text,
#page-content .alert p.kiu-compact-helper-text {
    margin-bottom: 0 !important;
}

/* Modern tab links/buttons */
#page-content .kiu-modern-tabs,
#page-content .nav-tabs,
#page-content .nav-pills,
#page-content .profile-tabs,
#page-content #profileTabs,
#page-content [id*="profile"][id*="Tabs"],
#page-content [id*="Profile"][id*="Tabs"] {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .38rem;
    padding: .42rem;
    border: 1px solid #dfe6f1 !important;
    border-bottom: 1px solid #dfe6f1 !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 8px 18px rgba(8,5,52,.05);
}
#page-content .kiu-modern-tabs .nav-item,
#page-content .nav-tabs .nav-item,
#page-content .nav-pills .nav-item {
    margin: 0 !important;
}
#page-content .kiu-modern-tabs .nav-link,
#page-content .nav-tabs .nav-link,
#page-content .nav-pills .nav-link,
#page-content .profile-tabs .nav-link,
#page-content #profileTabs .nav-link,
#page-content [id*="profile"][id*="Tabs"] .nav-link,
#page-content [id*="Profile"][id*="Tabs"] .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .32rem;
    min-height: 30px;
    padding: .38rem .68rem !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #46546a !important;
    font-size: .72rem !important;
    font-weight: 850 !important;
    line-height: 1.1;
    letter-spacing: .002em;
    white-space: nowrap;
    box-shadow: none !important;
}
#page-content .kiu-modern-tabs .nav-link i,
#page-content .nav-tabs .nav-link i,
#page-content .nav-pills .nav-link i {
    font-size: .95rem;
}
#page-content .kiu-modern-tabs .nav-link:hover,
#page-content .nav-tabs .nav-link:hover,
#page-content .nav-pills .nav-link:hover,
#page-content .profile-tabs .nav-link:hover,
#page-content #profileTabs .nav-link:hover {
    background: #ffffff !important;
    color: var(--kiu-primary) !important;
    border-color: rgba(8, 5, 52, .08) !important;
    transform: translateY(-1px);
}
#page-content .kiu-modern-tabs .nav-link.active,
#page-content .nav-tabs .nav-link.active,
#page-content .nav-pills .nav-link.active,
#page-content .profile-tabs .nav-link.active,
#page-content #profileTabs .nav-link.active,
#page-content [id*="profile"][id*="Tabs"] .nav-link.active,
#page-content [id*="Profile"][id*="Tabs"] .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--kiu-primary), #1d1672) !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow: 0 8px 18px rgba(8,5,52,.18) !important;
}
#page-content .kiu-modern-tab-content,
#page-content .tab-content {
    margin-top: .9rem;
}

/* Next/Previous tab navigation */
#page-content .kiu-tab-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 1rem 0 0;
    padding: .72rem;
    border: 1px solid #dfe6f1;
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 8px 18px rgba(8,5,52,.05);
}
#page-content .kiu-tab-stepper .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    min-height: 32px;
    padding: .4rem .72rem;
    font-size: .74rem;
    border-radius: 999px;
}
#page-content .kiu-tab-stepper .btn i { font-size: 1rem; }
#page-content .kiu-tab-count {
    color: #667085;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Staff profile/forms: compact, aligned, professional */
#page-content.kiu-profile-ui .card,
#page-content .staff-profile .card,
#page-content .profile-page .card {
    overflow: hidden;
}
#page-content .tab-pane .row,
#page-content.kiu-profile-ui .row,
#page-content .staff-profile .row,
#page-content .profile-page .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: .85rem;
}
#page-content .form-label,
#page-content label.form-label,
#page-content .kiu-field-card > label,
#page-content .kiu-field-card .form-label {
    margin-bottom: .32rem !important;
    color: #344054 !important;
    font-size: .70rem !important;
    font-weight: 850 !important;
    letter-spacing: .018em;
    text-transform: uppercase;
}
#page-content .form-control,
#page-content .form-select,
#page-content .input-group-text,
#page-content .form-control-static {
    min-height: var(--kiu-field-h) !important;
    padding: .44rem .68rem !important;
    border-radius: 12px !important;
    border-color: #d7deea !important;
    font-size: .84rem !important;
    line-height: 1.35;
    box-shadow: none !important;
}
#page-content textarea.form-control {
    min-height: 86px !important;
    resize: vertical;
}
#page-content .form-control::placeholder,
#page-content textarea::placeholder {
    color: #98a2b3;
    font-size: .8rem;
}
#page-content .form-control:focus,
#page-content .form-select:focus {
    border-color: var(--kiu-primary-2) !important;
    box-shadow: 0 0 0 .18rem rgba(8, 5, 52, .10) !important;
}
#page-content .form-control-static,
#page-content .kiu-field-card .form-control-static {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    background: #f8fafc !important;
    color: #172033 !important;
    font-weight: 750;
}
#page-content .kiu-field-card {
    margin-bottom: .72rem !important;
}
#page-content .tab-pane .card,
#page-content .tab-pane .dashboard-card {
    margin-bottom: 1rem;
}
#page-content .tab-pane h5,
#page-content .tab-pane h6,
#page-content.kiu-profile-ui h5,
#page-content.kiu-profile-ui h6 {
    font-size: .95rem;
    font-weight: 900;
    letter-spacing: -.01em;
}

/* Accurate-looking completion/progress display */
#page-content .progress {
    height: .62rem !important;
    border-radius: 999px !important;
    background: #e8eef7 !important;
}
#page-content .progress-bar {
    border-radius: 999px !important;
    background: linear-gradient(90deg, #080534, #0da604) !important;
    color: #ffffff !important;
    font-size: .62rem !important;
    font-weight: 900 !important;
    min-width: 0 !important;
}
#page-content .completion-percent,
#page-content .profile-completion-percent,
#page-content [data-profile-percent] {
    font-size: 1rem !important;
    font-weight: 950 !important;
}

/* Table polish across dashboards */
#page-content .table-responsive {
    border-radius: 18px !important;
    border: 1px solid #dfe6f1 !important;
    box-shadow: 0 8px 18px rgba(8,5,52,.045);
}
#page-content .table td,
#page-content .table th {
    vertical-align: middle;
    font-size: .82rem;
}
#page-content .table tbody td {
    color: #253044;
}

html.dark-mode #page-content > .row.mb-4:first-child,
html.dark-mode #page-content .page-header,
html.dark-mode #page-content .dashboard-page-header,
body.dark-mode #page-content > .row.mb-4:first-child,
body.dark-mode #page-content .page-header,
body.dark-mode #page-content .dashboard-page-header,
html.dark-mode #page-content .kiu-tab-stepper,
body.dark-mode #page-content .kiu-tab-stepper {
    background: rgba(20,29,47,.88) !important;
    border-color: var(--kiu-border) !important;
}
html.dark-mode #page-content .kiu-modern-tabs,
html.dark-mode #page-content .nav-tabs,
html.dark-mode #page-content .nav-pills,
body.dark-mode #page-content .kiu-modern-tabs,
body.dark-mode #page-content .nav-tabs,
body.dark-mode #page-content .nav-pills {
    background: linear-gradient(180deg, #141d2f 0%, #101827 100%) !important;
    border-color: var(--kiu-border) !important;
}
html.dark-mode #page-content .kiu-modern-tabs .nav-link,
html.dark-mode #page-content .nav-tabs .nav-link,
html.dark-mode #page-content .nav-pills .nav-link,
body.dark-mode #page-content .kiu-modern-tabs .nav-link,
body.dark-mode #page-content .nav-tabs .nav-link,
body.dark-mode #page-content .nav-pills .nav-link {
    color: #cbd5e1 !important;
}
html.dark-mode #page-content .kiu-modern-tabs .nav-link:hover,
html.dark-mode #page-content .nav-tabs .nav-link:hover,
html.dark-mode #page-content .nav-pills .nav-link:hover,
body.dark-mode #page-content .kiu-modern-tabs .nav-link:hover,
body.dark-mode #page-content .nav-tabs .nav-link:hover,
body.dark-mode #page-content .nav-pills .nav-link:hover {
    background: #162033 !important;
    color: #ffffff !important;
}
html.dark-mode #page-content .form-label,
body.dark-mode #page-content .form-label,
html.dark-mode #page-content label.form-label,
body.dark-mode #page-content label.form-label {
    color: #cbd5e1 !important;
}
html.dark-mode #page-content .form-control-static,
body.dark-mode #page-content .form-control-static {
    background: #101827 !important;
    border-color: var(--kiu-border) !important;
    color: #f8fafc !important;
}
html.dark-mode #page-content .table tbody td,
body.dark-mode #page-content .table tbody td {
    color: #e5e7eb;
}
html.dark-mode #page-content .kiu-compact-helper-text,
html.dark-mode #page-content .form-text,
html.dark-mode #page-content .help-text,
html.dark-mode #page-content .helper-text,
html.dark-mode #page-content .instruction-text,
body.dark-mode #page-content .kiu-compact-helper-text,
body.dark-mode #page-content .form-text,
body.dark-mode #page-content .help-text,
body.dark-mode #page-content .helper-text,
body.dark-mode #page-content .instruction-text {
    color: #a5b0c2 !important;
}

@media (max-width: 768px) {
    #page-content .kiu-modern-tabs,
    #page-content .nav-tabs,
    #page-content .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: .38rem;
    }
    #page-content .kiu-tab-stepper {
        position: sticky;
        bottom: 10px;
        z-index: 20;
    }
    #page-content .kiu-dashboard-hero {
        padding: 15px 16px !important;
    }
}


/* Theme toggle reliability + dark login polish */
.theme-toggle,
#themeToggle {
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.theme-toggle:hover,
#themeToggle:hover {
    transform: translateY(-1px);
}
.theme-toggle.active,
#themeToggle.active,
html.dark-mode .theme-toggle,
body.dark-mode .theme-toggle,
html.dark-mode #themeToggle,
body.dark-mode #themeToggle {
    background: linear-gradient(135deg, var(--kiu-secondary), #ffd19b) !important;
    border-color: rgba(248, 178, 112, .88) !important;
    color: #2a1a00 !important;
}
html.dark-mode .auth-form,
body.dark-mode .auth-form {
    background: rgba(15, 23, 42, .88) !important;
}
html.dark-mode .auth-card,
body.dark-mode .auth-card {
    background: #141d2f !important;
    border-color: #273449 !important;
    color: #e5e7eb !important;
    box-shadow: 0 28px 70px rgba(0,0,0,.35) !important;
}
html.dark-mode .auth-card h1,
html.dark-mode .auth-card h2,
html.dark-mode .auth-card h3,
html.dark-mode .auth-card h4,
html.dark-mode .auth-card h5,
html.dark-mode .auth-card h6,
body.dark-mode .auth-card h1,
body.dark-mode .auth-card h2,
body.dark-mode .auth-card h3,
body.dark-mode .auth-card h4,
body.dark-mode .auth-card h5,
body.dark-mode .auth-card h6 {
    color: #f8fafc !important;
}
html.dark-mode .auth-card .small-muted,
html.dark-mode .auth-card .text-muted,
body.dark-mode .auth-card .small-muted,
body.dark-mode .auth-card .text-muted {
    color: #a5b0c2 !important;
}
html.dark-mode .auth-card .form-label,
body.dark-mode .auth-card .form-label {
    color: #cbd5e1 !important;
}
html.dark-mode .auth-card .form-control,
html.dark-mode .auth-card .input-group-text,
body.dark-mode .auth-card .form-control,
body.dark-mode .auth-card .input-group-text {
    background: #0f172a !important;
    border-color: #273449 !important;
    color: #f8fafc !important;
}
html.dark-mode .auth-card .form-control::placeholder,
body.dark-mode .auth-card .form-control::placeholder {
    color: #7d8aa3 !important;
}

/* Lecturer role workspace copied/adapted from the old lecturer module, modernized for current dashboard */
.lecturer-ui {
  --lecturer-primary: #4f46e5;
  --lecturer-primary-2: #7c3aed;
  --lecturer-deep: #241447;
  --lecturer-text: #0f172a;
  --lecturer-muted: #64748b;
  --lecturer-soft: #f6f4ff;
  --lecturer-line: rgba(79,70,229,.14);
  color: var(--lecturer-text);
}
.lecturer-ui .card { border-radius: 18px; }
.lecturer-hero,
.lecturer-page-head,
.lecturer-filter,
.lecturer-result-panel,
.lecturer-table-card {
  background: linear-gradient(180deg,#ffffff 0%,#f8faff 100%);
  border: 1px solid var(--lecturer-line) !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.07) !important;
}
.lecturer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--lecturer-primary);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.lecturer-title {
  font-size: 1.22rem;
  line-height: 1.2;
  font-weight: 850;
  color: var(--lecturer-text);
}
.lecturer-subtitle {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--lecturer-muted);
}
.lecturer-identity-box {
  min-width: 190px;
  padding: .7rem .85rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(148,163,184,.2);
}
.lecturer-identity-box .label,
.lecturer-identity-box span.label {
  display: block;
  font-size: .65rem;
  color: var(--lecturer-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 800;
}
.lecturer-identity-box strong {
  display: block;
  margin-top: .15rem;
  font-size: .78rem;
  color: var(--lecturer-text);
  word-break: break-word;
}
.lecturer-filter-label {
  display: block;
  color: var(--lecturer-muted);
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
  margin-bottom: .28rem;
}
.lecturer-control,
.lecturer-ui .form-control,
.lecturer-ui .form-select {
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.3);
  color: var(--lecturer-text);
  background-color: #fff;
  font-size: .78rem;
  box-shadow: none !important;
}
.lecturer-control:focus,
.lecturer-ui .form-control:focus,
.lecturer-ui .form-select:focus {
  border-color: rgba(79,70,229,.45);
  box-shadow: 0 0 0 .16rem rgba(79,70,229,.1) !important;
}
.lecturer-toolbar { border-top: 1px solid rgba(148,163,184,.15); }
.lecturer-btn-primary,
.lecturer-ui .btn.lecturer-btn-primary {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg,var(--lecturer-primary),var(--lecturer-primary-2));
  color: #fff !important;
  font-size: .76rem;
  font-weight: 800;
  padding: .46rem .78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  box-shadow: 0 10px 20px rgba(79,70,229,.18);
}
.lecturer-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 13px 24px rgba(79,70,229,.24); }
.lecturer-btn-light,
.lecturer-ui .btn.lecturer-btn-light,
.lecturer-view-toggle .btn-outline-primary {
  border: 1px solid rgba(79,70,229,.16);
  background: #fff;
  color: var(--lecturer-primary) !important;
  border-radius: 12px;
  font-size: .76rem;
  font-weight: 800;
  padding: .42rem .7rem;
}
.lecturer-view-toggle .btn-primary {
  border: 0;
  background: linear-gradient(135deg,var(--lecturer-primary),var(--lecturer-primary-2));
  color: #fff !important;
  border-radius: 12px;
  font-size: .76rem;
  font-weight: 800;
}
.lecturer-stat {
  min-height: 72px;
  padding: .85rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .7rem;
  border: 1px solid var(--lecturer-line) !important;
  background: rgba(255,255,255,.95);
}
.lecturer-stat span:first-child {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#eef2ff,#f5f3ff);
  color: var(--lecturer-primary);
  font-size: 1.15rem;
  flex: 0 0 42px;
}
.lecturer-stat strong {
  display: block;
  color: var(--lecturer-text);
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.05;
}
.lecturer-stat small {
  display: block;
  color: var(--lecturer-muted);
  font-size: .68rem;
  font-weight: 750;
  margin-top: .14rem;
}
.lecturer-course-card {
  border: 1px solid var(--lecturer-line) !important;
  overflow: hidden;
  background: #fff;
  transition: transform .16s ease, box-shadow .16s ease;
}
.lecturer-course-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(15,23,42,.11) !important; }
.lecturer-card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem .92rem .7rem;
  background: linear-gradient(180deg,#fff 0%,#f8faff 100%);
  border-bottom: 1px solid rgba(148,163,184,.13);
}
.lecturer-code {
  color: var(--lecturer-text);
  font-size: .95rem;
  font-weight: 900;
  letter-spacing: .015em;
}
.lecturer-course-title {
  margin-top: .18rem;
  color: var(--lecturer-muted);
  font-size: .72rem;
  line-height: 1.35;
  font-weight: 650;
}
.lecturer-unit {
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  border: 1px solid rgba(79,70,229,.12);
  font-size: .62rem;
  font-weight: 900;
  padding: .28rem .55rem;
  white-space: nowrap;
}
.lecturer-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .68rem .9rem 0;
}
.lecturer-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .23rem .46rem;
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--lecturer-muted);
  font-size: .62rem;
  font-weight: 750;
  max-width: 100%;
}
.lecturer-card-body { padding: .76rem .9rem; }
.lecturer-card-stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .45rem;
}
.lecturer-card-stats div {
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.12);
  background: #f8fafc;
  padding: .5rem .3rem;
  text-align: center;
}
.lecturer-card-stats b {
  display: block;
  font-size: .88rem;
  line-height: 1;
  color: var(--lecturer-text);
  font-weight: 900;
}
.lecturer-card-stats span {
  display: block;
  margin-top: .16rem;
  color: var(--lecturer-muted);
  font-size: .58rem;
  font-weight: 760;
}
.lecturer-card-footer {
  padding: 0 .9rem .9rem;
  background: #fff;
}
.lecturer-program-list { display: grid; gap: .42rem; margin-top: .7rem; }
.lecturer-program-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .5rem;
  align-items: center;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 13px;
  padding: .52rem .56rem;
}
.lecturer-program-row strong { display: block; font-size: .72rem; line-height: 1.25; color: var(--lecturer-text); }
.lecturer-program-row small { display: block; color: var(--lecturer-muted); font-size: .62rem; margin-top: .12rem; }
.lecturer-row-actions { display: inline-flex; gap: .24rem; flex-wrap: wrap; justify-content: flex-end; }
.lecturer-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(79,70,229,.16);
  color: var(--lecturer-primary) !important;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lecturer-icon-btn:hover { background: var(--lecturer-primary); color: #fff !important; }
.lecturer-empty {
  min-height: 210px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border: 1px dashed rgba(79,70,229,.2) !important;
  background: #fff;
}
.lecturer-empty i { font-size: 2rem; color: var(--lecturer-primary); margin-bottom: .45rem; }
.lecturer-empty strong { display: block; color: var(--lecturer-text); font-weight: 900; }
.lecturer-empty span { color: var(--lecturer-muted); font-size: .82rem; }
.lecturer-result-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(148,163,184,.15);
}
.lecturer-result-tab {
  border: 1px solid rgba(79,70,229,.13);
  background: #f8f7ff;
  color: var(--lecturer-primary);
  border-radius: 13px;
  padding: .62rem .82rem;
  font-size: .78rem;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  gap: .42rem;
}
.lecturer-result-tab.active {
  background: linear-gradient(135deg,var(--lecturer-primary),var(--lecturer-primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(79,70,229,.18);
}
.lecturer-result-pane { display: none; }
.lecturer-result-pane.active { display: block; }
.lecturer-upload-card {
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
  height: 100%;
}
.lecturer-upload-card h5 {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--lecturer-text);
  font-size: .98rem;
  font-weight: 900;
  margin-bottom: .35rem;
}
.lecturer-upload-card p {
  color: var(--lecturer-muted);
  font-size: .8rem;
  line-height: 1.45;
}
.lecturer-table-title { color: var(--lecturer-text); font-size: .95rem; font-weight: 900; }
.lecturer-table-search { width: min(240px, 100%); }
.lecturer-table {
  --bs-table-bg: transparent;
  color: var(--lecturer-text);
  font-size: .77rem;
}
.lecturer-table thead th {
  background: #f5f3ff;
  color: #4338ca;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 900;
  border-bottom: 0;
  white-space: nowrap;
}
.lecturer-table tbody td {
  color: var(--lecturer-text);
  border-color: rgba(148,163,184,.14);
  vertical-align: middle;
}
.lecturer-table tbody tr:hover { background: #fbfaff; }
.lecturer-score-input {
  width: 78px;
  text-align: center;
  padding-left: .3rem;
  padding-right: .3rem;
}
.lecturer-row-locked { background: #f8fafc; color: var(--lecturer-muted); }
.lecturer-row-locked input { background: #f1f5f9 !important; color: #64748b !important; }
.lecturer-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .24rem .55rem;
  font-size: .62rem;
  font-weight: 900;
}
.lecturer-badge.open { background: #ecfdf5; color: #047857; }
.lecturer-badge.locked { background: #f1f5f9; color: #64748b; }
.lecturer-alert { font-size: .82rem; }
.dark-mode .lecturer-ui,
body.dark-mode .lecturer-ui {
  --lecturer-text: #e5e7eb;
  --lecturer-muted: #a5b4fc;
  --lecturer-line: rgba(165,180,252,.18);
}
.dark-mode .lecturer-hero,
.dark-mode .lecturer-page-head,
.dark-mode .lecturer-filter,
.dark-mode .lecturer-result-panel,
.dark-mode .lecturer-table-card,
.dark-mode .lecturer-course-card,
.dark-mode .lecturer-empty,
.dark-mode .lecturer-upload-card,
.dark-mode .lecturer-identity-box,
body.dark-mode .lecturer-hero,
body.dark-mode .lecturer-page-head,
body.dark-mode .lecturer-filter,
body.dark-mode .lecturer-result-panel,
body.dark-mode .lecturer-table-card,
body.dark-mode .lecturer-course-card,
body.dark-mode .lecturer-empty,
body.dark-mode .lecturer-upload-card,
body.dark-mode .lecturer-identity-box {
  background: linear-gradient(180deg,#111827 0%,#0f172a 100%);
  border-color: rgba(165,180,252,.18) !important;
  color: #e5e7eb;
}
.dark-mode .lecturer-control,
.dark-mode .lecturer-ui .form-control,
.dark-mode .lecturer-ui .form-select,
body.dark-mode .lecturer-control,
body.dark-mode .lecturer-ui .form-control,
body.dark-mode .lecturer-ui .form-select {
  background: #0b1220;
  border-color: rgba(165,180,252,.2);
  color: #e5e7eb;
}
.dark-mode .lecturer-meta-row span,
.dark-mode .lecturer-card-stats div,
.dark-mode .lecturer-table thead th,
body.dark-mode .lecturer-meta-row span,
body.dark-mode .lecturer-card-stats div,
body.dark-mode .lecturer-table thead th { background: #101827; }
.dark-mode .lecturer-table tbody td,
body.dark-mode .lecturer-table tbody td { color: #e5e7eb; }
@media (max-width: 1199px) { .lecturer-card-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 767px) {
  .lecturer-program-row { grid-template-columns: 1fr; }
  .lecturer-row-actions { justify-content: flex-start; }
  .lecturer-result-tab { flex: 1 1 100%; justify-content: center; }
  .lecturer-table-search { width: 100%; }
}

/* Final dashboard contrast + submitted result button polish */
#page-content .metric-card,
#page-content .card.metric-card,
#page-content .dashboard-metric,
#page-content .stat-card,
#page-content .summary-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7f9ff 58%, #eef2ff 100%) !important;
    border: 1px solid rgba(79, 70, 229, .12) !important;
    color: #172033 !important;
    box-shadow: 0 14px 30px rgba(8, 5, 52, .08) !important;
}
#page-content .metric-card .metric-label,
#page-content .metric-card .text-muted,
#page-content .dashboard-metric .metric-label,
#page-content .stat-card .metric-label,
#page-content .summary-card .metric-label {
    color: #596579 !important;
    font-size: .72rem !important;
    font-weight: 850 !important;
    letter-spacing: .035em;
    text-transform: uppercase;
}
#page-content .metric-card .h1,
#page-content .metric-card .h2,
#page-content .metric-card .h3,
#page-content .metric-card h1,
#page-content .metric-card h2,
#page-content .metric-card h3,
#page-content .metric-card b,
#page-content .metric-card strong {
    color: #080534 !important;
    font-weight: 950 !important;
}
#page-content .metric-card a,
#page-content .dashboard-metric a,
#page-content .stat-card a,
#page-content .summary-card a {
    color: #4338ca !important;
    font-size: .72rem;
    font-weight: 850;
    text-decoration: none;
}
#page-content .metric-card a:hover,
#page-content .dashboard-metric a:hover,
#page-content .stat-card a:hover,
#page-content .summary-card a:hover { text-decoration: underline; }

html.dark-mode #page-content .metric-card,
html.dark-mode #page-content .card.metric-card,
html.dark-mode #page-content .dashboard-metric,
html.dark-mode #page-content .stat-card,
html.dark-mode #page-content .summary-card,
body.dark-mode #page-content .metric-card,
body.dark-mode #page-content .card.metric-card,
body.dark-mode #page-content .dashboard-metric,
body.dark-mode #page-content .stat-card,
body.dark-mode #page-content .summary-card {
    background: linear-gradient(145deg, #172033 0%, #111827 58%, #0b1220 100%) !important;
    border-color: rgba(165, 180, 252, .18) !important;
    color: #eef2ff !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28) !important;
}
html.dark-mode #page-content .metric-card .metric-label,
html.dark-mode #page-content .metric-card .text-muted,
html.dark-mode #page-content .dashboard-metric .metric-label,
html.dark-mode #page-content .stat-card .metric-label,
html.dark-mode #page-content .summary-card .metric-label,
body.dark-mode #page-content .metric-card .metric-label,
body.dark-mode #page-content .metric-card .text-muted,
body.dark-mode #page-content .dashboard-metric .metric-label,
body.dark-mode #page-content .stat-card .metric-label,
body.dark-mode #page-content .summary-card .metric-label {
    color: #b8c3d9 !important;
}
html.dark-mode #page-content .metric-card .h1,
html.dark-mode #page-content .metric-card .h2,
html.dark-mode #page-content .metric-card .h3,
html.dark-mode #page-content .metric-card h1,
html.dark-mode #page-content .metric-card h2,
html.dark-mode #page-content .metric-card h3,
html.dark-mode #page-content .metric-card b,
html.dark-mode #page-content .metric-card strong,
body.dark-mode #page-content .metric-card .h1,
body.dark-mode #page-content .metric-card .h2,
body.dark-mode #page-content .metric-card .h3,
body.dark-mode #page-content .metric-card h1,
body.dark-mode #page-content .metric-card h2,
body.dark-mode #page-content .metric-card h3,
body.dark-mode #page-content .metric-card b,
body.dark-mode #page-content .metric-card strong {
    color: #ffffff !important;
}
html.dark-mode #page-content .metric-card a,
html.dark-mode #page-content .dashboard-metric a,
html.dark-mode #page-content .stat-card a,
html.dark-mode #page-content .summary-card a,
body.dark-mode #page-content .metric-card a,
body.dark-mode #page-content .dashboard-metric a,
body.dark-mode #page-content .stat-card a,
body.dark-mode #page-content .summary-card a {
    color: #f8b270 !important;
}

.lecturer-btn-submitted,
.lecturer-ui .btn.lecturer-btn-submitted {
    border: 0 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #0f766e, #0da604) !important;
    color: #ffffff !important;
    font-size: .76rem;
    font-weight: 850;
    padding: .46rem .78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    box-shadow: 0 10px 20px rgba(13, 166, 4, .16);
}
.lecturer-btn-submitted:hover,
.lecturer-ui .btn.lecturer-btn-submitted:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    color: #ffffff !important;
}
.lecturer-submitted-result-btn {
    color: #0f766e !important;
    border-color: rgba(15, 118, 110, .2) !important;
}
.lecturer-submitted-result-btn:hover {
    background: #0f766e !important;
    color: #ffffff !important;
}

html.dark-mode .lecturer-card-footer,
html.dark-mode .lecturer-program-row,
body.dark-mode .lecturer-card-footer,
body.dark-mode .lecturer-program-row {
    background: #101827 !important;
    border-color: rgba(165,180,252,.16) !important;
}
html.dark-mode .lecturer-btn-light,
html.dark-mode .lecturer-ui .btn.lecturer-btn-light,
html.dark-mode .lecturer-view-toggle .btn-outline-primary,
body.dark-mode .lecturer-btn-light,
body.dark-mode .lecturer-ui .btn.lecturer-btn-light,
body.dark-mode .lecturer-view-toggle .btn-outline-primary {
    background: #101827 !important;
    border-color: rgba(165,180,252,.20) !important;
    color: #dbe4ff !important;
}
html.dark-mode .lecturer-icon-btn,
body.dark-mode .lecturer-icon-btn {
    background: #101827 !important;
    border-color: rgba(165,180,252,.20) !important;
    color: #dbe4ff !important;
}
html.dark-mode .lecturer-icon-btn:hover,
body.dark-mode .lecturer-icon-btn:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

/* === Patch: mobile role switching + old lecturer template/export polish === */
.navbar-custom .container-fluid > .d-flex {
    min-width: 0;
}
.role-switch::-webkit-scrollbar { height: 4px; }
.role-switch::-webkit-scrollbar-thumb { background: rgba(79,70,229,.28); border-radius: 999px; }

@media (max-width: 768px) {
    .navbar-custom,
    .navbar.navbar-custom { min-height: auto; padding-top: .45rem; padding-bottom: .45rem; }
    .navbar-custom .container-fluid {
        align-items: flex-start;
        gap: .5rem;
        flex-wrap: wrap;
    }
    .navbar-custom .container-fluid > .d-flex {
        flex: 1 1 calc(100% - 52px);
        min-width: 0;
        justify-content: flex-end;
        align-items: center !important;
        flex-wrap: wrap;
        gap: .45rem;
    }
    .navbar-custom .role-switch,
    .role-switch {
        display: flex !important;
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        max-width: 100% !important;
        margin: .35rem 0 0 !important;
        padding: .28rem;
        gap: .28rem;
        overflow-x: auto;
        border-radius: 16px;
        background: rgba(248,250,252,.96);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
    }
    .role-switch a,
    .role-switch button,
    .role-btn {
        padding: .42rem .62rem;
        font-size: .68rem;
        line-height: 1;
        min-height: 28px;
    }
    .navbar-custom .theme-toggle { order: 1; flex: 0 0 auto; }
    .navbar-custom .dropdown { order: 2; min-width: 0; }
    .navbar-custom .dropdown-toggle {
        max-width: 46vw !important;
        min-height: 38px;
        padding: .42rem .62rem;
        font-size: .74rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

html.dark-mode .role-switch,
body.dark-mode .role-switch {
    background: #101827 !important;
    border-color: rgba(165,180,252,.18) !important;
}
html.dark-mode .role-switch a,
html.dark-mode .role-switch button,
html.dark-mode .role-btn,
body.dark-mode .role-switch a,
body.dark-mode .role-switch button,
body.dark-mode .role-btn {
    color: #cbd5e1 !important;
}
html.dark-mode .role-switch a.active,
html.dark-mode .role-switch button.active,
html.dark-mode .role-btn.active,
body.dark-mode .role-switch a.active,
body.dark-mode .role-switch button.active,
body.dark-mode .role-btn.active {
    color: #fff !important;
}

/* Keep old lecturer template/submitted-result actions neat and readable. */
.lecturer-ui form[action*="result_template_for_student"],
.lecturer-ui form[action*="export_course_results"] {
    min-width: 0;
}
.lecturer-ui .result-upload-btn.alt,
.lecturer-ui .lecturer-btn-submitted,
.lecturer-ui .lecturer-btn-primary,
.lecturer-ui .lecturer-icon-btn {
    white-space: nowrap;
}
@media (max-width: 576px) {
    .lecturer-card-footer .d-grid,
    .result-template-actions {
        gap: .45rem !important;
    }
    .lecturer-card-footer .btn,
    .result-template-actions .result-upload-btn {
        min-height: 34px;
        font-size: .72rem !important;
    }
}


/* === Patch: first-login default role modal + improved mobile-only role switcher === */
.default-role-modal .modal-content {
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--kiu-text);
    overflow: hidden;
}
.default-role-modal .modal-content::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--kiu-primary), var(--kiu-secondary), var(--kiu-accent));
}
.role-choice-kicker {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .35rem;
    padding: .28rem .58rem;
    border-radius: 999px;
    background: rgba(8,5,52,.08);
    color: var(--kiu-primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.default-role-modal .modal-title {
    color: var(--kiu-primary);
    font-weight: 850;
    letter-spacing: -.02em;
}
.role-choice-note {
    color: var(--kiu-muted);
    font-size: .9rem;
    line-height: 1.45;
}
.default-role-grid {
    display: grid;
    gap: .72rem;
}
.default-role-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .9rem .95rem;
    border: 1px solid var(--kiu-border);
    border-radius: 18px;
    background: #fff;
    color: var(--kiu-text);
    text-align: left;
    box-shadow: 0 8px 20px rgba(8,5,52,.06);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.default-role-option:hover,
.default-role-option:focus {
    transform: translateY(-1px);
    border-color: rgba(8,5,52,.28);
    box-shadow: 0 14px 28px rgba(8,5,52,.12);
    outline: none;
}
.default-role-option.is-current {
    border-color: rgba(248,178,112,.75);
    background: linear-gradient(135deg, rgba(248,178,112,.16), #ffffff 62%);
}
.default-role-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2));
    color: #fff;
    box-shadow: 0 10px 18px rgba(8,5,52,.18);
}
.default-role-icon i { font-size: 1.25rem; }
.default-role-copy { min-width: 0; flex: 1; }
.default-role-copy strong {
    display: block;
    font-size: .96rem;
    color: var(--kiu-text);
    line-height: 1.15;
}
.default-role-copy small {
    display: block;
    margin-top: .2rem;
    color: var(--kiu-muted);
    font-size: .74rem;
    font-weight: 650;
}
.default-role-arrow {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--kiu-primary);
}
html.dark-mode .default-role-modal .modal-content,
body.dark-mode .default-role-modal .modal-content {
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
    color: #f8fafc;
}
html.dark-mode .default-role-modal .modal-title,
body.dark-mode .default-role-modal .modal-title,
html.dark-mode .default-role-copy strong,
body.dark-mode .default-role-copy strong { color: #f8fafc; }
html.dark-mode .role-choice-kicker,
body.dark-mode .role-choice-kicker {
    background: rgba(165,180,252,.14);
    color: #dbe4ff;
}
html.dark-mode .role-choice-note,
body.dark-mode .role-choice-note,
html.dark-mode .default-role-copy small,
body.dark-mode .default-role-copy small { color: #cbd5e1; }
html.dark-mode .default-role-option,
body.dark-mode .default-role-option {
    background: #101827;
    border-color: rgba(165,180,252,.18);
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
html.dark-mode .default-role-option.is-current,
body.dark-mode .default-role-option.is-current {
    background: linear-gradient(135deg, rgba(248,178,112,.18), #101827 62%);
    border-color: rgba(248,178,112,.45);
}
html.dark-mode .default-role-arrow,
body.dark-mode .default-role-arrow {
    background: rgba(165,180,252,.12);
    color: #dbe4ff;
}

@media (max-width: 768px) {
    .navbar-custom .container-fluid {
        align-items: center;
    }
    .navbar-custom .role-switch,
    .role-switch {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        align-items: center;
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        max-width: 100% !important;
        margin: .4rem 0 0 !important;
        padding: .42rem;
        gap: .42rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        border: 1px solid rgba(226,232,240,.95);
        border-radius: 18px;
        background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
        box-shadow: 0 10px 24px rgba(15,23,42,.08);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .role-switch a,
    .role-switch button,
    .role-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: .52rem .78rem;
        border: 1px solid rgba(226,232,240,.95);
        border-radius: 13px;
        background: #ffffff;
        color: #334155;
        font-size: .72rem;
        font-weight: 800;
        line-height: 1;
        letter-spacing: .005em;
        box-shadow: 0 6px 14px rgba(15,23,42,.06);
    }
    .role-switch a.active,
    .role-switch button.active,
    .role-btn.active {
        border-color: transparent;
        color: #ffffff !important;
        background: linear-gradient(135deg, var(--kiu-primary), var(--kiu-primary-2));
        box-shadow: 0 10px 18px rgba(8,5,52,.22);
    }
    .navbar-custom .theme-toggle {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }
}
@media (max-width: 430px) {
    .role-switch a,
    .role-switch button,
    .role-btn {
        min-height: 32px;
        padding: .48rem .68rem;
        font-size: .68rem;
    }
}
@media (max-width: 768px) {
    html.dark-mode .navbar-custom .role-switch,
    body.dark-mode .navbar-custom .role-switch,
    html.dark-mode .role-switch,
    body.dark-mode .role-switch {
        background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(17,24,39,.92)) !important;
        border-color: rgba(165,180,252,.18) !important;
        box-shadow: 0 12px 24px rgba(0,0,0,.22);
    }
    html.dark-mode .role-switch a,
    html.dark-mode .role-switch button,
    html.dark-mode .role-btn,
    body.dark-mode .role-switch a,
    body.dark-mode .role-switch button,
    body.dark-mode .role-btn {
        background: #111827 !important;
        border-color: rgba(165,180,252,.16) !important;
        color: #dbe4ff !important;
    }
    html.dark-mode .role-switch a.active,
    html.dark-mode .role-switch button.active,
    html.dark-mode .role-btn.active,
    body.dark-mode .role-switch a.active,
    body.dark-mode .role-switch button.active,
    body.dark-mode .role-btn.active {
        background: linear-gradient(135deg, var(--kiu-secondary), #f59e0b) !important;
        color: #111827 !important;
    }
}


/* === Old lecturer Excel/template/result button polish === */
.lecturer-ui .btn-xs,
.result-import-shell .btn-xs {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: .88rem;
    line-height: 1;
}
.lecturer-ui .btn-outline-purple,
.result-import-shell .btn-outline-purple {
    border-color: rgba(79, 70, 229, .16) !important;
    color: #4f46e5 !important;
    background-color: transparent !important;
    font-weight: 700;
    border-radius: 11px;
}
.lecturer-ui .btn-outline-purple:hover,
.lecturer-ui .btn-outline-purple:focus,
.result-import-shell .btn-outline-purple:hover,
.result-import-shell .btn-outline-purple:focus {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.lecturer-ui .btn-submitted-result,
.result-import-shell .btn-submitted-result {
    border-color: rgba(16, 185, 129, .22) !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 800;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    white-space: nowrap;
}
.lecturer-ui .btn-submitted-result:hover,
.lecturer-ui .btn-submitted-result:focus,
.result-import-shell .btn-submitted-result:hover,
.result-import-shell .btn-submitted-result:focus {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #fff !important;
}
.lecturer-ui .btn-submitted-result.btn-xs,
.result-import-shell .btn-submitted-result.btn-xs {
    padding: 0 !important;
}
.result-import-toolbar .result-template-actions {
    gap: .5rem;
}
@media (max-width: 576px) {
    .result-template-actions .btn-outline-purple,
    .result-template-actions .btn-submitted-result {
        width: 100%;
        min-height: 34px;
        font-size: .72rem !important;
    }
}
html.dark-mode .lecturer-ui .btn-submitted-result,
body.dark-mode .lecturer-ui .btn-submitted-result,
html.dark-mode .result-import-shell .btn-submitted-result,
body.dark-mode .result-import-shell .btn-submitted-result {
    background: rgba(16,185,129,.14) !important;
    border-color: rgba(16,185,129,.28) !important;
    color: #6ee7b7 !important;
}
html.dark-mode .lecturer-ui .btn-outline-purple,
body.dark-mode .lecturer-ui .btn-outline-purple,
html.dark-mode .result-import-shell .btn-outline-purple,
body.dark-mode .result-import-shell .btn-outline-purple {
    background: rgba(99,102,241,.10) !important;
    color: #c4b5fd !important;
    border-color: rgba(196,181,253,.22) !important;
}


/* === Patch: lecturer export CSP bridge + mobile sidebar repair === */
.sidebar-menu a.active {
    position: relative;
    color: #111827 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.14), inset 4px 0 0 var(--kiu-secondary) !important;
    transform: none !important;
}
.sidebar-menu a.active::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--kiu-accent);
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px rgba(13,166,4,.14);
}
.sidebar-menu a.active i {
    color: var(--kiu-primary) !important;
}
.sidebar-menu a.active .menu-text {
    color: #111827 !important;
}
.sidebar.collapsed .sidebar-menu a.active {
    box-shadow: 0 8px 18px rgba(0,0,0,.16), inset 0 -3px 0 var(--kiu-secondary) !important;
}
.sidebar.collapsed .sidebar-menu a.active::before {
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
}
.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        width: 66px !important;
        z-index: 1060;
        transition: width .22s ease, box-shadow .22s ease;
    }
    .sidebar.collapsed {
        width: 66px !important;
    }
    .sidebar:not(.collapsed) {
        width: 232px !important;
        box-shadow: 18px 0 45px rgba(2,6,23,.38);
    }
    .main-content,
    .main-content.expanded {
        margin-left: 66px !important;
    }
    .sidebar-header {
        min-height: 68px;
        padding: 12px 8px;
        justify-content: center;
    }
    .sidebar-header img.logo,
    .sidebar .logo {
        max-height: 42px !important;
    }
    .sidebar:not(.collapsed) .sidebar-header {
        justify-content: flex-start;
        padding-inline: 12px;
    }
    .sidebar:not(.collapsed) .sidebar-header .menu-text {
        display: inline-block !important;
        font-size: .72rem;
        color: #fff;
    }
    .sidebar-menu-container {
        padding: 8px 7px 14px;
    }
    .menu-section {
        margin: 12px 5px 6px;
    }
    .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu a {
        min-height: 49px;
        padding: 7px 4px;
        gap: 3px;
        font-size: .39rem;
        line-height: 1.05;
        border-radius: 12px;
    }
    .sidebar-menu a i,
    .sidebar.collapsed .sidebar-menu a i {
        font-size: 1.14rem;
    }
    .sidebar-menu a .menu-text,
    .sidebar.collapsed .sidebar-menu a .menu-text {
        max-width: 54px;
        font-size: .39rem;
        line-height: 1.05;
        color: #e5e7eb;
    }
    .sidebar:not(.collapsed) .sidebar-menu a {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        min-height: 39px;
        padding: 8px 10px 8px 18px;
        gap: 9px;
        text-align: left;
        font-size: .76rem;
        line-height: 1.1;
    }
    .sidebar:not(.collapsed) .sidebar-menu a .menu-text {
        display: inline-block;
        max-width: 170px;
        font-size: .76rem;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar:not(.collapsed) .menu-section {
        justify-content: flex-start;
        margin: 14px 8px 6px;
        padding: 0 2px;
        font-size: .58rem;
        text-align: left;
    }
    .sidebar:not(.collapsed) .menu-section span {
        max-width: none;
        font-size: .58rem;
        white-space: nowrap;
    }
    .sidebar:not(.collapsed) .menu-section::after {
        display: block;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15,23,42,.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-mobile-open {
        overflow-x: hidden;
    }
}
@media (max-width: 430px) {
    .sidebar,
    .sidebar.collapsed { width: 62px !important; }
    .main-content,
    .main-content.expanded { margin-left: 62px !important; }
    .sidebar:not(.collapsed) { width: 220px !important; }
    .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu a,
    .sidebar-menu a .menu-text,
    .sidebar.collapsed .sidebar-menu a .menu-text { font-size: .36rem; }
    .sidebar-menu a i,
    .sidebar.collapsed .sidebar-menu a i { font-size: 1.06rem; }
    .sidebar:not(.collapsed) .sidebar-menu a,
    .sidebar:not(.collapsed) .sidebar-menu a .menu-text { font-size: .72rem; }
}

.lecturer-ui .btn-submitted-result,
.result-import-shell .btn-submitted-result {
    border-color: rgba(16,185,129,.22) !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 800 !important;
    border-radius: 11px !important;
}
.lecturer-ui .btn-submitted-result:hover,
.lecturer-ui .btn-submitted-result:focus,
.result-import-shell .btn-submitted-result:hover,
.result-import-shell .btn-submitted-result:focus {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #fff !important;
}
