body {
    background: #f4f7fb;
    color: #172033;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

a { text-decoration: none; }

img, iframe, table {
    max-width: 100%;
}

.app-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--warna-sidebar);
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    margin-bottom: 24px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff;
    color: var(--warna-sidebar);
    font-size: 13px;
}

.brand-mark-gambar {
    background: #fff;
    overflow: hidden;
}

.brand-mark-gambar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.logo-login-lms {
    width: 86px;
    height: 86px;
    object-fit: contain;
    display: block;
    margin-bottom: 14px;
}

.brand-beranda-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
}

.sidebar-user {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.07);
    border-radius: 8px;
    color: #fff;
    margin-bottom: 18px;
    padding: 12px;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-user-label,
.sidebar-user-role {
    color: rgba(255,255,255,.66);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar-user strong {
    display: block;
    font-size: 15px;
    line-height: 1.25;
    margin: 3px 0;
    overflow-wrap: anywhere;
}

.avatar-profil {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    flex: 0 0 auto;
}

.avatar-profil img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-profil-sidebar {
    width: 42px;
    height: 42px;
}

.avatar-profil-besar {
    width: 96px;
    height: 96px;
    background: #f8fafc;
    border-color: #cbd5e1;
    margin-bottom: 14px;
}

.kartu-foto-profil {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    background: #f8fbff;
    position: sticky;
    top: 18px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.82);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.11);
}

.menu-kategori {
    margin-top: 10px;
}

.menu-kategori-label {
    color: rgba(255,255,255,.56);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 10px 12px 6px;
    text-transform: uppercase;
}

.menu-kategori-label svg {
    width: 14px;
    height: 14px;
}

.sidebar .nav-link-anak {
    padding-left: 26px;
}

.sidebar svg, .btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.konten {
    padding: 24px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 26px;
    margin: 0;
    font-weight: 800;
}

.teks-kecil {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kartu {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(31, 45, 61, .06);
    padding: 18px;
    min-width: 0;
}

.akses-cepat-dashboard {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    text-align: left;
}

.akses-cepat-dashboard > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.akses-cepat-dashboard .badge {
    flex: 0 0 auto;
}

.akses-cepat-dashboard.active {
    background: #0d6efd;
    color: #fff;
}

.item-dashboard-baru:last-child {
    border-bottom: 0 !important;
}

.kotak-status-integrasi,
.panduan-telegram-profil,
.kotak-notifikasi-profil {
    border: 1px solid #d7e1ee;
    background: #f7fbff;
    border-radius: 8px;
    padding: 14px 16px;
}

.kotak-notifikasi-profil {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.telegram-switch-profil {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
}

.telegram-switch-profil .form-check-input {
    flex: 0 0 auto;
    margin-left: 0;
}

.telegram-switch-profil small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.kotak-status-integrasi {
    display: grid;
    gap: 3px;
}

.kotak-status-integrasi strong {
    color: #0f172a;
}

.kotak-status-integrasi span {
    color: #1f2a44;
}

.kotak-status-integrasi p,
.panduan-telegram-profil p,
.kotak-notifikasi-profil p {
    color: #475569;
    margin: 0;
}

.form-terkelompok {
    display: grid;
    gap: 16px;
}

.kelompok-form {
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    padding: 16px;
}

.kelompok-form-header {
    border-bottom: 1px solid #edf1f6;
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.kelompok-form-header h3 {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 3px;
}

.kelompok-form-header p {
    color: #667085;
    font-size: 13px;
    margin: 0;
}

.konten-pengumuman {
    line-height: 1.7;
}

.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
    border-color: #d6deea;
    border-radius: 8px;
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple {
    padding: 2px 6px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #eef5ff;
    border-color: #cfe0ff;
    border-radius: 6px;
    color: #172033;
    padding: 2px 8px;
}

.kartu-stat {
    min-height: 116px;
}

.kartu-stat .angka {
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
}

.btn-primary {
    background: var(--warna-utama);
    border-color: var(--warna-utama);
}

.ruang-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.topik-kelas {
    border: 1px solid #e7edf5;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
    background: #fff;
}

.topik-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e7edf5;
}

.topik-header h4 {
    font-size: 18px;
    margin: 6px 0 0;
}

.aktivitas-kelas {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    position: relative;
}

.aktivitas-kelas::before {
    content: "";
    position: absolute;
    left: 28px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: #dce6f1;
}

.aktivitas-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    margin: 0 12px;
    min-width: 0;
    position: relative;
    background: #fff;
}

.aktivitas-item > div {
    min-width: 0;
}

.aktivitas-resource {
    border-color: #dce6f1;
    box-shadow: 0 4px 14px rgba(31, 45, 61, .04);
}

.aktivitas-komponen {
    margin-left: 48px;
    background: #fbfdff;
}

.aktivitas-komponen::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 24px;
    width: 22px;
    height: 2px;
    background: #dce6f1;
}

