/* =====================================================================
   ZonaNet VPN — design system
   Tanpa dependensi eksternal. Mendukung tema terang & gelap otomatis,
   dengan penggantian manual lewat atribut data-theme pada <html>.
   ===================================================================== */

:root {
  color-scheme: light dark;

  /* Warna dasar — nilai netral, diisi ulang oleh blok tema di bawah */
  --bg:            #f6f8fb;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #eef2f7;
  --bg-hover:      #f1f5f9;
  --surface-line:  #e2e8f0;

  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;
  --text-inverse:  #ffffff;

  --brand:         #2563eb;
  --brand-strong:  #1d4ed8;
  --brand-soft:    #dbeafe;
  --brand-text:    #1e40af;

  --success:       #059669;
  --success-soft:  #d1fae5;
  --success-text:  #065f46;

  --warning:       #d97706;
  --warning-soft:  #fef3c7;
  --warning-text:  #92400e;

  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --danger-text:   #991b1b;

  --info:          #0891b2;
  --info-soft:     #cffafe;
  --info-text:     #155e75;

  /* Bentuk & ruang */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 2px 8px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --header-h: 60px;
  --sidebar-w: 236px;
  --content-max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0b1120;
    --bg-elevated:   #131c31;
    --bg-sunken:     #0f172a;
    --bg-hover:      #1c2740;
    --surface-line:  #253149;

    --text:          #e8eef9;
    --text-muted:    #94a3b8;
    --text-subtle:   #64748b;

    --brand:         #60a5fa;
    --brand-strong:  #3b82f6;
    --brand-soft:    #1e3a5f;
    --brand-text:    #bfdbfe;

    --success:       #34d399;
    --success-soft:  #064e3b;
    --success-text:  #a7f3d0;

    --warning:       #fbbf24;
    --warning-soft:  #4d3410;
    --warning-text:  #fde68a;

    --danger:        #f87171;
    --danger-soft:   #4c1d1d;
    --danger-text:   #fecaca;

    --info:          #22d3ee;
    --info-soft:     #164e57;
    --info-text:     #a5f3fc;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 2px 10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg:            #0b1120;
  --bg-elevated:   #131c31;
  --bg-sunken:     #0f172a;
  --bg-hover:      #1c2740;
  --surface-line:  #253149;
  --text:          #e8eef9;
  --text-muted:    #94a3b8;
  --text-subtle:   #64748b;
  --brand:         #60a5fa;
  --brand-strong:  #3b82f6;
  --brand-soft:    #1e3a5f;
  --brand-text:    #bfdbfe;
  --success:       #34d399;
  --success-soft:  #064e3b;
  --success-text:  #a7f3d0;
  --warning:       #fbbf24;
  --warning-soft:  #4d3410;
  --warning-text:  #fde68a;
  --danger:        #f87171;
  --danger-soft:   #4c1d1d;
  --danger-text:   #fecaca;
  --info:          #22d3ee;
  --info-soft:     #164e57;
  --info-text:     #a5f3fc;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 2px 10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}

/* --- Reset ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .96rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

img, svg { max-width: 100%; }

code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .875em; }

hr { border: 0; border-top: 1px solid var(--surface-line); margin: 24px 0; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Utilitas ------------------------------------------------------- */

.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; }
.container--wide { max-width: 1400px; }

.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; gap: 12px; align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }

.muted    { color: var(--text-muted); }
.subtle   { color: var(--text-subtle); }
.small    { font-size: .85rem; }
.tiny     { font-size: .78rem; }
.strong   { font-weight: 650; }
.center   { text-align: center; }
.right    { text-align: right; }
.nowrap   { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden   { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.break-all { word-break: break-all; }

/* --- Grid ----------------------------------------------------------- */

.grid { display: grid; gap: 16px; }
.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)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Kartu ---------------------------------------------------------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card--flush { padding: 0; overflow: hidden; }
.card--accent { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.card__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-line);
}
.card__header h2, .card__header h3 { margin: 0; }
.card__body { padding: 20px; }
.card__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--surface-line);
  background: var(--bg-sunken);
}

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 14px;
}
.section-title h2, .section-title h3 { margin: 0; }

/* --- Statistik ------------------------------------------------------ */

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat__label {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-subtle); font-weight: 600; margin-bottom: 6px;
}
.stat__value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.stat__hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.stat--brand   .stat__value { color: var(--brand); }
.stat--success .stat__value { color: var(--success); }
.stat--warning .stat__value { color: var(--warning); }
.stat--danger  .stat__value { color: var(--danger); }

