/* ===== Padding konten utama (perbaikan AdminLTE 4 default yang tipis) ===== */
.app-content { padding: 1rem; }
.app-content > .container-fluid { padding: 0; }

/* ===== Kolom No yang ramping ===== */
.th-narrow { width: 5px !important; }

/* ===== Empty state (dipakai partial _empty_state) ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--bs-secondary-color);
}
.empty-state-icon { font-size: 3rem; display: block; margin-bottom: .75rem; opacity: .45; }
.empty-state-title { font-weight: 600; color: var(--bs-body-color); margin-bottom: .35rem; }
.empty-state-desc { font-size: .9rem; max-width: 420px; margin: 0 auto .75rem; }
.empty-state .btn { margin-top: .25rem; }
.empty-state-compact { padding: 1.5rem 1rem; }
.empty-state-compact .empty-state-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ===== Small-box (AdminLTE 4) sentuhan ===== */
.small-box .inner h3 { font-weight: 700; }
.small-box .small-box-icon i { position: relative; }

/* ===== Kartu header rapi ===== */
.card-header .card-title { float: none !important; }
.card-header .card-title i { margin-right: .5rem; }
.modal-title i { margin-right: .5rem; }

/* ===== Scrollbar halus (opsional, webkit) ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Calendar Picker (port CalendarPicker.tsx) ===== */
.cp-wrapper { position: relative; }
.cp-input-hidden { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; z-index: -1; }
.cp-trigger { cursor: pointer; }
.cp-trigger:disabled { cursor: not-allowed; opacity: .65; }
.cp-display { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-clear { cursor: pointer; padding: 0 .25rem; border-radius: .25rem; }
.cp-clear:hover { color: var(--bs-danger) !important; }
.cp-popover { display: none; position: fixed; z-index: 9999; width: 280px; background: #fff; border: 1px solid var(--bs-border-color); border-radius: 1rem; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); padding: 1rem; }
.cp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.cp-nav { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; color: var(--bs-secondary-color); display: inline-flex; align-items: center; justify-content: center; }
.cp-nav:hover { background: var(--bs-tertiary-bg); }
.cp-title { flex: 1; border: 0; background: transparent; padding: .25rem .5rem; border-radius: .5rem; font-size: .875rem; font-weight: 600; color: var(--bs-emphasis-color); cursor: pointer; }
.cp-title:hover { background: var(--bs-tertiary-bg); }
.cp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; justify-items: center; }
.cp-grid.mode-month { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.cp-grid.mode-year { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cp-pick { width: 100%; height: 42px; border: 0; background: transparent; border-radius: .75rem; font-size: .875rem; color: var(--bs-body-color); }
.cp-pick:hover { background: #cfe2ff; color: #0a58ca; }
.cp-pick.is-current { background: var(--bs-primary); color: #fff; font-weight: 700; }
.cp-pick.is-current:hover { background: #0b5ed7; color: #fff; }
.cp-pick.is-today { font-weight: 700; color: var(--bs-primary); }
.cp-pick.is-today:hover { color: #0a58ca; }
.cp-wd { padding: .25rem 0; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--bs-secondary-color); }
.cp-day { width: 100%; max-width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; font-size: .875rem; color: var(--bs-body-color); display: inline-flex; align-items: center; justify-content: center; }
.cp-day:hover:not(.is-disabled) { background: #cfe2ff; color: #0a58ca; }
.cp-day.is-selected { background: var(--bs-primary); color: #fff; }
.cp-day.is-selected:hover { background: #0b5ed7; color: #fff; }
.cp-day.is-today { font-weight: 700; color: var(--bs-primary); }
.cp-day.is-disabled { color: var(--bs-secondary-color); opacity: .4; cursor: not-allowed; }
.cp-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--bs-border-color); margin-top: .75rem; padding-top: .75rem; }
.cp-today { border: 0; background: transparent; border-radius: .5rem; padding: .25rem .75rem; font-size: .75rem; font-weight: 500; color: var(--bs-primary); }
.cp-today:hover { background: #cfe2ff; }
.cp-close { border: 0; background: transparent; border-radius: .5rem; padding: .25rem .75rem; font-size: .75rem; color: var(--bs-secondary-color); }
.cp-close:hover { background: var(--bs-tertiary-bg); }

/* ===== Card header: perbaiki ::after AdminLTE 4 (elemen flex ke-3) ===== */
.card-header.d-flex { align-items: center; gap: .5rem; }
.card-header.d-flex::after { content: none; }
.card-header.d-flex .btn { margin-left: auto; }

/* ===== Select2 disamakan persis dengan Bootstrap 5.3 (form-select) ===== */
.select2-container { width: 100% !important; }
.select2-container--bootstrap-5 .select2-selection {
    border: var(--bs-border-width) solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    background-color: var(--bs-body-bg) !important;
    min-height: calc(1.5em + .75rem + 2px) !important;
}
.select2-container--bootstrap-5 .select2-selection--single {
    padding: .375rem .75rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
    appearance: none !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0 !important;
    color: var(--bs-body-color) !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: var(--bs-secondary-color) !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    display: none !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .25rem !important;
    padding: .25rem !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5 .select2-selection:focus,
.select2-container--bootstrap-5 .select2-selection:hover {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25) !important;
    outline: 0 !important;
}
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0d6efd !important;
    color: #fff !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #e9ecef !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: .25rem !important;
}

/* ===== Thead: vertical middle, center, uppercase ===== */
thead th {
    vertical-align: middle !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}
thead th .dt-column-order { float: none !important; margin-left: .35rem; }

/* ===== Thead (diperkuat) ===== */
thead th,
.table thead th,
.dataTables_wrapper thead th {
    vertical-align: middle !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    font-size: .875rem !important;
}

/* ===== Select2 — samakan persis Bootstrap 5.3 form-select ===== */
.select2-container { width: 100% !important; }
.select2-container--bootstrap-5 .select2-selection {
    border: var(--bs-border-width) solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    background-color: var(--bs-body-bg) !important;
    min-height: calc(1.5em + .75rem + 2px) !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.select2-container--bootstrap-5 .select2-selection--single {
    padding: .375rem .75rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0 !important;
    color: var(--bs-body-color) !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    display: none !important;
}
.select2-container--bootstrap-5 .select2-selection:hover {
    border-color: var(--bs-border-color) !important;
    box-shadow: none !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5 .select2-selection:focus,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25) !important;
    outline: 0 !important;
}
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}
.select2-container--bootstrap-5 .select2-search__field {
    border: var(--bs-border-width) solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #e9ecef !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: .25rem !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0d6efd !important;
    color: #fff !important;
}
.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #e7f1ff !important;
    color: #0a58ca !important;
}

/* ===== DataTables paginate button: unset padding/margin bawaan ===== */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    cursor: default !important;
    color: var(--bs-secondary-color) !important;
    border: 0 !important;
}

/* ===== Topbar user dropdown (avatar & profil) ===== */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    flex-shrink: 0;
}
.user-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}
.user-menu .dropdown-menu { min-width: 260px; }
.user-menu .dropdown-item i { width: 1.1rem; text-align: center; }

/* ===== Password Strength Meter ===== */
.pw-meter-wrap { display: flex; align-items: center; gap: 4px; margin-top: .375rem; }
.pw-seg { flex: 1; height: 4px; border-radius: 2px; background: var(--bs-secondary-bg); transition: background .2s ease; }
.pw-seg.active { background: var(--bs-secondary-color); }
.pw-label { font-size: .75rem; font-weight: 600; margin-left: .25rem; white-space: nowrap; }

/* ===== DataTables empty-state (anti-stripe) ===== */
tr.empty-state-row td { background: var(--bs-body-bg); }
/* Backstop: sembunyikan baris kosong bawaan DataTables agar tidak dobel dgn empty-state custom */
table.dataTable tr:has(td.dataTables_empty) { display: none; }

/* ===== Print Styles ===== */
@media print {
    .sidebar, .navbar, .btn, .no-print { display: none !important; }
    .content-wrapper { margin: 0 !important; padding: 1rem !important; }
    .app-sidebar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .card { break-inside: avoid; }
}

/* ===== User Avatar with Photo ===== */
.user-avatar img.user-avatar-img,
.user-avatar-lg img.user-avatar-lg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.user-avatar {
    overflow: hidden;
}
