/* =====================================================================
   UI PINK — gaya Rascal Store, aksen pink magenta (mode terang & gelap)
   ===================================================================== */
:root {
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-d: 'Space Grotesk', 'Poppins', sans-serif;
    --bg: #fdf2fb;
    --surface: #ffffff;
    --surface-2: #fce7f8;
    --surface-3: #f8dcf2;
    --line: #f6d4ee;
    --line-soft: #f6d4ee;
    --line-strong: #efc2e5;
    --text: #2a0f26;
    --text-2: #4a2a44;
    --muted: #8a6a84;
    --ink: #170b1c;
    --brand: #e100c8;
    --brand-2: #ff4fe0;
    --lime: #ff00d4;
    --brand-soft: rgba(255, 0, 212, .10);
    --brand-line: rgba(255, 0, 212, .35);
    --grad: linear-gradient(135deg, #ff00d4, #c800e0);
    --ok: #059669;  --ok-soft: rgba(16, 185, 129, .12);
    --warn: #d97706; --warn-soft: rgba(245, 158, 11, .14);
    --bad: #e11d48; --bad-soft: rgba(225, 29, 72, .10);
    --info: #2563eb; --info-soft: rgba(59, 130, 246, .12);
    --glass: rgba(253, 242, 251, .9);
    --sh: 0 10px 26px -14px rgba(255, 0, 212, .45);
    --shadow-sm: var(--sh); --shadow: var(--sh); --shadow-lg: 0 18px 36px -16px rgba(120, 0, 100, .45);
    --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 22px;
    --header-h: 64px;
    --cut: none; --cut-sm: none;
    color-scheme: light;
}
[data-theme="dark"] {
    --bg: #0e0a14;
    --surface: #171223;
    --surface-2: #211830;
    --surface-3: #2a1f3b;
    --line: #33213f;
    --line-soft: #33213f;
    --line-strong: #43294f;
    --text: #fbefff;
    --text-2: #e4cfe9;
    --muted: #a693b5;
    --ink: #08050c;
    --brand: #ff3de0;
    --brand-soft: rgba(255, 0, 212, .15);
    --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
    --glass: rgba(14, 10, 20, .9);
    --sh: 0 10px 26px -14px rgba(0, 0, 0, .85);
    --shadow-lg: 0 18px 36px -16px rgba(0, 0, 0, .9);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
    font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    padding-top: var(--header-h); padding-bottom: 104px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 0, 212, .3); }
.ui-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 14px 8px; }
.ui-narrow { max-width: 580px; }
.muted { color: var(--muted); }
.disp { font-family: var(--font-d); text-transform: uppercase; letter-spacing: .02em; }

/* ---------- bingkai berjalan (dipakai banner & kartu) ---------- */
.run-border { position: relative; overflow: hidden; background: var(--line); }
.run-border::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 160%; height: 160%; z-index: 0;
    background: conic-gradient(transparent 0%, transparent 55%, #ff00d4 78%, #ff9cf0 100%);
    animation: runb 3s linear infinite;
}
.run-border > * { position: relative; z-index: 1; }
@keyframes runb { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- header ---------- */
.ui-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 60; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.ui-header-in { height: 100%; max-width: 1120px; margin: 0 auto; padding: 0 14px; display: flex; align-items: center; gap: 10px; }
.ui-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ui-brand .lg, .ui-drawer-head .lg { position: relative; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--grad); display: grid; place-items: center; overflow: hidden; box-shadow: var(--sh); }
.ui-brand .lg img, .ui-drawer-head .lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.ui-brand .lg b, .ui-drawer-head .lg b { font-family: var(--font-d); color: #fff; font-size: 1.1rem; }
.ui-brand .tx { min-width: 0; line-height: 1.1; }
.ui-brand .tx b { display: block; font-family: var(--font-d); font-weight: 700; font-size: 1.08rem; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-brand .tx small { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: .64rem; font-weight: 500; color: var(--muted); }
.ui-brand .tx small i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex: none; }
.ui-iconbtn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; cursor: pointer; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; transition: .15s; }
.ui-iconbtn:hover { color: var(--brand); border-color: var(--brand-line); }
.ui-theme .fa-sun { display: none; }
[data-theme="dark"] .ui-theme .fa-sun { display: inline; }
[data-theme="dark"] .ui-theme .fa-moon { display: none; }

