/* ====================================================================
   AVRIST CREDIT LIFE GLOBAL UTILITY THEME (CLAPS)
   ==================================================================== */
:root {
    --avrist-theme: #6e2082;
    --avrist-theme-secondary: #f5ebff;
    --avrist-theme-hover: #551666;
    --avrist-theme-active: #3d0c4a;
    --avrist-theme-gradient: linear-gradient(135deg, #6e2082 0%, #4a1259 100%);
    --avrist-theme-light: rgba(110, 32, 130, 0.11);
    --avrist-theme-light-hover: rgba(110, 32, 130, 0.20);
}

/* --- 1. TEXT UTILITIES --- */
.text-theme {
    color: var(--avrist-theme) !important;
}

.text-theme-hover:hover {
    color: var(--avrist-theme-hover) !important;
}

/* --- 2. BACKGROUND UTILITIES --- */
.bg-theme {
    background-color: var(--avrist-theme) !important;
}

.bg-theme-gradient {
    background: var(--avrist-theme-gradient) !important;
}

.bg-theme-light {
    background-color: var(--avrist-theme-light) !important;
}

.bg-theme-light-hover:hover {
    background-color: var(--avrist-theme-light-hover) !important;
}

.bg-theme-secondary {
    background-color: var(--avrist-theme-secondary);
}

.bg-theme-gradient-secondary {
    color: #6e2082;
    background: #f5ebff;
    background: -webkit-linear-gradient(to bottom, #fef3ff, #eaddf6);
    background: linear-gradient(to bottom, #fef3ff, #eaddf6);
}

/* --- 3. BORDER UTILITIES --- */
.border-theme {
    border: 1px solid var(--avrist-theme) !important;
}

.border-start-theme {
    border-left: 3px solid var(--avrist-theme) !important;
}

.border-top-theme {
    border-top: 3px solid var(--avrist-theme) !important;
}

.border-theme-hover:hover {
    border-color: var(--avrist-theme-hover) !important;
}

.border-theme-active.active,
.border-theme-active:active {
    border-color: var(--avrist-theme-active) !important;
}

/* --- 4. BUTTON SOLID MODE (STANDARD) --- */
.btn-theme {
    background-color: var(--avrist-theme) !important;
    color: #ffffff !important;
    border: 1px solid var(--avrist-theme) !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-theme:hover {
    background-color: var(--avrist-theme-hover) !important;
    border-color: var(--avrist-theme-hover) !important;
    color: #ffffff !important;
}

.btn-theme:active,
.btn-theme.active {
    background-color: var(--avrist-theme-active) !important;
    border-color: var(--avrist-theme-active) !important;
    color: #ffffff !important;
    transform: scale(0.98);
}

.btn-theme:disabled {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
}

/* --- 5. BUTTON OUTLINE MODE --- */
.btn-outline-theme {
    background-color: transparent !important;
    color: var(--avrist-theme) !important;
    border: 1px solid var(--avrist-theme) !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-theme:hover {
    background-color: var(--avrist-theme) !important;
    color: #ffffff !important;
}

.btn-outline-theme:active,
.btn-outline-theme.active {
    background-color: var(--avrist-theme-hover) !important;
    border-color: var(--avrist-theme-hover) !important;
    color: #ffffff !important;
    transform: scale(0.98);
}

.btn-outline-theme:disabled {
    background-color: transparent !important;
    border-color: #cccccc !important;
    color: #cccccc !important;
    cursor: not-allowed;
}

.btn-close-theme {
    filter: invert(30%) sepia(100%) saturate(500%) hue-rotate(250deg) brightness(90%) contrast(90%);
    background-color: transparent !important;
    border: none !important;
}

/* --- 6. LAYOUT UTILITIES --- */
body,
html {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    overflow: hidden;
}

.wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
}

.navbar {
    height: 56px;
    width: 100%;
    z-index: 1030;
    top: 0;
    position: fixed;
    padding: 0px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f8f9fa;

}

.navbar .dropdown-link {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar .dropdown-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.offcanvas-sidebar {
    width: 300px !important;
    display: flex;
    flex-direction: column;
}

.offcanvas-header {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    font-size: 16px;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    color: #6e2082;
    border-bottom: 1px solid #dfa2ef30;
    flex-shrink: 0;
}

/* Area Scroll Sidebar yang Efisien */
.offcanvas-body.sidebar-scroll-area {
    display: block;
    width: 100%;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0rem !important;
    scroll-behavior: smooth;
    flex-grow: 1;
}

/* Kustomisasi Scrollbar Sidebar */
.offcanvas-body.sidebar-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.offcanvas-body.sidebar-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.offcanvas-body.sidebar-scroll-area::-webkit-scrollbar-thumb {
    background-color: #dfa2ef60;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.offcanvas-body.sidebar-scroll-area::-webkit-scrollbar-thumb:hover {
    background-color: #6e2082;
}

.main-page {
    position: relative;
    padding-top: 56px;
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: 100%;
    margin-left: 0;
    overflow-y: auto;
}

.avatar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    background-color: var(--avrist-theme);
    color: #ffffff;
}

:deep .vh-50 {
    min-height: 50vh !important;
}

:deep .vh-75 {
    min-height: 75vh !important;
}

.btn-table-op {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-table-op:hover {
    transform: translateY(-1px);
}

.th-moded,
.td-moded {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    color: #475569 !important;
    font-size: 0.92rem !important;
}


/* ========================================================
CUSTOM SLIDER NAV-LINK
======================================================== */
.nav-custom {
    width: 100% !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    color: var(--avrist-theme) !important;
}

.nav-custom:hover {
    background-color: var(--avrist-theme-light) !important;
    color: var(--avrist-theme) !important;
}

.nav-custom.active {
    background-color: var(--avrist-theme) !important;
    color: #ffffff !important;
}

/* Kotak Teks Tooltip */
.nav-mini::after {
    content: attr(titles);
    position: absolute;
    top: 50%;
    left: 80%;
    transform: translateY(-50%) translateX(10px);
    background-color: var(--bs-gray-800, #343a40);
    /* Warna gelap khas Bootstrap */
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    /* Ukuran font standar */
    font-weight: 400;
    font-family: inherit;
    border-radius: 0.375rem;
    /* Lengkungan ujung persis Bootstrap */
    border: 0px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1070;
    /* Pastikan di atas offcanvas (1045) & dropdown (1000) */
    pointer-events: none;
}

/* Panah Kecil Tooltip (Arrow) */
.nav-mini::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 81%;
    transform: translateY(-50%) translateX(4px);
    border-width: 6px 6px 6px 0;
    /* Membentuk segitiga panah yang presisi */
    border-style: solid;
    border-color: transparent var(--bs-gray-800, #343a40) transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1070;
    pointer-events: none;
}

/* Tampilkan Tooltip saat di-Hover */
.nav-mini:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(14px);
    /* Jarak kotak dari tombol */
}

.nav-mini:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(8px);
    /* Jarak panah dari tombol */
}


/* NavCustom for child menu */
.nav-mini .dropdown-item {
    color: var(--avrist-theme) !important;
}

.nav-mini .dropdown-item.active,
.nav-mini .dropdown-item:active {
    background-color: var(--avrist-theme) !important;
    color: #ffffff !important;
}

.nav-mini .dropdown-item:hover,
.nav-mini .dropdown-item:focus {
    background-color: var(--avrist-theme-light) !important;
    color: var(--avrist-theme) !important;
}




/* --- 7. DESKTOP & RESPONSIVE BREAKPOINT (>= 992px) --- */
@media (min-width: 992px) {
    .navbar {
        background-color: #fff;
        /* box-shadow: 0px 0px 12px #a6a6a65f; */
        left: 260px;
        width: calc(100% - 260px);
        transition: left 0.3s ease, width 0.3s ease;
    }

    .offcanvas-sidebar {
        position: fixed;
        transform: none !important;
        visibility: visible !important;
        top: 0px;
        left: 0;
        height: 100vh;
        width: 260px !important;
        box-shadow: none !important;
        z-index: 1040;
        background: #f5ebff;
        background: -webkit-linear-gradient(to bottom, #fef3ff, #eaddf6);
        background: linear-gradient(to bottom, #fef3ff, #eaddf6);
        transition: width 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .main-page {
        margin-left: 260px;
        width: calc(100% - 260px);
    }

    /* --- MODE MINI SIDEBAR (sidebar-mini) --- */
    .sidebar-mini .offcanvas-sidebar {
        width: 75px !important;
        overflow: visible !important;
    }

    .sidebar-mini .offcanvas-body.sidebar-scroll-area {
        overflow: visible !important;
    }

    .sidebar-mini .navbar {
        left: 75px;
        width: calc(100% - 75px);
    }

    .sidebar-mini .main-page {
        margin-left: 75px;
        width: calc(100% - 75px);
    }

    .sidebar-mini .brand-text,
    .sidebar-mini .menu-text,
    .sidebar-mini .arrow-icon {
        display: none !important;
    }

    .sidebar-mini .nav-custom {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-left: none !important;
    }


    .sidebar-mini .dropdown-menu .dropdown-item {
        display: flex;
        width: 100%;
        align-items: center;
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
        white-space: nowrap;
        color: var(--avrist-theme) !important;
        border-radius: 0.7rem;
        cursor: pointer;
    }

    .sidebar-mini .dropdown-menu .dropdown-item:hover {
        background-color: var(--avrist-theme-light) !important;
        color: var(--avrist-theme) !important;
    }

    .sidebar-mini .dropdown-menu .dropdown-item.active {
        background-color: var(--avrist-theme) !important;
        color: #ffffff !important;
    }
}


img,
a,
button,
.nav-custom,
.offcanvas-sidebar {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}