:root {
  --bg: #0b0b0c;
  --panel: #151517;
  --panel2: #1c1c1f;
  --line: #2a2a2e;
  --text: #f2efe6;
  --muted: #9a968a;
  --gold: #f5b82e;
  --gold2: #d9961a;
  --gold-grad: linear-gradient(135deg, #ffd45a, #e8a21c 60%, #c98410);
  --ok: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #f5b82e;
  --info: #5aa9ff;
  --radius: 14px;
  --head: "Rajdhani", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--head); letter-spacing: .3px; margin: 0; }
a { color: var(--gold); text-decoration: none; }
small, .muted { color: var(--muted); }
.grow { flex: 1; }
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash img { width: 160px; height: auto; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.97); } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.side-brand img { width: 52px; height: auto; }
.side-brand b { display: block; font-family: var(--head); font-size: 17px; line-height: 1.1; }
.side-brand small { display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.nav a i { font-style: normal; width: 22px; text-align: center; }
.nav a:hover { background: var(--panel2); }
.nav a.active { background: var(--gold-grad); color: #1a1200; font-weight: 600; }
.side-foot { margin-top: auto; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.topbar-title b { display: block; font-family: var(--head); font-size: 18px; line-height: 1.1; }
.topbar-title small { display: none; }
.who { color: var(--muted); font-size: 13px; }
.main { padding: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
.public-main { padding: 20px; max-width: 880px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--head); font-size: 20px; }
.brand img { width: 38px; height: auto; }
.view-loading { color: var(--muted); padding: 40px; text-align: center; }

.powered { display: flex; justify-content: center; padding: 14px 0; }
.powered img { width: 230px; max-width: 70%; height: auto; opacity: .95; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 6px; background: radial-gradient(circle at 50% -10%, #2a2008 0%, var(--bg) 55%); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-logo { width: 190px; height: auto; align-self: center; }
.auth-card h2 { text-align: center; font-size: 24px; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- Komponen ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-title { font-size: 18px; margin-bottom: 12px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 28px; flex: 1; min-width: 160px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-family: var(--head); font-size: 28px; color: var(--gold); line-height: 1.2; }
.stat-sub { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; }

.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 10px 16px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold-grad); color: #1a1200; border: none; font-weight: 600; }
.btn.danger { background: #3a1517; border-color: #6b2226; color: #ffb4b4; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: #1d5c42; background: #0f2a20; }
.badge.bad { color: var(--bad); border-color: #6b2226; background: #2a1213; }
.badge.warn { color: var(--warn); border-color: #6b5016; background: #2a2210; }
.badge.info { color: var(--info); border-color: #1d4a7a; background: #0f1f33; }
.badge.gold { color: #1a1200; background: var(--gold); border-color: var(--gold); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.right { text-align: right; }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field small { font-size: 12px; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input[type="checkbox"] { width: auto; }
.check { display: flex; align-items: center; gap: 8px; }
.form-err { color: var(--bad); font-size: 13px; min-height: 1em; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; }

/* ---------- Modal & toast ---------- */
.modal-root { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 460px; max-height: 92vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 20px; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(92vw, 420px); }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 12px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast.bad { border-left-color: var(--bad); }

/* ---------- Fitur ---------- */
.chart { width: 100%; height: auto; }
.chart .bar { fill: url(#g); fill: var(--gold); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; }
.chip:hover { border-color: var(--gold); }
.chip.sel { background: var(--gold-grad); color: #1a1200; border-color: transparent; font-weight: 600; }
.chip:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.barber-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.barber-card { border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 12px; text-align: center; cursor: pointer; color: var(--text); font: inherit; }
.barber-card.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--gold-grad); display: grid; place-items: center; margin: 0 auto 8px; color: #1a1200; font-family: var(--head); font-size: 26px; }
.shop-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.shop-hero img { width: 72px; height: 72px; object-fit: contain; }
.shop-hero h1 { font-size: 30px; }
.step-title { font-family: var(--head); font-size: 18px; margin: 18px 0 8px; color: var(--gold); }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-item:last-child { border-bottom: none; }
.list-item .grow b { display: block; }
.cart-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.total-row { display: flex; justify-content: space-between; font-size: 18px; font-family: var(--head); padding-top: 10px; }
.receipt { background: #fff; color: #111; padding: 16px; border-radius: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.receipt .line { display: flex; justify-content: space-between; gap: 10px; }
.receipt hr { border: none; border-top: 1px dashed #888; margin: 8px 0; }
.receipt img.rl { width: 70px; display: block; margin: 0 auto 6px; }
.receipt .pw { text-align: center; font-size: 11px; margin-top: 10px; }

@media print {
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt { position: absolute; left: 0; top: 0; width: 80mm; }
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; padding-bottom: 68px; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; padding: 6px; z-index: 30; border-right: none; border-top: 1px solid var(--line); }
  .side-brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; overflow-x: auto; gap: 2px; }
  .nav a { flex: 1; min-width: 64px; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; text-align: center; }
  .nav a i { font-size: 18px; }
  .main, .public-main { padding: 14px; }
  .page-head h2 { font-size: 24px; }
  .who { display: none; }
  .topbar { padding: 10px 14px; }
  .toasts { bottom: 90px; }
}

/* ---------- Tambahan v2 ---------- */
.grid.two > .card, .grid.two > div > .card { margin-bottom: 16px; }
.stat-value { word-break: break-word; }
video { max-height: 60vh; }
.receipt .line + .line { margin-top: 2px; }
@media print { .toasts { display: none !important; } }
