@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

/* =========================================================
   ROOT / VARIABLES
========================================================= */

:root {
    --brand-orange: #E85D1F;
    --brand-orange-dark: #B8430A;
    --brand-orange-soft: #FDEBE0;
    --brand-gold: #F2B705;

    --ink: #2B2420;
    --ink-soft: #6B5F55;

    --paper: #FFFFFF;
    --sand: #FFF4E9;

    --line: #F0DCC5;
    --line-soft: #F4E9DD;

    --sidebar-width: 250px;

    /* Kompatibilitas kode lama */
    --lms-blue: var(--brand-orange);
    --lms-blue-dark: var(--brand-orange-dark);
    --lms-gray: #FAF7F4;
    --lms-gray-dark: var(--ink-soft);
}


/* =========================================================
   GLOBAL
========================================================= */

* {
    scrollbar-color: var(--brand-orange) var(--sand);
}

body {
    background-color: var(--lms-gray);
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--ink);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.fw-medium {
    font-family: 'Sora', 'Inter', system-ui, sans-serif;
}

a {
    color: var(--brand-orange-dark);
}

a:hover {
    color: var(--brand-orange);
}

:focus-visible {
    outline: 2px solid var(--brand-orange);
    outline-offset: 2px;
}


/* =========================================================
   BRAND RULE
========================================================= */

.brand-rule {
    height: 4px;
    background: var(--brand-orange);
    position: relative;
}

.brand-rule::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--brand-gold);
}


/* =========================================================
   NAVBAR
========================================================= */

.navbar-lms {
    background-color: var(--paper);
    padding: 0.6rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 0 var(--line-soft);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.brand-lockup img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-lockup .brand-text {
    line-height: 1.15;
}

.brand-lockup .brand-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
    display: block;
}

.brand-lockup .brand-subtitle {
    font-size: 0.7rem;
    color: var(--brand-orange-dark);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    display: block;
}

.navbar-lms .btn-link {
    color: var(--ink) !important;
}

.navbar-lms .dropdown-toggle {
    color: var(--ink) !important;
}

.navbar-lms .dropdown-toggle::after {
    color: var(--ink-soft);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar-lms {
    width: var(--sidebar-width);
    min-height: calc(100vh - 61px);
    background-color: var(--paper);
    border-right: 1px solid var(--line-soft);
    transition: margin-left 0.25s ease;
}

.sidebar-lms .text-uppercase.small {
    color: var(--ink-soft) !important;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.7rem !important;
    letter-spacing: 0.08em;
}

.nav-link-lms {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.nav-link-lms i {
    color: var(--ink-soft);
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
    transition: color 0.15s ease;
}

.nav-link-lms:hover {
    background-color: var(--brand-orange-soft);
    color: var(--brand-orange-dark);
}

.nav-link-lms:hover i {
    color: var(--brand-orange-dark);
}

.nav-link-lms.active {
    background-color: var(--brand-orange);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(232, 93, 31, 0.35);
}

.nav-link-lms.active i {
    color: #ffffff;
}


/* =========================================================
   CONTENT & FOOTER
========================================================= */

.content-lms {
    min-height: calc(100vh - 61px);
    display: flex;
    flex-direction: column;
}

.footer-lms {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--line-soft);
    background-color: var(--paper);
}


/* =========================================================
   CARD, BUTTON, BADGE
========================================================= */

.card {
    border: 1px solid var(--line-soft);
}

.btn-primary {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--brand-orange-dark) !important;
    border-color: var(--brand-orange-dark) !important;
}

.btn-outline-primary {
    color: var(--brand-orange-dark);
    border-color: var(--brand-orange);
}

.btn-outline-primary:hover {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

.text-primary {
    color: var(--brand-orange) !important;
}

.bg-primary {
    background-color: var(--brand-orange) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.2rem var(--brand-orange-soft);
}

.form-check-input:checked {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

.nav-tabs .nav-link.active {
    color: var(--brand-orange-dark);
    border-bottom: 2px solid var(--brand-orange);
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    color: var(--brand-orange-dark);
}


/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sand);

    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);

    background-size: 28px 28px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.login-card .brand-rule {
    margin: -1.5rem -1.5rem 1.5rem;
}

.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.login-card h4 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
}

