/* JAAD Member — mengikuti Panduan Identitas Visual JAAD:
   palet 8 warna, Poppins + Lora, Lingkaran JAAD, sudut cangkir, garis emas, pil outlet. */

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/poppins-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/lora-latin-600-normal.woff2') format('woff2'); }

:root {
  --jaad: #0F4641;
  --pekat: #0A2F2C;
  --daun: #3F9F9E;
  --emas: #C89B4B;
  --krem: #F6E9DA;
  --kabut: #EDF3F0;
  --putih: #FFFFFF;
  --arang: #1C1B1A;

  --bg: var(--krem);
  --bg-circle: #EBD5B9;
  --surface: var(--putih);
  --surface-2: var(--kabut);
  --ink: var(--arang);
  --ink-2: #5a5450;
  --head: var(--jaad);
  --line: rgba(15, 70, 65, 0.16);
  --line-strong: rgba(15, 70, 65, 0.32);
  --btn-bg: var(--jaad);
  --btn-ink: var(--putih);
  --card-muted: rgba(246, 233, 218, 0.72);
  --ok-bg: #DCEAE3;
  --ok-ink: #0F4641;
  --err-bg: #F3E0D6;
  --err-ink: #8A3B2A;
  --ring: url('/img/ring-green.png');
  --ring-opacity: 0.16;
  --grain-dark-opacity: 0.5;
  --grain-light-opacity: 0.6;

  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --r-small: 6px;
  --r-cup: 28px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--pekat); --bg-circle: #0F4641; --surface: #0F4641; --surface-2: #0C3A36; --ink: #F3F6F3; --ink-2: #B7C9C3;
    --head: var(--putih); --line: rgba(246, 233, 218, 0.16); --line-strong: rgba(246, 233, 218, 0.32);
    --btn-bg: var(--krem); --btn-ink: var(--pekat);
    --ok-bg: #163F3A; --ok-ink: #CDE3DA; --err-bg: #4A2A22; --err-ink: #F2C9B8;
    --ring: url('/img/ring-cream.png'); --ring-opacity: 0.12; --grain-dark-opacity: 0.35; --grain-light-opacity: 0.35;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; position: relative; }
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: url('/img/grain-dark.png') 0 0 / 512px 512px repeat; opacity: var(--grain-dark-opacity); }
body::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: url('/img/grain-light.png') 128px 256px / 512px 512px repeat; opacity: var(--grain-light-opacity); }
.page { position: relative; z-index: 1; overflow: hidden; min-height: 100vh; }
.page::before { content: ''; position: absolute; z-index: 0; pointer-events: none; right: 0; top: 15rem; width: min(62vw, 40rem); aspect-ratio: 1; border-radius: 50%; background: var(--bg-circle); transform: translate(50%, -50%); }
.page::after { content: ''; position: absolute; z-index: 0; pointer-events: none; left: -9rem; top: 34rem; width: 22rem; height: 22rem; background: var(--ring) center / contain no-repeat; opacity: var(--ring-opacity); transform: rotate(-12deg); }
.page > * { position: relative; z-index: 1; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; color: var(--head); text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 6.5vw, 2.25rem); }
h2 { font-size: 1.5rem; }
p { margin: 0; }
a { color: var(--head); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--daun); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 0.4rem; }
.gold-line { display: block; width: 72px; height: 2px; background: var(--emas); border-radius: 1px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.3em; }

/* ---------- Kerangka ---------- */
.shell { max-width: 30rem; margin: 0 auto; padding-block: 1.5rem 3.5rem; padding-inline: 16px; display: grid; gap: 1.1rem; }
.shell-wide { max-width: 72rem; }
.shell > * { min-width: 0; }
.intro { display: grid; gap: 0.7rem; }
.intro-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 0.75rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lead { font-size: 1rem; color: var(--ink-2); max-width: 36rem; }