/* --- Tombol --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  font: inherit; font-size: .9rem; font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--brand); color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-strong); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--ghost {
  background: transparent; color: var(--text);
  border-color: var(--surface-line);
}
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--soft { background: var(--brand-soft); color: var(--brand-text); }
.btn--soft:hover { background: var(--brand-soft); color: var(--brand-text); filter: brightness(.96); }

.btn--danger { background: var(--danger); }
.btn--danger:hover { background: var(--danger); filter: brightness(.92); }

.btn--danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); color: var(--danger-text); }

.btn--success { background: var(--success); }
.btn--success:hover { background: var(--success); filter: brightness(.92); }

.btn--sm { padding: 5px 11px; font-size: .82rem; border-radius: var(--radius-sm); }
.btn--lg { padding: 12px 24px; font-size: 1rem; }
.btn--block { display: flex; width: 100%; }

.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* --- Badge ---------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  font-size: .74rem; font-weight: 650; line-height: 1.7;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger-text); }
.badge--info    { background: var(--info-soft);    color: var(--info-text); }
.badge--brand   { background: var(--brand-soft);   color: var(--brand-text); }
.badge--muted   { background: var(--bg-sunken);    color: var(--text-muted); }

.badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge--live .badge__dot { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* --- Form ----------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block; margin-bottom: 6px;
  font-size: .85rem; font-weight: 600; color: var(--text);
}
.label .req { color: var(--danger); }

.input, .select, .textarea {
  display: block; width: 100%;
  padding: 9px 12px;
  font: inherit; font-size: .92rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder { color: var(--text-subtle); }
.input[readonly] { background: var(--bg-sunken); color: var(--text-muted); }
.textarea { min-height: 88px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field__hint { margin-top: 5px; font-size: .8rem; color: var(--text-muted); }
.field__error { margin-top: 5px; font-size: .8rem; color: var(--danger); font-weight: 500; }
.input.has-error, .select.has-error { border-color: var(--danger); }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn  { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group__prefix {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--bg-sunken); border: 1px solid var(--surface-line); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-muted); font-size: .9rem; white-space: nowrap;
}
.input-group__prefix + .input { border-radius: 0 var(--radius) var(--radius) 0; }

.check {
  display: flex; align-items: flex-start; gap: 9px;
  cursor: pointer; font-size: .9rem;
  padding: 3px 0;
}
.check input { margin: 3px 0 0; accent-color: var(--brand); width: 15px; height: 15px; flex: none; }

.fieldset {
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 18px;
}
.fieldset > legend {
  padding: 0 8px; margin-left: -8px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}

/* --- Pilihan berbentuk kartu (radio tersembunyi) -------------------- */

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }

/* Isi .choice ditulis dengan <span> agar sah berada di dalam <label>.
   Karena span bersifat inline, tiap bagian WAJIB dijadikan block —
   tanpa itu padding & margin tidak membentuk kotak dan seluruh pilihan
   saling tumpang tindih. */
.choice__box {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--surface-line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice:hover .choice__box { border-color: var(--brand); }
.choice input:checked + .choice__box {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.choice input:focus-visible + .choice__box { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice input:disabled + .choice__box { opacity: .45; cursor: not-allowed; }

.choice__title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  font-weight: 650; font-size: .93rem;
  line-height: 1.35;
}
.choice__meta {
  display: block;
  font-size: .8rem; line-height: 1.45;
  color: var(--text-muted);
  margin-top: 3px;
}
.choice__price {
  display: block;
  font-size: 1.05rem; font-weight: 700; line-height: 1.3;
  color: var(--brand);
  margin-top: auto; padding-top: 6px;
}

/* Harga selalu menempel di dasar kartu supaya deretan pilihan sejajar,
   walau panjang deskripsinya berbeda-beda. */
.choice__box > .choice__meta:last-child { margin-top: auto; padding-top: 6px; }

/* --- Tabel ---------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle; }
.table thead th {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-subtle);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--surface-line);
  white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--surface-line); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-hover); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.table--compact th, .table--compact td { padding: 8px 12px; }

/* --- Alert ---------------------------------------------------------- */

.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .9rem;
}
.alert__icon { flex: none; font-size: 1.05rem; line-height: 1.4; }
.alert__body { flex: 1; min-width: 0; }
.alert--success { background: var(--success-soft); color: var(--success-text); border-color: var(--success); }
.alert--error   { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger); }
.alert--warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning); }
.alert--info    { background: var(--info-soft);    color: var(--info-text);    border-color: var(--info); }

