/* member.me, arah member-pass. Token merek hanya di :root. */
:root {
  --primary: #E85A17;
  --primary-foreground: #FFF7F0;
  --ring: #E85A17;
  --background: #F6F1E9;
  --surface: #FFFFFF;
  --foreground: #1C1917;
  --muted: #78716C;
  --border: #E7DFD3;
  --ink: #1C1917;
  --ink-soft: #292524;
  --success: #15803D;
  --success-bg: #DCFCE7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --radius: 1.1rem;
  --font-sans: "Barlow", system-ui, -apple-system, sans-serif;
  --font-heading: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --tab-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, .display {
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Shell */
.stage { min-height: 100dvh; display: flex; justify-content: center; }
.side-caption { display: none; }
.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  background: var(--background);
  display: flex;
  flex-direction: column;
  position: relative;
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: #FAFAF9;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brandmark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brandname { font-family: var(--font-heading); font-weight: 700; font-size: 22px; line-height: 1; }
.brandname small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 11px; color: #D6D3D1; letter-spacing: 0.04em; }
.role-switch {
  margin-left: auto;
  display: flex;
  background: var(--ink-soft);
  border: 1px solid #44403C;
  border-radius: 999px;
  padding: 3px;
  font-size: 12px;
  font-weight: 600;
}
.role-switch a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  color: #D6D3D1;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.role-switch a[aria-current="page"] { background: var(--primary); color: var(--primary-foreground); }

.content { flex: 1; padding: 16px 16px calc(var(--tab-h) + 24px); display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 34px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--tab-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-height: 44px;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--primary); }

/* Status hero */
.hero {
  background: var(--ink);
  color: #FAFAF9;
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--primary);
}
.hero .kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #FDBA74; }
.hero-days { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.hero-days .display { font-size: 64px; font-weight: 700; }
.hero-days .unit { font-size: 18px; font-weight: 600; }
.hero p.note { font-size: 14px; color: #D6D3D1; }
.hero.warn { background: #451A03; }
.hero.danger-hero { background: #450A0A; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: calc(var(--radius) * 0.8);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 150ms ease-out, background 200ms ease-out;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); width: 100%; }
.btn-dark { background: var(--ink); color: #FAFAF9; width: 100%; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--foreground); width: 100%; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.link-more { font-weight: 700; color: var(--primary); text-decoration: none; font-size: 15px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card h2 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head h2 { font-size: 26px; font-weight: 600; }

/* Member pass */
.pass {
  background: var(--ink);
  color: #FAFAF9;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.pass-strip { height: 8px; background: var(--primary); }
.pass-body { padding: 18px; display: flex; gap: 16px; }
.pass-perf {
  width: 0;
  border-left: 2px dashed #57534E;
  position: relative;
  flex: none;
}
.pass-info { flex: 1; min-width: 0; }
.pass-info .member-name { font-family: var(--font-heading); font-size: 26px; font-weight: 700; }
.pass-info .member-id { font-size: 13px; color: #D6D3D1; margin-top: 2px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-top: 10px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.badge-new { background: var(--primary); color: var(--primary-foreground); }
.badge-info { background: #E0E7FF; color: #3730A3; }
.qr-panel {
  background: #FAFAF9;
  border-radius: 12px;
  padding: 10px;
  width: 132px;
  flex: none;
  align-self: center;
}
.qr-panel canvas, .qr-panel svg { width: 100%; height: auto; display: block; aspect-ratio: 1; }
.qr-panel figcaption { color: var(--muted); font-size: 10px; text-align: center; margin-top: 4px; }
.pass-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px dashed #57534E;
  font-size: 13px;
  color: #D6D3D1;
}

/* Bill rows */
.bill-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bill-total .amount { font-family: var(--font-heading); font-size: 44px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.kv:first-of-type { border-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

/* Payment methods */
.pay-option { display: block; margin-bottom: 10px; }
.pay-option input { position: absolute; opacity: 0; }
.pay-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 64px;
  font-weight: 600;
}
.pay-card .logo {
  width: 52px;
  height: 32px;
  flex: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.logo-qris { background: #DC2626; }
.logo-gopay { background: #00AED6; }
.logo-dana { background: #108EE9; }
.logo-ovo { background: #4C1D95; }
.pay-card small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pay-option input:checked + .pay-card { border-color: var(--primary); }
.pay-option input:focus-visible + .pay-card { outline: 3px solid var(--ring); outline-offset: 2px; }
.pay-card .check { margin-left: auto; width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--border); flex: none; }
.pay-option input:checked + .pay-card .check { border-color: var(--primary); background: var(--primary); }

/* History */
.hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  min-height: 56px;
}
.hist-row:first-of-type { border-top: 0; }
.hist-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-weight: 700;
}
.hist-main { flex: 1; min-width: 0; }
.hist-main strong { display: block; font-size: 15px; }
.hist-main span { font-size: 13px; color: var(--muted); }
.hist-amt { text-align: right; font-weight: 700; }
.hist-amt span { display: block; font-size: 12px; font-weight: 600; }
.st-ok { color: var(--success); }
.st-bad { color: var(--danger); }

/* Reminder strip */
.remind {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--success-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
}
.remind svg { width: 24px; height: 24px; flex: none; color: var(--success); }

/* Announcement */
.anc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
}
.anc-photo {
  height: 150px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
}
.anc-1 { background: linear-gradient(135deg, #7C2D12 0%, var(--primary) 70%, #F59E0B 100%); }
.anc-2 { background: linear-gradient(135deg, #1C1917 0%, #44403C 70%, #78716C 100%); }
.anc-3 { background: linear-gradient(135deg, #14532D 0%, #15803D 70%, #4ADE80 100%); }
.anc-body { padding: 12px 14px 14px; }
.anc-body h3 { font-size: 22px; font-weight: 600; }
.anc-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.anc-body p.excerpt { font-size: 14px; color: var(--muted); margin-top: 6px; }
.anc-photo-full {
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: #fff;
}
.anc-photo-full .display { font-size: 38px; font-weight: 700; }
.prose p { margin-bottom: 12px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field input {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--foreground);
}
.field input:focus { outline: 3px solid var(--ring); outline-offset: 1px; border-color: var(--primary); }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sticky-cta {
  position: sticky;
  bottom: calc(var(--tab-h) + 12px);
  padding-top: 8px;
}

/* Success */
.success-hero { text-align: center; padding: 24px 8px 8px; }
.success-check {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.success-check svg { width: 44px; height: 44px; }
.success-hero h1 { font-size: 36px; }
.next-steps { text-align: left; margin-top: 8px; }
.next-steps li { margin-bottom: 8px; }

/* Admin */
.tabs { display: flex; gap: 8px; }
.tabs a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 8px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tabs a[aria-current="page"] { background: var(--ink); color: #FAFAF9; border-color: var(--ink); }
.applicant { padding: 12px 0; border-top: 1px solid var(--border); }
.applicant:first-of-type { border-top: 0; }
.applicant strong { font-size: 16px; }
.applicant .meta { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.applicant .actions { display: flex; gap: 8px; }
.btn-small { min-height: 44px; font-size: 15px; padding: 8px 16px; border-radius: 10px; font-weight: 700; border: 1px solid transparent; }
.btn-approve { background: var(--success); color: #fff; flex: 1; }
.btn-reject { background: var(--surface); border-color: var(--border); color: var(--danger); flex: 1; }
.scan-frame {
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: var(--surface);
  padding: 20px;
  text-align: center;
}
.scan-result { border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.scan-result.ok { background: var(--success-bg); }
.scan-result.warn { background: var(--warn-bg); }
.scan-result strong { font-size: 20px; font-family: var(--font-heading); }
.price-input { display: flex; gap: 8px; }
.price-input input { flex: 1; }

/* Empty + misc */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; margin-bottom: 8px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Tablet: dua kolom untuk daftar */
@media (min-width: 768px) {
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .span-2 { grid-column: 1 / -1; }
  .hero-days .display { font-size: 72px; }
}

/* Desktop: caption di kiri kolom HP */
@media (min-width: 1100px) {
  .stage { gap: 48px; align-items: flex-start; padding: 32px 16px; }
  .side-caption { display: block; max-width: 340px; position: sticky; top: 32px; }
  .side-caption .display { font-size: 52px; font-weight: 700; }
  .side-caption p { color: var(--muted); margin-top: 12px; }
  .phone {
    min-height: calc(100dvh - 64px);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
  }
  .tabbar { border-radius: 0 0 28px 28px; }
}
