/* SALIMAH — sistem desain
   Ungu logo + emas selendang, di atas kertas krem. Serif untuk judul, sans untuk isi. */

:root {
  --ink: #241433;
  --plum: #4a2870;
  --plum-700: #3a1f59;
  --plum-50: #f3eef8;
  --plum-100: #e6dcf0;
  --gold: #b48a46;
  --gold-600: #96702f;
  --gold-50: #f6eedd;
  --paper: #f8f5ef;
  --card: #fffdf9;
  --line: #e5ddd0;
  --line-strong: #d3c8b6;
  --muted: #6c6275;
  --ok: #2f6b4f;
  --ok-50: #e7f2ec;
  --warn: #9a5b12;
  --warn-50: #fbf0df;
  --danger: #a3322e;
  --danger-50: #f9e7e5;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 0 rgba(36, 20, 51, .04), 0 8px 24px -12px rgba(36, 20, 51, .18);
  --wrap: 1120px;
  --gutter: 16px;
  --tabbar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
@media (min-width: 860px) { body { padding-bottom: 0; font-size: 16px; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--plum); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.01em; font-optical-sizing: auto; }
h1 { font-size: clamp(2rem, 6.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--plum-100); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 860px) { :root { --gutter: 32px; } }

.eyebrow {
  font: 600 .72rem/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(248, 245, 239, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 42px; object-fit: contain; mix-blend-mode: multiply; }
.brand b { display: block; font: 600 1.15rem/1 var(--serif); letter-spacing: .14em; color: var(--plum); }
.brand span { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: none; margin-left: auto; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .92rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--plum-50); }
.nav a[aria-current="page"] { color: var(--plum); background: var(--plum-50); }
.nav a.nav-cta { background: var(--plum); color: #fff; margin-left: 6px; }
.nav a.nav-cta:hover { background: var(--plum-700); }
@media (min-width: 860px) { .nav { display: flex; } }

/* Tab bar bawah untuk HP */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 500;
}
.tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--plum); }
.tabbar a[aria-current="page"] svg { stroke-width: 2; }
@media (min-width: 860px) { .tabbar { display: none; } }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--plum); color: #fff;
  font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--plum-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--plum); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--plum-50); border-color: var(--plum-100); }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: var(--gold-600); }
