/* Komponen — Template V3 (Quiet Luxury Fintech) */

/* ---- Pill tab (Swap / Limit) ----
   Radius standar tunggal: var(--radius-sm). TIDAK ada varian pill-penuh
   utk pill-tab — acuan referensi (tombol/tab di dalam card) selalu radius sedang. */
.pilltabs {
    display: inline-flex;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    gap: 2px;
}
.pilltab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background .15s, color .15s;
}
.pilltab.is-active {
    background: var(--surface-3);
    color: var(--text);
}

/* ---- Button ----
   Radius standar tunggal: var(--radius-sm), termasuk full-width.
   TIDAK ada varian pill-penuh utk tombol. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary,
.app a.btn-primary {
    background: #dcbc84;
    color: #14121c;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.btn-primary:hover { opacity: .92; }
.btn-ghost,
.app a.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-soft); }
.btn-danger,
.app a.btn-danger { background: var(--danger, #d9756b); color: var(--text-on-white); }
.btn-danger:hover { opacity: .92; }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Varian tombol di dalam card gelap (mis. "Swap" pada card Exchange) —
   gradasi surface halus, BUKAN putih solid seperti .btn-primary di area kosong */
.btn-surface {
    background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}
.btn-surface:hover { background: linear-gradient(180deg, var(--surface-3), var(--surface-3)); }

/* ---- Card ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}
@media (max-width: 480px) {
    .card { padding: var(--space-4); }
}
/* Jarak antar card yg BERURUTAN LANGSUNG (halaman detail spt
   order_detail_agen.php/order_detail.php — beberapa <div class="card">
   ditumpuk vertikal langsung di .content, bukan di dalam .grid). Pakai
   adjacent-sibling (bukan margin-bottom di .card itu sendiri) supaya card
   di dalam .grid (yg gap-nya sudah diatur parent) tidak kena margin dobel. */
.card + .card { margin-top: var(--space-4); }
.grid > .card + .card { margin-top: 0; } /* di dalam .grid, jarak sudah dari gap parent (components.css .grid) */
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}
.card-title { font-family: var(--font-heading); font-size: 17px; font-weight: 600; margin: 0; }
.card-icon-btn {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
}

/* Stat tile kecil (baris atas: Total profit, Best-profit token, dst) */
.stat {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: var(--space-4);
}
.stat-label { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.stat-value { font-size: 24px; }
.stat-value .figure-sm { font-size: 15px; opacity: .55; }
.stat-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}
.stat-delta.up { background: var(--amber-bg); color: var(--amber); }
.stat-delta.down { background: var(--danger-bg); color: var(--danger); }

/* Stat tile dgn ikon (Best-profit token / Unprofitable token) */
.stat-icon-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
}
.stat-icon.white {
    background: linear-gradient(160deg, #ededed, #f0eef2);
    border-color: #ededed;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    color: var(--text-on-white);
}

/* ---- List item (Exchange row: token swap) ---- */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin-bottom: 8px;
}
.list-item-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.list-item-link:hover { background: var(--surface-3, var(--surface-2)); }
.list-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--text-dim);
    background: none;
    border: none;
}
.list-icon.amber { color: var(--amber); }
.list-icon.rose { color: var(--rose); }
.list-icon.info { color: var(--info); }
.list-icon.success { color: var(--success); }
.list-icon.danger { color: var(--danger); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; font-weight: 500; }
.list-sub { font-size: 12px; color: var(--text-muted); }
.list-value { text-align: right; font-size: 13.5px; }
.list-value-sub { font-size: 12px; color: var(--danger); }

