:root {
    --lms-primary: #2563eb;
    --lms-primary-dark: #1d4ed8;
    --lms-primary-light: #eff6ff;
    --lms-secondary: #64748b;
    --lms-success: #10b981;
    --lms-warning: #f59e0b;
    --lms-danger: #ef4444;
    --lms-info: #06b6d4;
    --lms-bg: #f8fafc;
    --lms-card-bg: #ffffff;
    --lms-sidebar-bg: #0f172a;
    --lms-sidebar-color: #94a3b8;
    --lms-sidebar-active: #ffffff;
    --lms-sidebar-active-bg: #1e293b;
    --lms-border: #e2e8f0;
    --lms-font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--lms-font);
    background-color: var(--lms-bg);
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative !important;
    touch-action: pan-y pinch-zoom;
    margin: 0;
    padding: 0;
}

#lms-app-layout {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--lms-font);
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #0f172a;
}

/* Fast Touch Response */
a, button, .btn, .nav-link, .dropdown-item {
    touch-action: manipulation;
}

/* ========================================================================= */
/* SIDEBAR & BACKDROP STYLING (HARDWARE ACCELERATED)                         */
/* ========================================================================= */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s ease;
    pointer-events: none;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#sidebar-wrapper {
    min-height: 100vh;
    height: 100%;
    width: 255px;
    max-width: 82vw;
    background-color: var(--lms-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    touch-action: pan-y;
}

#sidebar-wrapper::-webkit-scrollbar {
    width: 4px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#sidebar-wrapper .sidebar-brand {
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

#sidebar-wrapper .nav-link {
    color: var(--lms-sidebar-color);
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    margin: 0.08rem 0.45rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    line-height: 1.35;
    transition: all 0.15s ease;
}

#sidebar-wrapper .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

#sidebar-wrapper .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

#sidebar-wrapper .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.sidebar-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0.6rem 0.85rem 0.25rem;
    font-weight: 700;
}

/* Page Content Wrapper */
#page-content-wrapper {
    margin-left: 255px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.28s ease;
    width: calc(100% - 255px);
    max-width: calc(100% - 255px);
    overflow-x: hidden !important;
}

/* Mobile & Tablet Sidebar Transformations */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        transform: translate3d(-105%, 0, 0);
        box-shadow: none !important;
    }
    #sidebar-wrapper.toggled {
        transform: translate3d(0, 0, 0);
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.45) !important;
    }
    #page-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ========================================================================= */
/* NAVBAR & CARDS                                                            */
/* ========================================================================= */
.lms-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--lms-border);
    padding: 0.65rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.navbar .dropdown-menu {
    z-index: 1060 !important;
}

.card {
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.card-hover {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

.stat-icon {
    transition: transform 0.2s ease;
}

.card-hover:hover .stat-icon {
    transform: scale(1.08);
}

/* Modern Pill Buttons & Gradients */
.btn {
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.18s ease;
}

.btn-white {
    background-color: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

.btn-white:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.35);
}

.btn-outline-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.btn-outline-success {
    color: #059669;
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-outline-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.25);
    transform: translateY(-1px);
}

/* Notification Dropdown & Menus */
.dropdown-menu {
    max-width: calc(100vw - 1.5rem) !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.notification-menu {
    width: 320px;
    max-width: calc(100vw - 1.5rem) !important;
    max-height: 420px;
    overflow-y: auto;
    right: 0 !important;
    left: auto !important;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--lms-border);
    transition: background-color 0.15s ease;
    text-decoration: none;
    display: block;
}

.notification-item.unread {
    background-color: #eff6ff;
}

.notification-item:hover {
    background-color: #f1f5f9;
}

/* Modern Tables & Responsive Touch Scrolling */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: block;
}

.table {
    margin-bottom: 0;
    max-width: 100%;
}

.table th {
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
    border-bottom: 1.5px solid var(--lms-border);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.88rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* DataTables Styling */
.dataTables_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.35rem 1.8rem 0.35rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 0.5rem;
    border: 1px solid var(--lms-border);
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.35rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 0.5rem;
    border: 1px solid var(--lms-border);
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.82rem;
    padding-top: 0.75rem;
}

/* Sticky Action Bar */
.sticky-action-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--lms-border);
    padding: 0.75rem 1.5rem;
    z-index: 1020;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* PDF Viewer Containers */
.pdf-embed-wrapper {
    background-color: #1e293b;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    transition: background-color 0.25s ease;
}

.pdf-embed-frame {
    transition: filter 0.3s ease, background-color 0.3s ease;
}

/* ========================================================================= */
/* MOBILE SPECIFIC FINE-TUNING (PERFORMANCE & ZERO HORIZONTAL SHAKE)         */
/* ========================================================================= */
.dataTables_wrapper {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.dataTables_wrapper .dataTables_filter input {
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.dataTables_wrapper .dataTables_length select {
    display: inline-block !important;
    width: auto !important;
    min-width: 4.8rem !important;
    padding: 0.32rem 1.85rem 0.32rem 0.75rem !important;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    outline: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.dataTables_wrapper .dataTables_info {
    font-size: 0.8rem;
    color: #64748b;
    padding-top: 0.75rem;
}
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.5rem;
}
.dataTables_wrapper .dataTables_paginate .pagination {
    margin-bottom: 0;
    gap: 3px;
    flex-wrap: wrap;
}
.dataTables_wrapper .dataTables_paginate .page-link {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    color: #334155;
    font-weight: 500;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    .row {
        margin-left: -0.375rem !important;
        margin-right: -0.375rem !important;
    }
    .row > * {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
        max-width: 100% !important;
    }
    .lms-navbar {
        padding: 0.5rem 0.75rem;
    }
    .notification-menu {
        width: 290px;
        right: 0 !important;
        left: auto !important;
    }
    .card {
        border-radius: 0.85rem;
    }
    .table td, .table th {
        padding: 0.6rem 0.75rem;
    }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: left;
        margin-bottom: 0.5rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100% - 1rem) !important;
    }
}

@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    h4, .h4 {
        font-size: 1.15rem;
    }
    h5, .h5 {
        font-size: 1.02rem;
    }
}

/* ========================================================================= */
/* CBT EXAM INTERACTIVE OPTIONS STYLING                                      */
/* ========================================================================= */
.cbt-option-label {
    cursor: pointer;
    background-color: #ffffff;
    border: 1.5px solid #dee2e6 !important;
    transition: all 0.15s ease-in-out;
}

.cbt-option-label:hover {
    background-color: #f8fafc;
    border-color: #94a3b8 !important;
}

/* Blok warna hijau penuh dari kiri ke kanan ketika jawaban terpilih */
.cbt-option-input:checked + .cbt-option-label {
    background-color: #dcfce7 !important; /* Blok warna hijau */
    border-color: #16a34a !important;     /* Garis tepi hijau tegas */
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25) !important;
}

.cbt-option-input:checked + .cbt-option-label .cbt-badge-letter,
.cbt-option-input:checked + .cbt-option-label .badge {
    background-color: #16a34a !important; /* Huruf opsi jadi hijau solid */
    color: #ffffff !important;
    border-color: #16a34a !important;
    font-weight: 700;
}

.cbt-option-input:checked + .cbt-option-label .cbt-text-content,
.cbt-option-input:checked + .cbt-option-label span.fs-6 {
    color: #14532d !important;            /* Teks terbaca jelas & tegas */
    font-weight: 600;
}

.cbt-number-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 3px;
    font-weight: 600;
    border-radius: 0.6rem;
}