.btn-danger { background: transparent; color: var(--danger); border-color: #e7c2bf; }
.btn-danger:hover { background: var(--danger-50); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .84rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--plum-50); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Hero beranda ---------- */
.hero { padding: 40px 0 32px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--plum); }
.hero .lede { font-size: 1.05rem; color: var(--muted); max-width: 34em; margin-top: 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-figure { display: none; position: relative; justify-self: end; width: clamp(220px, 22vw, 280px); margin: 0; }
@media (min-width: 860px) { .hero-figure { display: block; } }
.hero-figure .arch {
  aspect-ratio: 4 / 5; border-radius: 999px 999px var(--r-lg) var(--r-lg);
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 16% 14% 34%;
  box-shadow: var(--shadow);
}
.hero-figure .arch img { width: 100%; height: auto; mix-blend-mode: multiply; }
.hero-figure .tag {
  position: absolute; left: -10%; bottom: 7%;
  background: var(--plum); color: #fff; border-radius: var(--r);
  padding: 12px 16px; box-shadow: var(--shadow);
}
.hero-figure .tag b { font: 500 1.6rem/1 var(--serif); display: block; }
.hero-figure .tag span { font-size: .75rem; opacity: .8; }
@media (min-width: 860px) {
  .hero { padding: 56px 0 48px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: 64px; }
  .hero h1 { max-width: 13em; }
}

/* Strip angka */
.figures {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.figures > div { padding: 20px 4px; }
.figures > div:nth-child(odd) { padding-right: 16px; }
.figures > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.figures b { display: block; font: 400 clamp(2rem, 7vw, 2.8rem)/1 var(--serif); color: var(--plum); }
.figures span { display: block; margin-top: 8px; font-size: .82rem; color: var(--muted); }
@media (min-width: 720px) {
  .figures { grid-template-columns: repeat(4, 1fr); }
  .figures > div { padding: 24px 20px !important; border-top: 0 !important; border-left: 1px solid var(--line); }
  .figures > div:first-child { border-left: 0; padding-left: 0 !important; }
}

/* ---------- Section ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head .eyebrow { margin-bottom: 10px; display: block; }
.page-head { padding: 32px 0 8px; }
.page-head p { margin-top: 10px; color: var(--muted); max-width: 40em; }
@media (min-width: 860px) { .page-head { padding: 56px 0 16px; } .section { padding: 64px 0; } }

/* ---------- Kartu kegiatan ---------- */
.activity-grid { display: grid; gap: 28px 20px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .activity-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .activity-grid { grid-template-columns: repeat(3, 1fr); } }
.activity {
  display: block; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; width: 100%;
}
.activity .ph {
  aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--plum-50);
  position: relative;
}
.activity .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.activity:hover .ph img { transform: scale(1.03); }
.activity .ph .count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(36, 20, 51, .72); color: #fff;
  font-size: .72rem; padding: 3px 8px; border-radius: 999px;
}
.ph-empty { width: 100%; height: 100%; display: grid; place-items: center; }
.ph-empty img { width: 30%; opacity: .25; mix-blend-mode: multiply; }
.activity .meta { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.activity h3 { margin-top: 8px; font-size: 1.22rem; }
.activity p { margin-top: 6px; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--plum-50); color: var(--plum);
}
.chip.gold { background: var(--gold-50); color: var(--gold-600); }
.chip.ok { background: var(--ok-50); color: var(--ok); }
.chip.warn { background: var(--warn-50); color: var(--warn); }
.chip.off { background: #eeeae4; color: var(--muted); }

/* Filter pil horizontal (bisa digeser di HP) */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gutter) 10px; margin: 0 calc(var(--gutter) * -1); scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
@media (min-width: 860px) { .pills { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 10px; } }
.pill {
  flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); cursor: pointer; font-size: .86rem; font-weight: 500; white-space: nowrap;
}
.pill:hover { border-color: var(--plum-100); background: var(--plum-50); }
.pill[aria-pressed="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }

/* ---------- Direktori cabang ---------- */
.branch-list { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .branch-list { grid-template-columns: repeat(2, 1fr); column-gap: 40px; } }
.branch {
  display: flex; align-items: baseline; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.branch .no { font: 400 .95rem/1 var(--serif); color: var(--gold); width: 24px; flex: none; font-variant-numeric: tabular-nums; }
.branch h3 { font-size: 1.15rem; flex: 1; }
.branch .sub { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ---------- Panel / kartu umum ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
@media (min-width: 720px) { .panel { padding: 32px; } }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.field label, .field .label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.req { color: var(--danger); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: #fff; font-size: 16px; /* 16px: cegah zoom iOS */
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 104px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234a2870' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-100); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-size: .92rem;
}
.check input { accent-color: var(--plum); width: 18px; height: 18px; margin: 0; }
.check:has(input:checked) { border-color: var(--plum); background: var(--plum-50); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--muted); cursor: pointer; }
.consent input { accent-color: var(--plum); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }

/* Unggah foto */
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-pick .preview {
  width: 96px; height: 120px; border-radius: 48px 48px var(--r-sm) var(--r-sm); flex: none;
  background: var(--plum-50) center / cover no-repeat; border: 1px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--plum); overflow: hidden;
}
.photo-pick .preview svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; opacity: .6; }
.photo-pick .preview.has { border-style: solid; }
.photo-pick .preview.has svg { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumbs .t { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--plum-50); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(36, 20, 51, .75); color: #fff; cursor: pointer; font-size: 15px; line-height: 1;
}

/* Langkah pendaftaran */
.steps { display: flex; gap: 8px; margin: 20px 0 24px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--plum); }
.unit-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .unit-cards { grid-template-columns: 1fr 1fr; } }
.unit-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; min-height: 56px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; text-align: left; width: 100%;
}
.unit-card:hover { border-color: var(--plum-100); background: var(--plum-50); }
.unit-card[aria-pressed="true"] { border-color: var(--plum); background: var(--plum-50); box-shadow: inset 0 0 0 1px var(--plum); }
.unit-card b { font-weight: 600; }
.unit-card small { color: var(--muted); font-size: .78rem; display: block; }
.unit-card svg { width: 18px; height: 18px; stroke: var(--plum); fill: none; stroke-width: 2; flex: none; }
.selected-unit {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--r); background: var(--plum-50); margin-bottom: 24px;
}
.form-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h3 { margin-bottom: 16px; }