/* ---- Gradient feature card (dusty-rose, ciri khas referensi) ---- */
.card-feature {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2a1f2e 0%, #5a3a45 55%, #c98a94 100%);
    border: none;
    color: #ededed;
}
.card-feature .card-title,
.card-feature p { color: #ededed; }
.card-feature .btn-primary { background: rgba(255,255,255,.16); color: #ededed; backdrop-filter: blur(6px); }
.feature-dots {
    display: flex;
    gap: 6px;
    margin-top: var(--space-4);
}
.feature-dot { width: 20px; height: 3px; border-radius: var(--radius-full); background: rgba(255,255,255,.3); }
.feature-dot.is-active { background: #ededed; width: 28px; }

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 11.5px;
    font-weight: 600;
}
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-white { background: #ededed; color: var(--text-on-white); }
.badge-gray { background: var(--surface-3); color: var(--text-muted); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13.5px; }
.table thead th {
    text-align: left;
    padding: 0 16px 8px;
    color: var(--text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.table tbody tr { background: var(--surface-2); }
.table tbody td { padding: 14px 16px; color: var(--text-dim); }
.table tbody td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table tbody td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---- Form ---- */
.field { margin-bottom: var(--space-4); }
.label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 8px; }
.input, .select, .textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--amber-dim);
    background: var(--surface-3);
}
/* Paksa background autofill browser (Chrome/Edge biru/kuning muda, dst) tetap gelap
   sesuai tema — trik delay-transition krn browser tidak izinkan override langsung */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.select:-webkit-autofill,
.textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
    box-shadow: 0 0 0 1000px var(--surface-2) inset;
    transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
    caret-color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 96px; }
/* .select = native <select>, dropdown OPTION-nya dikontrol browser (TIDAK bisa
   di-custom penuh via CSS, warna highlight ikut tema browser). Hanya utk pilihan
   sangat pendek (2-3 opsi) yg tidak butuh search. Utk daftar lebih panjang
   (bank, kategori, dst) WAJIB pakai .ssel (searchable-select.js) — full custom. */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f3f7' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.help { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
/* State error dibuat gold (bukan merah) — konsisten dgn warna focus (--amber-dim),
   teks helper tetap dibedakan via ikon/kata "wajib" bukan lewat warna merah */
.field-error .input,
.field-error .select,
.field-error .textarea { border-color: var(--amber); }
.field-error .help { color: var(--amber); }

/* ---- Searchable Select (dropdown custom mirip select2, vanilla JS) ---- */
.ssel { position: relative; }
.ssel-control {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ssel-control .ssel-placeholder { color: var(--text-muted); }
.ssel-control i { color: var(--text-muted); font-size: 13px; transition: transform .15s; flex-shrink: 0; }
.ssel.is-open .ssel-control {
    border-color: var(--amber-dim);
    background: var(--surface-3);
}
.ssel.is-open .ssel-control i { transform: rotate(180deg); }

.ssel-panel {
    display: none;
    position: absolute;
    left: 0; right: 0; top: calc(100% + 6px);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 60;
    overflow: hidden;
}
.ssel.is-open .ssel-panel { display: block; }

.ssel-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
}
.ssel-search i { color: var(--text-muted); font-size: 13px; }
.ssel-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13.5px;
}
.ssel-search input:focus { outline: none; }
.ssel-search input::placeholder { color: var(--text-muted); }

.ssel-options { max-height: 220px; overflow-y: auto; padding: 6px; }
.ssel-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-dim);
    cursor: pointer;
}
.ssel-option:hover { background: var(--surface-2); color: var(--text); }
.ssel-option.is-selected { background: var(--amber-bg); color: var(--amber); }
.ssel-option.is-selected i { color: var(--amber); }
.ssel-empty { padding: 16px 12px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* Input dgn ikon prefix (spt search-box di referensi) */
.input-group { position: relative; }
.input-group .input { padding-left: 44px; }
.input-group-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Varian ikon kanan, CLICKABLE (mis. toggle show/hide password) */
.input-group-end .input { padding-left: 16px; padding-right: 44px; }
.input-group-btn {
    position: absolute;
    right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}
.input-group-btn:hover { color: var(--text); background: var(--surface-3); }

/* Checkbox & Radio custom */
.check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 10px;
}
.check input[type="checkbox"],
.check input[type="radio"] {
    appearance: none;
    width: 20px; height: 20px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    position: relative;
    transition: background .15s, border-color .15s;
}
.check input[type="checkbox"] { border-radius: 6px; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked {
    background: var(--amber);
    border-color: var(--amber);
}
.check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #14121c;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.check input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #14121c;
    transform: translate(-50%, -50%);
}

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
    width: 42px; height: 24px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    border: 1px solid var(--border);
    position: relative;
    transition: background .2s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform .2s, background .2s;
}
.toggle input:checked + .toggle-track { background: var(--amber-bg); border-color: var(--amber-dim); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); background: var(--amber); }

