/* ── Sidebar Active Menu ─────────────────────────── */
.sidebar-active {
    position: relative;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(99, 102, 241, 0.10) 100%);
    color: #fff !important;
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #38bdf8, #6366f1) 1;
    border-radius: 0 0.5rem 0.5rem 0;
    padding-left: calc(1rem - 3px);
    /* Compensate for border width */
    box-shadow: 0 0 20px -5px rgba(56, 189, 248, 0.15);
}

.sidebar-active i {
    color: #38bdf8;
}

.sidebar-active:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(99, 102, 241, 0.15) 100%) !important;
}

/* Submenu active item */
.sidebar-sub-active {
    color: #fff !important;
    background: rgba(56, 189, 248, 0.10);
    position: relative;
    font-weight: 500;
}

.sidebar-sub-active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Transisi halus untuk sidebar dan search */
.transition-all-custom {
    transition: all 0.3s ease-in-out;
}

/* Menyembunyikan scrollbar tapi tetap bisa scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Kelas untuk menyembunyikan sidebar di desktop secara dinamis */
@media (min-width: 768px) {
    .desktop-sidebar-hidden {
        margin-left: -16rem;
        /* Lebar sidebar adalah w-64 (16rem), margin negatif menyembunyikannya */
    }
}

/* Custom DataTables Tailwind Overrides */
.dataTables_wrapper {
    width: 100% !important;
}

.dataTables_wrapper .dataTables_length {
    color: #64748b !important;
    /* slate-500 */
    font-size: 0.875rem !important;
    /* text-sm */
    float: none !important;
    display: flex !important;
    align-items: center !important;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.375rem 2rem 0.375rem 0.75rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    background-color: #fff !important;
    outline: none !important;
    color: #334155 !important;
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1rem !important;
}

.dataTables_wrapper .dataTables_info {
    color: #64748b !important;
    font-size: 0.875rem !important;
    float: none !important;
    padding-top: 0 !important;
}

.dataTables_wrapper .dataTables_paginate {
    float: none !important;
    padding-top: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0 !important;
    margin-left: 2px !important;
    margin-right: 2px !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #475569 !important;
    /* slate-600 */
    transition: all 0.2s !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: #0f172a !important;
    /* slate-900 */
    background: #0f172a !important;
    color: #fff !important;
    border-color: #0f172a !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #94a3b8 !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 0.6 !important;
}

.dt-buttons {
    margin-bottom: 0 !important;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin: 0.5rem 0 1.25rem 0 !important;
    /* tight top margin (8px) to reduce gap from filter bar */
    border: 1px solid #e2e8f0 !important;
    /* slate-200 outer border */
    border-radius: 0.375rem !important;
    /* rounded-md (6px) for crisp macOS table header */
    overflow: hidden !important;
}

table.dataTable thead {
    background-color: #f1f5f9 !important;
    /* slate-100 */
}

table.dataTable thead th {
    border-bottom: 2px solid #94a3b8 !important;
    /* slate-400 */
    border-right: 1px solid #e2e8f0 !important;
    /* slate-200 */
    position: relative !important;
    padding: 6px 4px !important;
    font-weight: 700 !important;
    /* bold */
    color: #0f172a !important;
    /* slate-900 */
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
}

table.dataTable thead th:last-child {
    border-right: none !important;
}

table.dataTable tbody td,
table.dataTable tfoot td {
    border-bottom: 1px solid #e2e8f0 !important;
    /* slate-200 row border instead of slate-100 */
    border-right: 1px solid #e2e8f0 !important;
    /* slate-200 column divider */
    padding: 4px 4px !important;
    vertical-align: middle !important;
}

table.dataTable tfoot td.text-right,
#footer_total_price {
    text-align: right !important;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}

table.dataTable tbody td:last-child {
    border-right: none !important;
}

table.dataTable tbody tr {
    transition: background-color 0.15s ease-in-out !important;
}

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

/* Custom Sorting Icons styling */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    right: 8px !important;
    opacity: 0.4 !important;
}

table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::after {
    opacity: 0.9 !important;
    color: #0f172a !important;
}

/* Disable sorting arrows for non-orderable column headers (e.g. checkbox column) */
table.dataTable thead th.no-sort,
table.dataTable thead th.dt-orderable-none,
table.dataTable thead th.sorting_disabled {
    padding-right: 0.5rem !important;
    padding-left: 0.5rem !important;
    text-align: center !important;
}

table.dataTable thead th.no-sort::before,
table.dataTable thead th.no-sort::after,
table.dataTable thead th.dt-orderable-none::before,
table.dataTable thead th.dt-orderable-none::after,
table.dataTable thead th.sorting_disabled::before,
table.dataTable thead th.sorting_disabled::after,
table.dataTable thead th:first-child.no-sort::before,
table.dataTable thead th:first-child.no-sort::after {
    display: none !important;
    content: "" !important;
    background-image: none !important;
    opacity: 0 !important;
}



/* Custom Select2 Tailwind Overrides */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    background-color: rgba(248, 250, 252, 0.5) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-radius: 0.5rem !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease-in-out !important;
    position: relative !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    background-color: #fff !important;
    border-color: #cbd5e1 !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(241, 245, 249, 0.8) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #334155 !important;
    font-size: 0.875rem !important;
    padding-left: 0.875rem !important;
    padding-right: 2rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    float: none !important;
    display: inline-block !important;
    margin-left: 0.8rem !important;
    margin-right: 0.5rem !important;
    color: #94a3b8 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
    line-height: 1 !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ef4444 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #64748b transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-dropdown {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    background-color: #fff !important;
    z-index: 1050 !important;
    margin-top: 4px !important;
}

.select2-container--default .select2-results__option {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    transition: background-color 0.15s, color 0.15s !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 500 !important;
}

.select2-search--dropdown {
    padding: 0.625rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    outline: none !important;
    background-color: #f8fafc !important;
    transition: border-color 0.2s, background-color 0.2s !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #94a3b8 !important;
    background-color: #fff !important;
}

/* Custom Main Padding Overrides */
main {
    padding: 1.2rem !important;
}

main.portal-main {
    padding: 0 !important;
}

/* Custom Aesthetic Switch Toggle style to avoid Tailwind JIT compilation dependency */
.switch-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.switch-toggle-btn input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #e2e8f0;
    /* slate-200 */
    border-radius: 9999px;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.switch-toggle-btn input:checked+.switch-slider {
    background-color: #2563eb;
    /* blue-600 */
}

.switch-toggle-btn input:checked+.switch-slider::after {
    transform: translateX(20px);
}

.switch-label {
    margin-left: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    /* slate-700 */
    transition: color 0.2s ease;
}

.switch-toggle-btn input:checked~.switch-label {
    color: #2563eb;
}