/* --- 1. Reset Global & Utility --- */
.text-primary {
    font-size: 15px !important;
    font-weight: 400 !important;
}

/* --- 2. Bootstrap Modal (Tambah/Edit Role) --- */
.ios-modal-custom {
    max-width: 800px !important;
    margin: 1.75rem auto;
}

.modal.fade .ios-modal-custom {
    transform: scale(0.9) opacity(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1.2), opacity 0.2s;
}

.modal.show .ios-modal-custom {
    transform: scale(1) opacity(1);
}

.ios-modal-custom .modal-content {
    margin-left: 10px;
    margin-top: -40px;
    margin-right: 10px;
    border-radius: 22px !important;
    border: none !important;
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2) !important;
}

.ios-modal-custom .modal-header {
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1) !important;
    padding: 16px 20px;
    justify-content: center;
    position: relative;
}

.ios-modal-custom .modal-title {
    font-size: 17px !important;
    font-weight: 500 !important;
    color: #000;
    letter-spacing: 0px;
}

.form-label {
    color: #000 !important;
    font-size: 13px !important;
}

.btn-close-ios {
    position: absolute;
    right: 15px;
    background: rgba(118, 118, 128, 0.12);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #8e8e93;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Input Style inside Modal */
.ios-input-group {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    background-color: rgba(120, 120, 128, 0.12) !important;
    border-radius: 10px;
    padding: 2px;
}

.ios-input {
    background: transparent !important;
    border: none !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

.ios-input::placeholder {
    color: #a2a2a2 !important;
    opacity: 1;
}

textarea.ios-input {
    min-height: 100px;
    /* Memberikan ruang yang cukup */
    padding-top: 40px !important;
    /* Memberikan jarak atas agar teks placeholder rapi */
    resize: none;
    /* Opsional: mematikan resize manual agar desain tetap konsisten */
    line-height: 1.5;
}

/* Memunculkan Icon Arrow Down pada Select */
select.ios-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238e8e93' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 15px) center !important;
    /* Jarak 15px dari kanan */
    padding-right: 40px !important;
}

.js-toggle {
    position: absolute;
    right: 15px;
    z-index: 10;
    cursor: pointer;
    color: #8e8e93;
    display: flex;
    align-items: center;
    height: 100%;
}

.js-toggle-pwd {
    position: absolute;
    right: 15px;
    /* Jarak 15px dari kanan, sama dengan arrow */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8e8e93;
    z-index: 5;
}

.ios-modal-custom .modal-footer {
    display: flex;
    padding: 0 !important;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1) !important;
    gap: 0 !important;
    background: transparent !important;
}

.ios-btn-cancel,
.ios-btn-submit {
    flex: 1;
    margin: 0 !important;
    padding: 15px !important;
    background: transparent !important;
    border: none !important;
    font-size: 16px !important;
}

.ios-btn-submit {
    color: #EC008C;
}

.ios-btn-cancel {
    color: #007aff !important;
    border-right: 0.5px solid rgba(0, 0, 0, 0.1) !important;
}

/* --- 3. SweetAlert2 iOS Fix (Mencegah Warna Merah/Hitam di Tombol) --- */
/* --- SweetAlert2 iOS Theme Fix (Updated for Border) --- */

.ios-alert-popup {
    width: 270px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    /* Sedikit lebih solid agar border terlihat */
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 20px 0 0 0 !important;
    border: none !important;
    overflow: hidden !important;
    /* Memastikan border-radius memotong background active state */
}