/* ---------- Pesan ---------- */
.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: .9rem; }
.alert.err { background: var(--danger-50); color: var(--danger); }
.alert.ok { background: var(--ok-50); color: var(--ok); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
@media (min-width: 860px) { .toast { bottom: 24px; } }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #efe9df 25%, #f6f1e9 50%, #efe9df 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Dialog / modal ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--card); color: var(--ink);
  width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 40px rgba(36, 20, 51, .25);
}
dialog.sheet::backdrop { background: rgba(36, 20, 51, .45); }
dialog.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet-head {
  position: sticky; top: 0; z-index: 2; background: var(--card);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.sheet-head h3 { font-size: 1.25rem; }
.sheet-body { padding: 20px; }
.sheet-foot {
  position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) {
  dialog.sheet { max-width: 720px; margin: auto; border-radius: var(--r-lg); max-height: 88vh; }
}
.gallery { display: grid; gap: 8px; }
.gallery img { width: 100%; border-radius: var(--r-sm); background: var(--plum-50); }
.prose { white-space: pre-line; line-height: 1.75; }

/* ---------- Statistik ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 860px) { .stat-cards { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat-card b { display: block; font: 400 2.2rem/1 var(--serif); color: var(--plum); margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: .8rem; color: var(--muted); }
.stat-card.accent { background: var(--plum); border-color: var(--plum); color: #fff; }
.stat-card.accent b { color: #fff; }
.stat-card.accent span { color: rgba(255, 255, 255, .75); }

.charts { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .charts { grid-template-columns: repeat(3, 1fr); } .charts .wide { grid-column: 1 / -1; } }
.chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.chart h3 { font-size: 1.1rem; margin-bottom: 16px; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .86rem; }
.bar-row .track { grid-column: 1 / -1; height: 8px; border-radius: 8px; background: var(--plum-50); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--plum); border-radius: 8px; transition: width .5s ease; }
.bar-row.gold .fill { background: var(--gold); }
.bar-row b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Grafik bulanan */
.months { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 20px; }
.month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.month .cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.month .col { width: min(14px, 45%); background: var(--plum); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.month .col.g { background: var(--gold); }
.month .col[data-v]:not([data-v="0"])::after {
  content: attr(data-v); position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.month small { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--plum); margin-right: 6px; vertical-align: -1px; }
.legend i.g { background: var(--gold); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fbf8f2; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.pc-row td { font-weight: 600; }
.table tr.pc-row td:first-child { font-family: var(--serif); font-size: 1rem; font-weight: 500; }
.table tr.pra-row td { color: var(--muted); font-size: .84rem; }
.table tr.pra-row td:first-child { padding-left: 32px; }
.table tr.pc-row { cursor: pointer; }
.table tr.pc-row:hover { background: var(--plum-50); }
.caret { display: inline-block; width: 14px; transition: transform .15s; color: var(--gold); }
.open .caret { transform: rotate(90deg); }

/* ---------- Admin ---------- */
.admin-shell { padding: 24px 0 48px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs button {
  flex: none; background: none; border: 0; padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .92rem;
}
.admin-tabs button[aria-selected="true"] { color: var(--plum); border-bottom-color: var(--plum); }
.admin-tabs .badge { background: var(--gold); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; margin-left: 6px; }
.toolbar { display: grid; gap: 10px; margin-bottom: 16px; grid-template-columns: 1fr 1fr; }
.toolbar .search { grid-column: 1 / -1; }
@media (min-width: 860px) { .toolbar { grid-template-columns: 2fr 1.3fr 1fr auto; align-items: center; } .toolbar .search { grid-column: auto; } }
.bulkbar {
  position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r); background: var(--ink); color: #fff;
}
.bulkbar .input { min-height: 38px; padding: 6px 36px 6px 10px; font-size: .88rem; width: auto; flex: 1; min-width: 160px; }
.bulkbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.bulkbar .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* Daftar anggota: kartu di HP, baris tabel di desktop */
.member-list { display: grid; gap: 8px; }
.member {
  display: grid; grid-template-columns: auto 48px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
}
.member input[type="checkbox"] { accent-color: var(--plum); width: 18px; height: 18px; }
.member .av {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--plum-50);
  display: grid; place-items: center; font: 500 1.1rem/1 var(--serif); color: var(--plum);
}
.member .who { min-width: 0; }
.member .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who span { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.member .extra { display: none; }
.member { cursor: pointer; }
.member .side .btn { display: none; }
@media (min-width: 960px) { .member .side .btn { display: inline-flex; } }
@media (min-width: 960px) {
  .member { grid-template-columns: auto 44px 2fr 1.4fr 1.2fr 1fr auto; padding: 10px 14px; }
  .member .extra { display: block; font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .member .side { flex-direction: row; align-items: center; }
}
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 12px; font-size: .86rem; color: var(--muted); flex-wrap: wrap; }

.admin-acts { display: grid; gap: 10px; }
.admin-act {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
}
.admin-act .ph { width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; background: var(--plum-50); }
.admin-act .ph img { width: 100%; height: 100%; object-fit: cover; }
.admin-act b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.admin-act span { font-size: .8rem; color: var(--muted); }

.tree { display: grid; gap: 12px; }
.tree-pc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tree-pc > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fbf8f2; border-bottom: 1px solid var(--line); }
.tree-pc > header h3 { flex: 1; font-size: 1.1rem; }
.tree-pc ul { list-style: none; margin: 0; padding: 0; }
.tree-pc li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.tree-pc li:last-child { border-bottom: 0; }
.tree-pc li span { flex: 1; }
.link-btn { background: none; border: 0; color: var(--plum); cursor: pointer; font-size: .82rem; font-weight: 600; padding: 6px; }
.link-btn.del { color: var(--danger); }

.login-box { max-width: 400px; margin: 48px auto; }
.login-box .brandmark { width: 64px; margin: 0 auto 16px; mix-blend-mode: multiply; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 32px; font-size: .84rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }
.arabic { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--plum); }

/* Sukses */
.done { text-align: center; padding: 24px 0; }
.done .seal {
  width: 72px; height: 72px; border-radius: 50%; background: var(--ok-50); color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 20px;
}
.done .seal svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

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

/* ---------- Halaman data cabang (hanya baca) ---------- */
.ro-toolbar { grid-template-columns: 1fr; }
@media (min-width: 720px) { .ro-toolbar { grid-template-columns: 1fr auto; } }
button.member { font: inherit; color: inherit; text-align: left; width: 100%; }
.member.ro { grid-template-columns: 48px 1fr auto; }
.member.ro:hover { border-color: var(--plum-100); background: #fff; }
@media (min-width: 960px) { .member.ro { grid-template-columns: 44px 2.4fr 1.2fr 1fr auto; } }
.profile { display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center; }
.profile-photo {
  width: 112px; aspect-ratio: 4 / 5; border-radius: 56px 56px var(--r-sm) var(--r-sm); overflow: hidden;
  background: var(--plum-50); display: grid; place-items: center; font: 500 2rem/1 var(--serif); color: var(--plum);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.dl { margin: 24px 0 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .dl { grid-template-columns: 1fr 1fr; column-gap: 32px; } }
.dl > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl dt { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dl dd { margin: 4px 0 0; }

/* ---------- Link rahasia (admin) ---------- */
.links-panel { margin-bottom: 20px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.link-row .lbl { font-size: .78rem; color: var(--muted); margin-right: auto; }
.link-row .btn-sm { min-height: 32px; padding: 0 12px; font-size: .8rem; }
@media (max-width: 719px) {
  .tree-pc li { flex-wrap: wrap; gap: 2px 4px; padding: 10px 16px; }
  .tree-pc li span { flex: 1 1 100%; font-weight: 500; }
  .tree-pc li .link-btn { padding: 6px 6px 6px 0; margin-right: 4px; }
  .link-row .lbl { flex: 1 1 100%; }
}
