/* App shell: sidebar accent, topbar, main width, student mobile bottom nav */

.sidebar.appshell-sidebar {
    position: relative;
    border-right: 1px solid var(--ed-border);
}

/* Sidebar siswa: fixed ke viewport (tidak ikut scroll body). AdminKit memakai margin pada .sidebar;
   sibling .main dapat margin kiri di desktop saat sidebar terbuka. */
.sidebar.appshell-sidebar--student {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    /* Garis pemisah hanya di area menu, bukan di strip putih → brand full width ke tepi kanan */
    border-right: none;
}

.sidebar.appshell-sidebar--student > .appshell-student-brand {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    align-self: stretch;
    min-width: 100%;
    margin-left: 0;
    margin-right: 0;
    /* Samarkan garis pemisah kanan (border sidebar-content) agar strip putih terlihat full */
    border-right: 1px solid #ffffff;
}

.sidebar.appshell-sidebar--student > .sidebar-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    border-right: 1px solid var(--ed-border);
    /* Tanpa scroll di sidebar siswa (timpa SimpleBar + overflow flex) */
    overflow: hidden !important;
    overflow-y: hidden !important;
}

.sidebar.appshell-sidebar--student > .sidebar-content .simplebar-wrapper,
.sidebar.appshell-sidebar--student > .sidebar-content .simplebar-mask,
.sidebar.appshell-sidebar--student > .sidebar-content .simplebar-content-wrapper {
    overflow: hidden !important;
}

.sidebar.appshell-sidebar--student > .sidebar-content .simplebar-content-wrapper {
    overflow-y: hidden !important;
}

.sidebar.appshell-sidebar--student > .sidebar-content .simplebar-track {
    display: none !important;
}

/* Aksen kiri (gradient) dinonaktifkan di sidebar siswa: sering terlihat sebagai “garis biru” di tepi brand/menu */
.sidebar.appshell-sidebar--student::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    background: none !important;
    background-image: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.sidebar.appshell-sidebar--admin::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    z-index: 2;
    background: linear-gradient(180deg, var(--ed-secondary-brand) 0%, var(--ed-primary) 100%);
    border-radius: 0 2px 2px 0;
}

