/* ══════════════════════════════════════════════════════════════════
   app-theme.css — token + komponen untuk halaman USER (dashboard, billing,
   fitur). Sengaja dipisah dari theme.css supaya panel admin yang sudah
   berjalan tidak ikut berubah.

   Keputusan desain: struktur widget ala referensi Outcrowd (kanvas sangat
   terang, ink sangat gelap, satu accent jenuh, pastel teredam untuk data),
   accent tetap merah bata kopi supaya identitas brand tidak hilang.

   SEMUA warna/spasi/radius di sini token. Tidak ada ukuran sekali pakai.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #F4F3F0;
  --bg-alt: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F3F1ED;
  --surface-3: #EAE7E1;

  --ink: #14120F;
  --ink-2: #35312B;
  --muted: #6B645C;
  --faint: #97918A;

  --line: #E3DFD7;
  --line-soft: #EDEAE4;
  --line-strong: #D1CBC0;

  --accent: #A13D2D;
  --accent-ink: #7E2D20;
  --accent-hover: #B8472F;
  --accent-soft: #FBF0ED;
  --accent-line: #F0D8D1;
  --accent-ring: rgba(161, 61, 45, .16);

  --ok: #1B7A46;      --ok-bg: #E9F5EE;   --ok-line: #C5E3D2;
  --warn: #8A6410;    --warn-bg: #FBF3E0;  --warn-line: #EEDFB8;
  --err: #A52121;     --err-bg: #FBECEC;   --err-line: #EFD0D0;
  --info: #1F5B99;    --info-bg: #EAF2FB;  --info-line: #CBDEF2;

  /* warna data — pastel teredam, bukan accent */
  --data-1: #7C9DC4;
  --data-2: #B1D1A6;
  --data-3: #FDCA4B;
  --data-4: #B26552;
  --data-5: #C6C3D7;

  --fs-display: 32px;
  --fs-h1: 24px;
  --fs-h2: 17px;
  --fs-h3: 14px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-micro: 11px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 72px;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(20, 18, 15, .04);
  --sh-2: 0 2px 10px rgba(20, 18, 15, .05);
  --sh-3: 0 8px 28px rgba(20, 18, 15, .08);
  --sh-4: 0 20px 56px rgba(20, 18, 15, .13);

  --sidebar-w: 244px;
  --topbar-h: 64px;
}

/* dark mode: cukup timpa token */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --bg-alt: #181716;
    --surface: #1D1B19;
    --surface-2: #242220;
    --surface-3: #2C2A27;
    --ink: #F4F2EE;
    --ink-2: #DDD8D1;
    --muted: #A39C93;
    --faint: #7C756D;
    --line: #302D2A;
    --line-soft: #282523;
    --line-strong: #3D3935;
    --accent: #D2684F;
    --accent-ink: #E9856D;
    --accent-hover: #E07A60;
    --accent-soft: #2A1B17;
    --accent-line: #3D2620;
    --ok-bg: #14261C;   --ok-line: #24422F;   --ok: #6FC796;
    --warn-bg: #2A2415; --warn-line: #443A22; --warn: #E0BC6A;
    --err-bg: #2B1717;  --err-line: #472424;  --err: #E88C8C;
    --info-bg: #14222F; --info-line: #24405A; --info: #7FB4E8;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
    --sh-2: 0 2px 10px rgba(0, 0, 0, .45);
    --sh-3: 0 8px 28px rgba(0, 0, 0, .55);
    --sh-4: 0 20px 56px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.25; letter-spacing: -.011em; }
svg { stroke-width: 1.8; }

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { margin-left: auto; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.inline { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── tombol ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer; box-shadow: var(--sh-1); white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg {
  width: 15px; height: 15px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--err); }
.btn.danger-soft { background: var(--err-bg); color: var(--err); border-color: var(--err-line); box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: var(--fs-xs); gap: 5px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.xs { padding: 4px 9px; font-size: var(--fs-micro); gap: 4px; border-radius: var(--r-sm); }
.btn.xs svg { width: 12px; height: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 34px; height: 34px; }
.btn.icon.sm { width: 28px; height: 28px; }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
.btn.secondary.loading::after, .btn.ghost.loading::after {
  border-color: var(--line-strong); border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── form ───────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--fs-body);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2); color: var(--muted); cursor: not-allowed;
}
textarea {
  min-height: 96px; resize: vertical;
  font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.7;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field > label, .lbl {
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); letter-spacing: .01em;
}
.field .help { font-size: var(--fs-xs); color: var(--faint); line-height: 1.45; }

.input-ico { position: relative; display: flex; align-items: center; width: 100%; }
.input-ico > svg {
  position: absolute; left: 12px; width: 15px; height: 15px;
  stroke: var(--faint); fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.input-ico > input { padding-left: 35px; }
.input-ico:focus-within > svg { stroke: var(--accent); }

.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 150px; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }
.actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s3); }

