:root {
  --pink: #f2547d;
  --pink-600: #d93a65;
  --pink-100: #ffe3ea;
  --pink-50: #fff4f7;
  --teal: #2fb3a8;
  --teal-100: #d9f3f0;
  --violet: #8a6cf0;
  --violet-100: #ece7ff;
  --amber: #f3a33b;
  --ink: #2a2233;
  --ink-2: #6b6275;
  --ink-3: #a59eae;
  --line: #efe8ee;
  --bg: #fbf7f9;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(80, 30, 60, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); min-height: 100%; }
body { overscroll-behavior-y: contain; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pink-600); }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; padding: 0 18px calc(110px + var(--safe-b)); min-height: 100vh; }

/* ---------- splash */
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash-dot { width: 46px; height: 46px; border-radius: 50%; background: var(--pink); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.75); opacity: .6; } }

/* ---------- typography */
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 10px; color: var(--ink-2); font-weight: 600; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 14px; position: sticky; top: 0; background: linear-gradient(var(--bg) 80%, transparent); z-index: 5; }
.topbar .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards & buttons */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.btn { border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; background: var(--pink); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, background .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--pink-100); color: var(--pink-600); }
.btn.white { background: #fff; color: var(--pink-600); }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: #fde8e8; color: #c62828; }
.btn.sm { padding: 9px 16px; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--pink-600); font-weight: 700; padding: 6px 0; }