.navbar.appshell-topbar {
    position: relative;
    z-index: 1100;
    overflow: visible !important;
    isolation: isolate;
    border-bottom: 1px solid var(--ed-border);
    background: var(--ed-surface) !important;
    min-height: var(--ed-topbar-h);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.navbar.appshell-topbar .navbar-collapse,
.navbar.appshell-topbar .navbar-nav,
.navbar.appshell-topbar .nav-item.dropdown {
    position: relative;
}

.navbar.appshell-topbar .dropdown-menu {
    z-index: 1200;
}

/* Siswa: tanpa :has() (dukungan browser). Pakai sibling .sidebar ~ .main.
   max-height viewport = kolom utama tidak memanjangkan body; scroll hanya di main.content. */
.sidebar.appshell-sidebar--student ~ .main {
    overflow: hidden;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
}

.sidebar.appshell-sidebar--student ~ .main > main.content {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: clip;
    -webkit-overflow-scrolling: touch;
}

.sidebar.appshell-sidebar--student ~ .main > nav.navbar.appshell-topbar:first-of-type {
    position: relative;
    flex-shrink: 0;
    z-index: 1040;
}

/* Desktop: sidebar fixed keluar alur — beri ruang 260px (selaras AdminKit, breakpoint 992px). */
@media (min-width: 992px) {
    .sidebar.appshell-sidebar--student:not(.collapsed) ~ .main {
        margin-left: 260px;
        width: calc(100% - 260px);
        max-width: calc(100% - 260px);
    }

    .sidebar.appshell-sidebar--student.collapsed ~ .main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

.navbar-light.appshell-topbar .nav-link {
    color: var(--ed-text-secondary);
}

.appshell-page-head {
    min-width: 0;
}

.appshell-page-title {
    font-family: var(--ed-font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
    color: var(--ed-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(50vw, 420px);
}

.appshell-page-subtitle {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    color: var(--ed-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(55vw, 480px);
}

.appshell-role-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ed-primary-soft);
    color: var(--ed-link);
}

html:not(.dark-mode) .appshell-role-badge {
    color: var(--ed-primary);
}

/* Main content width */
.sidebar.appshell-sidebar--student ~ .main main.content {
    background: var(--ed-canvas) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student ~ .main,
html:not(.dark-mode) .sidebar.appshell-sidebar--student ~ .main main.content {
    background: transparent !important;
}

.wrapper:has(.appshell-sidebar--admin) main.content {
    background: var(--ed-canvas) !important;
}

.sidebar.appshell-sidebar--student ~ .main main.content > .container-fluid.p-0 {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ed-space-5) !important;
    padding-right: var(--ed-space-5) !important;
}

.wrapper:has(.appshell-sidebar--admin) main.content > .container-fluid.p-0 {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ed-space-4) !important;
    padding-right: var(--ed-space-4) !important;
}

/* Admin slightly denser tables */
.wrapper:has(.appshell-sidebar--admin) .table {
    font-size: 0.875rem;
}

.wrapper:has(.appshell-sidebar--admin) .table th,
.wrapper:has(.appshell-sidebar--admin) .table td {
    padding: 0.5rem 0.65rem;
}

/* Card surface */
.ed-card {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-lg);
    box-shadow: var(--ed-shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ed-card:hover {
    box-shadow: var(--ed-shadow-elevated);
}

html.dark-mode .ed-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.ed-page-header {
    margin-bottom: var(--ed-space-5);
}

.ed-page-header h1,
.ed-page-header .h3 {
    font-family: var(--ed-font-display);
    font-weight: 700;
    margin-bottom: var(--ed-space-2);
}

.ed-page-header .lead,
.ed-page-header p.text-muted {
    font-size: 0.9375rem;
    max-width: 52ch;
}

/* Breadcrumbs (admin) */
.appshell-breadcrumb {
    font-size: 0.8125rem;
    margin-bottom: 4px;
}

.appshell-breadcrumb a {
    color: var(--ed-text-muted);
    text-decoration: none;
}

.appshell-breadcrumb a:hover {
    color: var(--ed-primary);
}

/* Quiz focus layout */
html.appshell-quiz-focus .wrapper .main {
    max-width: 100%;
}

html.appshell-quiz-focus main.content > .container-fluid.p-0 {
    max-width: 960px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

html.appshell-quiz-focus .navbar.fixed-top {
    box-shadow: var(--ed-shadow-md);
}

#autoSaveStatus {
    font-size: 0.8125rem;
    color: var(--ed-success);
    margin-bottom: 0.75rem;
    min-height: 1.25em;
}

/* Student bottom navigation */
.appshell-bottomnav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: var(--ed-surface);
    border-top: 1px solid var(--ed-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
}

.appshell-bottomnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--ed-radius-sm);
    min-width: 0;
    color: var(--ed-text-secondary) !important;
}

.appshell-bottomnav a i {
    font-size: 1.15rem;
    color: var(--ed-link) !important;
}

.appshell-bottomnav a .appshell-bottomnav__brand {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 22%;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    background: transparent;
    box-shadow: none;
}

.appshell-bottomnav a:hover,
.appshell-bottomnav a:focus-visible {
    color: var(--ed-primary) !important;
    background: var(--ed-primary-soft);
}

.appshell-bottomnav a.active {
    color: #fafaf7 !important;
    background: rgba(var(--ed-primary-rgb), 0.22) !important;
}

html:not(.dark-mode) .appshell-bottomnav a {
    color: var(--ed-text-muted) !important;
}

html:not(.dark-mode) .appshell-bottomnav a i {
    color: var(--ed-primary) !important;
}

html:not(.dark-mode) .appshell-bottomnav a.active {
    color: var(--ed-primary) !important;
    background: var(--ed-primary-soft) !important;
}

html:not(.dark-mode) .appshell-bottomnav {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top-color: rgba(18, 17, 15, 0.1);
}

@media (max-width: 767.98px) {
    .appshell-bottomnav {
        display: flex;
    }

    .sidebar.appshell-sidebar--student ~ .main main.content {
        padding-bottom: 72px !important;
    }
}

/* Distraction-free reader hint (materi viewer uses own page; class for embed) */
.materi-reader-focus {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

/* Student sidebar — optional image brand strip (Admin: Brand Area); always white strip */
.sidebar.appshell-sidebar--student .appshell-student-brand {
    flex-shrink: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(18, 17, 15, 0.1);
}

html.dark-mode .sidebar.appshell-sidebar--student > .appshell-student-brand {
    /* Samakan dengan light: tepi kanan strip putih tetap menyatu */
    border-right-color: #ffffff;
}

/* Brand strip tetap putih di dark mode (sama seperti light) — logo gelap tetap terbaca */
html.dark-mode .sidebar.appshell-sidebar--student .appshell-student-brand {
    background: #ffffff !important;
    border-bottom-color: rgba(18, 17, 15, 0.12);
}

.sidebar.appshell-sidebar--student .appshell-student-brand__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    /* Padding horizontal lebih besar → ruang letterbox untuk object-position X (logo mendatar) */
    padding: var(--sb-pt, 12px) clamp(16px, 8%, 40px) var(--sb-pb, 12px);
    text-decoration: none;
    min-height: 0;
    background-color: #ffffff !important;
}

.sidebar.appshell-sidebar--student .appshell-student-brand__link:focus-visible {
    outline: 2px solid var(--ed-primary);
    outline-offset: -2px;
}

.sidebar.appshell-sidebar--student .appshell-student-brand__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(56px * var(--sb-scale, 100) / 100);
    object-fit: var(--sb-fit, contain);
    object-position: var(--sb-ox, 50%) var(--sb-oy, 50%);
}

