:root {
  --bg: #141210;
  --surface: #1e1b18;
  --surface-2: #28241f;
  --line: #3a342c;
  --text: #f4ecdf;
  --muted: #a89d8c;
  --gold: #d4a24c;
  --gold-2: #e9bf6e;
  --red: #d9534a;
  --green: #4caf7a;
  --blue: #5b8fd6;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--gold-2); text-decoration: none; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: .3px; line-height: 1.2; }
h1 { font-size: clamp(28px, 6vw, 46px); margin: 0 0 8px; }
h2 { font-size: 22px; margin: 28px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.container { max-width: 1040px; margin: 0 auto; padding: 16px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(20, 18, 16, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: Georgia, serif; font-size: 18px; }
.brand b { color: var(--gold); font-weight: 600; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.bottomnav { display: none; }

@media (max-width: 760px) {
  .nav { display: none; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 2px; color: var(--muted); font-size: 11px;
  }
  .bottomnav a .ico { font-size: 20px; line-height: 1; }
  .bottomnav a.active { color: var(--gold); }
}
@media (min-width: 761px) { body { padding-bottom: 24px; } }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 36px 24px; margin-top: 8px;
  background:
    radial-gradient(circle at 85% 20%, rgba(212, 162, 76, .25), transparent 45%),
    linear-gradient(135deg, #221d17, #15120f);
  border: 1px solid var(--line);
}
.hero p { color: var(--muted); max-width: 520px; font-size: 16px; }
.hero .pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 20px; }

/* Components */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .05s, background .15s;
}
.btn:hover { background: #332e27; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1408; }
.btn.primary:hover { background: var(--gold-2); }
.btn.danger { color: #ffb4ae; border-color: #5a2a26; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 22px; font-size: 16px; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #4a3b16; color: #ffd27a; }
.badge.confirmed { background: #173a5c; color: #9cc7ff; }
.badge.completed { background: #173d2a; color: #8be0b0; }
.badge.cancelled { background: #4a1d1a; color: #ffaaa3; }
.badge.no_show { background: #3a3a3a; color: #cfcfcf; }
.badge.paid { background: #173d2a; color: #8be0b0; }
.badge.unpaid { background: #3a3a3a; color: #cfcfcf; }
.badge.role-super_admin { background: #4a3b16; color: #ffd27a; }
.badge.role-admin { background: #173a5c; color: #9cc7ff; }
.badge.role-user { background: #333; color: #ccc; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.price { color: var(--gold); font-weight: 700; }
.strike { text-decoration: line-through; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 20px;
  background: linear-gradient(135deg, var(--gold), #8a6420); color: #1a1408;
}

.promo-card { background: linear-gradient(135deg, #3a2b12, #1e1b18 70%); border-color: #6b5222; }
.promo-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; background: #0e0c0a; border: 1px dashed var(--gold); color: var(--gold-2); padding: 3px 10px; border-radius: 8px; }

/* Selectable options */
.option { cursor: pointer; transition: border-color .15s, background .15s; text-align: left; font: inherit; color: inherit; width: 100%; }
.option:hover { border-color: #6b5a3e; }
.option.selected { border-color: var(--gold); background: #2a2216; box-shadow: 0 0 0 1px var(--gold) inset; }
.option:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip {
  flex: none; min-width: 66px; padding: 8px 10px; border-radius: 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text); font: inherit;
}
.chip small { display: block; color: var(--muted); font-size: 11px; }
.chip.selected { border-color: var(--gold); background: #2a2216; }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { padding: 10px 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.slot.selected { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 700; }
.slot:disabled { opacity: .3; cursor: not-allowed; text-decoration: line-through; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; font-size: 18px; font-family: Georgia, serif; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1408; font: 700 14px system-ui; }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; font: inherit;
  background: #0f0d0b; color: var(--text); border: 1px solid var(--line);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: auto; accent-color: var(--gold); }
.field { margin-bottom: 12px; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.auth-box { max-width: 420px; margin: 24px auto; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: flex; gap: 4px; align-items: center; color: var(--text); background: var(--surface-2); padding: 6px 10px; border-radius: 8px; margin: 0; }

/* Summary */
/* Ringkasan booking: krem terang + teks gelap agar kontras dengan halaman yang gelap */
.summary {
  position: sticky; bottom: 76px; padding: 10px 12px;
  background: #f4ecdf; color: #1a1408; border: 2px solid var(--gold);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .55);
}
@media (min-width: 761px) { .summary { bottom: 12px; } }
.sum-detail { width: 100%; border-collapse: collapse; margin-bottom: 8px; border-bottom: 1px dashed #c9b48c; color: #1a1408; }
.sum-detail td { padding: 3px 0 5px; }
.sum-detail td.muted { color: #6b5a3e; }
.sum-detail td:last-child { text-align: right; font-weight: 600; }
.sum-bar { display: flex; align-items: center; }
.sum-toggle { flex: 1; min-width: 0; display: block; text-align: left; background: none; border: 0; padding: 2px 10px 2px 2px; color: inherit; font: inherit; cursor: pointer; }
.sum-total { display: block; font-size: 19px; font-weight: 800; color: #1a1408; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-total .strike { color: #8a7a60; font-weight: 500; font-size: 11.5px; }
.sum-hint { display: block; font-size: 12.5px; color: #4a3f2e; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-caret { color: #8a5a12; margin-left: 2px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.sum-bar .btn { flex: none; padding: 12px 18px; background: #141210; border-color: #141210; color: var(--gold-2); }
.sum-bar .btn:hover { background: #2a241c; }
.sum-bar .btn:disabled { opacity: .35; }

/* Tables & tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--gold); border-color: var(--gold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.data tr:last-child td { border-bottom: 0; }
.stat { font-size: 26px; font-weight: 700; color: var(--gold); font-family: Georgia, serif; }

.booking-item { display: grid; gap: 6px; }
.booking-item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.points-hero { text-align: center; padding: 26px; background: linear-gradient(135deg, #3a2b12, #1e1b18); }
.points-hero .stat { font-size: 44px; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Toast & modal */
.toast {
  position: fixed; left: 50%; top: calc(68px + env(safe-area-inset-top)); transform: translateX(-50%) translateY(-20px);
  background: #f4ecdf; color: #1a1408; padding: 11px 18px; border-radius: 12px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #ffb4ae; color: #3b0905; }
dialog {
  width: min(560px, 94vw); max-height: 90vh; padding: 20px; border-radius: 18px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* Kartu jadwal berikutnya (margin dipakai, bukan gap, agar rapi di WebView lama) */
.next-card { margin-top: 16px; border-color: #6b5222; background: linear-gradient(135deg, #2c2213, #1e1b18 65%); }
.next-body { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.next-body > * { margin: 6px 12px 6px 0; }
.countdown { text-align: right; }
.countdown-num { font: 700 30px/1.1 ui-monospace, Consolas, monospace; color: var(--gold-2); letter-spacing: 1px; }
.next-card .actions { display: flex; flex-wrap: wrap; margin-top: 10px; }
.next-card .actions > *, .booking-item .actions > * { margin: 0 6px 6px 0; }

/* Struk digital */
.receipt-head { display: flex; align-items: center; }
.receipt-head img { margin-right: 12px; flex: none; }
.receipt-title { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 10px; padding-top: 14px; border-top: 1px dashed var(--line); font: 700 17px Georgia, serif; }
.receipt-meta { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.receipt-meta > div { display: flex; justify-content: space-between; padding: 3px 0; }
.receipt-meta span { margin-right: 12px; }
.receipt-meta b { text-align: right; }
.receipt-lines { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.receipt-lines td { padding: 5px 0; }
.receipt-lines td:last-child { text-align: right; }
.receipt-lines tr.total td { border-top: 1px dashed var(--line); padding-top: 10px; font-size: 18px; font-weight: 700; color: var(--gold); }
.receipt-earned { display: flex; justify-content: space-between; align-items: center; background: var(--gold); color: #1a1408; border-radius: 10px; padding: 12px 14px; margin: 6px 0 10px; }
.receipt-earned b { font-size: 18px; }

/* Popup promo */
.promo-popup { text-align: center; }
.promo-popup-head { display: inline-block; background: var(--gold); color: #1a1408; font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.promo-actions { justify-content: center; margin-top: 14px; }
.promo-actions .btn { margin: 0 4px; }

/* Jam dikelompokkan per waktu */
.slot-group + .slot-group { margin-top: 14px; }
.slot-group-title { font-weight: 600; margin-bottom: 8px; }

footer.site { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