.flash-stack {
  position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.flash-stack .alert {
  box-shadow: var(--shadow-lg);
  background: var(--bg-elevated);
  animation: slideIn .25s ease-out;
}
.flash-stack .alert--success { background: var(--success-soft); }
.flash-stack .alert--error   { background: var(--danger-soft); }
.flash-stack .alert--warning { background: var(--warning-soft); }
.flash-stack .alert--info    { background: var(--info-soft); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

.flash-close {
  background: none; border: 0; cursor: pointer; padding: 0 2px;
  color: inherit; opacity: .6; font-size: 1.1rem; line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* --- Header & navigasi ---------------------------------------------- */

.header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--surface-line);
}
.header__inner {
  width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
}
.header--wide .header__inner { max-width: 1400px; }

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 750; font-size: 1.02rem; color: var(--text);
  text-decoration: none; letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center;
  color: #fff; font-size: .82rem; font-weight: 800;
  flex: none;
}

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem; font-weight: 550;
  text-decoration: none;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a.is-active { color: var(--brand); background: var(--brand-soft); }

.header__spacer { flex: 1; }

.balance-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  font-size: .85rem; font-weight: 650; color: var(--text);
  text-decoration: none;
}
.balance-chip:hover { background: var(--bg-hover); text-decoration: none; color: var(--text); }
.balance-chip__label { color: var(--text-subtle); font-weight: 500; font-size: .78rem; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer; font-size: .95rem;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* Menu pengguna */
.menu { position: relative; }
.menu__trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: transparent; border: 1px solid var(--surface-line);
  border-radius: 999px; cursor: pointer; font: inherit; font-size: .86rem;
  color: var(--text);
}
.menu__trigger:hover { background: var(--bg-hover); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: .74rem; font-weight: 700; flex: none;
}
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px; padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 70;
}
.menu__panel[hidden] { display: none; }
.menu__panel a, .menu__panel button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 11px;
  border: 0; background: none;
  font: inherit; font-size: .88rem; color: var(--text); text-align: left;
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
}
.menu__panel a:hover, .menu__panel button:hover { background: var(--bg-hover); text-decoration: none; }
.menu__sep { height: 1px; background: var(--surface-line); margin: 5px 0; }
.menu__head { padding: 8px 11px 6px; }

/* --- Tata letak halaman --------------------------------------------- */

.page { padding: 28px 0 64px; }
.page__head { margin-bottom: 22px; }
.page__head h1 { margin-bottom: 4px; }
.page__head p { color: var(--text-muted); margin: 0; }

.breadcrumb { font-size: .82rem; color: var(--text-subtle); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); }

/* Layout admin dengan sidebar */
.admin-layout { display: flex; min-height: calc(100vh - var(--header-h)); }

.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--bg-elevated);
  border-right: 1px solid var(--surface-line);
  padding: 18px 12px;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar__group { margin-bottom: 18px; }
.sidebar__title {
  padding: 0 10px; margin-bottom: 6px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-subtle);
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .88rem; font-weight: 550;
  text-decoration: none;
}
.sidebar a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidebar a.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 650; }
.sidebar a .count {
  margin-left: auto; font-size: .74rem;
  background: var(--bg-sunken); color: var(--text-muted);
  padding: 1px 7px; border-radius: 999px;
}

.admin-main { flex: 1; min-width: 0; padding: 26px 26px 64px; }

@media (max-width: 900px) {
  .sidebar {
    position: static; width: 100%; height: auto;
    border-right: 0; border-bottom: 1px solid var(--surface-line);
    display: flex; gap: 4px; overflow-x: auto; padding: 10px;
  }
  .sidebar__group { display: flex; gap: 4px; margin: 0; }
  .sidebar__title { display: none; }
  .sidebar a { white-space: nowrap; margin: 0; }
  .sidebar a .count { display: none; }
  .admin-layout { flex-direction: column; }
  .admin-main { padding: 20px 16px 56px; }
}

/* --- Halaman auth --------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 500px at 12% -8%, var(--brand-soft), transparent 60%),
    radial-gradient(700px 420px at 92% 108%, var(--info-soft), transparent 62%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.auth-card__head { text-align: center; margin-bottom: 22px; }
.auth-card__head .brand { justify-content: center; margin-bottom: 14px; font-size: 1.1rem; }
.auth-card__head h1 { font-size: 1.32rem; margin-bottom: 4px; }
.auth-card__head p { color: var(--text-muted); font-size: .89rem; margin: 0; }
.auth-foot { margin-top: 20px; text-align: center; font-size: .87rem; color: var(--text-muted); }

/* --- Landing page --------------------------------------------------- */

.hero {
  padding: 64px 0 52px;
  background:
    radial-gradient(1000px 520px at 50% -12%, var(--brand-soft), transparent 65%),
    var(--bg);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -.03em; margin-bottom: 14px;
}
.hero p.lead {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 620px; margin: 0 auto 26px;
}
.hero .btn-group { justify-content: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 13px; margin-bottom: 18px;
  background: var(--brand-soft); color: var(--brand-text);
  border-radius: 999px; font-size: .82rem; font-weight: 650;
}