/* Admin setting preview: same --sb-* behavior as student sidebar (not inside .sidebar) */
.appshell-student-brand.appshell-student-brand--preview {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
    border-bottom: 1px solid rgba(18, 17, 15, 0.1);
}

.appshell-student-brand.appshell-student-brand--preview .appshell-student-brand__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: var(--sb-pt, 12px) clamp(16px, 8%, 40px) var(--sb-pb, 12px);
    text-decoration: none;
    min-height: 0;
    background-color: #ffffff;
}

.appshell-student-brand.appshell-student-brand--preview .appshell-student-brand__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(48px * var(--sb-scale, 100) / 100);
    object-fit: var(--sb-fit, contain);
    object-position: var(--sb-ox, 50%) var(--sb-oy, 50%);
}

.appshell-student-brand__empty {
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--ed-text-muted, #6b7280);
    padding: 0.75rem 0.5rem;
    text-align: center;
}

html:not(.dark-mode) .appshell-student-brand__empty {
    color: #6b7280;
}

/* Sidebar brand — tokenized (replaces hardcoded #fff in PHP) */
.sidebar .sidebar-brand.appshell-sidebar-brand {
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 0;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--ed-surface-elevated) !important;
    border-bottom: 1px solid var(--ed-border);
}

html:not(.dark-mode) .sidebar .sidebar-brand.appshell-sidebar-brand {
    background: #ffffff !important;
}

/* Nama merek di strip brand: teks gelap di atas latar putih (kalahkan gaya AdminKit / link). */
html:not(.dark-mode) .sidebar a.sidebar-brand.appshell-sidebar-brand,
html:not(.dark-mode) .sidebar a.sidebar-brand.appshell-sidebar-brand:hover,
html:not(.dark-mode) .sidebar a.sidebar-brand.appshell-sidebar-brand:focus,
html:not(.dark-mode) .sidebar a.sidebar-brand.appshell-sidebar-brand:focus-visible,
html:not(.dark-mode) .sidebar a.sidebar-brand.appshell-sidebar-brand .align-middle {
    color: #121110 !important;
}

.navbar-light.appshell-topbar,
.navbar-light.appshell-topbar.navbar-bg {
    background: var(--ed-surface) !important;
}

/* Light mode: latar putih (tanpa gradasi emas/krem) */
html:not(.dark-mode) body {
    background-color: #ffffff !important;
    background-image: none !important;
}

html:not(.dark-mode) .wrapper {
    background: transparent !important;
}

html:not(.dark-mode) .navbar-light.appshell-topbar,
html:not(.dark-mode) .navbar-light.appshell-topbar.navbar-bg {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(18, 17, 15, 0.08) !important;
}

.navbar-light.appshell-topbar .nav-link,
.navbar-light.appshell-topbar .navbar .dropdown-toggle {
    color: var(--ed-text-secondary) !important;
}

.navbar-light.appshell-topbar .nav-link:hover,
.navbar-light.appshell-topbar .nav-link:focus {
    color: var(--ed-text) !important;
}