.login-card .input-group-text {
    background-color: var(--sand);
    border-color: #ced4da;
    color: var(--brand-orange-dark);
}


/* =========================================================
   DASHBOARD - STAT CARD
========================================================= */

.stat-card {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 1.15rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-orange);
}

.stat-card.accent-gold::before {
    background: var(--brand-gold);
}

.stat-card.accent-danger::before {
    background: #D64545;
}

.stat-card.accent-success::before {
    background: #2F9E5B;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    background: var(--brand-orange-soft);
    color: var(--brand-orange-dark);
}

.stat-icon.gold {
    background: #FDF3D3;
    color: #A87F04;
}

.stat-icon.danger {
    background: #FBE4E4;
    color: #B12F2F;
}

.stat-icon.success {
    background: #E1F3E8;
    color: #227A47;
}

.stat-value {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.65rem;
    line-height: 1.1;
    color: var(--ink);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 0.1rem;
}


/* =========================================================
   PANEL KONTEN
========================================================= */

.panel-lms {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.panel-lms-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-lms-header h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-lms-header h6 i {
    color: var(--brand-orange);
}

.panel-lms-body {
    padding: 1.25rem;
}

.panel-lms-body.p-0 {
    padding: 0;
}


/* =========================================================
   PENGUMUMAN
========================================================= */

.announce-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line-soft);
}

.announce-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.announce-date {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--sand);
    color: var(--brand-orange-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    line-height: 1;
}

.announce-date .day {
    font-weight: 700;
    font-size: 1rem;
}

.announce-date .mon {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.announce-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ink-soft);
}

.announce-empty i {
    font-size: 1.8rem;
    color: var(--line);
    display: block;
    margin-bottom: 0.5rem;
}


/* =========================================================
   TABLE
========================================================= */

.panel-lms .table {
    margin-bottom: 0;
}

.panel-lms .table thead th {
    border-top: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-weight: 600;
    background-color: var(--sand);
}


/* =========================================================
   QUICK ACTION
========================================================= */

.quick-tile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    text-decoration: none;
    color: var(--ink);
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.quick-tile:hover {
    background-color: var(--brand-orange-soft);
    border-color: var(--brand-orange);
    color: var(--ink);
}

.quick-tile .quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--sand);
    color: var(--brand-orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-tile .quick-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.quick-tile .quick-desc {
    font-size: 0.76rem;
    color: var(--ink-soft);
}


/* =========================================================
   LOGIN PAGE V2
========================================================= */

.login-page-v2 {
    min-height: 100vh;
    display: flex;
}

.login-showcase {
    flex: 1.1;
    position: relative;
    background: linear-gradient(
        160deg,
        var(--brand-orange) 0%,
        var(--brand-orange-dark) 100%
    );
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.login-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(
            rgba(255, 255, 255, 0.14) 1.5px,
            transparent 1.5px
        );
    background-size: 22px 22px;
    opacity: 0.5;
}

.login-showcase::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(242, 183, 5, 0.18);
    right: -140px;
    bottom: -160px;
}

.login-showcase-inner {
    position: relative;
    z-index: 1;
}

.login-showcase-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 1.5rem;
}

.login-showcase h1 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.login-showcase p.lead-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    max-width: 380px;
}

.login-showcase-footer {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.25rem;
}

