/* ==========================================================================
   CUSTOM MODERN THEME - ULTIMATE PRO REBUILD (GREEN EDUCATION EDITION v2.0)
   Kompatibel : AdminLTE 3, Bootstrap 4, DataTables, Select2, SweetAlert2,
                Toastr, Summernote, & Halaman Login (Manual / QR / CBT)
   Support    : Semua Layar (4K, 2K, FHD, Laptop, Tablet & Smartphone/Mobile)
   Fitur      : Tema Ilustratif Pendidikan Hijau (SVG Vector Embedded),
                Harmoni Login & Dashboard, Light & Dark Mode Sempurna,
                Perbaikan Total Layout Flex/Grid Mobile & Proteksi .d-none
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CSS VARIABLES (DESIGN TOKENS - EMERALD EDUCATION PALETTE)
   -------------------------------------------------------------------------- */
:root {
    /* Surface & Background */
    --cm-bg-body: #f0fdf4;
    --cm-bg-body-dashboard: #f1f5f9;
    --cm-bg-surface: #ffffff;
    --cm-card-bg: #ffffff;
    --cm-card-border: #e2e8f0;
    --cm-bg-subtle: #f8fafc;
    --cm-bg-hover: #ecfdf5;
    --cm-bg-active: #d1fae5;
    --cm-bg-glass: rgba(255, 255, 255, 0.92);

    /* Typography */
    --cm-text-main: #0f172a;
    --cm-text-secondary: #334155;
    --cm-text-muted: #64748b;
    --cm-text-on-primary: #ffffff;

    /* Borders & Dividers */
    --cm-border: #cbd5e1;
    --cm-border-subtle: #e2e8f0;
    --cm-border-light: #f1f5f9;

    /* Brand & Semantic Colors (Emerald Education Theme) */
    --cm-primary: #059669;
    --cm-primary-hover: #047857;
    --cm-primary-light: #10b981;
    --cm-primary-dark: #064e3b;
    --cm-primary-soft: rgba(5, 150, 105, 0.1);
    --cm-primary-focus: rgba(16, 185, 129, 0.22);
    --cm-accent: #0d9488;

    --cm-success: #10b981;
    --cm-success-soft: rgba(16, 185, 129, 0.12);
    --cm-warning: #f59e0b;
    --cm-warning-soft: rgba(245, 158, 11, 0.12);
    --cm-danger: #ef4444;
    --cm-danger-soft: rgba(239, 68, 68, 0.12);
    --cm-info: #0ea5e9;
    --cm-info-soft: rgba(14, 165, 233, 0.12);
    --cm-blue: #2563eb;
    --cm-purple: #8b5cf6;
    --cm-teal: #0d9488;
    --cm-orange: #f97316;
    --cm-pink: #ec4899;

    /* Exam Status Palette */
    --cm-exam-active: #059669;
    --cm-exam-active-grad: linear-gradient(135deg, #10b981, #059669);
    --cm-exam-doubt: #f59e0b;
    --cm-exam-doubt-grad: linear-gradient(135deg, #fbbf24, #d97706);
    --cm-exam-done: #059669;
    --cm-exam-done-grad: linear-gradient(135deg, #10b981, #047857);
    --cm-exam-unanswered: #f1f5f9;

    /* Border Radius */
    --cm-radius-xs: 6px;
    --cm-radius-sm: 8px;
    --cm-radius-md: 12px;
    --cm-radius-lg: 16px;
    --cm-radius-xl: 24px;
    --cm-radius-pill: 9999px;

    /* Elevation & Shadows */
    --cm-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --cm-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --cm-shadow-md: 0 6px 18px rgba(15, 23, 42, 0.06);
    --cm-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --cm-shadow-primary: 0 4px 14px rgba(5, 150, 105, 0.28);

    /* Transitions */
    --cm-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --cm-transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    /* Surface & Background (Deep Slate & Forest Tint) */
    --cm-bg-body: #0b1120;
    --cm-bg-body-dashboard: #0b1120;
    --cm-bg-surface: #1e293b;
    --cm-card-bg: #1e293b;
    --cm-card-border: #334155;
    --cm-bg-subtle: #0f172a;
    --cm-bg-hover: rgba(16, 185, 129, 0.12);
    --cm-bg-active: #334155;
    --cm-bg-glass: rgba(30, 41, 59, 0.9);

    /* Typography */
    --cm-text-main: #f8fafc;
    --cm-text-secondary: #cbd5e1;
    --cm-text-muted: #94a3b8;

    /* Borders & Dividers */
    --cm-border: #334155;
    --cm-border-subtle: #1e293b;
    --cm-border-light: #1e293b;

    /* Brand & Semantic Colors (Adjusted for Dark Contrast) */
    --cm-primary: #10b981;
    --cm-primary-hover: #34d399;
    --cm-primary-light: #34d399;
    --cm-primary-dark: #065f46;
    --cm-primary-soft: rgba(16, 185, 129, 0.18);
    --cm-primary-focus: rgba(16, 185, 129, 0.28);
    --cm-accent: #14b8a6;

    /* Exam Status Palette (Dark Mode) */
    --cm-exam-active: #34d399;
    --cm-exam-active-grad: linear-gradient(135deg, #059669, #10b981);
    --cm-exam-doubt: #fbbf24;
    --cm-exam-doubt-grad: linear-gradient(135deg, #d97706, #b45309);
    --cm-exam-done: #10b981;
    --cm-exam-done-grad: linear-gradient(135deg, #065f46, #059669);
    --cm-exam-unanswered: #334155;

    /* Elevation & Shadows */
    --cm-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --cm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --cm-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --cm-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --cm-shadow-primary: 0 4px 16px rgba(16, 185, 129, 0.32);
}

/* --------------------------------------------------------------------------
   1. GLOBAL BASE, RESET & SCROLLBAR
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background-color: #f1f5f9;
}

html.dark-mode {
    color-scheme: dark;
    background-color: #0b1120 !important;
}

html.dark-mode,
html.dark-mode body,
body.dark-mode {
    /* Surface & Background (Deep Slate & Forest Tint) */
    --cm-bg-body: #0b1120;
    --cm-bg-body-dashboard: #0b1120;
    --cm-bg-surface: #1e293b;
    --cm-card-bg: #1e293b;
    --cm-card-border: #334155;
    --cm-bg-subtle: #0f172a;
    --cm-bg-hover: rgba(16, 185, 129, 0.12);
    --cm-bg-active: #334155;
    --cm-bg-glass: rgba(30, 41, 59, 0.9);

    /* Typography */
    --cm-text-main: #f8fafc;
    --cm-text-secondary: #cbd5e1;
    --cm-text-muted: #94a3b8;

    /* Borders & Dividers */
    --cm-border: #334155;
    --cm-border-subtle: #1e293b;
    --cm-border-light: #1e293b;

    /* Brand & Semantic Colors (Adjusted for Dark Contrast) */
    --cm-primary: #10b981;
    --cm-primary-hover: #34d399;
    --cm-primary-light: #34d399;
    --cm-primary-dark: #065f46;
    --cm-primary-soft: rgba(16, 185, 129, 0.18);
    --cm-primary-focus: rgba(16, 185, 129, 0.28);
    --cm-accent: #14b8a6;

    /* Exam Status Palette (Dark Mode) */
    --cm-exam-active: #34d399;
    --cm-exam-active-grad: linear-gradient(135deg, #059669, #10b981);
    --cm-exam-doubt: #fbbf24;
    --cm-exam-doubt-grad: linear-gradient(135deg, #d97706, #b45309);
    --cm-exam-done: #10b981;
    --cm-exam-done-grad: linear-gradient(135deg, #065f46, #059669);
    --cm-exam-unanswered: #334155;

    /* Elevation & Shadows */
    --cm-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --cm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --cm-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --cm-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --cm-shadow-primary: 0 4px 16px rgba(16, 185, 129, 0.32);
}

body {
    font-family: 'Inter', 'Poppins', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: var(--cm-bg-body-dashboard) !important;
    color: var(--cm-text-main) !important;
    line-height: 1.55;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Matikan transisi warna saat hold-transition aktif agar tidak ada animasi glitch putih ke hitam */
body.hold-transition,
body.hold-transition *,
body.hold-transition *::before,
body.hold-transition *::after,
html.dark-mode body.hold-transition,
html.dark-mode body.hold-transition * {
    transition: none !important;
    -webkit-transition: none !important;
}

/* Proteksi penuh class .d-none agar tidak pernah tertimpa oleh .btn-block / flex */
.d-none {
    display: none !important;
}

.wrapper {
    overflow-x: hidden;
    width: 100%;
}

/* Custom Scrollbar Modern & Ramping */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cm-bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--cm-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cm-primary-light);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #475569;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--cm-primary);
}

/* Animasi Halaman (Tanpa transform agar posisi Modal Bootstrap 100% aman) */
@keyframes cmFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.content-wrapper {
    background-color: var(--cm-bg-body-dashboard) !important;
}

/* --------------------------------------------------------------------------
   2. NAVBAR, SIDEBAR & FOOTER (ADMINLTE 3)
   -------------------------------------------------------------------------- */
.main-header.navbar {
    background-color: var(--cm-bg-surface) !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
    box-shadow: var(--cm-shadow-xs) !important;
    min-height: 56px;
    padding: 0.4rem 1rem;
}

.main-header .navbar-nav {
    align-items: center;
}

.main-header .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-text-secondary) !important;
    font-weight: 500;
    border-radius: var(--cm-radius-sm);
    transition: color var(--cm-transition-fast), background-color var(--cm-transition-fast);
}

.main-header .nav-link:hover {
    color: var(--cm-primary) !important;
    background-color: var(--cm-bg-hover);
}

/* Sidebar Utama */
.main-sidebar {
    background-color: var(--cm-bg-surface) !important;
    border-right: 1px solid var(--cm-border-subtle) !important;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.03) !important;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

.brand-link {
    background-color: var(--cm-bg-surface) !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
    color: var(--cm-text-main) !important;
    font-weight: 700 !important;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.brand-link .brand-image {
    float: none;
    margin-left: 0.5rem;
    margin-right: 0.65rem;
    max-height: 34px;
    width: auto;
}

.user-panel {
    border-bottom: 1px solid var(--cm-border-subtle) !important;
}

.user-panel .info a {
    color: var(--cm-text-main) !important;
    font-weight: 600;
}

/* Navigasi Sidebar */
.nav-sidebar .nav-header {
    color: var(--cm-text-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px 6px 16px !important;
}

.nav-sidebar .nav-item > .nav-link {
    border-radius: var(--cm-radius-sm) !important;
    margin-bottom: 4px;
    color: var(--cm-text-secondary) !important;
    font-weight: 500;
    padding: 9px 12px;
    transition: all var(--cm-transition-fast);
}

.nav-sidebar .nav-item > .nav-link .nav-icon {
    color: var(--cm-text-muted);
    transition: color var(--cm-transition-fast), transform var(--cm-transition-fast);
}

.nav-sidebar .nav-item > .nav-link:hover {
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
}

.nav-sidebar .nav-item > .nav-link:hover .nav-icon {
    color: var(--cm-primary) !important;
    transform: translateX(2px);
}

.nav-sidebar > .nav-item > .nav-link.active,
.nav-sidebar > .nav-item.menu-open > .nav-link:not(.active) {
    background-color: var(--cm-primary-soft) !important;
    color: var(--cm-primary) !important;
    font-weight: 600;
}

.nav-sidebar > .nav-item > .nav-link.active {
    box-shadow: inset 3.5px 0 0 var(--cm-primary) !important;
}

.nav-sidebar > .nav-item > .nav-link.active .nav-icon,
.nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon {
    color: var(--cm-primary) !important;
}

/* Submenu Treeview */
.nav-treeview {
    padding-left: 6px;
}

.nav-treeview > .nav-item > .nav-link {
    border-radius: var(--cm-radius-sm) !important;
    font-size: 0.88rem;
    padding: 7px 12px;
    color: var(--cm-text-muted) !important;
}

.nav-treeview > .nav-item > .nav-link:hover {
    color: var(--cm-primary) !important;
    background-color: var(--cm-bg-hover) !important;
}

.nav-treeview > .nav-item > .nav-link.active {
    background-color: var(--cm-primary-soft) !important;
    color: var(--cm-primary) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* Ikon Toggle Dark Mode */
.dark-mode-toggle {
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--cm-text-secondary);
    transition: color var(--cm-transition-fast), transform var(--cm-transition-fast);
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cm-radius-sm);
}

.dark-mode-toggle:hover {
    color: var(--cm-primary);
    background-color: var(--cm-bg-hover);
    transform: scale(1.06);
}

body.dark-mode .dark-mode-toggle {
    color: #facc15 !important;
}

/* Footer */
.main-footer {
    background-color: var(--cm-bg-surface) !important;
    border-top: 1px solid var(--cm-border-subtle) !important;
    color: var(--cm-text-muted) !important;
    font-size: 0.85rem;
    padding: 12px 20px !important;
}

/* --------------------------------------------------------------------------
   3. CARD, CALLOUT & PANEL DESIGN (DENGAN DUKUNGAN CARD-OUTLINE)
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--cm-border-subtle);
    border-radius: var(--cm-radius-md) !important;
    box-shadow: var(--cm-shadow-sm) !important;
    background-color: var(--cm-bg-surface) !important;
    margin-bottom: 20px;
    transition: box-shadow var(--cm-transition-base);
}

/* Jaga garis atas berwarna pada .card-outline bawaan AdminLTE */
.card-primary.card-outline { border-top: 3px solid var(--cm-primary) !important; }
.card-success.card-outline { border-top: 3px solid var(--cm-success) !important; }
.card-danger.card-outline { border-top: 3px solid var(--cm-danger) !important; }
.card-warning.card-outline { border-top: 3px solid var(--cm-warning) !important; }
.card-info.card-outline { border-top: 3px solid var(--cm-info) !important; }
.card-purple.card-outline { border-top: 3px solid var(--cm-purple) !important; }
.card-teal.card-outline { border-top: 3px solid var(--cm-teal) !important; }

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
    padding: 15px 20px !important;
    border-top-left-radius: var(--cm-radius-md) !important;
    border-top-right-radius: var(--cm-radius-md) !important;
}

.card-header.p-0 {
    padding: 0 !important;
}

.card-header::after {
    display: block;
    clear: both;
    content: "";
}

.card-title {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: var(--cm-text-main) !important;
    letter-spacing: -0.2px;
    margin-bottom: 0;
    line-height: 1.4;
    background: transparent !important;
}

/* Header Card Solid / Berwarna (Tetap Bersih & Modern dengan Aksen Teks) */
.card-primary:not(.card-outline) > .card-header,
.card-danger:not(.card-outline) > .card-header,
.card-success:not(.card-outline) > .card-header,
.card-warning:not(.card-outline) > .card-header,
.card-info:not(.card-outline) > .card-header,
.card-blue > .card-header,
.card-red > .card-header,
.card-teal > .card-header,
.card-cyan > .card-header,
.card-purple > .card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
}

.card-primary > .card-header .card-title,
.card-success > .card-header .card-title { color: #059669 !important; }
.card-blue > .card-header .card-title { color: #2563eb !important; }
.card-danger > .card-header .card-title,
.card-red > .card-header .card-title { color: #dc2626 !important; }
.card-warning > .card-header .card-title { color: #d97706 !important; }
.card-info > .card-header .card-title,
.card-cyan > .card-header .card-title { color: #0284c7 !important; }
.card-teal > .card-header .card-title { color: #0d9488 !important; }
.card-purple > .card-header .card-title { color: #7c3aed !important; }

body.dark-mode .card-primary > .card-header .card-title,
body.dark-mode .card-success > .card-header .card-title { color: #34d399 !important; }
body.dark-mode .card-blue > .card-header .card-title { color: #60a5fa !important; }
body.dark-mode .card-danger > .card-header .card-title,
body.dark-mode .card-red > .card-header .card-title { color: #f87171 !important; }
body.dark-mode .card-warning > .card-header .card-title { color: #fbbf24 !important; }
body.dark-mode .card-info > .card-header .card-title,
body.dark-mode .card-cyan > .card-header .card-title { color: #38bdf8 !important; }
body.dark-mode .card-teal > .card-header .card-title { color: #2dd4bf !important; }
body.dark-mode .card-purple > .card-header .card-title { color: #a78bfa !important; }

.card-body {
    padding: 20px;
    color: var(--cm-text-main);
}

.card-footer {
    background-color: var(--cm-bg-subtle) !important;
    border-top: 1px solid var(--cm-border-subtle) !important;
    border-bottom-left-radius: var(--cm-radius-md) !important;
    border-bottom-right-radius: var(--cm-radius-md) !important;
    padding: 12px 20px;
}

/* Callouts & Alerts Modern */
.callout {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    border-radius: var(--cm-radius-sm) !important;
    border: 1px solid var(--cm-border-subtle);
    border-left-width: 5px !important;
    box-shadow: var(--cm-shadow-xs) !important;
}

.callout.callout-info { border-left-color: var(--cm-info) !important; }
.callout.callout-danger { border-left-color: var(--cm-danger) !important; }
.callout.callout-warning { border-left-color: var(--cm-warning) !important; }
.callout.callout-success { border-left-color: var(--cm-success) !important; }

.alert {
    border-radius: var(--cm-radius-sm) !important;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4. DASHBOARD BANNER, SMALL-BOX, INFO-BOX & MENU SISWA
   -------------------------------------------------------------------------- */

/* Banner Header Dashboard (Harmoni Hijau Pendidikan + Ornamen Vektor) */
.content-header[style*="background"] {
    position: relative;
    height: auto !important;
    min-height: 220px !important;
    padding: 24px 0 36px 0 !important;
    background-image: none !important;
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #10b981 100%) !important;
    border-bottom-left-radius: var(--cm-radius-lg);
    border-bottom-right-radius: var(--cm-radius-lg);
    overflow: hidden;
    border-bottom: none !important;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.2);
    display: flex !important;
    align-items: center !important;
}

body.dark-mode .content-header[style*="background"] {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 55%, #047857 100%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Ilustrasi Ornamen Pendidikan Halus di Banner Dashboard */
.content-header[style*="background"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16) 0%, transparent 45%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200' viewBox='0 0 400 200'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-opacity='0.1'%3E%3Cpath d='M320 40 L355 25 L390 40 L355 55 Z'/%3E%3Cpath d='M332 46 V64 C332 70 378 70 378 64 V46'/%3E%3Cpath d='M388 40 V68'/%3E%3Cpath d='M60 140 Q80 125 100 140 V175 Q80 160 60 175 Z'/%3E%3Cpath d='M140 140 Q120 125 100 140 V175 Q120 160 140 175 Z'/%3E%3Ccircle cx='240' cy='50' r='22'/%3E%3Cellipse cx='240' cy='50' rx='36' ry='12' transform='rotate(-25 240 50)'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-size: cover, 420px 210px !important;
    background-position: center, right top !important;
    z-index: 0;
    pointer-events: none;
}

.content-header[style*="background"] .container-fluid {
    position: relative;
    z-index: 1;
    background: transparent !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    margin-top: 0 !important;
    width: 100%;
}

.content-header[style*="background"] + .content {
    margin-top: -18px !important;
    position: relative;
    z-index: 2;
}

/* Small Box (Kotak Statistik Admin & Guru) */
.small-box {
    position: relative;
    overflow: hidden;
    border-radius: var(--cm-radius-md) !important;
    background-color: var(--cm-bg-surface) !important;
    box-shadow: var(--cm-shadow-md) !important;
    border: 1px solid var(--cm-border-subtle);
    border-left: 5px solid var(--cm-primary) !important;
    margin-bottom: 20px;
    transition: transform var(--cm-transition-fast), box-shadow var(--cm-transition-fast);
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-shadow-lg) !important;
}

/* Warna Aksen Kiri Small-Box */
.small-box.bg-blue,
.small-box.bg-primary { border-left-color: #2563eb !important; }
.small-box.bg-cyan,
.small-box.bg-info { border-left-color: #0ea5e9 !important; }
.small-box.bg-teal { border-left-color: #0d9488 !important; }
.small-box.bg-fuchsia,
.small-box.bg-pink { border-left-color: #ec4899 !important; }
.small-box.bg-success,
.small-box.bg-green { border-left-color: #059669 !important; }
.small-box.bg-yellow,
.small-box.bg-warning { border-left-color: #f59e0b !important; }
.small-box.bg-danger,
.small-box.bg-red,
.small-box.bg-maroon { border-left-color: #ef4444 !important; }
.small-box.bg-indigo,
.small-box.bg-purple { border-left-color: #8b5cf6 !important; }
.small-box.bg-orange { border-left-color: #f97316 !important; }

.small-box .inner {
    position: relative;
    z-index: 10;
    padding: 16px 52px 16px 16px !important;
    color: var(--cm-text-main) !important;
}

.small-box .inner h3,
.small-box .inner h4,
.small-box .inner h5 {
    font-size: clamp(1.35rem, 2vw, 1.8rem) !important;
    font-weight: 800 !important;
    color: var(--cm-text-main) !important;
    margin-bottom: 4px !important;
    line-height: 1.2;
}

.small-box .inner p,
.small-box .inner span {
    display: block;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    color: var(--cm-text-muted) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0 !important;
}

.small-box .icon {
    position: absolute;
    top: 12px !important;
    right: 12px !important;
    z-index: 1;
    color: rgba(100, 116, 139, 0.12) !important;
    font-size: 2.5rem !important;
    transition: transform 0.3s ease, color 0.3s ease;
    pointer-events: none;
}

.small-box .icon > i {
    font-size: inherit !important;
    position: static !important;
}

.small-box:hover .icon {
    transform: scale(1.08) rotate(-5deg);
    color: rgba(5, 150, 105, 0.18) !important;
}

body.dark-mode .small-box .icon {
    color: rgba(255, 255, 255, 0.06) !important;
}

.small-box > a.small-box-footer,
.small-box .small-box-footer,
.floating-stats .small-box-footer,
[class*="bg-"] > a.small-box-footer,
a.small-box-footer,
.small-box-footer {
    position: relative;
    z-index: 10;
    background: var(--cm-bg-subtle) !important;
    color: var(--cm-text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.8rem;
    padding: 8px 16px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--cm-border-subtle);
    text-decoration: none !important;
    transition: background-color var(--cm-transition-fast), color var(--cm-transition-fast);
}

.small-box > a.small-box-footer i,
.small-box .small-box-footer i,
a.small-box-footer i {
    color: var(--cm-primary) !important;
    transition: transform var(--cm-transition-fast);
}

.small-box > a.small-box-footer:hover,
.small-box .small-box-footer:hover,
.floating-stats .small-box-footer:hover,
[class*="bg-"] > a.small-box-footer:hover,
a.small-box-footer:hover,
.small-box-footer:hover {
    background: var(--cm-primary-soft) !important;
    color: var(--cm-primary) !important;
}

.small-box > a.small-box-footer:hover i,
.small-box .small-box-footer:hover i,
a.small-box-footer:hover i {
    transform: translateX(3px);
    color: var(--cm-primary-hover) !important;
}

/* Dark mode styling untuk small-box-footer */
body.dark-mode .small-box > a.small-box-footer,
body.dark-mode .small-box .small-box-footer,
body.dark-mode .floating-stats .small-box-footer,
body.dark-mode [class*="bg-"] > a.small-box-footer,
body.dark-mode a.small-box-footer,
body.dark-mode .small-box-footer {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-top-color: #334155 !important;
}

body.dark-mode .small-box > a.small-box-footer i,
body.dark-mode .small-box .small-box-footer i,
body.dark-mode a.small-box-footer i {
    color: var(--cm-primary-light) !important;
}

body.dark-mode .small-box > a.small-box-footer:hover,
body.dark-mode .small-box .small-box-footer:hover,
body.dark-mode .floating-stats .small-box-footer:hover,
body.dark-mode [class*="bg-"] > a.small-box-footer:hover,
body.dark-mode a.small-box-footer:hover,
body.dark-mode .small-box-footer:hover {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

/* Info Box (Kotak Info Token, Penilaian, Status) */
.info-box {
    border-radius: var(--cm-radius-md) !important;
    background-color: var(--cm-bg-surface) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    box-shadow: var(--cm-shadow-sm) !important;
    min-height: 80px;
    padding: 10px;
    margin-bottom: 16px;
    transition: transform var(--cm-transition-fast), box-shadow var(--cm-transition-fast);
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--cm-shadow-md) !important;
}

/* Info-Box Transparan di dalam Banner Dashboard */
.content-header .info-box.bg-transparent {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.content-header .info-box.bg-transparent:hover {
    transform: none;
}

.content-header .info-box.bg-transparent .info-box-text,
.content-header .info-box.bg-transparent .info-box-number,
.content-header .info-box.bg-transparent h5,
.content-header .info-box.bg-transparent span {
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    white-space: normal !important;
}

.info-box .info-box-icon {
    border-radius: var(--cm-radius-sm) !important;
    width: 60px;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.info-box .info-box-content {
    color: var(--cm-text-main) !important;
    padding: 5px 10px;
    overflow: hidden;
    flex: 1 1 auto;
}

.info-box .info-box-text {
    color: var(--cm-text-muted) !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-box .info-box-number {
    color: var(--cm-text-main) !important;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Menu Utama Siswa (Ikon <figure> pada Dashboard Siswa)
   Dikecualikan dari .note-editable & .table agar gambar soal ujian TIDAK mengecil */
.card-body .row a figure,
.card-body .row > [class*="col-"] > figure {
    background-color: var(--cm-bg-subtle);
    border: 1px solid var(--cm-border-subtle);
    border-radius: var(--cm-radius-md);
    padding: 18px 10px !important;
    margin-bottom: 12px !important;
    text-align: center;
    transition: all var(--cm-transition-base);
    height: calc(100% - 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-body .row a figure:hover,
.card-body .row > [class*="col-"] > figure:hover {
    background-color: var(--cm-bg-surface);
    border-color: var(--cm-primary-light);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.14);
    transform: translateY(-4px);
}

.card-body .row a figure img,
.card-body .row > [class*="col-"] > figure img {
    max-width: 52px !important;
    height: auto !important;
    margin-bottom: 10px;
    transition: transform var(--cm-transition-base);
}

.card-body .row a figure:hover img,
.card-body .row > [class*="col-"] > figure:hover img {
    transform: scale(1.1);
}

.card-body .row a figure figcaption,
.card-body .row > [class*="col-"] > figure figcaption {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cm-text-main) !important;
    line-height: 1.25;
}

/* Pastikan gambar, audio & video di dalam soal ujian / tabel / editor selalu proporsional */
.note-editable img,
.card-body table img,
.soal-siswa img,
.card-body audio,
.card-body video,
.card-body iframe {
    max-width: 100% !important;
    height: auto !important;
}

/* --------------------------------------------------------------------------
   5. BUTTONS, BADGES & NAV-TABS (DASHBOARD & CBT SAFE)
   -------------------------------------------------------------------------- */
.btn:not(.d-none) {
    border-radius: var(--cm-radius-sm);
    font-weight: 600 !important;
    font-size: 0.875rem;
    padding: 7px 14px;
    transition: all var(--cm-transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

/* Jaga sambungan sudut pada .btn-group */
.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn-group:not(:last-child) > .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-group > .btn:not(:first-child),
.btn-group > .btn-group:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.btn-sm,
.btn-group-sm > .btn {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
    border-radius: var(--cm-radius-xs);
}

.btn-xs,
.btn-group-xs > .btn {
    padding: 3px 8px !important;
    font-size: 0.74rem !important;
    border-radius: var(--cm-radius-xs);
}

.btn-block:not(.d-none) {
    display: flex !important;
    width: 100% !important;
}

.btn-circle:not(.d-none) {
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.btn-success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: var(--cm-shadow-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, #047857, #059669) !important;
    border-color: #047857 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.36) !important;
    color: #ffffff !important;
}

.btn-default,
.btn-light {
    background-color: var(--cm-bg-subtle) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

.btn-default:hover,
.btn-light:hover {
    background-color: var(--cm-bg-hover) !important;
    border-color: var(--cm-primary-light) !important;
    color: var(--cm-primary) !important;
}

/* Badges */
.badge {
    border-radius: var(--cm-radius-xs);
    font-weight: 600;
    padding: 0.35em 0.6em;
    letter-spacing: 0.2px;
}

.badge-pill {
    border-radius: var(--cm-radius-pill);
}

/* Nav Tabs Reguler (Di dalam Dashboard / Card) */
.nav-tabs:not(#loginTab) {
    border-bottom: 1px solid var(--cm-border-subtle) !important;
}

.nav-tabs:not(#loginTab) .nav-link {
    color: var(--cm-text-muted) !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    font-weight: 600;
    padding: 10px 16px;
    transition: all var(--cm-transition-fast);
    background: transparent !important;
}

.nav-tabs:not(#loginTab) .nav-link:hover {
    color: var(--cm-primary) !important;
    border-bottom-color: var(--cm-border) !important;
}

.nav-tabs:not(#loginTab) .nav-link.active {
    color: var(--cm-primary) !important;
    background-color: transparent !important;
    border-bottom: 3px solid var(--cm-primary) !important;
}

/* Nav Pills */
.nav-pills .nav-link {
    border-radius: var(--cm-radius-sm) !important;
    color: var(--cm-text-secondary);
    font-weight: 600;
    transition: all var(--cm-transition-fast);
}

.nav-pills .nav-link:not(.active):hover {
    background-color: var(--cm-bg-hover);
    color: var(--cm-primary);
}

.nav-pills .nav-link.active {
    background-color: var(--cm-primary) !important;
    color: #ffffff !important;
    box-shadow: var(--cm-shadow-primary);
}

/* --------------------------------------------------------------------------
   6. TABLES & DATATABLES (ANTI-OVERFLOW & RESPONSIVE)
   -------------------------------------------------------------------------- */
.table-responsive {
    border-radius: var(--cm-radius-sm);
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0 !important;
    color: var(--cm-text-main) !important;
    border-color: var(--cm-border-subtle) !important;
}

.table thead th,
table.dataTable thead th,
table.dataTable thead td {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-muted) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px;
    padding: 12px 12px !important;
    border-top: 1px solid var(--cm-border-subtle) !important;
    border-bottom: 2px solid var(--cm-border) !important;
    vertical-align: middle !important;
}

.table tbody tr,
table.dataTable tbody tr {
    background-color: var(--cm-bg-surface) !important;
    transition: background-color var(--cm-transition-fast);
}

.table tbody tr:hover,
table.dataTable tbody tr:hover {
    background-color: var(--cm-bg-hover) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--cm-bg-subtle) !important;
}

.table-striped > tbody > tr:nth-of-type(odd):hover {
    background-color: var(--cm-bg-hover) !important;
}

.table tbody td,
table.dataTable tbody td {
    padding: 11px 12px !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
    vertical-align: middle !important;
    color: var(--cm-text-secondary) !important;
}

.table-bordered,
.table-bordered th,
.table-bordered td {
    border-color: var(--cm-border-subtle) !important;
}

/* DataTables Controls (Search, Length, Info, Pagination) */
.dataTables_wrapper {
    padding: 6px 0;
    width: 100%;
}

.dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--cm-text-muted) !important;
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--cm-border) !important;
    border-radius: var(--cm-radius-sm) !important;
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    padding: 6px 12px !important;
    margin-left: 8px !important;
    outline: none !important;
    transition: border-color var(--cm-transition-fast), box-shadow var(--cm-transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--cm-primary-light) !important;
    box-shadow: 0 0 0 3px var(--cm-primary-focus) !important;
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--cm-border) !important;
    border-radius: var(--cm-radius-sm) !important;
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    padding: 4px 24px 4px 10px !important;
    height: auto !important;
}

/* Pagination DataTables & Bootstrap */
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item) {
    border-radius: var(--cm-radius-sm) !important;
    border: 1px solid var(--cm-border) !important;
    padding: 5px 12px !important;
    margin: 2px !important;
    font-weight: 600 !important;
    color: var(--cm-text-secondary) !important;
    background: var(--cm-bg-surface) !important;
    transition: all var(--cm-transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:not(.page-item),
.dataTables_wrapper .dataTables_paginate .paginate_button.current:not(.page-item):hover {
    background: var(--cm-primary) !important;
    color: #ffffff !important;
    border-color: var(--cm-primary) !important;
    box-shadow: var(--cm-shadow-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item):hover:not(.disabled) {
    background: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
    border-color: var(--cm-primary-light) !important;
}

.page-item .page-link {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-secondary) !important;
    border-radius: var(--cm-radius-xs);
    margin: 0 2px;
    font-weight: 600;
    transition: all var(--cm-transition-fast);
}

.page-item .page-link:hover {
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
}

.page-item.active .page-link {
    background-color: var(--cm-primary) !important;
    border-color: var(--cm-primary) !important;
    color: #ffffff !important;
    box-shadow: var(--cm-shadow-primary);
}

.page-item.disabled .page-link {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-muted) !important;
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   7. FORMS, INPUT GROUPS, SELECT2 & SUMMERNOTE
   -------------------------------------------------------------------------- */
.form-control,
.custom-select,
.custom-file-label {
    border-radius: var(--cm-radius-sm) !important;
    border: 1.5px solid var(--cm-border) !important;
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    padding: 7px 12px;
    min-height: 38px;
    font-size: 0.925rem;
    transition: border-color var(--cm-transition-fast), box-shadow var(--cm-transition-fast), background-color var(--cm-transition-fast);
}

.form-control:focus,
.custom-select:focus,
.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--cm-primary-light) !important;
    box-shadow: 0 0 0 3px var(--cm-primary-focus) !important;
    outline: none;
}

.form-control:disabled,
.form-control[readonly],
.custom-select:disabled {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-muted) !important;
    opacity: 0.85;
}

.custom-file-label::after {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-secondary) !important;
    border-left: 1px solid var(--cm-border) !important;
}

.form-control-sm,
.custom-select-sm {
    min-height: 31px !important;
    padding: 4px 8px !important;
    font-size: 0.82rem !important;
    border-radius: var(--cm-radius-xs) !important;
}

/* Input Group Seamless Integration */
.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .form-control:not(:first-child),
.input-group > .custom-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group-prepend .input-group-text,
.input-group-prepend .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group-append .input-group-text,
.input-group-append .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group-text {
    background-color: var(--cm-bg-subtle) !important;
    border: 1.5px solid var(--cm-border) !important;
    color: var(--cm-text-muted) !important;
    border-radius: var(--cm-radius-sm);
}

/* Select2 Single & Multiple (Lengkap dengan Dropdown Dark Mode) */
.select2-container {
    max-width: 100%;
}

.select2-container--default .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--single {
    border-radius: var(--cm-radius-sm) !important;
    border: 1.5px solid var(--cm-border) !important;
    background-color: var(--cm-bg-surface) !important;
    height: 38px !important;
    padding: 4px 10px !important;
    display: flex;
    align-items: center;
    transition: border-color var(--cm-transition-fast), box-shadow var(--cm-transition-fast);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--bootstrap4.select2-container--focus .select2-selection--single {
    border-color: var(--cm-primary-light) !important;
    box-shadow: 0 0 0 3px var(--cm-primary-focus) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    color: var(--cm-text-main) !important;
    line-height: 28px !important;
    padding-left: 2px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 6px !important;
}

.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap4 .select2-selection--multiple {
    border-radius: var(--cm-radius-sm) !important;
    border: 1.5px solid var(--cm-border) !important;
    background-color: var(--cm-bg-surface) !important;
    min-height: 38px !important;
    padding: 2px 6px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--cm-primary-soft) !important;
    border: 1px solid var(--cm-primary-light) !important;
    color: var(--cm-primary) !important;
    border-radius: var(--cm-radius-xs) !important;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 2px 8px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--cm-primary) !important;
    margin-right: 5px !important;
}

.select2-dropdown {
    background-color: var(--cm-bg-surface) !important;
    border: 1.5px solid var(--cm-border) !important;
    border-radius: var(--cm-radius-sm) !important;
    box-shadow: var(--cm-shadow-lg) !important;
    overflow: hidden;
    z-index: 1060;
}

.select2-search--dropdown .select2-search__field {
    background-color: var(--cm-bg-subtle) !important;
    border: 1px solid var(--cm-border) !important;
    color: var(--cm-text-main) !important;
    border-radius: var(--cm-radius-xs) !important;
    padding: 6px 10px !important;
    outline: none !important;
}

.select2-results__option {
    color: var(--cm-text-main) !important;
    padding: 8px 12px !important;
    font-size: 0.9rem;
}

.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
    font-weight: 600;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--cm-primary) !important;
    color: #ffffff !important;
}

/* Summernote Editor Support */
.note-editor.note-frame {
    border-radius: var(--cm-radius-sm) !important;
    border: 1.5px solid var(--cm-border) !important;
    overflow: hidden;
}

.note-editor .note-toolbar {
    background-color: var(--cm-bg-subtle) !important;
    border-bottom: 1px solid var(--cm-border) !important;
}

.note-editor .note-editing-area .note-editable {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .note-editor .note-btn {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

/* --------------------------------------------------------------------------
   8. MODALS, SWEETALERT2, TOASTR & PRELOADER
   -------------------------------------------------------------------------- */
.modal-content {
    border-radius: var(--cm-radius-lg) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    background-color: var(--cm-bg-surface) !important;
    box-shadow: var(--cm-shadow-lg) !important;
    overflow: hidden;
}

.modal-header {
    background-color: var(--cm-bg-subtle) !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
    padding: 16px 22px !important;
    align-items: center;
}

.modal-title {
    font-weight: 700 !important;
    font-size: 1.08rem;
    color: var(--cm-text-main) !important;
}

.modal-body {
    padding: 20px 22px !important;
    color: var(--cm-text-main);
}

.modal-footer {
    border-top: 1px solid var(--cm-border-subtle) !important;
    padding: 14px 22px !important;
    background-color: var(--cm-bg-subtle) !important;
}

.modal-header .close {
    font-size: 1.4rem !important;
    color: var(--cm-danger) !important;
    opacity: 0.75;
    transition: transform var(--cm-transition-fast), opacity var(--cm-transition-fast);
    text-shadow: none !important;
    outline: none;
}

.modal-header .close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Dropdown Menu & Toast Bootstrap */
.dropdown-menu {
    background-color: var(--cm-bg-surface) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    border-radius: var(--cm-radius-md) !important;
    box-shadow: var(--cm-shadow-lg) !important;
    padding: 6px;
}

.dropdown-item {
    color: var(--cm-text-main) !important;
    border-radius: var(--cm-radius-xs);
    padding: 7px 12px;
    font-size: 0.9rem;
    transition: background-color var(--cm-transition-fast), color var(--cm-transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
}

.dropdown-divider {
    border-top-color: var(--cm-border-subtle) !important;
}

.toast {
    background-color: var(--cm-bg-surface) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    border-radius: var(--cm-radius-md) !important;
    box-shadow: var(--cm-shadow-lg) !important;
}

.toast-header {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-main) !important;
    border-bottom: 1px solid var(--cm-border-subtle) !important;
}

.toast-body {
    color: var(--cm-text-secondary) !important;
}

/* SweetAlert2 */
.swal2-popup {
    border-radius: var(--cm-radius-xl) !important;
    font-family: 'Inter', 'Poppins', sans-serif !important;
    background-color: var(--cm-bg-surface) !important;
    border: 1px solid var(--cm-border-subtle);
    box-shadow: var(--cm-shadow-lg) !important;
    padding: 26px !important;
}

.swal2-title {
    font-weight: 800 !important;
    color: var(--cm-text-main) !important;
    font-size: 1.35rem !important;
}

.swal2-html-container,
.swal2-content {
    color: var(--cm-text-muted) !important;
    font-size: 0.95rem !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-radius: 10px !important;
    box-shadow: var(--cm-shadow-primary) !important;
    font-weight: 600 !important;
    padding: 10px 26px !important;
    border: none !important;
}

.swal2-cancel {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 10px 26px !important;
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-text-main) !important;
}

/* Toastr Notification */
#toast-container > div {
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18) !important;
    opacity: 1 !important;
    font-family: 'Inter', sans-serif !important;
    padding: 15px 15px 15px 50px !important;
    background-position: 15px center !important;
}

.toast-success { background-color: #10b981 !important; }
.toast-error { background-color: #ef4444 !important; }
.toast-info { background-color: #0ea5e9 !important; }
.toast-warning { background-color: #f59e0b !important; }

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cm-bg-body-dashboard);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid var(--cm-border);
    border-top: 4px solid var(--cm-primary);
    border-radius: 50%;
    animation: cmSpin 0.8s linear infinite;
}

@keyframes cmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tooltip-inner {
    background-color: #064e3b !important;
    border-radius: var(--cm-radius-xs) !important;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. MODERN GREEN EDUCATIONAL ILLUSTRATIVE LOGIN PAGE (100% TERISOLASI)
   Perbaikan Total Struktur Wrapper (.container.pt-4 -> flex-direction: column)
   agar Kartu Sekolah & Form Login TIDAK PERNAH Berjejer ke Samping di Mobile!
   -------------------------------------------------------------------------- */

/* 1. Latar Belakang Ilustratif Pendidikan Hijau (Multi-Layer SVG Vector) */
body.login-page,
body:not(:has(.wrapper)):has(.form-signin),
body:not(:has(.wrapper)):has(#loginTab),
body:not(:has(.wrapper)):has(.slideshow-container) {
    background-color: #ecfdf5 !important;
    background-image:
        /* Layer 1: Ilustrasi Bukit & Siluet Kampus/Pendidikan di Bawah Layar */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23a7f3d0' fill-opacity='0.55' d='M0,192L60,181.3C120,171,240,149,360,154.7C480,160,600,192,720,197.3C840,203,960,181,1080,165.3C1200,149,1320,139,1380,133.3L1440,128L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'/%3E%3Cpath fill='%2334d399' fill-opacity='0.35' d='M0,224L80,213.3C160,203,320,181,480,186.7C640,192,800,224,960,224C1120,224,1280,192,1360,176L1440,160L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'/%3E%3Cpath fill='%23059669' fill-opacity='0.22' d='M0,256L60,250.7C120,245,240,235,360,234.7C480,235,600,245,720,256C840,267,960,277,1080,266.7C1200,256,1320,224,1380,208L1440,192L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'/%3E%3C/svg%3E"),
        /* Layer 2: Pola Ilustrasi Ikon Pendidikan (Toga, Buku, Atom, Daun, Lentera Ilmu) */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' stroke-opacity='0.11'%3E%3C!-- Graduation Cap --%3E%3Cpath d='M85 75 L135 52 L185 75 L135 98 Z' fill='%2310b981' fill-opacity='0.06'/%3E%3Cpath d='M102 84 V108 C102 118 168 118 168 108 V84'/%3E%3Cpath d='M182 76 V114'/%3E%3Ccircle cx='182' cy='116' r='3'/%3E%3C!-- Open Book & Knowledge Pages --%3E%3Cpath d='M360 110 Q390 92 420 110 V156 Q390 138 360 156 Z' fill='%2310b981' fill-opacity='0.05'/%3E%3Cpath d='M480 110 Q450 92 420 110 V156 Q450 138 480 156 Z' fill='%2310b981' fill-opacity='0.05'/%3E%3Cpath d='M372 122 Q390 112 408 122 M372 134 Q390 124 408 134 M432 122 Q450 112 468 122 M432 134 Q450 124 468 134'/%3E%3C!-- Science Atom / Orbit --%3E%3Ccircle cx='120' cy='360' r='8' fill='%23059669' fill-opacity='0.12'/%3E%3Cellipse cx='120' cy='360' rx='46' ry='16' transform='rotate(30 120 360)'/%3E%3Cellipse cx='120' cy='360' rx='46' ry='16' transform='rotate(-30 120 360)'/%3E%3Cellipse cx='120' cy='360' rx='46' ry='16' transform='rotate(90 120 360)'/%3E%3C!-- Botanical Education Leaf --%3E%3Cpath d='M410 380 C410 340 460 330 475 330 C475 345 465 395 425 395 C415 395 410 390 410 380 Z' fill='%2310b981' fill-opacity='0.07'/%3E%3Cpath d='M402 402 L455 348'/%3E%3C!-- Diploma Scroll & Stars --%3E%3Crect x='235' y='220' width='65' height='22' rx='6' transform='rotate(-15 235 220)' fill='%2310b981' fill-opacity='0.05'/%3E%3Cpath d='M260 40 L264 52 L276 56 L264 60 L260 72 L256 60 L244 56 L256 52 Z' fill='%2310b981' fill-opacity='0.1'/%3E%3Cpath d='M65 220 L68 228 L76 231 L68 234 L65 242 L62 234 L54 231 L62 228 Z' fill='%2310b981' fill-opacity='0.1'/%3E%3Cpath d='M310 430 L313 438 L321 441 L313 444 L310 452 L307 444 L299 441 L307 438 Z' fill='%2310b981' fill-opacity='0.1'/%3E%3C/g%3E%3C/svg%3E"),
        /* Layer 3: Cahaya Radial Halus & Gradien Alam Segar */
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 25%, rgba(20, 184, 166, 0.14) 0%, transparent 50%),
        linear-gradient(160deg, #f0fdf4 0%, #dcfce7 48%, #d1fae5 100%) !important;
    background-repeat: no-repeat, repeat, no-repeat, no-repeat, no-repeat !important;
    background-position: bottom center, center center, top left, top right, center center !important;
    background-size: 100% 240px, 480px 480px, 100% 100%, 100% 100%, 100% 100% !important;
    background-attachment: fixed !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fallback untuk browser lama yang mengandalkan .slideshow-container */
.slideshow-container {
    background-color: #ecfdf5 !important;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23a7f3d0' fill-opacity='0.55' d='M0,192L60,181.3C120,171,240,149,360,154.7C480,160,600,192,720,197.3C840,203,960,181,1080,165.3C1200,149,1320,139,1380,133.3L1440,128L1440,320L0,320Z'/%3E%3Cpath fill='%2310b981' fill-opacity='0.28' d='M0,240L80,229.3C160,219,320,197,480,202.7C640,208,800,240,960,240C1120,240,1280,208,1360,192L1440,176L1440,320L0,320Z'/%3E%3C/svg%3E"),
        linear-gradient(160deg, #f0fdf4 0%, #dcfce7 50%, #d1fae5 100%) !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: bottom center, center center !important;
    background-size: 100% 240px, 100% 100% !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
    display: block !important;
    pointer-events: none !important;
}

/* Sembunyikan gambar slide bawaan (wall1/wall2/wall3) & Backstretch JS */
#backstretch,
.slideshow-container .slide,
.slideshow-container::after {
    display: none !important;
}

/* 2. PERBAIKAN KRUSIAL CONTAINER HALAMAN LOGIN:
   Pada DOM aplikasi CBT, <div class="container pt-4"> membungkus .info-box
   sekaligus .container-fluid.h-100! Wajib flex-direction: column agar
   elemen tersusun vertikal dari atas ke bawah, BUKAN menyamping! */
body.login-page > .container,
body.login-page .container.pt-4,
body:not(:has(.wrapper)):has(.form-signin) > .container,
body:not(:has(.wrapper)):has(.form-signin) .container.pt-4,
body:not(:has(.wrapper)):has(#loginTab) > .container,
body:not(:has(.wrapper)):has(#loginTab) .container.pt-4,
body:not(:has(.wrapper)):has(.slideshow-container) > .container,
body:not(:has(.wrapper)):has(.slideshow-container) .container.pt-4 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 1140px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 20px 16px 32px 16px !important;
    margin: auto !important;
    position: relative;
    z-index: 10;
}

/* Pastikan .container-fluid dan .row di dalam halaman login selalu 100% lebar normal */
body.login-page .container-fluid,
body.login-page .container-fluid.h-100,
body:not(:has(.wrapper)):has(.form-signin) .container-fluid,
body:not(:has(.wrapper)):has(.form-signin) .container-fluid.h-100,
body:not(:has(.wrapper)):has(#loginTab) .container-fluid,
body:not(:has(.wrapper)):has(#loginTab) .container-fluid.h-100 {
    width: 100% !important;
    max-width: 460px !important;
    height: auto !important;
    min-height: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
    flex: 0 0 auto !important;
}

body.login-page .container-fluid > .row,
body.login-page .row.h-100,
body:not(:has(.wrapper)):has(.form-signin) .container-fluid > .row,
body:not(:has(.wrapper)):has(.form-signin) .row.h-100,
body:not(:has(.wrapper)):has(#loginTab) .container-fluid > .row,
body:not(:has(.wrapper)):has(#loginTab) .row.h-100 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
}

/* Pastikan wrapper .login-box atau kolom apapun di dalam .row mengambil lebar penuh hingga 440px */
body.login-page .login-box,
body:not(:has(.wrapper)):has(.form-signin) .login-box,
body:not(:has(.wrapper)):has(#loginTab) .login-box,
body.login-page .container-fluid > .row > [class*="col-"],
body:not(:has(.wrapper)):has(.form-signin) .container-fluid > .row > [class*="col-"],
body:not(:has(.wrapper)):has(#loginTab) .container-fluid > .row > [class*="col-"],
body.login-page .container-fluid > .row > div,
body:not(:has(.wrapper)):has(.form-signin) .container-fluid > .row > div,
body:not(:has(.wrapper)):has(#loginTab) .container-fluid > .row > div {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
}

/* 3. Kartu Header Identitas Sekolah (Floating Pill Ilustratif - Anti Stretch) */
body.login-page .info-box.bg-transparent,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent,
body:not(:has(.wrapper)):has(#loginTab) .info-box.bg-transparent,
body:not(:has(.wrapper)):has(.slideshow-container) .info-box.bg-transparent {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.28) !important;
    border-radius: 18px !important;
    padding: 12px 20px !important;
    box-shadow: 0 10px 28px rgba(6, 78, 59, 0.08) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    width: 100% !important;
    max-width: 440px !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto 14px auto !important;
    gap: 14px;
}

body.login-page .info-box.bg-transparent img,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent img,
body:not(:has(.wrapper)):has(#loginTab) .info-box.bg-transparent img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.15);
    background: #ffffff;
    padding: 4px;
}

body.login-page .info-box.bg-transparent .info-box-content,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .info-box-content,
body:not(:has(.wrapper)):has(#loginTab) .info-box.bg-transparent .info-box-content {
    text-shadow: none !important;
    padding: 0 !important;
    text-align: left !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

body.login-page .info-box.bg-transparent .text-white,
body.login-page .info-box.bg-transparent .info-box-text,
body.login-page .info-box.bg-transparent .info-box-number,
body.login-page .info-box.bg-transparent h5,
body.login-page .info-box.bg-transparent span,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .text-white,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .info-box-text,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .info-box-number,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent h5,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent span {
    color: #064e3b !important;
    text-shadow: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.3 !important;
}

body.login-page .info-box.bg-transparent h5,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent h5 {
    font-weight: 800 !important;
    font-size: 1.02rem !important;
    letter-spacing: 0.3px;
    margin-bottom: 2px !important;
}

body.login-page .info-box.bg-transparent .info-box-text,
body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .info-box-text {
    font-size: 0.78rem !important;
    color: #047857 !important;
    font-weight: 600 !important;
}

/* 4. Judul Utama "Selamat Datang" */
.login-logo {
    font-size: clamp(1.55rem, 3.5vw, 2.15rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px;
    color: #064e3b !important;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.85) !important;
    margin: 4px auto 16px auto !important;
    text-align: center !important;
    width: 100% !important;
    line-height: 1.25 !important;
}

.login-logo a {
    color: #064e3b !important;
}

/* 5. Kartu Utama Login (Modern White & Emerald Accent Card) */
.form-signin,
.login-box .card,
.login-card-body {
    position: relative;
    z-index: 5;
}

.form-signin {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.28) !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(6, 78, 59, 0.12),
                0 4px 12px rgba(5, 150, 105, 0.06) !important;
    width: 100% !important;
    max-width: 440px !important;
    min-width: 0 !important;
    margin: 0 auto 20px auto !important;
    padding: 32px 28px !important;
    overflow: hidden;
    display: block !important;
}

/* Pita Aksen Ilustratif Hijau di Bagian Atas Kartu Login */
.form-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #059669 0%, #10b981 50%, #0d9488 100%);
    z-index: 6;
}

.form-signin .card-body,
.form-signin .login-card-body {
    padding: 0 !important;
    background: transparent !important;
    width: 100% !important;
    overflow: visible !important;
}

/* Pastikan seluruh teks, label, dan pesan di dalam kartu login berwarna gelap & tajam */
.form-signin,
.form-signin label,
.form-signin p,
.form-signin span:not(.badge) {
    color: #1e293b !important;
    font-weight: 500;
}

.form-signin .login-box-msg {
    color: #047857 !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center !important;
    padding: 0 0 14px 0 !important;
    margin-bottom: 6px !important;
    white-space: nowrap !important;
}

/* 6. Segmented Control Tabs (Manual / QR Login) */
.nav-tabs#loginTab,
.form-signin .nav-tabs {
    border: 1px solid #d1fae5 !important;
    background: #f0fdf4 !important;
    border-radius: 14px !important;
    padding: 5px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.nav-tabs#loginTab .nav-item,
.form-signin .nav-tabs .nav-item {
    flex: 1 1 50% !important;
    margin-bottom: 0 !important;
}

.nav-tabs#loginTab .nav-link,
.form-signin .nav-tabs .nav-link {
    width: 100% !important;
    border: none !important;
    border-radius: 10px !important;
    color: #047857 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    padding: 10px 12px !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    white-space: nowrap !important;
    background: transparent !important;
    transition: all var(--cm-transition-base);
}

.nav-tabs#loginTab .nav-link i,
.nav-tabs#loginTab .nav-link span,
.form-signin .nav-tabs .nav-link i,
.form-signin .nav-tabs .nav-link span {
    color: inherit !important;
}

.nav-tabs#loginTab .nav-link:hover,
.form-signin .nav-tabs .nav-link:hover {
    color: #064e3b !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.nav-tabs#loginTab .nav-link.active,
.form-signin .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28) !important;
}

.nav-tabs#loginTab .nav-link.active i,
.nav-tabs#loginTab .nav-link.active span,
.form-signin .nav-tabs .nav-link.active i,
.form-signin .nav-tabs .nav-link.active span {
    color: #ffffff !important;
}

/* 7. Input Form (Username & Password) - 1 Baris Utuh & Tidak Terpotong */
.form-signin .input-group {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 16px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    transition: all var(--cm-transition-base);
}

.form-signin .input-group:focus-within {
    background: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16) !important;
}

.form-signin .input-group-prepend,
.form-signin .input-group-append {
    border: none !important;
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
}

.form-signin .input-group-text {
    background: transparent !important;
    border: none !important;
    color: #059669 !important;
    padding: 0 10px 0 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.form-signin .input-group-append .input-group-text {
    padding: 0 14px 0 10px !important;
}

.form-signin .form-control {
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    padding: 12px 10px !important;
    height: 46px !important;
    min-height: 46px !important;
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
    box-shadow: none !important;
}

.form-signin .form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 400;
}

/* Proteksi Autofill Browser di Kartu Login Putih (Teks Tetap Gelap & Tajam) */
.form-signin input:-webkit-autofill,
.form-signin input:-webkit-autofill:hover,
.form-signin input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a !important;
    -webkit-box-shadow: 0 0 0px 1000px #f0fdf4 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

#toggle-password {
    color: #64748b !important;
    cursor: pointer;
    transition: color var(--cm-transition-fast);
}

#toggle-password:hover {
    color: #059669 !important;
}

/* 8. Baris Bawah Form Login (Dropdown CBT/E-Learning & Tombol Masuk) */
.form-signin .row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    margin-left: -6px !important;
    margin-right: -6px !important;
}

.form-signin .row > [class*="col-"] {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

#cbt-only,
#cbt-only-qr {
    background-color: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    color: #0f172a !important;
    height: 46px !important;
    min-height: 46px !important;
    width: 100% !important;
    padding: 8px 12px !important;
    font-weight: 600;
    font-size: 0.9rem !important;
    transition: all var(--cm-transition-base);
}

#cbt-only:focus,
#cbt-only-qr:focus {
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16) !important;
}

#cbt-only option,
#cbt-only-qr option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* 9. Tombol Submit Login & Scan Kamera QR */
#submit,
#qr-submit {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    height: 46px !important;
    min-height: 46px !important;
    width: 100% !important;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.32) !important;
    transition: all var(--cm-transition-base);
}

#submit span,
#submit i,
#qr-submit span,
#qr-submit i {
    color: #ffffff !important;
}

#submit:hover,
#qr-submit:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.42) !important;
}

#qr-camera-btn:not(.d-none) {
    background: #f0fdf4 !important;
    border: 1.5px solid #a7f3d0 !important;
    color: #047857 !important;
    border-radius: 12px !important;
    font-weight: 600;
    padding: 10px 14px !important;
    transition: all var(--cm-transition-base);
}

#qr-camera-btn:hover {
    background: #dcfce7 !important;
    border-color: #10b981 !important;
    color: #064e3b !important;
}

#qr-reader {
    border-radius: 14px;
    overflow: hidden;
    border: 2px dashed #6ee7b7 !important;
    background: #f8fafc;
    width: 100% !important;
}

#qr-reader video {
    max-width: 100% !important;
    border-radius: 12px;
}

/* --------------------------------------------------------------------------
   10. DARK MODE OVERRIDES UNTUK UTILITAS BAWAAN ADMINLTE / BOOTSTRAP
   -------------------------------------------------------------------------- */
body.dark-mode .bg-white,
body.dark-mode .bg-light,
body.dark-mode .bg-gray-light,
body.dark-mode .table-light {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .text-dark,
body.dark-mode .text-black,
body.dark-mode .text-gray,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--cm-text-main) !important;
}

body.dark-mode .list-group-item {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border-subtle) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode hr,
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-left,
body.dark-mode .border-right {
    border-color: var(--cm-border-subtle) !important;
}

/* --------------------------------------------------------------------------
   11. RESPONSIVE BREAKPOINTS (SEMUA UKURAN DESKTOP, TABLET & SMARTPHONE)
   -------------------------------------------------------------------------- */

/* A. Layar Desktop Lebar / Ultra-Wide (>= 1440px) */
@media (min-width: 1440px) {
    .content > .container-fluid,
    .content-header > .container-fluid {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* B. Laptop & Tablet Landscape (max-width: 1199.98px) */
@media (max-width: 1199.98px) {
    .small-box .inner {
        padding: 14px 44px 14px 14px !important;
    }
    .small-box .icon {
        font-size: 2.2rem !important;
    }
}

/* C. Tablet Portrait & Layar Menengah (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .content-header[style*="background"] .row.m-0 > [class*="col-"]:has(.small-box) {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

@media (max-width: 991.98px) {
    .content-header[style*="background"] {
        min-height: 180px !important;
        padding: 20px 0 28px 0 !important;
    }

    .content-header[style*="background"] + .content {
        margin-top: -12px !important;
    }

    .card-header:not(.p-0) {
        padding: 14px 16px !important;
    }
}

/* D. Smartphone & Tablet Kecil (max-width: 767.98px) */
@media (max-width: 767.98px) {
    /* Navbar Mobile Rapi & Anti-Turun Baris */
    .main-header.navbar {
        padding: 0.35rem 0.65rem !important;
        flex-wrap: nowrap !important;
    }

    .main-header .nav-link {
        padding: 0.35rem 0.55rem !important;
        font-size: 0.9rem;
    }

    .content-wrapper > .content {
        padding: 10px 8px !important;
    }

    .content-header {
        padding: 12px 8px !important;
    }

    .content-header[style*="background"] {
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
        padding: 16px 6px 24px 6px !important;
    }

    /* Kotak Statistik di dalam Banner Dashboard: 2 Kolom Rapi (Tanpa Merusak col-12 Header) */
    .content-header[style*="background"] .row.m-0 > [class*="col-"]:not(.col-12),
    .content-header[style*="background"] .row > [class*="col-"]:has(.small-box) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 0 5px !important;
    }

    .content-header[style*="background"] .small-box .icon {
        display: none !important;
    }

    .content-header[style*="background"] .small-box .inner {
        padding: 12px 10px !important;
        min-height: 78px;
    }

    .content-header[style*="background"] .small-box .inner h3,
    .content-header[style*="background"] .small-box .inner h4,
    .content-header[style*="background"] .small-box .inner h5 {
        font-size: 1.45rem !important;
        margin-bottom: 4px !important;
        font-weight: 800 !important;
    }

    .content-header[style*="background"] .small-box .inner p,
    .content-header[style*="background"] .small-box .inner span {
        font-size: 0.68rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .content-header[style*="background"] .small-box-footer {
        padding: 6px 10px !important;
        font-size: 0.68rem !important;
    }

    /* Card & Card Header Responsif (Anti-Tabrakan Judul dan Tombol) */
    .card {
        margin-bottom: 14px;
        border-radius: 12px !important;
    }

    .card-header:not(.p-0):not(:has(.nav-tabs)):not(:has(.nav-pills)) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 14px !important;
    }

    .card-header:not(.p-0):not(:has(.nav-tabs)):not(:has(.nav-pills))::after {
        display: none;
    }

    .card-header > .card-title {
        float: none !important;
        font-size: 0.95rem !important;
        flex: 1 1 auto;
    }

    .card-header > .card-tools {
        float: none !important;
        margin-right: 0 !important;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }

    .card-body {
        padding: 14px !important;
        overflow-x: auto;
    }

    .card-footer {
        padding: 10px 14px !important;
    }

    /* Small-Box Reguler di HP */
    .small-box {
        margin-bottom: 12px;
    }

    .small-box .inner {
        padding: 12px 38px 12px 12px !important;
    }

    .small-box .inner h3,
    .small-box .inner h4,
    .small-box .inner h5 {
        font-size: 1.3rem !important;
    }

    .small-box .inner p,
    .small-box .inner span {
        font-size: 0.72rem !important;
    }

    .small-box .icon {
        font-size: 1.8rem !important;
        top: 10px !important;
        right: 10px !important;
    }

    /* Info Box di HP */
    .info-box {
        min-height: 70px;
        padding: 8px;
        margin-bottom: 12px;
    }

    .info-box .info-box-icon {
        width: 50px;
        font-size: 1.35rem;
    }

    .info-box .info-box-number {
        font-size: 0.98rem;
    }

    /* Menu Utama Siswa (Ikon <figure>) di HP */
    .card-body .row a figure,
    .card-body .row > [class*="col-"] > figure {
        padding: 14px 8px !important;
    }

    .card-body .row a figure img,
    .card-body .row > [class*="col-"] > figure img {
        max-width: 42px !important;
        margin-bottom: 8px;
    }

    .card-body .row a figure figcaption,
    .card-body .row > [class*="col-"] > figure figcaption {
        font-size: 0.74rem !important;
    }

    /* DataTables di HP: Search & Show Entries Rata Rapi & Full Width */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
        width: 100%;
        margin-bottom: 8px;
    }

    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        align-items: center;
        margin-bottom: 0;
    }

    .dataTables_wrapper .dataTables_filter input {
        flex: 1;
        width: 100% !important;
        margin-left: 8px !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        width: 100%;
        margin-top: 8px;
    }

    /* Modal di HP */
    .modal-dialog {
        margin: 10px !important;
    }

    .modal-header {
        padding: 14px 16px !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    .modal-footer {
        padding: 12px 16px !important;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Halaman Login di Tablet Kecil & HP */
    body.login-page > .container,
    body.login-page .container.pt-4,
    body:not(:has(.wrapper)):has(.form-signin) > .container,
    body:not(:has(.wrapper)):has(.form-signin) .container.pt-4,
    body:not(:has(.wrapper)):has(#loginTab) > .container,
    body:not(:has(.wrapper)):has(#loginTab) .container.pt-4 {
        padding: 16px 14px 28px 14px !important;
    }

    body.login-page .info-box.bg-transparent,
    body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent,
    body:not(:has(.wrapper)):has(#loginTab) .info-box.bg-transparent {
        width: 100% !important;
        max-width: 440px !important;
        padding: 10px 14px !important;
        margin-bottom: 12px !important;
        justify-content: flex-start !important;
    }

    .form-signin {
        width: 100% !important;
        max-width: 440px !important;
        margin: 0 auto 20px auto !important;
        padding: 26px 20px !important;
        border-radius: 20px !important;
    }
}

/* E. Smartphone Layar Kecil (max-width: 575.98px) - Optimasi Penuh Mobile */
@media (max-width: 575.98px) {
    body.login-page,
    body:not(:has(.wrapper)):has(.form-signin),
    body:not(:has(.wrapper)):has(#loginTab),
    body:not(:has(.wrapper)):has(.slideshow-container) {
        justify-content: flex-start !important;
    }

    body.login-page > .container,
    body.login-page .container.pt-4,
    body:not(:has(.wrapper)):has(.form-signin) > .container,
    body:not(:has(.wrapper)):has(.form-signin) .container.pt-4,
    body:not(:has(.wrapper)):has(#loginTab) > .container,
    body:not(:has(.wrapper)):has(#loginTab) .container.pt-4 {
        justify-content: flex-start !important;
        padding: 14px 12px 24px 12px !important;
        margin: 0 auto !important;
    }

    body.login-page .info-box.bg-transparent img,
    body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent img,
    body:not(:has(.wrapper)):has(#loginTab) .info-box.bg-transparent img {
        width: 42px !important;
        height: 42px !important;
        max-width: 42px !important;
    }

    body.login-page .info-box.bg-transparent h5,
    body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent h5 {
        font-size: 0.95rem !important;
    }

    body.login-page .info-box.bg-transparent .info-box-text,
    body:not(:has(.wrapper)):has(.form-signin) .info-box.bg-transparent .info-box-text {
        font-size: 0.74rem !important;
    }

    .login-logo {
        font-size: 1.5rem !important;
        margin: 2px auto 12px auto !important;
    }

    .form-signin {
        padding: 22px 16px !important;
        border-radius: 18px !important;
    }

    .form-signin .login-box-msg {
        font-size: 0.85rem !important;
        padding-bottom: 10px !important;
    }

    /* Tumpuk Dropdown Mode & Tombol Masuk di dalam .form-signin menjadi Full-Width Rapi */
    .form-signin .row > .col-7,
    .form-signin .row > .col-5,
    .form-signin .row > .col-8,
    .form-signin .row > .col-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
    }

    .form-signin .row > [class*="col-"]:last-child {
        margin-bottom: 0 !important;
    }
}

/* F. Smartphone Layar Ekstra Kecil (max-width: 380px) */
@media (max-width: 380px) {
    .small-box .inner {
        padding: 10px 12px !important;
    }

    .small-box .icon {
        opacity: 0.35;
        font-size: 1.5rem !important;
    }

    .btn:not(.d-none) {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .nav-tabs#loginTab .nav-link,
    .form-signin .nav-tabs .nav-link {
        font-size: 0.82rem !important;
        padding: 8px 8px !important;
    }
}

/* ==========================================================================
   UNIFIED EMERALD EDUCATION THEME v3.0 - CORE EXTENSIONS
   ========================================================================== */

/* 1. COMPACT HERO HEADER (ADMIN & GURU DASHBOARD) */
.hero-compact {
    min-height: 180px !important;
    max-height: 220px !important;
    height: auto !important;
    background-size: cover !important;
    background-position: center !important;
    position: relative;
    border-bottom: 1px solid var(--cm-border-subtle);
}

.hero-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.88), rgba(6, 78, 59, 0.94));
    z-index: 1;
}

body.dark-mode .hero-compact::before {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.92), rgba(11, 17, 32, 0.96));
}

.hero-compact .hero-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem 1rem 3rem 1rem !important;
    width: 100%;
}

.hero-compact .hero-title {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.hero-compact .hero-subtitle {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.9rem;
}

/* 2. FLOATING SMALL-BOX STATS */
.floating-stats {
    margin-top: -2.5rem;
    position: relative;
    z-index: 3;
}

.floating-stats .small-box {
    border-radius: var(--cm-radius-md) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    box-shadow: var(--cm-shadow-md) !important;
    transition: transform var(--cm-transition-fast), box-shadow var(--cm-transition-fast);
}

.floating-stats .small-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-shadow-lg) !important;
}

/* 3. EMERALD GLASSMORPHISM LOGIN */
.login-emerald-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.35), transparent 60%),
                linear-gradient(135deg, rgba(6, 78, 59, 0.82), rgba(15, 23, 42, 0.9));
    z-index: 0;
}

.form-signin.glass-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.25) !important;
    border-radius: var(--cm-radius-lg) !important;
}

body.dark-mode .form-signin.glass-card {
    background: rgba(30, 41, 59, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

/* Tab Login Emerald */
.nav-tabs#loginTab .nav-link {
    color: var(--cm-text-muted) !important;
    font-weight: 600;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    transition: all var(--cm-transition-fast);
}

.nav-tabs#loginTab .nav-link.active {
    color: var(--cm-primary) !important;
    border-bottom: 2px solid var(--cm-primary) !important;
    background: transparent !important;
}

.qr-scanner-frame {
    border: 2px dashed var(--cm-primary);
    border-radius: var(--cm-radius-md);
    padding: 8px;
    background: var(--cm-bg-subtle);
    overflow: hidden;
}

/* 4. STUDENT APP LAUNCHER CARDS */
.student-launcher-card {
    background: var(--cm-card-bg) !important;
    border: 1px solid var(--cm-border-subtle) !important;
    border-radius: var(--cm-radius-lg) !important;
    padding: 1.25rem 0.75rem !important;
    text-align: center;
    box-shadow: var(--cm-shadow-sm) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    text-decoration: none !important;
    height: 100%;
}

.student-launcher-card:hover {
    transform: translateY(-5px);
    border-color: var(--cm-primary-light) !important;
    box-shadow: 0 12px 24px rgba(5, 150, 105, 0.18) !important;
}

.student-launcher-card img {
    transition: transform var(--cm-transition-fast);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
}

.student-launcher-card:hover img {
    transform: scale(1.08);
}

.student-launcher-card figcaption {
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cm-text-main) !important;
}

/* Student Top Profile Banner */
.student-profile-banner {
    background: linear-gradient(135deg, #059669, #0d9488) !important;
    border-radius: var(--cm-radius-lg) !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: var(--cm-shadow-md) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-mode .student-profile-banner {
    background: linear-gradient(135deg, #064e3b, #134e4a) !important;
}

.student-profile-banner .avatar-ring {
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 5. JEXCEL & SUMMERNOTE DARK MODE ADAPTATIONS */
body.dark-mode .jexcel {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    border-color: var(--cm-border) !important;
}

body.dark-mode .jexcel > thead > tr > td {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-main) !important;
    border-color: var(--cm-border) !important;
}

body.dark-mode .jexcel > tbody > tr > td {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
    border-color: var(--cm-border-subtle) !important;
}

body.dark-mode .note-editor.note-frame {
    border-color: var(--cm-border) !important;
}

body.dark-mode .note-editor .note-toolbar {
    background-color: var(--cm-bg-subtle) !important;
    border-bottom: 1px solid var(--cm-border) !important;
}

body.dark-mode .note-editor .note-editing-area {
    background-color: var(--cm-bg-surface) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .note-editor .note-editable {
    color: var(--cm-text-main) !important;
}

/* Select2 Dark Mode Fix */
body.dark-mode .select2-container--bootstrap4 .select2-selection {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-selection__rendered {
    color: var(--cm-text-main) !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-dropdown {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border) !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-results__option {
    color: var(--cm-text-main) !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-results__option--highlighted {
    background-color: var(--cm-primary) !important;
    color: #ffffff !important;
}

/* 6. SWEETALERT2 & TOASTR DARK MODE FIX */
body.dark-mode .swal2-popup {
    background-color: var(--cm-card-bg) !important;
    color: var(--cm-text-main) !important;
    border: 1px solid var(--cm-border) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .swal2-title,
body.dark-mode .swal2-content,
body.dark-mode .swal2-html-container {
    color: var(--cm-text-main) !important;
}

/* 7. DROPIFY & FILE INPUT DARK MODE */
body.dark-mode .dropify-wrapper {
    background-color: var(--cm-bg-subtle) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .dropify-wrapper .dropify-message p {
    color: var(--cm-text-muted) !important;
}

body.dark-mode .dropify-wrapper .dropify-preview {
    background-color: var(--cm-bg-surface) !important;
}

/* 8. DATATABLES PAGINATION & INFO DARK MODE */
body.dark-mode .page-link {
    background-color: var(--cm-bg-surface) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .page-item.disabled .page-link {
    background-color: var(--cm-bg-subtle) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-muted) !important;
}

body.dark-mode .page-item.active .page-link {
    background-color: var(--cm-primary) !important;
    border-color: var(--cm-primary) !important;
    color: #ffffff !important;
}

/* 9. ALERTS & BREADCRUMB DARK MODE */
body.dark-mode .alert-default-info,
body.dark-mode .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #7dd3fc !important;
}

body.dark-mode .alert-default-danger,
body.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

body.dark-mode .alert-default-warning,
body.dark-mode .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fde68a !important;
}

body.dark-mode .alert-default-success,
body.dark-mode .alert-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

body.dark-mode .breadcrumb {
    background-color: transparent !important;
}

body.dark-mode .breadcrumb-item.active {
    color: var(--cm-text-muted) !important;
}

body.dark-mode .breadcrumb-item + .breadcrumb-item::before {
    color: var(--cm-border) !important;
}

/* 10. COMPREHENSIVE DARK MODE REFINEMENTS */
html.dark-mode,
body.dark-mode {
    color-scheme: dark !important;
}

body.dark-mode .card,
html.dark-mode .card {
    background-color: var(--cm-card-bg) !important;
    border-color: var(--cm-card-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .card-header,
html.dark-mode .card-header {
    border-bottom-color: var(--cm-card-border) !important;
}

body.dark-mode .card-footer,
html.dark-mode .card-footer {
    background-color: var(--cm-bg-subtle) !important;
    border-top-color: var(--cm-card-border) !important;
}

body.dark-mode .table,
html.dark-mode .table {
    color: var(--cm-text-main) !important;
    background-color: transparent !important;
}

body.dark-mode .table thead th,
html.dark-mode .table thead th {
    background-color: var(--cm-bg-subtle) !important;
    color: var(--cm-text-main) !important;
    border-color: var(--cm-border) !important;
}

body.dark-mode .table td,
body.dark-mode .table th,
html.dark-mode .table td,
html.dark-mode .table th {
    border-color: var(--cm-border-subtle) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd),
html.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode .table-hover tbody tr:hover,
html.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.08) !important;
}

body.dark-mode .form-control,
body.dark-mode .custom-select,
html.dark-mode .form-control,
html.dark-mode .custom-select {
    background-color: var(--cm-bg-subtle) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .custom-select:focus,
html.dark-mode .form-control:focus,
html.dark-mode .custom-select:focus {
    background-color: var(--cm-card-bg) !important;
    border-color: var(--cm-primary-light) !important;
    box-shadow: 0 0 0 3px var(--cm-primary-focus) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .form-control::placeholder,
html.dark-mode .form-control::placeholder {
    color: var(--cm-text-muted) !important;
}

body.dark-mode .input-group-text,
html.dark-mode .input-group-text {
    background-color: var(--cm-bg-subtle) !important;
    border-color: var(--cm-border) !important;
    color: var(--cm-text-muted) !important;
}

body.dark-mode .modal-content,
html.dark-mode .modal-content {
    background-color: var(--cm-card-bg) !important;
    color: var(--cm-text-main) !important;
    border: 1px solid var(--cm-border) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7) !important;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer,
html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    border-color: var(--cm-border) !important;
    background-color: var(--cm-bg-subtle) !important;
}

body.dark-mode .close,
html.dark-mode .close {
    color: var(--cm-text-muted) !important;
    text-shadow: none !important;
}

body.dark-mode .close:hover,
html.dark-mode .close:hover {
    color: var(--cm-text-main) !important;
}

body.dark-mode .dropdown-menu,
html.dark-mode .dropdown-menu {
    background-color: var(--cm-card-bg) !important;
    border: 1px solid var(--cm-border) !important;
    box-shadow: var(--cm-shadow-lg) !important;
}

body.dark-mode .dropdown-item,
html.dark-mode .dropdown-item {
    color: var(--cm-text-main) !important;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus,
html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background-color: var(--cm-bg-hover) !important;
    color: var(--cm-primary) !important;
}

body.dark-mode .dropdown-divider,
html.dark-mode .dropdown-divider {
    border-color: var(--cm-border) !important;
}

body.dark-mode .dataTables_wrapper,
html.dark-mode .dataTables_wrapper {
    color: var(--cm-text-main) !important;
}

body.dark-mode .dataTables_info,
html.dark-mode .dataTables_info {
    color: var(--cm-text-muted) !important;
}

body.dark-mode .dataTables_filter input,
body.dark-mode .dataTables_length select,
html.dark-mode .dataTables_filter input,
html.dark-mode .dataTables_length select {
    background-color: var(--cm-bg-subtle) !important;
    border: 1px solid var(--cm-border) !important;
    color: var(--cm-text-main) !important;
}

body.dark-mode .nav-tabs .nav-link,
html.dark-mode .nav-tabs .nav-link {
    color: var(--cm-text-muted) !important;
}

body.dark-mode .nav-tabs .nav-link.active,
html.dark-mode .nav-tabs .nav-link.active {
    background-color: var(--cm-card-bg) !important;
    border-color: var(--cm-border) var(--cm-border) transparent !important;
    color: var(--cm-primary) !important;
}

body.dark-mode .text-dark,
html.dark-mode .text-dark {
    color: var(--cm-text-main) !important;
}

body.dark-mode .navbar-light .navbar-nav .nav-link,
html.dark-mode .navbar-light .navbar-nav .nav-link {
    color: var(--cm-text-secondary) !important;
}