/* ── kartu ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-1);
}
.card + .card { margin-top: var(--s4); }
.card-head { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); }
.card-head.tight { margin-bottom: var(--s3); }
.card-title { font-size: var(--fs-h2); font-weight: 700; color: var(--ink); margin: 0; }
.card-sub { font-size: var(--fs-xs); color: var(--muted); margin: 3px 0 0; }
.card.soft { background: var(--surface-2); box-shadow: none; border-color: var(--line-soft); }
.card.dashed { background: var(--bg-alt); border-style: dashed; box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }

.divider { height: 1px; background: var(--line-soft); margin: var(--s5) 0; border: 0; }
.divider-txt {
  display: flex; align-items: center; gap: var(--s3);
  margin: var(--s5) 0; font-size: var(--fs-xs); color: var(--faint);
}
.divider-txt::before, .divider-txt::after {
  content: ""; flex: 1; height: 1px; background: var(--line-soft);
}

/* ── badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2); font-size: var(--fs-micro); font-weight: 600;
  color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.badge.ok::before, .badge.err::before, .badge.warn::before {
  content: "●"; font-size: 7px; line-height: 1;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--err); }

/* ── tabel ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
thead th {
  text-align: left; padding: 10px var(--s4);
  background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-micro); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
tbody td { padding: 11px var(--s4); border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-alt); }
.td-strong { font-weight: 700; color: var(--ink); }

/* ── kosong & skeleton ──────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: var(--s8) var(--s5); text-align: center;
  color: var(--faint); font-size: var(--fs-sm); line-height: 1.6;
}
.empty svg { width: 30px; height: 30px; stroke: var(--line-strong); fill: none; stroke-width: 1.6; }
.empty b { color: var(--ink); font-size: var(--fs-body); font-weight: 700; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-line:last-child { margin-bottom: 0; width: 60%; }
.sk-card { height: 78px; border-radius: var(--r); margin-bottom: 10px; }
.sk-row { height: 40px; margin-bottom: 6px; }

/* ── widget statistik ───────────────────────────────────────────── */
.stat-grid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s4) var(--s5); box-shadow: var(--sh-1);
}
.stat .st-top { display: flex; align-items: center; gap: 7px; margin-bottom: var(--s2); }
.stat .st-ico {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.stat .st-ico svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.stat .st-label {
  font-size: var(--fs-micro); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.stat .st-val {
  font-size: var(--fs-h1); font-weight: 800; color: var(--ink);
  letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.stat .st-sub { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }

/* ── modal ──────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: var(--s4);
  background: rgba(20, 18, 15, .45); backdrop-filter: blur(2px);
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%; max-width: 460px; max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-4); overflow: hidden;
  animation: popIn .18s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-box.wide { max-width: 620px; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s5); border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: var(--fs-h2); font-weight: 700; }
.modal-head p { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.modal-x {
  margin-left: auto; width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--faint); font-size: 20px; line-height: 1; cursor: pointer; flex: 0 0 auto;
}
.modal-x:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: var(--s5); overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s4) var(--s5); border-top: 1px solid var(--line-soft);
  background: var(--bg-alt);
}

/* ── toast ──────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; right: var(--s5); bottom: var(--s5); z-index: 200;
  display: flex; flex-direction: column; gap: var(--s2);
  max-width: min(360px, calc(100vw - 32px));
}
.toast-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px var(--s4);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--faint); border-radius: var(--r);
  box-shadow: var(--sh-3); font-size: var(--fs-sm); color: var(--ink-2);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.toast-item.show { opacity: 1; transform: none; }
.toast-item.ok { border-left-color: var(--ok); }
.toast-item.err { border-left-color: var(--err); }
.toast-item.warn { border-left-color: var(--warn); }
.toast-item.info { border-left-color: var(--info); }
.toast-item b { display: block; color: var(--ink); font-weight: 700; margin-bottom: 1px; }

/* ── kerangka ───────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: var(--s5) var(--s4);
  border-bottom: 1px solid var(--line-soft); color: inherit;
}
.sb-brand:hover { text-decoration: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 17px; flex: 0 0 auto;
}
.brand-txt h1 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -.02em; }
.brand-txt span { font-size: var(--fs-micro); color: var(--faint); }

.sb-nav { flex: 1; overflow-y: auto; padding: var(--s3) var(--s3) var(--s4); }
.sb-group {
  padding: 10px 10px 5px;
  font-size: var(--fs-micro); font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .07em;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; margin-bottom: 2px;
  border: 0; border-radius: var(--r); background: transparent;
  color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background .13s, color .13s;
}
.sb-item svg {
  width: 16px; height: 16px; flex: 0 0 auto;
  stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; opacity: .75;
}
.sb-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sb-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.sb-item.active svg { opacity: 1; }
.sb-item .cnt {
  margin-left: auto; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--muted);
  font-size: var(--fs-micro); font-weight: 700; font-variant-numeric: tabular-nums;
}
.sb-item.active .cnt { background: var(--accent); color: #fff; }
.sb-item.locked { opacity: .55; }
.sb-item .lock { margin-left: auto; font-size: 10px; opacity: .8; }

.sb-foot { border-top: 1px solid var(--line-soft); padding: var(--s3); }
.userbox { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--r); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--fs-xs); font-weight: 800; flex: 0 0 auto;
}
.userbox .un { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); min-width: 0; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s6);
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: var(--fs-h2); font-weight: 700; }
.topbar .sub { font-size: var(--fs-xs); color: var(--muted); }

.credit-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--accent-line); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--fs-sm); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.credit-chip:hover { text-decoration: none; border-color: var(--accent); }
.credit-chip svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.content { padding: var(--s6); max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s5); }
.page-head .phi {
  width: 40px; height: 40px; border-radius: var(--r);
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent-ink);
}
.page-head .phi svg {
  width: 19px; height: 19px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.page-head h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--muted); }

.banner {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s4); border: 1px solid var(--accent-line);
  border-radius: var(--r-lg); background: var(--accent-soft); margin-bottom: var(--s5);
}
.banner svg {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
  stroke: var(--accent-ink); fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.banner b { color: var(--accent-ink); }
.banner p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.banner.warn b { color: var(--warn); }
.banner.warn svg { stroke: var(--warn); }
.banner.err { background: var(--err-bg); border-color: var(--err-line); }
.banner.err b { color: var(--err); }
.banner.err svg { stroke: var(--err); }

.alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px var(--s4); border: 1px solid var(--err-line);
  border-radius: var(--r); background: var(--err-bg);
  color: var(--err); font-size: var(--fs-sm); font-weight: 500;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; }

.grid2 { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── auth ───────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-side {
  padding: var(--s9) var(--s8);
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #fff;
}
.auth-side h1 { color: #fff; font-size: var(--fs-display); font-weight: 800; letter-spacing: -.03em; }
.auth-side p { color: rgba(255, 255, 255, .82); margin: var(--s3) 0 0; font-size: var(--fs-body); max-width: 400px; }
.auth-side ul { list-style: none; padding: 0; margin: var(--s6) 0 0; display: flex; flex-direction: column; gap: var(--s3); }
.auth-side li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .92); }
.auth-side li svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.4; flex: 0 0 auto; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--s7) var(--s5); }
.auth-card { width: 100%; max-width: 404px; }
.auth-card h2 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.02em; }
.auth-card .lead { color: var(--muted); font-size: var(--fs-sm); margin: 6px 0 0; }
.auth-form { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s5); }
.auth-foot { margin-top: var(--s5); font-size: var(--fs-xs); color: var(--faint); line-height: 1.7; }

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--faint); cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-2); color: var(--ink); }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── paket harga ────────────────────────────────────────────────── */
.plan-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: var(--s6); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.plan:hover { box-shadow: var(--sh-3); transform: translateY(-2px); }
.plan.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--sh-2); }
.plan .tag {
  position: absolute; top: -11px; left: var(--s6);
  padding: 3px 11px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-size: var(--fs-micro); font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
}
.plan h3 { font-size: var(--fs-h2); font-weight: 800; }
.plan .desc { font-size: var(--fs-sm); color: var(--muted); margin: 5px 0 var(--s4); }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.plan .price b { font-size: var(--fs-display); font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
.plan .price span { font-size: var(--fs-xs); color: var(--faint); }
.plan ul { list-style: none; padding: 0; margin: var(--s5) 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.plan li svg { width: 15px; height: 15px; margin-top: 2px; flex: 0 0 auto; stroke: var(--ok); fill: none; stroke-width: 2.6; }

/* ── progress ───────────────────────────────────────────────────── */
.opt-track { display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.opt-fill { display: block; height: 100%; width: 0; border-radius: var(--r-pill); background: var(--accent); transition: width .25s ease; }
.prog-row { display: flex; align-items: center; gap: var(--s3); }
.prog-row .opt-track { flex: 1; }

.steps { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 600;
}
.step.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.step.done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

/* ── daftar tarif ───────────────────────────────────────────────── */
.rate-list { display: flex; flex-direction: column; gap: 2px; }
.rate-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: 9px var(--s2); border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}
.rate-row + .rate-row { border-top: 1px solid var(--line-soft); }
.rate-row .rr-name { color: var(--ink-2); }
.rate-row .rr-val {
  margin-left: auto; font-weight: 700; color: var(--accent-ink);
  font-variant-numeric: tabular-nums; font-size: var(--fs-xs);
}
.rate-row .rr-val.free { color: var(--ok); }

/* ── kartu akun KK ──────────────────────────────────────────────── */
.acc-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.acc-card {
  display: flex; flex-direction: column; gap: 7px;
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; text-align: left;
  font: inherit; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.acc-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.acc-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.acc-card .ac-name { font-weight: 700; color: var(--ink); font-size: var(--fs-sm); }
.acc-card .ac-phone { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.acc-card .ac-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── mobile ─────────────────────────────────────────────────────── */
.burger { display: none; }
.sb-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(20, 18, 15, .42); }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--sh-4);
  }
  .sidebar.open { transform: none; }
  .burger { display: inline-flex; }
  .content { padding: var(--s4); }
  .topbar { padding: 0 var(--s4); }
  .topbar h2 { font-size: var(--fs-h3); }
  .topbar .sub { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: var(--s3); }
  .card { padding: var(--s4); }
  .page-head h1 { font-size: var(--fs-h2); }
  .credit-chip { padding: 5px 10px; font-size: var(--fs-xs); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