.aktivitas-tugas {
    border-left: 3px solid #2563eb;
}

.komponen-belum-dibuka {
    background: #fff8eb;
    border-color: #f7c66a;
}

.komponen-belum-dibuka strong {
    font-weight: 800;
}

.tombol-dengan-badge {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.indikator-baru {
    font-size: 11px;
    min-width: 20px;
}

.baris-belum-dibuka {
    background: #fff8eb;
}

.baris-belum-dibuka td {
    font-weight: 600;
}

.baris-belum-dibuka .small,
.baris-belum-dibuka .text-muted,
.baris-belum-dibuka input {
    font-weight: 400;
}

.aktivitas-kuis {
    border-left: 3px solid #0f9f6e;
}

.aktivitas-item svg {
    width: 18px;
    height: 18px;
    color: var(--warna-utama);
    flex: 0 0 auto;
    margin-top: 2px;
    background: #fff;
    position: relative;
    z-index: 1;
}

.jawaban-pengumpulan {
    min-width: 260px;
}

.lampiran-pengumpulan {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px;
}

.lampiran-item {
    align-items: center;
    border-top: 1px solid #edf2f7;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.lampiran-item:first-of-type {
    border-top: 0;
}

.lampiran-nama {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.live-frame {
    align-items: center;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 520px;
    overflow: hidden;
    padding: 16px;
}

.live-canvas-wrap {
    align-items: center;
    display: flex;
    height: 520px;
    justify-content: center;
    max-width: 100%;
    width: 100%;
}

.live-canvas-wrap canvas {
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .18);
    max-height: 100%;
    max-width: 100%;
    pointer-events: none;
    user-select: none;
}

.blok-dinamis-nonaktif,
.blok-dinamis-terkunci {
    opacity: .48;
}

.blok-dinamis-nonaktif {
    filter: grayscale(.25);
}

[data-aktif-dinamis="ya"] {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

[data-aktif-dinamis="ya"] .form-control,
[data-aktif-dinamis="ya"] .form-select,
[data-aktif-dinamis="ya"] .form-check-input,
[data-aktif-dinamis="ya"] .select2-container {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.blok-dinamis-nonaktif .select2-container--default .select2-selection--single,
.blok-dinamis-terkunci .select2-container--default .select2-selection--single {
    background-color: #e9ecef;
}

.blok-dinamis-nonaktif .select2-container,
.select2-container--disabled {
    pointer-events: none;
}

.blok-selalu-aktif {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.blok-selalu-aktif .ck-editor__editable {
    min-height: 120px;
    background: #fff;
}

.blok-selalu-aktif .ck-editor,
.blok-selalu-aktif .ck-editor__top,
.blok-selalu-aktif .ck-editor__main,
.blok-selalu-aktif .ck-editor__editable,
.editor-penugasan + .ck-editor,
.blok-selalu-aktif .cke,
.blok-selalu-aktif .cke_inner,
.blok-selalu-aktif .cke_wysiwyg_frame,
.blok-selalu-aktif .cke_wysiwyg_div {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.blok-selalu-aktif .cke_wysiwyg_frame,
.blok-selalu-aktif .cke_wysiwyg_div {
    background: #fff !important;
}

.cke_notifications_area,
.cke_notification,
.cke_notification_warning {
    display: none !important;
}

.textarea-penugasan {
    min-height: 140px;
    resize: vertical;
    background: #fff !important;
    color: #0f172a !important;
    pointer-events: auto !important;
}

.beranda {
    min-height: 100vh;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 52%, #ecfdf5 100%);
}

.hero {
    padding: 72px 0 48px;
}

.hero h1 {
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 850;
    line-height: 1.05;
}

.hero-panel {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 18px 50px rgba(31, 45, 61, .08);
}

.hero-gambar-wrap {
    width: 100%;
    height: var(--tinggi-gambar-hero, 360px);
    min-height: 180px;
    position: relative;
    border-radius: 8px;
    border: 1px solid #e7edf5;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 18px 50px rgba(31, 45, 61, .08);
    overflow: hidden;
}

.hero-gambar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: var(--mode-gambar-hero, contain);
    object-position: var(--posisi-gambar-hero, center center);
    display: block;
    transform: scale(var(--skala-gambar-hero, 1));
}

.stat-beranda {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 520px;
}

.stat-beranda div {
    background: rgba(255, 255, 255, .78);
    border: 1px solid #e7edf5;
    border-radius: 8px;
    padding: 12px;
}

.stat-beranda strong {
    display: block;
    font-size: 24px;
    line-height: 1;
}

.stat-beranda span {
    color: #64748b;
    font-size: 13px;
}

.form-control, .form-select, .select2-container .select2-selection--single {
    border-radius: 8px;
}

.form-control, .form-select, .select2-container {
    max-width: 100%;
}

.input-group {
    min-width: 0;
}

.input-group .form-control {
    min-width: 0;
}

.btn {
    white-space: normal;
}

.table-responsive {
    border-radius: 8px;
}

.dataTables_wrapper,
.dt-container {
    width: 100%;
    overflow-x: auto;
}

.ck-editor,
.ck-editor__main,
.ck-content {
    max-width: 100%;
}

.table thead th {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
}

@media (max-width: 1200px) {
    .app-shell {
        grid-template-columns: 240px 1fr;
    }

    .konten {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
        padding: 14px 12px;
        overflow-x: auto;
        overflow-y: visible;
    }
    .brand {
        margin-bottom: 12px;
    }
    .sidebar-user {
        margin-bottom: 12px;
    }
    .sidebar .nav {
        display: flex;
        flex-direction: row !important;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }
    .menu-kategori {
        display: flex;
        flex: 0 0 auto;
        gap: 8px;
        margin-top: 0;
    }
    .menu-kategori-label {
        display: none;
    }
    .sidebar .nav-link,
    .sidebar .nav-link-anak {
        flex: 0 0 auto;
        padding: 9px 11px;
        border: 1px solid rgba(255,255,255,.14);
        background: rgba(255,255,255,.06);
        white-space: nowrap;
    }
    .konten {
        padding: 16px;
    }
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .topbar > .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }
    .topbar h1 {
        font-size: 22px;
    }
    .ruang-hero,
    .topik-header {
        flex-direction: column;
    }
    .ruang-hero .d-flex,
    .topik-header .d-flex,
    .kartu .d-flex {
        flex-wrap: wrap;
    }
    .stat-beranda {
        grid-template-columns: 1fr;
    }
    .live-frame,
    .live-frame iframe {
        min-height: 360px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    .konten {
        padding: 12px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .topbar {
        margin-bottom: 14px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar .btn,
    .topbar .badge {
        font-size: 12px;
    }

    .kartu {
        padding: 14px;
        box-shadow: 0 8px 20px rgba(31, 45, 61, .05);
    }

    .kartu-stat .angka {
        font-size: 26px;
    }

    .row.g-3 {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }

    .btn {
        min-height: 38px;
    }

    .btn-sm {
        min-height: 34px;
    }

    .d-flex.gap-2,
    .d-flex.gap-3 {
        gap: .45rem !important;
    }

    .aktivitas-item {
        align-items: flex-start;
        margin-left: 8px;
        margin-right: 8px;
    }

    .aktivitas-kelas::before {
        left: 22px;
    }

    .aktivitas-komponen {
        margin-left: 30px;
    }

    .aktivitas-komponen::before {
        left: -16px;
        width: 16px;
    }

    .aktivitas-item .btn,
    .topik-header .btn,
    .ruang-hero .btn {
        width: 100%;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group > .form-control {
        flex-basis: calc(100% - 54px);
    }

    .input-group .btn {
        width: 100%;
        margin-top: 6px;
        border-radius: 8px !important;
    }

    .modal-dialog {
        margin: .75rem;
    }

    .hero {
        padding: 42px 0 28px;
    }

    .hero-panel {
        padding: 16px;
    }

    .hero-gambar-wrap {
        height: min(var(--tinggi-gambar-hero, 360px), 320px);
    }

.live-frame,
.live-canvas-wrap {
    min-height: 280px;
    height: 280px;
}
}

.file-preview-body {
    overflow: auto;
    max-height: 78vh;
    background: #f8fafc;
}

.file-preview-kanvas {
    min-height: 180px;
    transition: transform .15s ease, width .15s ease;
}

.file-preview-kanvas iframe {
    background: #fff;
}
