/* P3KPI - dropdown & tanggal kustom (pasangan assets/js/components/form-enhance.js) */

.fx-select {
    --fx-brand: #0059ad;
    --fx-brand-50: #eef5fc;
    --fx-brand-700: #003f7a;
    --fx-ink: #142033;
    --fx-muted: #6b778a;
    --fx-line: #d5dce6;
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}
.fx-select > select.fx-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}
.fx-select-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: calc(1.5em + .9rem + 2px);
    padding: .45rem .75rem;
    font: inherit;
    font-size: .875rem;
    line-height: 1.5;
    text-align: left;
    color: var(--fx-ink);
    background: #fff;
    border: 1px solid var(--fx-line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fx-select-toggle:hover { border-color: #b9c4d3; }
.fx-select-toggle:focus,
.fx-select.is-open .fx-select-toggle {
    outline: 0;
    border-color: var(--fx-brand);
    box-shadow: 0 0 0 3px rgba(0, 89, 173, .14);
}
.fx-select-toggle:disabled { background: #f7f9fc; color: var(--fx-muted); cursor: not-allowed; }
.fx-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-select-label.is-placeholder { color: #8f9bad; }
.fx-select-caret { flex-shrink: 0; color: var(--fx-muted); font-size: .85rem; transition: transform .15s ease; }
.fx-select.is-open .fx-select-caret { transform: rotate(180deg); color: var(--fx-brand); }
.fx-select.is-invalid .fx-select-toggle,
.was-validated .fx-select > select:invalid ~ .fx-select-toggle { border-color: #c0392b; }
.fx-select.fx-sm .fx-select-toggle { min-height: calc(1.5em + .5rem + 2px); padding: .25rem .6rem; font-size: .8rem; border-radius: 6px; }
.fx-select.fx-lg .fx-select-toggle { min-height: calc(1.5em + 1rem + 2px); padding: .5rem 1rem; font-size: 1rem; }
.input-group > .fx-select { flex: 1 1 auto; width: 1%; }
.input-group > .fx-select:not(:last-child) .fx-select-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .fx-select:not(:first-child) .fx-select-toggle { border-top-left-radius: 0; border-bottom-left-radius: 0; }
div.dt-container .dt-length .fx-select { display: inline-block; width: auto; min-width: 4.5rem; margin: 0 .35rem; vertical-align: middle; }

/* Menu (ditempel ke body, posisi fixed) */
.fx-menu {
    position: fixed;
    z-index: 1080;
    max-width: min(28rem, calc(100vw - 16px));
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(10, 31, 60, .14);
    padding: .3rem;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: .86rem;
    color: #142033;
    animation: fx-in .12s ease-out;
}
.fx-menu.in-modal { z-index: 1090; }
@keyframes fx-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fx-menu.is-above { animation-name: fx-in-up; }
@keyframes fx-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fx-menu-list {
    max-height: 18rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d5dce6 transparent;
}
.fx-menu-search { position: relative; padding: .2rem .2rem .4rem; }
.fx-menu-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-60%); color: #8f9bad; font-size: .9rem; }
.fx-menu-search input {
    width: 100%;
    padding: .4rem .6rem .4rem 2rem;
    border: 1px solid #d5dce6;
    border-radius: 6px;
    font: inherit;
    font-size: .82rem;
    outline: 0;
}
.fx-menu-search input:focus { border-color: #0059ad; box-shadow: 0 0 0 3px rgba(0, 89, 173, .12); }
.fx-option {
    position: relative;
    padding: .5rem 2rem .5rem .75rem;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.35;
    white-space: normal;
}
.fx-option.is-active { background: #eef5fc; color: #003f7a; }
.fx-option.is-selected { font-weight: 600; color: #0059ad; }
.fx-option.is-selected::after {
    content: "";
    position: absolute;
    right: .7rem;
    top: 50%;
    width: .45rem;
    height: .8rem;
    border: solid #0059ad;
    border-width: 0 2px 2px 0;
    transform: translateY(-60%) rotate(45deg);
}
.fx-option.is-placeholder { color: #8f9bad; }
.fx-option.is-disabled { color: #b2bccb; cursor: not-allowed; }
.fx-option[hidden] { display: none; }
.fx-menu-group {
    padding: .55rem .75rem .25rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b778a;
}

/* Input tanggal kustom */
input.fx-date {
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect x='40' y='40' width='176' height='176' rx='8' fill='none' stroke='%230059ad' stroke-width='16'/%3E%3Cpath d='M176 24v32M80 24v32M40 88h176' fill='none' stroke='%230059ad' stroke-linecap='round' stroke-width='16'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 1rem !important;
    padding-right: 2.4rem !important;
    cursor: pointer;
}
input.fx-date:disabled { background-color: #f7f9fc !important; cursor: not-allowed; }
input.fx-date::placeholder { color: #8f9bad; }

/* Kalender jQuery UI (dipakai input tanggal kustom) */
.ui-datepicker {
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif !important;
    border: 1px solid #e3e8ef !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(10, 31, 60, .14);
    padding: .6rem !important;
    background: #fff !important;
    width: 18rem !important;
    z-index: 1090 !important;
}
.ui-datepicker .ui-datepicker-header { background: transparent !important; border: 0 !important; color: #142033; padding: .25rem 2rem .5rem !important; }
.ui-datepicker .ui-datepicker-title { font-weight: 700; font-size: .9rem; display: flex; gap: .35rem; justify-content: center; margin: 0 !important; }
.ui-datepicker .ui-datepicker-title select {
    width: auto !important;
    border: 1px solid #d5dce6;
    border-radius: 6px;
    padding: .15rem .35rem;
    font: inherit;
    font-size: .8rem;
    background: #fff;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    top: .3rem !important;
    width: 1.9rem !important;
    height: 1.9rem !important;
    border-radius: 6px;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev { left: .3rem !important; }
.ui-datepicker .ui-datepicker-next { right: .3rem !important; }
.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover { background: #f4f6fa !important; }
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    background-image: none !important;
    text-indent: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    top: 0 !important;
    left: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
}
.ui-datepicker .ui-datepicker-prev span::before { content: "\2039"; font-size: 1.3rem; color: #3c4a5e; }
.ui-datepicker .ui-datepicker-next span::before { content: "\203A"; font-size: 1.3rem; color: #3c4a5e; }
.ui-datepicker table { font-size: .82rem; margin: 0 !important; }
.ui-datepicker th { color: #6b778a; font-size: .68rem; font-weight: 700; text-transform: uppercase; padding: .35rem 0; }
.ui-datepicker td { padding: 1px; }
.ui-datepicker td a.ui-state-default,
.ui-datepicker td span.ui-state-default {
    text-align: center;
    border: 0 !important;
    border-radius: 6px;
    background: transparent !important;
    color: #142033 !important;
    padding: .42rem 0 !important;
}
.ui-datepicker td a.ui-state-default:hover { background: #eef5fc !important; color: #003f7a !important; }
.ui-datepicker td a.ui-state-highlight { box-shadow: inset 0 0 0 1px #0059ad; color: #0059ad !important; font-weight: 700; }
.ui-datepicker td a.ui-state-active { background: #0059ad !important; color: #fff !important; font-weight: 700; }
.ui-datepicker .ui-datepicker-unselectable span.ui-state-default { color: #c3ccd8 !important; }
.ui-datepicker .ui-datepicker-buttonpane { border-top: 1px solid #e3e8ef; margin: .4rem 0 0; padding-top: .4rem; display: flex; justify-content: space-between; }
.ui-datepicker .ui-datepicker-buttonpane button {
    float: none !important;
    margin: 0 !important;
    border: 1px solid #e3e8ef !important;
    border-radius: 6px;
    background: #fff !important;
    color: #3c4a5e !important;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    opacity: 1 !important;
    padding: .25rem .65rem !important;
}
.ui-datepicker .ui-datepicker-buttonpane button:hover { background: #f4f6fa !important; }

/* Pesan validasi (menggantikan balon bawaan browser) */
.fx-feedback {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    margin-top: .35rem;
    color: #c0392b;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
    animation: fx-in .12s ease-out;
}
.fx-feedback i { font-size: .95rem; margin-top: .05rem; flex-shrink: 0; }
.form-control.is-invalid,
input.fx-date.is-invalid,
.fx-select-toggle.is-invalid {
    border-color: #c0392b !important;
    background-image: none;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .12) !important;
}
input.fx-date.is-invalid {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect x='40' y='40' width='176' height='176' rx='8' fill='none' stroke='%23c0392b' stroke-width='16'/%3E%3Cpath d='M176 24v32M80 24v32M40 88h176' fill='none' stroke='%23c0392b' stroke-linecap='round' stroke-width='16'/%3E%3C/svg%3E") !important;
}
.custom-control-input.is-invalid ~ .custom-control-label,
.form-check-input.is-invalid ~ .form-check-label { color: #c0392b; }
.custom-control-input.is-invalid ~ .custom-control-label::before { border-color: #c0392b; }

/* Pesan validasi di dalam SweetAlert */
.swal2-validation-message {
    background: #fbeceb !important;
    color: #8a261c !important;
    font-size: .82rem !important;
    border-radius: 8px;
    margin: .75rem 1.5rem 0 !important;
}
.swal2-validation-message::before { background-color: #c0392b !important; }

