:root {
    --primary-color: #3a3ab9;
    --primary-gradient: linear-gradient(135deg,
            #3a3ab9 0%,
            #2f2f9a 100%);
    --white-color: #ffffff;
    --form-height: 40px;
    --form-font-size: 13px;
    --form-line-height: 1.2;
}


/* =========================
   PANEL HEADER
========================= */
.panel-header {
    background: var(--primary-gradient);
}


.panel-header-sm {
    height: 120px;
}

/* =========================
   SIDEBAR
========================= */
.sidebar,
.sidebar .logo,
.sidebar .sidebar-wrapper {
    background: var(--primary-color);
}

.sidebar .logo {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.sidebar .logo a {
    color: var(--white-color) !important;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* =========================
   MAIN MENU
========================= */
.sidebar .nav li>a {
    color: var(--white-color);
    opacity: 0.82;
    border-radius: 8px;
    margin: 4px 10px;
    padding: 10px 14px;
    transition: all 0.25s ease;
}

.sidebar .nav li>a:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

/* =========================
   ACTIVE MENU
========================= */
.sidebar .nav li.active>a {
    background: linear-gradient(135deg,
            #ffffff,
            #ededff);
    color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(58, 58, 185, 0.35);
}

.sidebar .nav li.active>a i {
    color: var(--primary-color);
}

/* =========================
   SUB MENU
========================= */
.nav-sub {
    margin-top: 6px;
    padding-left: 22px;
}

.nav-sub .nav-link {
    font-size: 13px;
    color: var(--white-color);
    opacity: 0.7;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-sub .nav-link:hover {
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.15);
}

.nav-sub .nav-item.active>.nav-link {
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 3px 10px rgba(58, 58, 185, 0.25);
}

/* =========================
   CARET
========================= */
.sidebar .caret {
    border-top-color: var(--white-color);
    opacity: 0.7;
}

/* =========================
   BUTTON
========================= */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-color);
    box-shadow: 0 4px 12px rgba(58, 58, 185, 0.35);
}

.btn-primary:hover {
    background: #2f2f9a;
    border-color: #2f2f9a;
    box-shadow: 0 4px 14px rgba(58, 58, 185, 0.45);
}

/* =========================
   NAVBAR TOP
========================= */
.navbar {
    background: var(--white-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
}

/* =========================
   MAIN PANEL
========================= */
.main-panel {
    background: var(--white-color);
}

/* =========================
   CARD
========================= */
.card {
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* =========================
   TABLE HEADER (GLOBAL)
========================= */
.table thead.table-head-custom th {
    background: #ffffff;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.8px;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(58, 58, 185, 0.18);
}

/* =========================
   FORM INPUT BORDER
========================= */

/* NORMAL */
.form-control {
    border: 1.5px solid rgba(58, 58, 185, 0.25);
    border-radius: 999px;

    height: var(--form-height);
    padding: 12px 18px;

    font-size: var(--form-font-size);
    line-height: var(--form-line-height);
    color: #495057;

    transition: all 0.25s ease;
}


/* FOCUS */
.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(58, 58, 185, 0.15);
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.pagination li {
    list-style: none;
}

/* BUTTON */
.pagination .page-link {
    min-width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px !important;
    border: 1.25px solid rgba(58, 58, 185, 0.25);
    background: #ffffff;

    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

/* HOVER */
.pagination .page-link:hover {
    background: rgba(58, 58, 185, 0.08);
    color: var(--primary-color);
}

/* ACTIVE */
.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(58, 58, 185, 0.35);
}

/* DISABLED */
.pagination .page-item.disabled .page-link {
    color: rgba(58, 58, 185, 0.35);
    pointer-events: none;
    background: #f6f6ff;
    border-color: rgba(58, 58, 185, 0.15);
}

/* HILANGKAN ICON & ELEMENT ANEH */
.pagination svg,
.pagination i,
.pagination .now-ui-icons {
    display: none !important;
}

/* HILANGKAN BOX HANTU */
.pagination li::before,
.pagination li::after {
    display: none !important;
    content: none !important;
}

/* =========================
   TOP NAVBAR (BLUE SOLID)
========================= */

.navbar,
.navbar.navbar-transparent {
    background: transparent !important;
    box-shadow: none;
}


.navbar.navbar-transparent {
    background: var(--primary-gradient) !important;
}


/* =========================
   BRAND / PAGE TITLE
========================= */
.navbar .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.3px;
    padding: 0;
}

/* =========================
   NAV LINKS & ICONS
========================= */
.navbar .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.navbar .nav-link i {
    font-size: 17px;
    color: #ffffff;
}

/* =========================
   HAMBURGER
========================= */
.navbar-toggler {
    padding: 4px 6px;
}

.navbar-toggler .navbar-toggler-bar {
    background: #ffffff;
}

/* =========================
   SEARCH BAR (KONTRAS DI BIRU)
========================= */
.navbar .input-group.no-border {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 4px 6px;
    margin-right: 12px;
}

.navbar .input-group.no-border .form-control {
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 13px;
    color: #ffffff;
    height: auto;
}

.navbar .input-group.no-border .form-control::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.navbar .input-group-text {
    background: transparent;
    border: none;
    color: #ffffff;
    padding-right: 8px;
}

/* =========================
   DROPDOWN MENU
========================= */
.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    margin-top: 8px;
}

.dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #3a3ab9;
    transition: background 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(58, 58, 185, 0.12);
}

/* =========================
   RIGHT ICON GROUP SPACING
========================= */
.navbar-nav {
    align-items: center;
    gap: 4px;
}

.user-nav i {
    transform: translateY(-4px);
}

/* =========================
   SECTION TITLE (FORM)
========================= */
.section-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================
   CARD HEADER (FORM)
========================= */
.card-header.form-header {
    background: #ffffff;
    border-bottom: 2px solid rgba(58, 58, 185, 0.18);
    padding: 20px 24px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

/* TITLE */
.card-header.form-header .card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

/* SUBTITLE */
.card-header.form-header .card-subtitle {
    font-size: 13px;
    color: rgba(58, 58, 185, 0.65);
    font-weight: 500;
    line-height: 1.4;
}

/* =========================
   FIX ORANGE ACTIVE BUTTON
========================= */
.btn-primary:active,
.btn-primary.active,
.btn-primary:focus,
.btn-primary:active:focus,
.btn-primary.active:focus,
.show>.btn-primary.dropdown-toggle {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(58, 58, 185, 0.45) !important;
}


/* ======================================
   FINAL FIX: USER DROPDOWN MOBILE
====================================== */

@media (max-width: 991.98px) {

    /* HEADER lebih pendek */
    .panel-header,
    .panel-header-sm {
        height: 90px;
    }

    /* INI KUNCI UTAMA */
    .main-panel>.content {
        margin-top: -120px !important;
        /* 🔼 NAIK LEBIH KE ATAS */
        padding-top: 0 !important;
        position: relative;
        z-index: 30;
    }

    /* Card tetap di atas */
    .card {
        position: relative;
        z-index: 40;
    }

    /* NAVBAR HARUS BOLEH OVERFLOW */
    .navbar,
    .navbar-absolute,
    .panel-header {
        overflow: visible !important;
        background: var(--primary-gradient) !important;
        position: relative !important;
    }

    /* JAGA TINGGI NAVBAR */
    .navbar {
        height: 64px !important;
        min-height: 64px !important;
        align-items: center;
    }

    /* ANCHOR DROPDOWN */
    .navbar .nav-item.dropdown {
        position: relative !important;
    }

    /* DROPDOWN POPUP */
    .navbar .dropdown-menu {
        position: absolute !important;
        top: 64px !important;
        right: 12px !important;
        left: auto !important;

        display: block;
        background: #ffffff !important;
        opacity: 1 !important;

        border-radius: 14px;
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
        z-index: 9999 !important;
    }

    /* MATIKAN EFEK NOW UI */
    .navbar .dropdown-menu::before,
    .navbar .dropdown-menu::after {
        display: none !important;
        content: none !important;
    }

    /* Naikkan icon user secara manual */
    .navbar .user-nav {
        transform: translateY(-5px);
        /* ubah nilainya */
    }

    html,
    body {
        height: 100%;
        overflow: auto !important;
    }

    body.nav-open {
        overflow: auto !important;
        /* JANGAN DIKUNCI */
    }

    .main-panel {
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .main-panel>.content {
        min-height: 100vh;
        overflow-y: auto;
    }
}

/* =========================
   FIX MODAL & BACKDROP (GLOBAL)
========================= */

/* backdrop lebih soft & tidak blok klik */
.modal-backdrop.show {
    opacity: 0.15 !important;
    background: rgba(0, 0, 0, 0.15) !important;
    pointer-events: none !important;
}

/* modal harus selalu di atas */
.modal {
    z-index: 2105 !important;
    pointer-events: auto !important;
}

/* jaga urutan backdrop di bawah modal */
.modal-backdrop {
    z-index: 2100 !important;
}

/* modal bisa scroll di mobile */
.modal-dialog {
    max-height: 90vh;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* body aman saat modal open */
body.modal-open {
    overflow: hidden !important;
    width: 100%;
}

/* =========================
   SELECT2 = DATE INPUT HEIGHT (CLEAN)
========================= */

.select2-container {
    width: 100% !important;
}

/* BOX */
.select2-container--bootstrap4 .select2-selection--single {
    height: var(--form-height) !important;

    border: 1.5px solid rgba(58, 58, 185, 0.25) !important;
    border-radius: 999px !important;

    padding: 0 18px !important;
    background-color: #ffffff !important;

    display: flex;
    align-items: center;

    outline: none !important;
    box-shadow: none !important;
    /* ⬅️ penting */
}

/* TEXT SELECT2 */
.select2-container--bootstrap4 .select2-selection__rendered {
    line-height: var(--form-height) !important;
    padding: 0 !important;
    margin: 0 !important;

    font-size: var(--form-font-size) !important;
    font-weight: normal;
    color: #495057;
}


/* ARROW */
.select2-container--bootstrap4 .select2-selection__arrow {
    height: var(--form-height) !important;
    right: 16px;
}

/* RESET EFEK BAWAAN SELECT2 */
.select2-selection {
    outline: none !important;
    box-shadow: none !important;
}

/* FOCUS — SATU BORDER SAJA (RAPI) */
.select2-container--bootstrap4.select2-container--focus .select2-selection--single {
    border: 1.5px solid var(--primary-color) !important;
    box-shadow: none !important;
    /* ⬅️ HAPUS SHADOW */
}

input[type="date"].form-control {
    font-size: var(--form-font-size);
    line-height: var(--form-line-height);
}

/* =========================
   BUTTON = FORM HEIGHT
========================= */

.btn {
    height: var(--form-height);
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: var(--form-font-size);
    line-height: var(--form-line-height);
}

/* =========================
   LINK MODAL (TABLE)
========================= */
.link-primary-modal {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* hover */
.link-primary-modal:hover {
    color: #2f2f9a;
    /* sedikit lebih gelap */
    text-decoration: underline;
}

/* focus / active */
.link-primary-modal:focus,
.link-primary-modal:active {
    color: var(--primary-color);
    outline: none;
}

/* FIX INPUT DATE iOS SAFARI */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 30px;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