/* Bar atas (staf) & kepala halaman publik */
.topbar { background: var(--jaad); color: var(--putih); position: relative; overflow: hidden; }
.topbar::before { content: ''; position: absolute; inset: 0; background: url('/img/grain-light.png') 0 0 / 512px 512px repeat; opacity: 0.35; pointer-events: none; }
.topbar-inner { position: relative; max-width: 72rem; margin: 0 auto; padding: 0.9rem 16px 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; padding-bottom: 0.9rem; }
.brand img { width: 44px; height: 44px; display: block; }
.brand-name { font-weight: 700; letter-spacing: 0.1em; font-size: 1.125rem; line-height: 1.1; display: block; }
.brand-sub { display: block; font-weight: 300; letter-spacing: 0.02em; font-size: 0.8125rem; color: rgba(246, 233, 218, 0.8); }
.brand-tagline { font-family: var(--serif); font-style: italic; }
@media (max-width: 600px) { .brand-tagline { display: none; } }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.25rem; }
.topnav a, .topnav .linklike { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.04em; color: rgba(246, 233, 218, 0.78); text-decoration: none; padding: 0.5rem 0.75rem 0.7rem; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.topnav a[aria-current='page'] { color: var(--putih); border-bottom-color: var(--emas); }
.topnav form { margin: 0; }
.public-head { display: flex; align-items: center; gap: 0.75rem; color: var(--head); }
.public-head img { width: 48px; height: 48px; display: block; }
.public-head .brand-name { color: var(--head); }
.public-head .brand-sub { color: var(--ink-2); }

.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--head); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- Pil, chip, label ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; background: var(--jaad); color: var(--putih); padding: 0.4rem 0.85rem; border-radius: 999px; white-space: nowrap; justify-self: start; }
.pill .ico { width: 1em; height: 1em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font: inherit; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.5rem 0.9rem; border-radius: 999px; border: 1.5px solid var(--line-strong); background: transparent; color: var(--head); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.chip.is-current, .chip[aria-current='true'] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.chip .count { letter-spacing: 0; font-variant-numeric: tabular-nums; opacity: 0.75; }
.tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem; }
.tabs .chip { flex: none; }

/* ---------- Form ---------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.label { font-weight: 500; font-size: 0.9375rem; color: var(--head); }
input, select { font: inherit; color: var(--ink); width: 100%; min-height: 3.1rem; padding: 0.65rem 0.9rem; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-small); }
input:focus, select:focus { border-color: var(--daun); outline: none; box-shadow: 0 0 0 3px rgba(63, 159, 158, 0.25); }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--err-ink); }
.hint { font-size: 0.875rem; color: var(--ink-2); }
.field-error { font-size: 0.875rem; color: var(--err-ink); font-weight: 500; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.65rem; align-items: start; font-size: 0.9rem; color: var(--ink-2); }
.check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0.15rem 0 0; accent-color: var(--jaad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.where { display: grid; gap: 0.4rem; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3.1rem; padding: 0.7rem 1.3rem; border-radius: var(--r-small); border: 1.5px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink); font: inherit; font-weight: 500; letter-spacing: 0.02em; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn-ghost { background: transparent; color: var(--head); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); filter: none; }
.btn-block { width: 100%; }
.btn-small { font: inherit; font-size: 0.8125rem; font-weight: 500; padding: 0.4rem 0.7rem; border-radius: var(--r-small); border: 1.5px solid var(--line-strong); background: transparent; color: var(--head); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem; }
.btn-small:hover { background: var(--surface-2); }
.btn-quiet { color: var(--ink-2); }
.btn-danger { background: var(--err-ink); border-color: var(--err-ink); color: var(--putih); }

/* ---------- Pesan & panel ---------- */
.alert { padding: 0.8rem 1rem; border-radius: var(--r-small); font-size: 0.9375rem; display: flex; gap: 0.6rem; align-items: flex-start; }
.alert .ico { margin-top: 0.15rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-err { background: var(--err-bg); color: var(--err-ink); }
.alert-info { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.form .alert { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.1rem; display: grid; gap: 0.6rem; border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); }
.panel-soft { background: var(--surface-2); }
.panel-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.stack { display: grid; gap: 0.6rem; }

/* ---------- Kartu member ---------- */
.member-card { position: relative; overflow: hidden; background: var(--jaad); color: var(--putih); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); padding: 1.25rem 1.35rem 1.2rem; box-shadow: 0 24px 44px -28px rgba(10, 47, 44, 0.75); display: grid; gap: 0.2rem; }
.member-card::before { content: ''; position: absolute; inset: 0; background: url('/img/grain-light.png') 0 0 / 512px 512px repeat; opacity: 0.3; pointer-events: none; }
.member-card::after { content: ''; position: absolute; right: 0; top: 62%; width: 11rem; height: 11rem; border-radius: 50%; border: 2px solid var(--emas); opacity: 0.8; transform: translate(50%, -50%); pointer-events: none; }
.member-card > * { position: relative; }
.member-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.member-top img { width: 40px; height: 40px; display: block; }
.member-top .eyebrow { color: var(--emas); }
.member-code { font-size: clamp(2.3rem, 11vw, 3rem); font-weight: 300; line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin: 0 0 0.6rem; }
.member-name { font-size: 1.125rem; font-weight: 500; }
.member-meta { color: var(--card-muted); font-size: 0.875rem; }
.member-benefit { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed rgba(246, 233, 218, 0.35); display: flex; align-items: center; gap: 0.6rem; font-weight: 500; color: var(--krem); }
.member-benefit .ico { color: var(--emas); }
.after-card { font-weight: 500; color: var(--head); }

