/* ============================================================================
   SARPRAS — Design System
   Palet: Emerald #1E9E8A (utama) + Emas Sampanye #C6A15B (aksen)
   Latar ivory lembut. Terang, mewah, tenang — nyaman dilihat berjam-jam.
   ========================================================================== */

:root {
    --brand:        #1E9E8A;
    --brand-600:    #178275;
    --brand-700:    #12695F;
    --brand-050:    #EAF6F3;
    --brand-100:    #D5EDE8;
    --brand-tint:   #F3FAF8;

    --gold:         #C6A15B;
    --gold-600:     #B08A45;
    --gold-700:     #94722F;
    --gold-l:       #EAD79B;
    --gold-050:     #FBF5E9;

    /* Teal mewah (untuk sidebar & login gelap) */
    --teal-750:     #17564D;
    --teal-800:     #123F39;
    --teal-900:     #0E332E;
    --sidebar-ink:  #EAF6F3;
    --sidebar-muted:rgba(234,246,243,.60);

    --ink:          #1F3B36;
    --ink-soft:     #3D5651;
    --muted:        #6B807B;
    --faint:        #97A6A2;

    --bg:           #FBFAF7;
    --surface:      #FFFFFF;
    --surface-2:    #F6F5F0;
    --line:         #EAE7DF;
    --line-soft:    #F0EEE7;

    --ok:           #2E9E7B;
    --ok-050:       #E7F5EF;
    --warn:         #C99A2E;
    --warn-050:     #FBF3DD;
    --danger:       #C6604F;
    --danger-050:   #F8EBE7;

    --radius:       16px;
    --radius-sm:    11px;
    --radius-pill:  999px;
    --shadow-sm:    0 1px 2px rgba(31,59,54,.05), 0 1px 3px rgba(31,59,54,.04);
    --shadow:       0 6px 22px rgba(31,59,54,.08), 0 1px 3px rgba(31,59,54,.04), 0 1px 0 rgba(255,255,255,.6) inset;
    --shadow-lg:    0 26px 60px rgba(18,63,57,.16);
    --shadow-gold:  0 10px 22px rgba(184,138,45,.30);
    --shadow-brand: 0 10px 24px rgba(30,158,138,.30);
    --sidebar-w:    266px;
    --font:         'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

h1,h2,h3,h4,h5 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; margin: 0; }

::selection { background: var(--brand-100); }

/* Scrollbar lembut */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DCD9D0; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C9C6BC; }

/* ============================ APP SHELL ================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background:
        radial-gradient(520px 260px at 84% -8%, rgba(198,161,91,.20), transparent 60%),
        linear-gradient(178deg, var(--teal-750) 0%, var(--teal-800) 56%, var(--teal-900) 100%);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    box-shadow: 8px 0 32px rgba(12,42,39,.16);
}
.sidebar__brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(198,161,91,.10), transparent);
}
.sidebar__logo {
    width: 44px; height: 44px; border-radius: 13px;
    background: linear-gradient(135deg, #fff 0%, #EAF6F3 100%);
    display: grid; place-items: center; color: var(--brand-700); flex: 0 0 44px;
    box-shadow: 0 6px 16px rgba(0,0,0,.24), 0 0 0 3px rgba(198,161,91,.38);
}
.sidebar__logo i { font-size: 22px; }
.sidebar__logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 11px; }
.sidebar__title { font-weight: 800; font-size: 16px; letter-spacing: -.02em; line-height: 1.1; color: #fff; }
.sidebar__subtitle { font-size: 11.5px; color: var(--gold-l); font-weight: 500; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 14px 18px; }
.sidebar__nav::-webkit-scrollbar { width: 7px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 0; }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(234,215,155,.42); }

.nav-group__label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
    color: rgba(234,246,243,.48); padding: 16px 12px 7px;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 11px; margin-bottom: 2px;
    color: var(--sidebar-ink); font-weight: 600; font-size: 14px;
    border-left: 3px solid transparent;
    transition: background .16s, color .16s, border-color .16s;
    position: relative;
}
.nav-link i { font-size: 18px; width: 20px; text-align: center; color: rgba(234,246,243,.66); transition: color .16s; }
.nav-link:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav-link:hover i { color: var(--gold-l); }
.nav-link.active {
    background: linear-gradient(90deg, rgba(198,161,91,.26), rgba(198,161,91,.05) 72%, transparent);
    color: #fff; border-left-color: var(--gold);
}
.nav-link.active i { color: var(--gold-l); }
.nav-link__badge {
    margin-left: auto; background: var(--gold); color: #3a2c05; font-size: 11px; font-weight: 800;
    padding: 1px 8px; border-radius: var(--radius-pill); min-width: 20px; text-align: center;
}
.nav-link.active .nav-link__badge { background: var(--gold-l); color: #3a2c05; }

.sidebar__user {
    border-top: 1px solid rgba(255,255,255,.08); padding: 14px 18px;
    display: flex; align-items: center; gap: 11px;
    background: linear-gradient(0deg, rgba(0,0,0,.14), transparent);
}
.sidebar__user > div { min-width: 0; }
.sidebar__user .fw-700, .sidebar__user > div > div:first-child { color: #fff; }
.sidebar__user .btn-icon { color: var(--sidebar-ink); }
.sidebar__user .btn-icon:hover { background: rgba(255,255,255,.12); color: #fff; }
.avatar {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    background: linear-gradient(140deg, var(--gold-l), var(--gold-600)); color: #3a2c05;
    display: grid; place-items: center; font-weight: 800; font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.avatar--brand { background: linear-gradient(140deg, #fff, #D5EDE8); color: var(--brand-700); }

/* ---- Sidebar ciut jadi rel ikon (desktop) ---- */
@media (min-width: 993px) {
    .sidebar { transition: width .2s ease, flex-basis .2s ease; }
    .app.sidebar-collapsed .sidebar { width: 76px; flex: 0 0 76px; }
    .app.sidebar-collapsed .sidebar__brand { justify-content: center; padding: 22px 0 18px; }
    .app.sidebar-collapsed .sidebar__brand-text { display: none; }
    .app.sidebar-collapsed .nav-group__label { height: 0; padding: 0; margin: 0; overflow: hidden; opacity: 0; }
    .app.sidebar-collapsed .nav-link {
        justify-content: center; gap: 0; padding-left: 0; padding-right: 0; font-size: 0; border-left-width: 0;
    }
    .app.sidebar-collapsed .nav-link i { font-size: 19px; }
    .app.sidebar-collapsed .nav-link__badge {
        position: absolute; top: 3px; right: 10px; margin: 0; min-width: 16px; padding: 0 5px; font-size: 10px;
    }
    .app.sidebar-collapsed .sidebar__user { flex-direction: column; gap: 10px; padding: 14px 0; }
    .app.sidebar-collapsed .sidebar__user > div:not(.avatar) { display: none; }
}