/* Container tombol dengan border atas yang lebih tegas */
.ios-alert-actions {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    /* Gunakan warna border yang sama dengan modal tambah role */
    border-top: 0.5px solid rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Base button style */
.swal2-styled.ios-alert-btn-cancel,
.swal2-styled.ios-alert-btn-default,
.swal2-styled.ios-alert-btn-danger {
    flex: 1 !important;
    margin: 0 !important;
    height: 48px !important;
    /* Sedikit lebih tinggi agar nyaman di tap */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Tombol Batal (Kiri) dengan Border Kanan */
.ios-alert-btn-cancel {
    color: #007aff !important;
    font-weight: 400 !important;
    /* Menambahkan border vertikal di tengah */
    border-right: 0.5px solid rgba(0, 0, 0, 0.2) !important;
}

/* Tombol Aksi (Kanan) */
.ios-alert-btn-default {
    color: #007aff !important;
    font-weight: 600 !important;
}

.ios-alert-btn-danger {
    color: #EC008C !important;
    font-weight: 600 !important;
}

/* Efek Tap yang lebih merata */
.swal2-styled.ios-alert-btn-cancel:active,
.swal2-styled.ios-alert-btn-default:active,
.swal2-styled.ios-alert-btn-danger:active {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* --- SweetAlert2 iOS Theme Fix --- */

/* Popup Container */
.ios-alert-popup {
    width: 270px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 20px 0 0 0 !important;
    /* Hilangkan padding bawah agar tombol nempel */
    border: none !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.ios-alert-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 16px 4px 16px !important;
    text-align: center !important;
}

.ios-alert-text {
    font-size: 16px !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 16px 16px 16px !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* Tombol Container */
.ios-alert-actions {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    border-top: 0.5px solid rgba(0, 0, 0, 0.15) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Reset Tombol Swal (Penting: Gunakan selector ini untuk membuang kotak hitam/merah) */
button.ios-alert-btn-default,
button.ios-alert-btn-cancel,
button.ios-alert-btn-danger {
    flex: 1 !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    height: 44px !important;
    background: transparent !important;
    /* Membuang warna background */
    font-size: 15px !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tombol Batal (Kiri) */
.ios-alert-btn-cancel {
    color: #007aff !important;
    font-weight: 400 !important;
    border-right: 0.5px solid rgba(0, 0, 0, 0.15) !important;
}

/* Tombol Default/Konfirmasi (Kanan) */
.ios-alert-btn-default {
    color: #ec008c !important;
    font-weight: 600 !important;
}


/* Efek Klik */
button.ios-alert-btn-default:active,
button.ios-alert-btn-cancel:active,
button.ios-alert-btn-danger:active {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* === FIX CHROME: VALUE DIANGGAP PLACEHOLDER === */
.ios-input:not(:placeholder-shown) {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

/* Jaga placeholder tetap abu */
.ios-input::placeholder {
    color: #a2a2a2 !important;
    -webkit-text-fill-color: #a2a2a2 !important;
}

.ui-autocomplete {
    z-index: 2147483647 !important;
    /* Agar muncul di atas modal */
    border: none !important;
    background: rgba(255, 255, 255, 0.8) !important;
    /* Efek Transparan */
    backdrop-filter: blur(20px) !important;
    /* Efek Blur iOS */
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
    margin-top: 5px !important;
    max-height: 250px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tiap Item dalam Daftar */
.ui-menu-item {
    border-radius: 10px !important;
    margin-bottom: 2px;
}

.ui-menu-item .ui-menu-item-wrapper {
    padding: 10px 15px !important;
    border: none !important;
    color: #333 !important;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* State saat dipilih/hover (Biru iOS) */
.ui-state-active,
.ui-widget-content .ui-state-active {
    background-color: rgba(0, 122, 255, 0.1) !important;
    color: #007AFF !important;
    font-weight: 500;
    border: none !important;
}

/* Gaya untuk pesan "Data tidak ditemukan" */
.non-selectable {
    cursor: default !important;
    pointer-events: none;
    opacity: 0.8;
}

/* Scrollbar Tipis */
.ui-autocomplete::-webkit-scrollbar {
    width: 4px;
}

.ui-autocomplete::-webkit-scrollbar-thumb {
    background: #d1d1d6;
    border-radius: 10px;
}

.swal2-html-container .list-group-item {
    background: transparent;
    font-size: 0.85rem;
}

.swal2-html-container i {
    font-size: 0.75rem;
}

.ios-autocomplete-style {
    border-radius: 12px !important;
    border: 1px solid #e5e5e7 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    z-index: 2000 !important;
    /* Supaya di atas modal */
}

.ui-menu-item-wrapper {
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1d1d1f !important;
}

.ui-state-active,
.ui-widget-content .ui-state-active {
    background: #007AFF !important;
    color: #fff !important;
    border: none !important;
}

.ui-menu-item .text-muted.italic {
    font-style: italic;
    background-color: #f8f9fa;
    cursor: default;
    pointer-events: none;
}