/* Sidebar: separate primary study nav from secondary links */
.sidebar.appshell-sidebar .sidebar-nav > .appshell-nav-divider {
    list-style: none;
    height: 0;
    margin: 0.5rem 1rem 0.55rem;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--ed-border-strong);
    pointer-events: none;
}

/* ------------------------------------------------------------------------- */
/* Siswa — light mode: sidebar glass putih, teks gelap (timpa AdminKit #222E3C) */
/* ------------------------------------------------------------------------- */

html:not(.dark-mode) .sidebar.appshell-sidebar--student {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 4px 0 24px rgba(18, 17, 15, 0.04);
    border-right: 1px solid rgba(18, 17, 15, 0.08) !important;
    color: var(--ed-text);
}

/* Ikon menu: timpa warna ikon AdminKit (abu terang); termasuk ikon di dalam <span> (item Quiz) */
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link i.fas,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link i.fab,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link i.far {
    color: var(--ed-primary) !important;
    opacity: 1 !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link:hover i.fas,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link:hover i.fab {
    color: var(--ed-primary-hover) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link i.fas,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link i.fab {
    color: var(--ed-primary) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-link i.fas,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-link i.fab {
    color: var(--ed-text-secondary) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active .sidebar-link i.fas,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active .sidebar-link i.fab {
    color: var(--ed-primary) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-content {
    background: transparent !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link span {
    color: var(--ed-text-secondary) !important;
    background: transparent !important;
    border-left-color: transparent !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link:hover {
    color: var(--ed-text) !important;
    background: rgba(var(--ed-primary-rgb), 0.08) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link {
    color: var(--ed-primary) !important;
    background: rgba(var(--ed-primary-rgb), 0.12) !important;
    box-shadow: inset 3px 0 0 var(--ed-primary);
    border-left-color: transparent !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-link {
    color: var(--ed-text-muted) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active > .sidebar-link {
    color: var(--ed-text) !important;
    background: rgba(var(--ed-primary-rgb), 0.08) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link[data-bs-toggle="collapse"]:hover::after,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link[data-bs-toggle="collapse"]::after,
html:not(.dark-mode) .sidebar.appshell-sidebar--student .sidebar-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    color: var(--ed-primary) !important;
}

html:not(.dark-mode) .sidebar.appshell-sidebar--student .appshell-nav-divider {
    border-top-color: var(--ed-border-strong) !important;
}

/* ------------------------------------------------------------------------- */
/* Siswa — dark mode: sidebar, nav, dan outline button (selaras token)        */
/* Timpa AdminKit: .sidebar-link memakai bg #222E3C → patch ke satu permukaan */
/* ------------------------------------------------------------------------- */

html.dark-mode .sidebar.appshell-sidebar--student {
    background: var(--ed-sidebar-bg) !important;
    color: var(--ed-text);
    border-right-color: var(--ed-border-strong) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-content {
    background: var(--ed-sidebar-bg) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-nav {
    background: transparent !important;
}

/* Default + hover: hilangkan panel biru-abu AdminKit pada setiap baris */
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student a.sidebar-link {
    background: transparent !important;
    border-left-color: transparent !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link span {
    color: var(--ed-text-secondary) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link i,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link svg {
    color: var(--ed-text-secondary) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link:hover,
html.dark-mode .sidebar.appshell-sidebar--student a.sidebar-link:hover {
    color: var(--ed-text) !important;
    background: rgba(255, 255, 255, 0.055) !important;
    border-left-color: transparent !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link:hover i,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link:hover svg {
    color: var(--ed-text) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > a.sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link:hover,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > a.sidebar-link:hover {
    color: var(--ed-text) !important;
    background: rgba(var(--ed-primary-rgb), 0.2) !important;
    box-shadow: inset 3px 0 0 var(--ed-primary);
    border-left-color: transparent !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link i,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link svg {
    color: var(--ed-link) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu a.sidebar-link {
    background: transparent !important;
    border-left-color: transparent !important;
    color: var(--ed-text-secondary) !important;
    box-shadow: none !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-link:hover,
html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu a.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.055) !important;
    color: var(--ed-text) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active > .sidebar-link,
html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active > a.sidebar-link {
    color: var(--ed-text) !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border-left-color: transparent !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .timeline-submenu .sidebar-item.active .sidebar-link i {
    color: var(--ed-link) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link[data-bs-toggle="collapse"]:hover::after,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-item.active > .sidebar-link[data-bs-toggle="collapse"]::after,
html.dark-mode .sidebar.appshell-sidebar--student .sidebar-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    color: var(--ed-link) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .appshell-nav-divider {
    border-top-color: var(--ed-border-strong) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student .appshell-student-brand__link {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

html.dark-mode .sidebar.appshell-sidebar--student ~ .main .btn-outline-primary {
    --bs-btn-color: var(--ed-link);
    color: var(--ed-link) !important;
}

html.dark-mode .sidebar.appshell-sidebar--student ~ .main .btn-outline-primary:hover {
    color: #fff !important;
}

html.dark-mode .sidebar.appshell-sidebar--student ~ .main main.content .list-unstyled .border-bottom {
    border-color: var(--ed-border-strong) !important;
}

/* ------------------------------------------------------------------------- */
/* Discord dashboard cards — selalu tema Discord (Blurple + dark surfaces).   */
/* Dikecualikan dari palette Nova, .ed-card, dan .dark-mode .card / .card-body */
/* ------------------------------------------------------------------------- */

.card.discord-card.ed-card,
.card.discord-card {
    border: none !important;
    border-radius: 16px !important;
    color: #ffffff !important;
    overflow: hidden !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28) !important;
}

.card.discord-card.ed-card:hover {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32) !important;
}

/* Jam operational — gradien indigo → charcoal (seperti UI Discord) */
.card.discord-card.discord-card--hours {
    background: linear-gradient(90deg, #3f447a 0%, #2c2f33 48%, #1e1f22 100%) !important;
}

/* Undangan server — surface + glow Blurple */
.card.discord-card.discord-card--invite {
    background:
        radial-gradient(900px circle at 10% -20%, rgba(88, 101, 242, 0.45) 0%, rgba(35, 39, 42, 0) 60%),
        #23272a !important;
}

.dark-mode .card.discord-card .card-body,
html.dark-mode .card.discord-card .card-body {
    background: transparent !important;
    color: #ffffff !important;
}

.card.discord-card .muted-small {
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 13px;
}

.card.discord-card strong {
    color: #ffffff !important;
}

.card.discord-card .discord-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #ffffff !important;
}

.card.discord-card .op-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    font-size: 20px;
    flex-shrink: 0;
}

.card.discord-card.discord-card--hours .op-icon {
    background: rgba(88, 101, 242, 0.32);
}

.card.discord-card .fw-bold {
    color: #ffffff !important;
}

.card.discord-card .badge.bg-success {
    background-color: #248046 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    font-weight: 700;
}

.card.discord-card .badge.bg-secondary {
    background-color: #4e5058 !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    font-weight: 700;
}

.card.discord-card .badge {
    font-weight: 700;
}

a.discord-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5865f2, #7289da) !important;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(88, 101, 242, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

a.discord-invite-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(88, 101, 242, 0.42);
    filter: saturate(1.05);
    color: #ffffff !important;
}

a.discord-invite-btn:active {
    transform: translateY(0);
}

/* Paksa menang atas .dark-mode .card / .ed-card (spesifikasi lebih tinggi + !important) */
.dark-mode .card.discord-card.discord-card--hours,
html.dark-mode .card.discord-card.discord-card--hours {
    background: linear-gradient(90deg, #3f447a 0%, #2c2f33 48%, #1e1f22 100%) !important;
    border: none !important;
    color: #ffffff !important;
}

.dark-mode .card.discord-card.discord-card--invite,
html.dark-mode .card.discord-card.discord-card--invite {
    background:
        radial-gradient(900px circle at 10% -20%, rgba(88, 101, 242, 0.5) 0%, rgba(35, 39, 42, 0) 60%),
        #23272a !important;
    border: none !important;
    color: #ffffff !important;
}

html:not(.dark-mode) .card.discord-card.discord-card--hours {
    background: linear-gradient(90deg, #3f447a 0%, #2c2f33 48%, #1e1f22 100%) !important;
}

html:not(.dark-mode) .card.discord-card.discord-card--invite {
    background:
        radial-gradient(900px circle at 10% -20%, rgba(88, 101, 242, 0.45) 0%, rgba(35, 39, 42, 0) 60%),
        #23272a !important;
}