/* ---------- Stempel & hadiah ---------- */
.stamps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.35rem; max-width: 24rem; }
.stamp { aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: transparent; }
.stamp .ico { width: 62%; height: 62%; stroke-width: 2.2; }
.stamp.is-on { border: 0; background: var(--jaad); color: var(--putih); }
.stamp.is-gold { border: 0; background: var(--emas); color: var(--pekat); }
.loyalty { display: grid; gap: 0.6rem; }
.loyalty-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--head); }
.reward { position: relative; overflow: hidden; display: grid; gap: 0.7rem; padding: 1rem 1.1rem; border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); background: var(--pekat); color: var(--krem); }
.reward::before { content: ''; position: absolute; inset: 0; background: url('/img/grain-light.png') 0 0 / 512px 512px repeat; opacity: 0.28; pointer-events: none; }
.reward > * { position: relative; }
.reward .eyebrow { color: var(--card-muted); }
.reward-title { font-family: var(--serif); font-style: italic; font-size: 1.375rem; color: var(--emas); line-height: 1.2; }
.reward form { margin: 0; }
.reward .btn { background: var(--krem); border-color: var(--krem); color: var(--pekat); width: 100%; }

/* ---------- Kasir ---------- */
.outlet-bar { display: grid; gap: 0.5rem; }
.outlet-bar-empty { border-color: var(--emas); }
.outlet-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.outlet-change summary { list-style: none; cursor: pointer; }
.outlet-change summary::-webkit-details-marker { display: none; }
.lookup { margin: 0; }
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.lookup input { font-size: 1.5rem; font-weight: 300; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; min-height: 3.5rem; }
.lookup .btn { min-height: 3.5rem; min-width: 5.5rem; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); padding: 1.15rem 1.25rem 1.25rem; display: grid; gap: 0.85rem; }
.result-status { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--ok-ink); background: var(--ok-bg); padding: 0.35rem 0.75rem 0.35rem 0.55rem; border-radius: 999px; justify-self: start; font-size: 0.9rem; }
.result-miss .result-status { color: var(--err-ink); background: var(--err-bg); }
.result-name { font-size: 1.75rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; margin: 0; padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.facts dd { margin: 0.1rem 0 0; font-weight: 500; }
.result-actions { margin: 0; }
.undo { margin: 0; font-size: 0.875rem; }
.undo .linklike { color: var(--ink-2); }

/* ---------- Admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); padding: 0.9rem 1rem; display: grid; gap: 0.1rem; }
.kpi-num { font-size: 2rem; font-weight: 300; line-height: 1.1; color: var(--head); font-variant-numeric: tabular-nums; }
.search { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; max-width: 32rem; margin: 0; }
.table-wrap { min-width: 0; overflow-x: auto; background: var(--surface); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.tag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.tag .ico { width: 1em; height: 1em; }
.tag-gold { background: var(--emas); color: var(--pekat); }
.tag-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag-err { background: var(--err-bg); color: var(--err-ink); }
.tag-wait { background: var(--surface-2); color: var(--ink-2); }
.tag-off { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.tag-note { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--err-ink); max-width: 16rem; }
.sub { display: block; font-size: 0.75rem; color: var(--ink-2); }
.actions { display: flex; gap: 0.4rem; align-items: flex-start; justify-content: flex-end; }
.actions form { margin: 0; }
details.confirm summary { list-style: none; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm[open] summary { display: none; }
.pager { display: flex; justify-content: space-between; align-items: center; font-size: 0.9375rem; }
.empty { padding: 2rem 1.25rem; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); color: var(--ink-2); }

/* ---------- QR ---------- */
.outlet-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.outlet-list a { display: grid; gap: 0.15rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); text-decoration: none; color: var(--head); }
.outlet-list a:hover { border-color: var(--daun); }
.outlet-list .muted { font-size: 0.875rem; overflow-wrap: anywhere; }
.qr-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.qr-buttons { display: flex; gap: 0.5rem; }
.poster { position: relative; overflow: hidden; background: var(--putih); color: var(--arang); border-radius: var(--r-small) var(--r-cup) var(--r-small) var(--r-small); padding: 2rem 1.5rem; text-align: center; display: grid; justify-items: center; gap: 0.6rem; }
.poster::before { content: ''; position: absolute; left: 0; top: 16%; width: 38%; aspect-ratio: 1; border-radius: 50%; background: var(--kabut); transform: translate(-50%, -50%); pointer-events: none; }
.poster > * { position: relative; }
.poster img { width: 72px; height: 72px; }
.poster h1 { max-width: 18ch; margin-top: 0.5rem; color: var(--jaad); }
.poster p { color: #4a4542; }
.poster .qr { width: min(100%, 20rem); margin: 0.75rem 0 0.25rem; }
.poster .qr svg { display: block; width: 100%; height: auto; }
.poster-outlet { display: inline-flex; margin-top: 0.4rem; }
.poster-url { font-size: 0.8125rem; color: #6b675f; overflow-wrap: anywhere; }

@media print {
  body { background: #fff; }
  body::before, body::after, .page::before, .page::after { display: none; }
  .topbar, .no-print { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .poster { padding: 2cm 1cm; box-shadow: none; }
  .poster .qr { width: 11cm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