/* ---------- forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 13px 14px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--pink); }
textarea.input { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.error-msg { color: #c62828; font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- auth */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 30px 0; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-logo { width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, #ff7a9c, var(--pink-600)); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(242, 84, 125, .35); }
.brand-logo svg { width: 30px; height: 30px; fill: #fff; }
.brand b { font-size: 26px; letter-spacing: -.02em; }
.auth .lead { font-size: 15px; color: var(--ink-2); margin: 0 0 22px; line-height: 1.5; }
.seg { display: flex; background: var(--pink-50); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--pink-600); box-shadow: var(--shadow); }

/* ---------- week strip */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 18px; }
.week .d { text-align: center; padding: 6px 0; border-radius: 14px; text-decoration: none; color: var(--ink); }
.week .d small { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 5px; font-weight: 600; }
.week .d b { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; font-size: 14px; }
.week .d.today small { color: var(--pink-600); }
.week .d.today b { box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- day marks (shared by week & calendar) */
.m-period b, .m-period .num { background: var(--pink); color: #fff; }
.m-pred b, .m-pred .num { box-shadow: inset 0 0 0 2px var(--pink) !important; color: var(--pink-600); background: var(--pink-50); border: 0; }
.m-pred.today b { box-shadow: inset 0 0 0 2px var(--pink), 0 0 0 2px var(--ink) !important; }
.m-fertile b, .m-fertile .num { background: var(--teal-100); color: #13756d; }
.m-ovu b, .m-ovu .num { background: var(--teal); color: #fff; }
.m-spot b, .m-spot .num { box-shadow: inset 0 0 0 2px #f7a6bb; }

/* ---------- hero circle */
.hero { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 6px auto 20px; }
.hero svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-inner { position: absolute; inset: 16px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.hero.p-menstruation .hero-inner { background: radial-gradient(circle at 30% 25%, #ff8aa8, var(--pink) 60%, var(--pink-600)); color: #fff; }
.hero.p-fertile .hero-inner, .hero.p-ovulation .hero-inner { background: radial-gradient(circle at 30% 25%, #6ad6cc, var(--teal) 65%, #1f8e85); color: #fff; }
.hero.p-follicular .hero-inner, .hero.p-luteal .hero-inner, .hero.p-none .hero-inner { background: radial-gradient(circle at 30% 25%, #fff, var(--pink-50)); color: var(--ink); }
.hero.p-late .hero-inner { background: radial-gradient(circle at 30% 25%, #ffd59a, var(--amber)); color: #4a2a00; }
.hero .k { font-size: 15px; font-weight: 600; opacity: .9; }
.hero .big { font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 4px 0 6px; }
.hero .s { font-size: 14px; opacity: .9; margin-bottom: 14px; }
.hero .btn { box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.hero.p-follicular .btn, .hero.p-luteal .btn, .hero.p-none .btn { background: var(--pink); color: #fff; }

/* ---------- stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile .lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tile .val { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.tile .val small { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tile .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.tile.accent { background: linear-gradient(135deg, var(--pink-50), #fff); }

/* ---------- phase card */
.phase-card { display: flex; gap: 14px; align-items: flex-start; }
.phase-ico { flex: 0 0 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--pink-50); }
.phase-card p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.chips-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips-mini span { background: var(--pink-50); color: var(--pink-600); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; }

/* ---------- calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 2px; }
.cal-grid .wd { text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 700; padding-bottom: 6px; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; border: 0; background: none; padding: 0; position: relative; }
.cal-day .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 600; transition: transform .1s; }
.cal-day:active .num { transform: scale(.9); }
.cal-day.out { visibility: hidden; }
.cal-day.future-off .num { color: var(--ink-3); }
.cal-day.today .num { box-shadow: 0 0 0 2px var(--ink); }
.cal-day.sel .num { outline: 3px solid rgba(242, 84, 125, .35); outline-offset: 2px; }
.cal-day .dot { position: absolute; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); }
.cal-edit .cal-day .num { box-shadow: inset 0 0 0 1.5px var(--line); }
.cal-edit .cal-day.m-period .num { box-shadow: none; }
.cal-edit .cal-day.future-off { pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: 5px; }
.edit-banner { background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 14px; }
.edit-banner .btn { padding: 8px 16px; }

/* ---------- day detail */
.tag { display: inline-block; white-space: nowrap; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; margin: 0 6px 6px 0; }
.tag.pink { background: var(--pink-100); color: var(--pink-600); }
.tag.teal { background: var(--teal-100); color: #13756d; }
.tag.violet { background: var(--violet-100); color: #5a3fc0; }
.tag.gray { background: #f1eef2; color: var(--ink-2); }

/* ---------- log screen */
.log-date { display: flex; align-items: center; justify-content: space-between; }
.log-date .t { text-align: center; }
.log-date .t b { display: block; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; border-radius: 16px; background: #f6f2f5; padding: 10px 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); transition: background .15s, color .15s, transform .1s; }
.chip:active { transform: scale(.95); }
.chip .e { font-size: 18px; }
.chip.on { background: var(--pink); color: #fff; }
.sec-mood .chip.on { background: var(--amber); }
.sec-discharge .chip.on { background: var(--teal); }
.sec-sex .chip.on { background: var(--violet); }
.flow-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flow-opt { border: 0; background: #f6f2f5; border-radius: 16px; padding: 12px 4px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flow-opt .drops { display: flex; gap: 2px; height: 20px; align-items: center; }
.flow-opt .drops svg { width: 14px; height: 18px; fill: var(--pink); }
.flow-opt.on { background: var(--pink); color: #fff; }
.flow-opt.on .drops svg { fill: #fff; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--pink-100); color: var(--pink-600); font-size: 20px; font-weight: 800; }
.stepper b { font-size: 20px; min-width: 32px; text-align: center; }
.save-bar { position: fixed; left: 0; right: 0; bottom: calc(78px + var(--safe-b)); padding: 10px 18px; z-index: 20; pointer-events: none; }
.save-bar .btn { max-width: 524px; margin: 0 auto; display: flex; pointer-events: auto; box-shadow: 0 10px 24px rgba(242, 84, 125, .35); }

/* ---------- insights */
.cycle-row { margin-bottom: 14px; }
.cycle-row .meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.cycle-row .meta b { color: var(--ink); }
.cycle-bar { height: 12px; border-radius: 999px; background: var(--teal-100); position: relative; overflow: hidden; }
.cycle-bar .p { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pink); border-radius: 999px; }
.cycle-bar.cur { background: repeating-linear-gradient(45deg, var(--teal-100), var(--teal-100) 6px, #eaf8f6 6px, #eaf8f6 12px); }
.rank { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.rank .e { width: 26px; text-align: center; font-size: 18px; }
.rank .n { flex: 0 0 120px; }
.rank .bar { flex: 1; height: 8px; border-radius: 999px; background: #f4eef2; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--pink); border-radius: 999px; }
.rank .c { width: 26px; text-align: right; color: var(--ink-2); font-size: 13px; }
.chart svg { width: 100%; height: 160px; display: block; }
.empty { text-align: center; padding: 26px 10px; color: var(--ink-2); }
.empty .e { font-size: 38px; margin-bottom: 8px; }

/* ---------- settings */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; font-size: 15px; text-decoration: none; color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.list-item .v { color: var(--ink-2); font-size: 14px; }
.list-item.danger { color: #c62828; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 48px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #e3dbe1; border-radius: 999px; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--pink); }
.switch input:checked + i::after { transform: translateX(20px); }
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #ff9db5, var(--pink)); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.disclaimer { font-size: 12px; color: var(--ink-3); line-height: 1.5; text-align: center; margin: 18px 6px; }

/* ---------- tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; padding: 8px 6px calc(8px + var(--safe-b)); }
.tabbar a { flex: 1; max-width: 100px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 700; padding: 4px 0; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--pink-600); }
.tabbar a.tab-add { flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--pink); color: #fff; margin-top: -26px; justify-content: center; box-shadow: 0 8px 20px rgba(242, 84, 125, .4); }
.tabbar a.tab-add svg { width: 28px; height: 28px; stroke-width: 2.6; }

/* ---------- sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(30, 15, 30, .35); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 26px 26px 0 0; padding: 10px 20px calc(36px + var(--safe-b)); max-width: 560px; margin: 0 auto; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; animation: up .25s cubic-bezier(.2,.9,.3,1.1); }
/* Kunci gulir halaman di belakang selama sheet terbuka, supaya gesekan menggulir isi sheet */
body.sheet-open { overflow: hidden; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offline-pill { background: #fff3cd; color: #7a5a00; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; display: inline-block; margin-bottom: 10px; }

@media (min-width: 700px) {
  #app { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- perbaikan penanda pada tanggal mendatang */
.btn { text-decoration: none; }
.cal-day.future-off.m-fertile .num { color: #13756d; }
.cal-day.future-off.m-ovu .num { color: #fff; }
.cal-day.future-off.m-pred .num { color: var(--pink-600); }
.cycle-row.invalid .meta { color: var(--ink-3); }

/* ---------- tarik untuk refresh */
.ptr { position: fixed; top: 0; left: 50%; z-index: 50; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(80, 30, 60, .18); display: grid; place-items: center; transform: translateY(-60px); opacity: 0; pointer-events: none; }
.ptr svg { width: 22px; height: 22px; fill: none; stroke: var(--pink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ptr.anim { transition: transform .25s, opacity .25s; }
.ptr.ready svg { stroke: var(--pink-600); }
.ptr.spin svg { animation: ptrspin .8s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* ---------- langganan (pengguna) */
.sub-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--violet-100), #fff); color: #4a33a8; border-radius: 16px; padding: 11px 14px; font-size: 14px; text-decoration: none; margin-bottom: 12px; box-shadow: var(--shadow); }
.sub-banner.warn { background: linear-gradient(135deg, #fdf0dc, #fff); color: #7a4a00; }
.plan-card { padding: 16px 18px; }
.plan-price { font-size: 22px; font-weight: 800; color: var(--pink-600); letter-spacing: -.02em; }

/* ---------- portal admin */
body.admin-mode #app { max-width: none; padding: 0; }
.adm { display: flex; min-height: 100vh; }
.adm-nav { width: 240px; flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.adm-brand .brand-logo { width: 40px; height: 40px; border-radius: 13px; }
.adm-brand .brand-logo svg { width: 22px; height: 22px; }
.adm-brand b { display: block; font-size: 18px; }
.adm-brand small { color: var(--ink-2); font-size: 12px; }
.adm-nav nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav nav a, .adm-nav-foot a, .adm-nav-foot button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; background: none; border: 0; text-align: left; width: 100%; }
.adm-nav nav a:hover, .adm-nav-foot a:hover, .adm-nav-foot button:hover { background: var(--pink-50); }
.adm-nav nav a.on { background: var(--pink-100); color: var(--pink-600); }
.adm-nav-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.adm-nav-foot a, .adm-nav-foot button { font-size: 14px; color: var(--ink-2); }
.adm-main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1200px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.adm-head h1 { font-size: 26px; }
.adm-head .sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.adm-head .back { text-decoration: none; color: var(--ink-2); margin-right: 4px; }
.adm-actions { display: flex; gap: 8px; }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.adm-tiles .tile { text-decoration: none; color: inherit; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.adm-grid > .card { margin-bottom: 14px; }
.adm-warn { background: #fff6e0; color: #7a5a00; border-radius: 14px; padding: 11px 14px; font-size: 14px; margin-bottom: 12px; }
.adm-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-filters .input { flex: 1; min-width: 150px; width: auto; padding: 10px 12px; }
.adm-filters #q { flex: 3; min-width: 220px; }
.adm-list .adm-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 14px; }
.adm-list .adm-row:last-child { border: 0; }
.adm-row .right { text-align: right; }
.tbl-wrap { overflow-x: auto; }
.card.tbl-wrap { padding: 6px 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-href] { cursor: pointer; }
.tbl tr[data-href]:hover td { background: var(--pink-50); }
.tbl .tag { margin: 0; }
.tbl code, .copy code { font-size: 12px; background: #f6f2f5; padding: 2px 6px; border-radius: 6px; }
.nowrap { white-space: nowrap; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border: 0; }
.kv span { color: var(--ink-2); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--ink-2); height: 100%; }
.bar-col i { display: block; width: 100%; max-width: 46px; background: linear-gradient(var(--pink), #ff8aa8); border-radius: 8px 8px 3px 3px; }
.bar-v { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.plan-grid .card.inactive { opacity: .6; }
.seg.gw { display: inline-flex; margin-bottom: 14px; }
.seg.gw label { position: relative; }
.seg.gw input { position: absolute; opacity: 0; }
.seg.gw span { display: block; padding: 9px 18px; border-radius: 999px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg.gw input:checked + span { background: #fff; color: var(--pink-600); box-shadow: var(--shadow); }
.gw-box { border: 1.5px dashed var(--line); border-radius: 16px; padding: 14px 14px 4px; margin-bottom: 14px; }
.copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy code { word-break: break-all; flex: 1; padding: 8px 10px; }
.field small { display: block; margin-top: 5px; font-size: 12px; }
select.input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6275' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
body.admin-mode .sheet { max-width: 620px; }

@media (max-width: 860px) {
  .adm { flex-direction: column; }
  .adm-nav { width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 10; padding: 10px 10px 6px; flex-direction: row; align-items: center; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .adm-brand { padding: 0 6px 0 0; }
  .adm-brand div:last-child { display: none; }
  .adm-nav nav { flex-direction: row; }
  .adm-nav nav a, .adm-nav-foot a, .adm-nav-foot button { white-space: nowrap; padding: 8px 10px; font-size: 14px; }
  .adm-nav-foot { margin: 0; border: 0; padding: 0; display: flex; }
  .adm-main { padding: 18px 14px 60px; }
  .adm-grid { grid-template-columns: 1fr; }
}

/* ---------- mode baca-saja */
.sub-banner.lock { background: linear-gradient(135deg, #2a2233, #4a3a55); color: #fff; }

/* ---------- tombol lihat kata sandi */
.pw-wrap { position: relative; display: block; flex: 1; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.pw-eye:hover { background: var(--pink-50); color: var(--ink-2); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- pembayaran di dalam aplikasi */
.method-list .list-item { padding: 12px 16px; }
.method-list img { width: 52px; height: 32px; object-fit: contain; flex: 0 0 52px; }
.method-list .m-ico { width: 52px; flex: 0 0 52px; text-align: center; font-size: 22px; }
.method-list .row > * { flex: initial; }
.method-list .list-item.picked { background: var(--pink-50); box-shadow: inset 3px 0 0 var(--pink); }
.method-list .m-check { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; font-size: 13px; color: #fff; }
.method-list .picked .m-check { background: var(--pink); box-shadow: none; }
.method-list .picked .m-check::after { content: "✓"; font-weight: 800; }
/* Tombol Bayar menempel di dasar pop-up, selalu terlihat walau daftar metode panjang */
.pay-footer { position: sticky; bottom: calc(-36px - var(--safe-b)); margin: 16px -20px calc(-36px - var(--safe-b)); padding: 12px 20px calc(16px + var(--safe-b)); background: #fff; box-shadow: 0 -8px 16px -10px rgba(80, 30, 60, .25); z-index: 1; }
.pay-footer .btn:disabled { opacity: .55; cursor: not-allowed; }
.pay-card { text-align: center; }
.pay-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pay-total { font-size: 34px; letter-spacing: -.02em; color: var(--ink); }
.pay-timer { display: inline-block; margin: 12px 0 4px; background: #fff3e6; color: #8a4b00; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.pay-method { font-weight: 700; margin: 10px 0 12px; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line); }
.qr-box svg { display: block; width: min(260px, 64vw); height: auto; }
.pay-card .row { justify-content: center; }
.pay-card .row > * { flex: 0 0 auto; }
.pay-code-label { font-size: 13px; color: var(--ink-2); }
.pay-code { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 4px; flex-wrap: wrap; }
.pay-code span { font-size: 26px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; word-break: break-all; }
.pay-status { margin-top: 16px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 8px; }
.dot-pulse { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); animation: pulse 1.2s ease-in-out infinite; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }
.pay-done h2 { margin: 6px 0; }
.chip.chk { cursor: pointer; }
.chip.chk input { accent-color: var(--pink); }

/* ---------- status offline / sinkronisasi */
.net-status { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 55; background: #2a2233; color: #fff; font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 999px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; white-space: nowrap; }
.net-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: pulse 1.2s ease-in-out infinite; }
.net-status.off { background: #7a4a00; }
.net-status.off .dot { background: #ffcf7a; animation: none; }
body.has-net #app { padding-top: 40px; }
body.has-net .topbar { top: 40px; }