/* ============================ MAIN ====================================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 68px; background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px;
    padding: 0 26px; position: sticky; top: 0; z-index: 30;
    box-shadow: 0 6px 20px rgba(18,63,57,.05);
}
.topbar__toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px;
    background: none; border: 0; font-size: 24px; color: var(--ink); cursor: pointer; transition: background .16s; }
.topbar__toggle:hover { background: var(--brand-tint); }
.topbar__title { font-weight: 800; font-size: 15.5px; color: var(--ink); letter-spacing: -.01em; display: inline-flex; align-items: center; }
.topbar__title::before {
    content: ""; width: 4px; height: 17px; margin-right: 11px; border-radius: 4px;
    background: linear-gradient(180deg, var(--gold-l), var(--gold-600));
}
.topbar__spacer { flex: 1; }

.search {
    display: flex; align-items: center; gap: 9px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    padding: 8px 16px; width: 300px; max-width: 34vw; color: var(--faint);
}
.search input { border: 0; outline: 0; background: none; font-family: var(--font); font-size: 14px; color: var(--ink); width: 100%; }

.content { padding: 26px 30px 60px; max-width: 1340px; width: 100%; margin: 0 auto; }

/* ============================ PAGE HEADER =============================== */
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head__eyebrow { color: var(--brand-600); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 3px; }
.page-head h1 { font-size: 25px; }
.page-head p { color: var(--muted); margin: 5px 0 0; font-size: 14.5px; }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.breadcrumb-x { display: flex; gap: 7px; align-items: center; color: var(--faint); font-size: 13px; margin-bottom: 12px; font-weight: 500; }
.breadcrumb-x a { color: var(--muted); }
.breadcrumb-x i { font-size: 13px; }

/* ============================ CARDS ==================================== */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
}
a.card:hover, .card.hover-lift:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card__head { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px;
    background: linear-gradient(180deg, rgba(234,246,243,.4), transparent); border-radius: var(--radius) var(--radius) 0 0; }