/* ---- Alert ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: var(--space-4);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
}
.alert i { margin-top: 2px; font-size: 15px; }
.alert-success { color: var(--success); }
.alert-success i { color: var(--success); }
.alert-warning { color: var(--text); }
.alert-warning i { color: var(--amber); }
.alert-danger { color: var(--text); }
.alert-danger i { color: var(--danger); }
.alert-info { color: var(--text); }
.alert-info i { color: var(--info); }

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.modal-overlay.is-open { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-soft);
}
.modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}
.modal-body { padding: var(--space-5); }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-soft);
}

/* ---- Avatar ---- */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), var(--rose));
    color: var(--text-on-white);
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 24px; }

/* Tombol ganti foto profil (halaman Akun) — wrapper klik di sekitar avatar
   + badge kamera overlay pojok kanan-bawah. */
.eko-ak-avatar-btn {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}
.eko-ak-avatar-edit {
    position: absolute;
    right: -2px; bottom: -2px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--text-on-white);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    border: 2px solid var(--surface);
}

/* Header profil halaman Akun — full-width, avatar sejajar horizontal dgn
   nama/ID/badge level (bukan lagi kolom kiri terpisah di grid-2). */
.eko-ak-header { display: flex; align-items: center; gap: var(--space-4); }
.eko-ak-header-info { min-width: 0; }
.eko-ak-header-name { font-family: var(--font-heading); font-size: 16px; font-weight: 600; color: var(--text); }
.eko-ak-header-id { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 480px) {
    .eko-ak-header { flex-wrap: wrap; }
}

/* Variasi warna gradasi (utk bedakan antar user di list) */
.avatar.c-amber { background: linear-gradient(135deg, var(--amber), var(--amber-dim)); }
.avatar.c-rose { background: linear-gradient(135deg, var(--rose), var(--rose-dim)); }
.avatar.c-info { background: linear-gradient(135deg, var(--info), #6a7fc9); }
.avatar.c-success { background: linear-gradient(135deg, var(--success), #5fae82); }

/* Indikator status (online/offline) */
.avatar-status {
    position: absolute;
    right: -1px; bottom: -1px;
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid var(--surface);
}
.avatar-status.online { background: var(--success); }
.avatar-status.offline { background: var(--text-muted); }
.avatar-status.busy { background: var(--danger); }

/* Avatar group (bertumpuk, mis. "5 member online") */
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group .avatar {
    border: 2px solid var(--surface);
    margin-left: -10px;
}
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 2px solid var(--surface);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    margin-left: -10px;
}

/* ---- Carousel ---- */
.carousel { position: relative; }
.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: var(--space-4);
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: start;
}
.carousel-slide.is-sized { width: 260px; }
/* Konten dalam slide pakai radius sedang (--radius-sm), BUKAN .card
   (--radius-lg) — supaya konsisten dgn komponen internal lain */
.carousel-panel {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
}
.carousel-panel.is-feature {
    border: none;
    color: #ededed;
    background: linear-gradient(135deg, #2a1f2e 0%, #5a3a45 55%, #c98a94 100%);
}
.carousel-panel.is-feature .card-title,
.carousel-panel.is-feature p { color: #ededed; }
.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.carousel-arrow {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 13px;
}
.carousel-arrow:hover { color: var(--text); border-color: var(--border); }
.carousel-dots { display: flex; gap: 6px; }
.carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background .15s, width .15s; }
.carousel-dot.is-active { background: var(--amber); width: 18px; border-radius: var(--radius-full); }

/* ---- Lightbox ---- */
.lightbox-trigger { cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden; display: block; }
.lightbox-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10,8,15,.92);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-figure { position: relative; max-width: 90vw; max-height: 85vh; }
.lightbox-figure img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius); display: block; }
.lightbox-caption { text-align: center; margin-top: var(--space-3); color: var(--text-dim); font-size: 13.5px; }
.lightbox-close {
    position: absolute; top: -44px; right: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.lightbox-nav {
    position: absolute; top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: #ededed;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.lightbox-nav.prev { left: -60px; }
.lightbox-nav.next { right: -60px; }
@media (max-width: 768px) {
    .lightbox-nav.prev { left: 4px; }
    .lightbox-nav.next { right: 4px; }
}

/* ---- Toast (notifikasi popup, beda dari .alert yg statis inline) ---- */
.toast-wrap {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    color: var(--text);
    animation: v3ToastIn .25s ease;
}
.toast i { margin-top: 1px; font-size: 15px; }
.toast-success i { color: var(--success); }
.toast-warning i { color: var(--amber); }
.toast-danger i { color: var(--danger); }
.toast-info i { color: var(--info); }
.toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; }
.toast.is-leaving { animation: v3ToastOut .2s ease forwards; }
@keyframes v3ToastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes v3ToastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---- Progress bar ---- */
.progress { margin-bottom: var(--space-4); }
.progress:last-child { margin-bottom: 0; }
.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}
.progress-label { color: var(--text-dim); }
.progress-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-track {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--amber);
    transition: width .3s ease;
}
.progress-fill.rose { background: var(--rose); }
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }

/* Progress bar tebal dgn label di dalam (mis. kuota/pagu) */
.progress-track.is-thick { height: 22px; }
.progress-track.is-thick .progress-fill {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-on-white);
    min-width: 32px;
}

/* ---- Empty state (paling sering dipakai — 68 file di codebase lama:
   riwayat_*.php, statement_bonus, dsb. Tampil saat num_rows == 0) ---- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-4);
}
.empty-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}
.empty-title { font-family: var(--font-heading); font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--text-muted); max-width: 280px; }
.empty .btn { margin-top: var(--space-4); }
/* Utility: empty-state di dalam .grid mengambil semua kolom (bukan 1 sel sempit) */
.eko-empty-span { grid-column: 1 / -1; }

/* ---- Filter chips (pill filter di atas list/riwayat, client-side —
   pola konsisten di semua halaman riwayat_*.php lama) ---- */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: var(--space-4);
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.is-active {
    background: var(--amber-bg);
    border-color: var(--amber-dim);
    color: var(--amber);
}

/* ---- Accordion ---- */
.accordion-item {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.accordion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}
.accordion-head i { color: var(--text-muted); transition: transform .2s; font-size: 12px; }
.accordion-item.is-open .accordion-head i { transform: rotate(180deg); }
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.accordion-body-inner { padding: 14px 16px; font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ---- Order status timeline (langkah non-interaktif, mis. status pesanan) ---- */
.timeline { display: flex; align-items: flex-start; }
.timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px; left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.timeline-step.is-done:not(:last-child)::after { background: var(--amber); }
.timeline-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}
.timeline-step.is-done .timeline-dot { background: var(--amber); border-color: var(--amber); color: var(--text-on-white); }
.timeline-step.is-current .timeline-dot { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.timeline-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.timeline-step.is-done .timeline-label,
.timeline-step.is-current .timeline-label { color: var(--text); }
.timeline-time { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 480px) {
    .timeline-label { font-size: 10px; line-height: 1.3; }
    .timeline-time { display: none; }
    .timeline-dot { width: 26px; height: 26px; font-size: 11px; }
    .timeline-step:not(:last-child)::after { top: 12px; }
}

/* ---- Grid util ---- */
.grid { display: grid; gap: var(--space-4); min-width: 0; }
.grid > * { min-width: 0; } /* cegah child grid memaksa track lebih lebar drpd konten yg wrap-able (teks panjang, tabel, dll) -> overflow-x horizontal */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 992px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