/* ---------- baris kembali ---------- */
.ui-back { max-width: 1120px; margin: 0 auto; padding: 10px 14px 0; }
.ui-back-in { display: flex; align-items: center; gap: 10px; }
.ui-back a { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: .86rem; }
.ui-back a span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.ui-back em { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 600; color: var(--muted); }

/* ---------- menu samping ---------- */
.ui-overlay { position: fixed; inset: 0; background: rgba(10, 0, 12, .5); backdrop-filter: blur(3px); z-index: 80; opacity: 0; visibility: hidden; transition: .2s; }
.ui-overlay.open { opacity: 1; visibility: visible; }
.ui-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); z-index: 90; background: var(--surface); border-left: 1px solid var(--line); transform: translateX(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; padding: 16px 14px 24px; overflow-y: auto; border-radius: 22px 0 0 22px; }
.ui-drawer.open { transform: none; }
.ui-drawer-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ui-drawer-head b { flex: 1; font-family: var(--font-d); text-transform: uppercase; line-height: 1.15; }
.ui-drawer-head small { display: block; font-family: var(--font); text-transform: none; font-weight: 500; color: var(--muted); font-size: .72rem; }
.ui-drawer-label { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; padding: 16px 6px 6px; }
.ui-drawer a.item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 13px; font-weight: 600; font-size: .9rem; }
.ui-drawer a.item i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--brand); font-size: .95rem; }
.ui-drawer a.item:hover, .ui-drawer a.item.active { background: var(--brand-soft); color: var(--brand); }
.ui-drawer a.item.active i { background: var(--grad); color: #fff; }
.ui-drawer a.item .go { margin-left: auto; width: auto; height: auto; background: none; color: var(--muted); font-size: .72rem; }
.ui-drawer a.item.wa i { color: #16a34a; } .ui-drawer a.item.tg i { color: #0284c7; }

/* ---------- menu bawah ---------- */
.ui-nav { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: calc(100% - 28px); max-width: 540px; display: flex; padding: 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.ui-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 99px; font-size: .62rem; font-weight: 600; color: var(--muted); }
.ui-nav a i { font-size: 1.02rem; }
.ui-nav a.active { background: var(--grad); color: #fff; }
body.no-nav { padding-bottom: 32px; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid transparent; border-radius: 13px; padding: 12px 18px; font-weight: 700; font-size: .88rem; line-height: 1.2; transition: transform .1s, filter .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--sh); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand-line); color: var(--brand); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-wa { background: #16a34a; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: .76rem; border-radius: 10px; }
.btn-lg { padding: 14px 20px; font-size: .95rem; border-radius: 15px; }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.input, .field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: .93rem; outline: none; transition: .15s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input::placeholder, .field input::placeholder { color: var(--muted); }

/* ---------- kartu, badge, pesan ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); }
.card-pad { padding: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; margin-bottom: 12px; }
.card-title i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); font-size: .78rem; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: .66rem; font-weight: 700; line-height: 1.3; border: 1px solid var(--line); background: var(--surface-2); color: var(--brand); }
.badge-brand { background: var(--grad); color: #fff; border-color: transparent; }
.badge-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.badge-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.badge-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; font-size: .86rem; font-weight: 600; margin-bottom: 14px; border: 1px solid; }
.alert i { margin-top: 2px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(16, 185, 129, .3); }
.alert-bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(225, 29, 72, .3); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 158, 11, .3); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: rgba(59, 130, 246, .3); }

.ui-pagehead { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.ui-pagehead .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--sh); flex: none; }
.ui-pagehead h1 { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
.ui-pagehead p { color: var(--muted); font-size: .82rem; margin-top: 3px; }

.ui-footer { text-align: center; color: var(--muted); font-size: .72rem; padding: 22px 0 8px; }
.ui-footer b { color: var(--text); }
.ui-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); z-index: 120; opacity: 0; pointer-events: none; background: var(--grad); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: .82rem; box-shadow: var(--sh); transition: .2s; }
.ui-toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes uiUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ui-anim { animation: uiUp .35s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .run-border::before, .ui-anim { animation: none !important; } }
@media (min-width: 900px) { .ui-container { padding: 20px 24px 8px; } }