.card__head h3 { font-size: 16px; }
.card__head .sub { color: var(--muted); font-size: 13px; font-weight: 500; }
.card__body { padding: 22px; }
.card__foot { padding: 15px 22px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card--flush .card__body { padding: 0; }

/* ============================ STAT CARDS =============================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(164px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
    transition: transform .18s, box-shadow .18s;
}
.stat::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--gold)); opacity: .9;
}
.stat::after {
    content: ""; position: absolute; top: -46px; right: -46px; width: 130px; height: 130px; border-radius: 50%;
    background: radial-gradient(circle, rgba(30,158,138,.07), transparent 66%); pointer-events: none;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat__icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; margin-bottom: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.stat__icon--brand { background: var(--brand-050); color: var(--brand-600); }
.stat__icon--gold  { background: var(--gold-050); color: var(--gold-600); }
.stat__icon--ok    { background: var(--ok-050); color: var(--ok); }
.stat__icon--warn  { background: var(--warn-050); color: var(--warn); }
.stat__icon--danger{ background: var(--danger-050); color: var(--danger); }
.stat__value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat__label { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.stat__hint { color: var(--faint); font-size: 12px; margin-top: 3px; }

/* ============================ BUTTONS ================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font); font-weight: 700; font-size: 14px;
    padding: 10px 18px; border-radius: 11px; border: 1px solid transparent;
    cursor: pointer; transition: background .14s, box-shadow .14s, border-color .14s, transform .06s;
    white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 17px; }
.btn-primary { background: linear-gradient(135deg, #23AB96 0%, var(--brand-600) 60%, var(--brand-700) 100%); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 28px rgba(30,158,138,.38); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-gold {
    position: relative; overflow: hidden; border: none; color: #3a2c05; font-weight: 800;
    background: linear-gradient(135deg, var(--gold-l) 0%, var(--gold) 55%, var(--gold-600) 100%);
    box-shadow: var(--shadow-gold);
}
.btn-gold:hover { color: #3a2c05; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(184,138,45,.42); }
.btn-gold::after {
    content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent);
    transform: skewX(-18deg); transition: left .6s;
}
.btn-gold:hover::after { left: 130%; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--brand-050); border-color: var(--brand-100); color: var(--brand-700); transform: translateY(-1px); }
.btn-soft { background: var(--brand-050); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-danger { background: var(--danger-050); color: var(--danger); }
.btn-danger:hover { background: #F1DAD4; color: var(--danger); }
.btn-sm { padding: 6.5px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 10px; }

/* ============================ TABLES ================================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl thead th {
    text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--faint); padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
    white-space: nowrap;
}
table.tbl thead th:first-child { border-top-left-radius: var(--radius); }
table.tbl thead th:last-child  { border-top-right-radius: var(--radius); text-align: right; }
table.tbl tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--brand-tint); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.actions { text-align: right; white-space: nowrap; }
.t-primary { font-weight: 700; color: var(--ink); }
.t-muted { color: var(--muted); font-size: 13px; }
.t-code { font-family: 'SFMono-Regular', ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; color: var(--ink-soft); border: 1px solid var(--line-soft); }

/* ============================ BADGES ================================= */
.badge-x {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
    padding: 3.5px 10px; border-radius: var(--radius-pill); line-height: 1.3; white-space: nowrap;
}
.badge-x i { font-size: 12px; }
.badge-ok     { background: var(--ok-050); color: #1E7A5E; }
.badge-warn   { background: var(--warn-050); color: #9A7414; }
.badge-danger { background: var(--danger-050); color: #A94433; }
.badge-brand  { background: var(--brand-050); color: var(--brand-700); }
.badge-gold   { background: var(--gold-050); color: var(--gold-600); }
.badge-muted  { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-danger { background: var(--danger); }

/* Condition bar (baik/rusak ringan/rusak berat) */
.cond-bar { display: flex; height: 9px; border-radius: 6px; overflow: hidden; background: var(--surface-2); min-width: 120px; }
.cond-bar span { display: block; height: 100%; }
.cond-good { background: var(--ok); } .cond-minor { background: var(--gold); } .cond-major { background: var(--danger); }
.cond-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 7px; flex-wrap: wrap; }
.cond-legend b { color: var(--ink); }

/* ============================ FORMS ================================= */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.field label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
    font-family: var(--font); font-size: 14.5px; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px;
    padding: 10px 14px; width: 100%; transition: border-color .14s, box-shadow .14s;
}
.input:focus, select.input:focus, textarea.input:focus {
    outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-050);
}
textarea.input { resize: vertical; min-height: 84px; }
.input::placeholder { color: var(--faint); }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { background: var(--surface-2); border: 1.5px solid var(--line); border-right: 0; padding: 10px 13px; border-radius: 11px 0 0 11px; color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; }
.input-group .input { border-radius: 0 11px 11px 0; }

/* ============================ ALERTS / FLASH ========================= */
.alert-x { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; border: 1px solid; }
.alert-x i { font-size: 19px; margin-top: 1px; }
.alert-ok { background: var(--ok-050); border-color: #C6E7DA; color: #1E7A5E; }
.alert-danger { background: var(--danger-050); border-color: #EBCFC8; color: #A94433; }
.alert-warn { background: var(--warn-050); border-color: #EDDBAF; color: #9A7414; }
.alert-info { background: var(--brand-050); border-color: var(--brand-100); color: var(--brand-700); }

/* ============================ EMPTY STATE ============================ */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty__icon { width: 76px; height: 76px; border-radius: 22px; background: var(--brand-050); color: var(--brand); display: grid; place-items: center; font-size: 34px; margin: 0 auto 18px; }
.empty h4 { font-size: 17px; margin-bottom: 6px; }
.empty p { max-width: 380px; margin: 0 auto 18px; font-size: 14px; }

/* ============================ MISC ================================= */
.pill-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 13px; border: 1px solid var(--line); }
.pill-tabs a { padding: 7px 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.pill-tabs a.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 12px 18px; font-size: 14px; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; color: var(--ink); font-weight: 600; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding-bottom: 20px; }
.timeline__item::before { content: ''; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--brand-100); }
.timeline__time { font-size: 12px; color: var(--faint); font-weight: 600; }
.timeline__title { font-weight: 700; font-size: 14px; margin: 2px 0; }
.timeline__meta { font-size: 13px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-3{margin-top:14px}.mb-0{margin-bottom:0}.text-muted{color:var(--muted)}.text-gold{color:var(--gold-600)}.fw-700{font-weight:700}

/* ============================ RESPONSIVE ============================ */
.sidebar__backdrop { display: none; }
@media (max-width: 992px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .sidebar__backdrop.show { display: block; position: fixed; inset: 0; background: rgba(31,59,54,.34); z-index: 39; }
    .grid-2 { grid-template-columns: 1fr; }
    .search { display: none; }
}
@media (max-width: 640px) {
    .content { padding: 18px 16px 48px; }
    .form-grid { grid-template-columns: 1fr; }
    .page-head__actions { width: 100%; }
    .grid-3 { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; gap: 4px 0; }
    .detail-list dd { margin-bottom: 10px; }
}

/* ============================ SEARCHABLE SELECT ======================== */
.ss-wrap { position: relative; }
.ss-control { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.ss-control .ss-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-control .ss-value.ss-placeholder { color: var(--faint); }
.ss-control .ss-caret { color: var(--faint); font-size: 14px; transition: transform .15s; }
.ss-wrap.open .ss-control { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-050); }
.ss-wrap.open .ss-caret { transform: rotate(180deg); }
.ss-control.ss-disabled { opacity: .6; cursor: not-allowed; }
.ss-panel { position: fixed; z-index: 5000; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; }
.ss-panel.show { display: block; }
.ss-search { padding: 8px; border-bottom: 1px solid var(--line-soft); position: relative; }
.ss-search i { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; }
.ss-search input { width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 8px 10px 8px 32px;
    font-family: var(--font); font-size: 14px; outline: none; color: var(--ink); background: var(--surface); }
.ss-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.ss-list { max-height: 244px; overflow-y: auto; padding: 6px; }
.ss-item { padding: 9px 11px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item:hover, .ss-item.hi { background: var(--brand-050); color: var(--brand-700); }
.ss-item.active { background: linear-gradient(100deg, var(--brand), var(--brand-600)); color: #fff; }
.ss-empty { padding: 14px; text-align: center; color: var(--faint); font-size: 13px; }

/* ============================ MODAL (Bootstrap-compatible minimal) ===== */
.modal { position: fixed; inset: 0; z-index: 1055; display: none; width: 100%; height: 100%;
    overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 520px; pointer-events: none; }
.modal.fade .modal-dialog { transform: translateY(-28px); transition: transform .22s ease-out; }
.modal.show .modal-dialog { transform: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; }
.modal-sm { max-width: 340px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1060px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; width: 100vw; height: 100vh; background-color: #1F3B36; }
.modal-backdrop.fade { opacity: 0; transition: opacity .15s linear; }
.modal-backdrop.show { opacity: .45; }
body.modal-open { overflow: hidden; }
@media (max-width: 576px) { .modal-dialog { margin: .8rem; } .modal-dialog-centered { min-height: calc(100% - 1.6rem); } }

/* ============================ MODAL CARD (.modalx) global =============== */
.modal-content { background: var(--surface); }
.modalx { background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
    overflow: hidden; box-shadow: var(--shadow-lg); }
.modalx__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.modalx__head h3 { font-size: 18px; }
.modalx__body { padding: 6px 22px 10px; }
.modalx__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

/* ============================ FOOTER APLIKASI ========================== */
.app-footer { margin-top: 28px; padding: 16px 4px 10px; border-top: 1px solid var(--line);
    text-align: center; font-size: 12.5px; color: var(--muted); letter-spacing: .01em; }
.app-footer a { color: var(--brand-700); font-weight: 700; text-decoration: none; }
.app-footer a:hover { color: var(--gold-700); text-decoration: underline; }
.app-footer span { color: var(--faint); }