.feature { padding: 18px; }
.feature__icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand-text);
  display: grid; place-items: center; font-size: 1.2rem;
  margin-bottom: 11px;
}
.feature h3 { font-size: 1rem; margin-bottom: 5px; }
.feature p { font-size: .88rem; color: var(--text-muted); margin: 0; }

.price-card { position: relative; display: flex; flex-direction: column; }
.price-card__ribbon {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff;
  padding: 2px 13px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
}
.price-card__amount {
  font-size: 2rem; font-weight: 750; letter-spacing: -.03em;
  line-height: 1.1; margin: 8px 0 2px;
}
.price-card__period { font-size: .85rem; color: var(--text-muted); }
.price-list { list-style: none; padding: 0; margin: 16px 0; font-size: .88rem; }
.price-list li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 0; color: var(--text-muted);
}
.price-list li::before { content: "✓"; color: var(--success); font-weight: 700; flex: none; }

/* --- Komponen khusus ------------------------------------------------ */

/* Kotak salin (kredensial) */
.copy-box {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 9px 13px;
  background: var(--bg-sunken);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: .85rem;
  min-width: 0;
}
.copy-box__value { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.copy-box__value::-webkit-scrollbar { height: 4px; }
.copy-box__value::-webkit-scrollbar-thumb { background: var(--text-subtle); border-radius: 2px; }

.copy-btn {
  flex: none;
  padding: 4px 9px;
  font-size: .75rem; font-weight: 600; font-family: var(--font);
  background: var(--bg-elevated);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--brand); border-color: var(--brand); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

.secret { position: relative; }
.secret__masked { letter-spacing: .18em; }

/* Daftar deskripsi */
.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 9px 18px; font-size: .89rem; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
}

/* Bilah progres */
.meter {
  height: 6px; border-radius: 999px;
  background: var(--bg-sunken); overflow: hidden;
}
.meter__fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.meter__fill--warning { background: var(--warning); }
.meter__fill--danger  { background: var(--danger); }

/* Kondisi kosong */
.empty { text-align: center; padding: 44px 20px; }
.empty__icon { font-size: 2.4rem; margin-bottom: 12px; opacity: .55; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--text-muted); max-width: 420px; margin: 0 auto 18px; font-size: .9rem; }

/* Blok QR */
.qr-frame {
  display: inline-block; padding: 16px;
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--surface-line);
  line-height: 0;
}
/* Dibuat cukup besar agar tiap modul tetap lega saat dipindai dari layar. */
.qr-frame img, .qr-frame svg { width: 100%; max-width: 300px; height: auto; }

/* Hitung mundur masa berlaku pembayaran */
.countdown {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 1.15rem;
  letter-spacing: .02em;
}
.countdown--soon  { color: var(--warning); }
.countdown--urgent { color: var(--danger); }
.countdown__unit { font-size: .78rem; font-weight: 500; color: var(--text-muted); }

/* Tab */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--surface-line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 9px 15px;
  border: 0; border-bottom: 2px solid transparent;
  background: none; font: inherit; font-size: .89rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs a.is-active, .tabs button.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* Baris filter */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 18px;
}
.filters .field { margin: 0; min-width: 150px; }

/* Paginasi */
.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; padding: 6px 10px;
  text-align: center; font-size: .85rem;
  border: 1px solid var(--surface-line); border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
}
.pagination a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.pagination .is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Detail/summary */
details.disclosure {
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  padding: 0; overflow: hidden;
}
details.disclosure > summary {
  padding: 12px 16px; cursor: pointer;
  font-weight: 600; font-size: .9rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before {
  content: "›"; display: inline-block; transition: transform .18s;
  font-size: 1.15rem; line-height: 1; color: var(--text-subtle);
}
details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure > summary:hover { background: var(--bg-hover); }
details.disclosure .disclosure__body { padding: 4px 16px 16px; }

/* Blok kode */
pre.code {
  margin: 0; padding: 13px 15px;
  background: var(--bg-sunken);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  overflow-x: auto; font-size: .82rem; line-height: 1.55;
  white-space: pre;
}

/* Langkah bernomor */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative; padding: 0 0 14px 34px;
  font-size: .89rem; color: var(--text-muted);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-text);
  display: grid; place-items: center;
  font-size: .74rem; font-weight: 700;
}
.steps li:last-child { padding-bottom: 0; }

/* Footer */
.footer {
  border-top: 1px solid var(--surface-line);
  padding: 26px 0;
  font-size: .85rem; color: var(--text-muted);
  background: var(--bg-elevated);
}
.footer a { color: var(--text-muted); }

/* Skeleton pemuatan */
.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid var(--surface-line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* --- Cetak ---------------------------------------------------------- */

@media print {
  .header, .sidebar, .footer, .flash-stack, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