.login-form-side {
    flex: 1;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.login-form-wrapper .form-eyebrow {
    color: var(--brand-orange-dark);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.login-form-wrapper h4 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-form-wrapper .input-group-text {
    background-color: var(--sand);
    border-color: #ced4da;
    color: var(--brand-orange-dark);
}


/* =========================================================
   RESPONSIVE SIDEBAR
========================================================= */

@media (max-width: 767.98px) {

    .sidebar-lms {
        position: fixed;
        top: 61px;
        left: 0;
        bottom: 0;
        margin-left: calc(-1 * var(--sidebar-width));
        z-index: 1020;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    }

    .sidebar-lms.show {
        margin-left: 0;
    }

}


/* =========================================================
   RESPONSIVE LOGIN
========================================================= */

@media (max-width: 991.98px) {

    .login-showcase {
        display: none;
    }

    .login-form-side {
        flex: 1 0 100%;
    }

}


/* =========================================================
   RESPONSIVE DASHBOARD
========================================================= */

@media (max-width: 767.98px) {

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .panel-lms-header {
        padding: 0.9rem 1rem;
    }

    .panel-lms-body {
        padding: 1rem;
    }

}

/* =========================================================
   ITERASI 3 — Poles akhir: pagination, alert, modal, badge,
   tabel, form, dan halaman auth tambahan (lupa/reset password).
   Semua lewat CSS saja, tidak mengubah struktur HTML manapun.
========================================================= */

/* ===== Pagination ===== */
.pagination .page-link {
    color: var(--brand-orange-dark);
    border-color: var(--line-soft);
}

.pagination .page-item.active .page-link {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
}

.pagination .page-link:hover {
    background-color: var(--brand-orange-soft);
    color: var(--brand-orange-dark);
    border-color: var(--line);
}

.pagination .page-item.disabled .page-link {
    color: #c9beb2;
}

/* ===== Alert ===== */
.alert {
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #E9F6EE;
    border-color: #CDEBD9;
    color: #1E6B3E;
}

.alert-danger {
    background-color: #FCEAEA;
    border-color: #F5CFCF;
    color: #A32E2E;
}

.alert-info {
    background-color: var(--brand-orange-soft);
    border-color: #F6D3B8;
    color: var(--brand-orange-dark);
}

.alert-warning {
    background-color: #FDF6DC;
    border-color: #F5E7A8;
    color: #8A6D00;
}

/* ===== Badge (status pill, bukan kotak Bootstrap default) ===== */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.4em 0.75em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* ===== Modal ===== */
.modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
}

.modal-header {
    background-color: var(--sand);
    border-bottom: 1px solid var(--line-soft);
}

.modal-header .modal-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--ink);
}

/* ===== Tabel: baris lebih lega, hover halus ===== */
.table > :not(caption) > * > * {
    padding: 0.75rem 0.85rem;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--sand);
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-weight: 600;
    border-bottom-width: 1px;
}

/* ===== Empty state generik (dipakai lewat class tambahan opsional) ===== */
td.text-center.text-muted.py-4 {
    color: var(--ink-soft) !important;
    font-size: 0.88rem;
}

/* ===== Tombol: transisi halus + jarak ikon konsisten ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: filter 0.15s ease, transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    border-radius: 7px;
}

/* ===== Input group ikon (dipakai di form pencarian, dsb) ===== */
.input-group-text {
    background-color: var(--sand);
    border-color: #ced4da;
    color: var(--brand-orange-dark);
}

/* ===== Nav pills / tabs tambahan untuk halaman diskusi & profil ===== */
.nav-pills .nav-link.active {
    background-color: var(--brand-orange);
}

/* =========================================================
   HALAMAN AUTH TAMBAHAN — Lupa Password & Reset Password
   Memakai kerangka layout yang sama dengan login-page-v2,
   supaya identitas visual konsisten di seluruh alur autentikasi.
========================================================= */
.auth-side-note {
    font-size: 0.84rem;
    color: var(--ink-soft);
    background: var(--sand);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-top: 1.25rem;
}

.auth-side-note i {
    color: var(--brand-orange-dark);
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-decoration: none;
    margin-top: 1.25rem;
}

.auth-back-link:hover {
    color: var(--brand-orange-dark);
}

/* =========================================================
   ITERASI 5 — Preview file materi & pengumpulan tugas
========================================================= */

.file-tile {
    display: block;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.file-tile:hover {
    border-color: var(--brand-orange);
    color: var(--ink);
}

.file-tile:active {
    transform: scale(0.99);
}

.file-tile .pdf-preview {
    width: 100%;
    height: 190px;
    display: block;
    pointer-events: none;
    border-bottom: 1px solid var(--line-soft);
    background: var(--sand);
}

.file-tile .file-icon-block {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sand);
    border-bottom: 1px solid var(--line-soft);
}

.file-tile .file-icon-block i {
    font-size: 2.75rem;
    color: var(--brand-orange-dark);
}

.file-tile .file-tile-footer {
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.file-tile .file-tile-footer i {
    color: var(--brand-orange);
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.85rem;
    transition: border-color 0.15s ease;
}

.file-chip:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange-dark);
}

.file-chip i.file-chip-icon {
    font-size: 1.1rem;
    color: var(--brand-orange-dark);
}


/* =========================================================
   MOBILE OPTIMIZATION — LMS SMK
   Fokus: layar <= 767.98px
   Tidak mengubah struktur HTML.
========================================================= */

@media (max-width: 767.98px) {

    :root {
        --sidebar-width: 270px;
    }

    /* ---------- GLOBAL ---------- */

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 0.9rem;
    }

    .container,
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    /* ---------- NAVBAR ---------- */

    .navbar-lms {
        min-height: 61px;
        padding: 0.55rem 0.8rem;
    }

    .navbar-lms .container,
    .navbar-lms .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    .brand-lockup {
        gap: 0.45rem;
        min-width: 0;
    }

    .brand-lockup img {
        width: 34px;
        height: 34px;
    }

    .brand-lockup .brand-text {
        min-width: 0;
    }

    .brand-lockup .brand-title {
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-lockup .brand-subtitle {
        font-size: 0.58rem;
        white-space: nowrap;
    }

    /* Tombol hamburger Bootstrap / tombol menu yang sudah ada */
    .navbar-toggler {
        padding: 0.3rem 0.45rem;
        border: 1px solid var(--line);
        border-radius: 7px;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.15rem var(--brand-orange-soft);
    }

    .navbar-lms .dropdown-toggle {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-lms .dropdown-menu {
        max-width: calc(100vw - 1.5rem);
    }

    /* ---------- SIDEBAR ---------- */

    .sidebar-lms {
        width: var(--sidebar-width);
        max-width: 86vw;
        min-height: calc(100vh - 61px);
        top: 61px;
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 4px 0 18px rgba(43, 36, 32, 0.12);
    }

    .sidebar-lms .p-3 {
        padding: 0.9rem !important;
    }

    .nav-link-lms {
        min-height: 44px;
        padding: 0.68rem 0.8rem;
        font-size: 0.88rem;
    }

    /* ---------- CONTENT ---------- */

    .content-lms {
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
    }

    .content-lms > main,
    .content-lms .container,
    .content-lms .container-fluid {
        min-width: 0;
    }

    /* Judul halaman */
    .content-lms h1 {
        font-size: 1.35rem;
    }

    .content-lms h2 {
        font-size: 1.2rem;
    }

    .content-lms h3 {
        font-size: 1.1rem;
    }

    .content-lms h4 {
        font-size: 1rem;
    }

    .content-lms h5,
    .content-lms h6 {
        font-size: 0.92rem;
    }

    /* ---------- FOOTER ---------- */

    .footer-lms {
        padding: 0.85rem;
        font-size: 0.78rem;
        text-align: center;
    }

    /* ---------- CARD ---------- */

    .card {
        border-radius: 10px;
    }

    .card-body {
        padding: 0.95rem;
    }

    /* ---------- BUTTON ---------- */

    .btn {
        min-height: 38px;
    }

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

    /* Tombol dalam area aksi tidak terlalu sempit */
    .btn-group {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* ---------- STAT CARD ---------- */

    .stat-card {
        padding: 0.9rem;
        gap: 0.75rem;
        border-radius: 10px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 9px;
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.72rem;
        line-height: 1.3;
    }

    /* ---------- PANEL ---------- */

    .panel-lms {
        border-radius: 10px;
    }

    .panel-lms-header {
        padding: 0.8rem 0.9rem;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .panel-lms-header h6 {
        font-size: 0.88rem;
    }

    .panel-lms-body {
        padding: 0.9rem;
    }

    /* Jika header memiliki tombol aksi */
    .panel-lms-header .btn {
        font-size: 0.78rem;
    }

    /* ---------- TABLE ---------- */

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 620px;
        font-size: 0.8rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.65rem 0.7rem;
        white-space: nowrap;
    }

    .panel-lms .table thead th,
    .table thead th {
        font-size: 0.68rem;
    }

    /* ---------- FORM ---------- */

    .form-control,
    .form-select {
        min-height: 40px;
        font-size: 0.88rem;
    }

    textarea.form-control {
        min-height: 100px;
    }

    .input-group-text {
        min-width: 40px;
        justify-content: center;
    }

    .form-label {
        font-size: 0.84rem;
        margin-bottom: 0.35rem;
    }

    /* ---------- QUICK ACTION ---------- */

    .quick-tile {
        min-height: 62px;
        padding: 0.7rem 0.8rem;
        gap: 0.7rem;
    }

    .quick-tile .quick-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .quick-tile .quick-title {
        font-size: 0.82rem;
    }

    .quick-tile .quick-desc {
        font-size: 0.7rem;
        line-height: 1.25;
    }

    /* ---------- ANNOUNCEMENT ---------- */

    .announce-item {
        gap: 0.65rem;
        padding: 0.7rem 0;
    }

    .announce-date {
        width: 42px;
        height: 42px;
        border-radius: 9px;
    }

    .announce-date .day {
        font-size: 0.9rem;
    }

    .announce-date .mon {
        font-size: 0.58rem;
    }

    /* ---------- PAGINATION ---------- */

    .pagination {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .pagination .page-link {
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    /* ---------- ALERT ---------- */

    .alert {
        padding: 0.75rem 0.85rem;
        font-size: 0.8rem;
    }

    /* ---------- MODAL ---------- */

    .modal-dialog {
        margin: 0.65rem;
        max-width: none;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.8rem 0.9rem;
    }

    .modal-body {
        padding: 0.9rem;
    }

    .modal-footer {
        padding: 0.75rem 0.9rem;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }

    /* ---------- FILE PREVIEW ---------- */

    .file-tile .pdf-preview {
        height: 160px;
    }

    .file-tile .file-icon-block {
        height: 100px;
    }

    .file-tile .file-icon-block i {
        font-size: 2.2rem;
    }

    .file-tile .file-tile-footer {
        padding: 0.55rem 0.7rem;
        font-size: 0.76rem;
    }

    .file-chip {
        max-width: 100%;
        font-size: 0.78rem;
    }

    /* ---------- LOGIN ---------- */

    .login-wrapper {
        max-width: 100%;
        padding: 0.75rem;
    }

    .login-card {
        border-radius: 12px;
    }

    .login-card .card-body {
        padding: 1.1rem !important;
    }

    .login-logo {
        width: 62px;
        height: 62px;
    }

    .login-card h4 {
        font-size: 1.05rem;
    }

    /* Login V2 */
    .login-page-v2 {
        min-height: 100svh;
    }

    .login-form-side {
        min-height: 100svh;
        padding: 1.25rem 0.9rem;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .login-form-wrapper h4 {
        font-size: 1.25rem;
        margin-bottom: 1.15rem;
    }

    .login-form-wrapper .form-eyebrow {
        font-size: 0.65rem;
    }

    .auth-side-note {
        font-size: 0.76rem;
        padding: 0.7rem 0.8rem;
    }

    /* ---------- TABS ---------- */

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.55rem 0.7rem;
    }

    .nav-pills {
        gap: 0.25rem;
    }

    .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.7rem;
    }

    /* ---------- BADGE ---------- */

    .badge {
        font-size: 0.65rem;
        padding: 0.38em 0.65em;
    }

    /* ---------- UTILITIES ---------- */

    .text-truncate-mobile {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Mencegah gambar/video keluar layar */
    img,
    video,
    iframe {
        max-width: 100%;
    }

    /* ---------- SIDEBAR MOBILE OVERLAY ---------- */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* =========================================================
   EXTRA SMALL PHONE — <= 575.98px
========================================================= */

@media (max-width: 575.98px) {

    .container,
    .container-fluid {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .navbar-lms {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .brand-lockup .brand-title {
        font-size: 0.72rem;
    }

    .brand-lockup .brand-subtitle {
        font-size: 0.54rem;
    }

    .content-lms {
        padding-bottom: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.15rem;
    }

    .stat-label {
        font-size: 0.68rem;
    }

    .panel-lms-header {
        gap: 0.5rem;
    }

    .panel-lms-header .btn {
        width: 100%;
    }

    .quick-tile {
        padding: 0.65rem;
    }

    .quick-tile .quick-desc {
        display: none;
    }

    .modal-dialog {
        margin: 0.4rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        font-size: 0.72rem;
    }
}

/* =========================================================
   LANDSCAPE PHONE
========================================================= */

@media (max-width: 767.98px) and (orientation: landscape) {

    .sidebar-lms {
        max-height: calc(100svh - 61px);
    }

    .login-form-side {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}


/* =========================================================
   MOBILE TABLE — TANPA HORIZONTAL SCROLL
   Tabel dipaksa mengikuti lebar layar dan isi boleh wrapping.
========================================================= */

@media (max-width: 767.98px) {

    /* Hilangkan perilaku scroll horizontal dari tabel */
    .table-responsive {
        overflow-x: visible !important;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
    }

    .table-responsive > .table,
    .table-responsive > table,
    .panel-lms .table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        table-layout: fixed;
        margin-bottom: 0;
    }

    /* Header dan isi tabel boleh mengecil + membungkus teks */
    .table > :not(caption) > * > *,
    .panel-lms .table > :not(caption) > * > * {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        vertical-align: middle;
        padding: 0.55rem 0.45rem;
        font-size: 0.72rem;
    }

    .table thead th,
    .panel-lms .table thead th {
        font-size: 0.62rem;
        line-height: 1.25;
        white-space: normal !important;
    }

    .table tbody td {
        line-height: 1.35;
    }

    /* Kolom nomor biasanya dibuat sempit */
    .table th:first-child,
    .table td:first-child {
        width: 8%;
        text-align: center;
    }

    /* Kolom aksi tidak terlalu lebar */
    .table th:last-child,
    .table td:last-child {
        width: auto;
    }

    /* Tombol aksi di dalam tabel dapat turun ke baris berikutnya */
    .table td .btn-group,
    .table td .d-flex {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .table td .btn {
        white-space: normal;
        min-height: 32px;
        padding: 0.3rem 0.45rem;
        font-size: 0.68rem;
    }

    /* Badge tidak memaksa tabel melebar */
    .table .badge {
        display: inline-block;
        max-width: 100%;
        white-space: normal;
        line-height: 1.2;
    }

    /* Link/judul panjang tidak menyebabkan overflow */
    .table a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Input/select di dalam tabel tetap muat */
    .table .form-control,
    .table .form-select {
        width: 100%;
        min-width: 0;
        font-size: 0.72rem;
        padding: 0.35rem 0.45rem;
    }

    /* Tampilan baris lebih lega */
    .table-hover > tbody > tr:hover > * {
        background-color: var(--sand);
    }
}

/* HP sangat kecil */
@media (max-width: 575.98px) {

    .table > :not(caption) > * > *,
    .panel-lms .table > :not(caption) > * > * {
        padding: 0.45rem 0.3rem;
        font-size: 0.67rem;
    }

    .table thead th,
    .panel-lms .table thead th {
        font-size: 0.57rem;
    }

    .table td .btn {
        font-size: 0.62rem;
        padding: 0.25rem 0.35rem;
        min-height: 30px;
    }
}


/* =========================================================
   MOBILE TABLE → CARD
   Setiap baris tabel berubah menjadi kartu.
   Tulisan tetap besar dan nyaman dibaca.
========================================================= */

@media (max-width: 767.98px) {

    .table-responsive {
        overflow: visible !important;
        border: 0 !important;
    }

    /* Jangan gunakan table layout biasa di mobile */
    .table-responsive > table,
    .panel-lms .table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border: 0 !important;
    }

    /* Header disembunyikan karena informasi akan ditampilkan
       sebagai label di setiap card */
    .table-responsive > table > thead,
    .panel-lms .table > thead {
        display: none !important;
    }

    .table-responsive > table > tbody,
    .panel-lms .table > tbody {
        display: block !important;
        width: 100%;
    }

    /* SATU BARIS = SATU CARD */
    .table-responsive > table > tbody > tr,
    .panel-lms .table > tbody > tr {
        display: block !important;
        width: 100%;
        margin-bottom: 0.85rem;
        padding: 0.85rem;
        background: var(--paper);
        border: 1px solid var(--line-soft) !important;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(43, 36, 32, 0.06);
    }

    .table-responsive > table > tbody > tr:hover,
    .panel-lms .table > tbody > tr:hover {
        background: var(--paper) !important;
    }

    /* SETIAP CELL menjadi baris informasi */
    .table-responsive > table > tbody > tr > td,
    .panel-lms .table > tbody > tr > td {
        display: grid !important;
        grid-template-columns: minmax(82px, 32%) 1fr;
        gap: 0.65rem;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0.55rem 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--line-soft) !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 0.86rem !important;
        line-height: 1.45;
        text-align: left !important;
        vertical-align: middle;
    }

    .table-responsive > table > tbody > tr > td:last-child,
    .panel-lms .table > tbody > tr > td:last-child {
        border-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Label kiri */
    .table-responsive > table > tbody > tr > td::before,
    .panel-lms .table > tbody > tr > td::before {
        content: attr(data-label);
        color: var(--ink-soft);
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.35;
    }

    /* Jika HTML belum punya data-label,
       gunakan label umum berdasarkan urutan kolom */
    .table-responsive > table > tbody > tr > td:nth-child(1)::before,
    .panel-lms .table > tbody > tr > td:nth-child(1)::before {
        content: "No";
    }

    .table-responsive > table > tbody > tr > td:nth-child(2)::before,
    .panel-lms .table > tbody > tr > td:nth-child(2)::before {
        content: "Data";
    }

    .table-responsive > table > tbody > tr > td:nth-child(3)::before,
    .panel-lms .table > tbody > tr > td:nth-child(3)::before {
        content: "Keterangan";
    }

    .table-responsive > table > tbody > tr > td:nth-child(4)::before,
    .panel-lms .table > tbody > tr > td:nth-child(4)::before {
        content: "Status";
    }

    .table-responsive > table > tbody > tr > td:nth-child(5)::before,
    .panel-lms .table > tbody > tr > td:nth-child(5)::before {
        content: "Aksi";
    }

    .table-responsive > table > tbody > tr > td:nth-child(n+6)::before,
    .panel-lms .table > tbody > tr > td:nth-child(n+6)::before {
        content: "Info";
    }

    /* Kolom pertama dibuat sebagai identitas card */
    .table-responsive > table > tbody > tr > td:first-child,
    .panel-lms .table > tbody > tr > td:first-child {
        padding-top: 0 !important;
        font-weight: 600;
    }

    /* Link tetap mudah dibaca */
    .table-responsive > table > tbody > tr > td a,
    .panel-lms .table > tbody > tr > td a {
        font-size: 0.86rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Badge */
    .table-responsive > table > tbody > tr > td .badge,
    .panel-lms .table > tbody > tr > td .badge {
        justify-self: start;
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        font-size: 0.72rem;
    }

    /* Tombol aksi */
    .table-responsive > table > tbody > tr > td:last-child,
    .panel-lms .table > tbody > tr > td:last-child {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
    }

    .table-responsive > table > tbody > tr > td:last-child::before,
    .panel-lms .table > tbody > tr > td:last-child::before {
        width: 100%;
        flex-basis: 100%;
        margin-bottom: 0.1rem;
    }

    .table-responsive > table > tbody > tr > td .btn,
    .panel-lms .table > tbody > tr > td .btn {
        min-height: 36px;
        padding: 0.4rem 0.65rem;
        font-size: 0.76rem;
        white-space: normal;
    }

    /* Empty state */
    .table-responsive > table > tbody > tr > td[colspan],
    .panel-lms .table > tbody > tr > td[colspan] {
        display: block !important;
        text-align: center !important;
        padding: 1.2rem 0.5rem !important;
    }

    .table-responsive > table > tbody > tr > td[colspan]::before,
    .panel-lms .table > tbody > tr > td[colspan]::before {
        display: none;
    }
}

/* =========================================================
   MOBILE CARD — LAYAR SANGAT KECIL
========================================================= */

@media (max-width: 575.98px) {

    .table-responsive > table > tbody > tr,
    .panel-lms .table > tbody > tr {
        padding: 0.75rem;
        margin-bottom: 0.7rem;
        border-radius: 11px;
    }

    .table-responsive > table > tbody > tr > td,
    .panel-lms .table > tbody > tr > td {
        grid-template-columns: minmax(72px, 30%) 1fr;
        gap: 0.5rem;
        font-size: 0.82rem !important;
        padding: 0.5rem 0 !important;
    }

    .table-responsive > table > tbody > tr > td::before,
    .panel-lms .table > tbody > tr > td::before {
        font-size: 0.68rem;
    }

    .table-responsive > table > tbody > tr > td a,
    .panel-lms .table > tbody > tr > td a {
        font-size: 0.82rem;
    }

    .table-responsive > table > tbody > tr > td .btn,
    .panel-lms .table > tbody > tr > td .btn {
        min-height: 34px;
        font-size: 0.72rem;
        padding: 0.35rem 0.55rem;
    }
}