:root {
  --brand: #326EAB;
  --brand-light: #64B4DE;
  --brand-bg: #EAF3FB;
  --blue: #007AFF;
  --red: #FF3B30;
  --orange: #FF9500;
  --gray-bg: #F3F6FA;
  --header-bg: #FFFFFF;
  --card: #FFFFFF;
  --text: #1C1C1E;
  --text-secondary: #6E6E73;
  --border: #E1E8F0;
  --outer-bg: #D7E3EE;
  --img-placeholder: #DCE6F0;
  --orange-bg: #FFF4E5;
  --orange-text: #9A5B00; /* readable orange for text on --orange-bg / --card (≥4.5:1) */
  --blue-bg: #E5F2FF;
  --red-bg: #FFF1F0;
  --green: #1B7F4F;      /* money in — readable on --card and --green-bg (≥4.5:1) */
  --green-bg: #E6F5EC;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --header-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(0,0,0,0.05);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236E6E73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  --chevron-brand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23326EAB' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --brand-bg: rgba(50,110,171,0.18);
  --gray-bg: #05080C;
  --header-bg: #141B24;
  --card: #141B24;
  --text: #F2F2F7;
  --text-secondary: #98989F;
  --border: #26303C;
  --outer-bg: #000000;
  --img-placeholder: #1E2730;
  --shadow: 0 2px 10px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --header-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(0,0,0,0.35);
  --orange-bg: rgba(255,149,0,0.16);
  --orange-text: #FFB340;
  --blue-bg: rgba(0,122,255,0.16);
  --red-bg: rgba(255,59,48,0.16);
  --green: #5BD192;
  --green-bg: rgba(52,199,89,0.16);
  --brand: #5A9BD4;
  --brand-light: #8EC4E8;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2398989F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  --chevron-brand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%235A9BD4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  background: var(--outer-bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--outer-bg);
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease;
}

#root {
  min-height: 100vh;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--gray-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: background .25s ease;
}

@media (min-width: 481px) {
  body { padding: 24px 0; }
  .phone { min-height: calc(100vh - 48px); border-radius: 36px; overflow: hidden; }
}

/* Header */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background .25s ease;
}

.theme-toggle-btn {
  background: var(--gray-bg);
  color: var(--text);
  border: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.appbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.appbar-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-bg);
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.appbar-logo { height: 32px; width: auto; display: block; }
.appbar-brand { display: flex; align-items: center; gap: 10px; }

.role-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  box-shadow: var(--shadow);
  border: none;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
}

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  flex-shrink: 0;
}

.avatar-sm { width: 22px; height: 22px; font-size: 11px; }

.role-pill-text { text-align: left; line-height: 1.15; }
.role-pill-name { font-size: 12.5px; font-weight: 600; }
.role-pill-role { font-size: 10.5px; color: var(--text-secondary); }

/* Content */
.content {
  flex: 1;
  padding: 14px 16px 90px;
  overflow-y: auto;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 6px 0 12px;
}

.section-sub { font-size: 13px; color: var(--text-secondary); margin: -8px 0 14px; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card-flat {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

/* Hero banner carousel */
.banner-carousel {
  position: relative;
  width: 100%;
  height: 168px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  cursor: pointer;
  background: var(--img-placeholder);
}
.banner-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .6s ease;
}
.banner-slide.active { opacity: 1; }
.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 80%);
}
.banner-kat {
  position: absolute;
  top: 12px; left: 14px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.banner-text { position: absolute; left: 14px; right: 50px; bottom: 14px; color: #fff; }
.banner-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; text-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.banner-cta { font-size: 11px; opacity: 0.92; font-weight: 600; }
.banner-dots { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 5px; }
.banner-dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.45); transition: all .25s ease; }
.banner-dot.active { background: #fff; width: 16px; }

/* Category chips */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  /* Fades the trailing edge so a row with more chips than fit on screen visibly
     hints "there's more, scroll" instead of just cutting chips off with no cue. */
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
}
.chip-row::-webkit-scrollbar { display: none; }
/* ChipRow wrapper: carries the row's spacing so the ‹ › buttons can sit over its edges. */
.chip-scroller { position: relative; margin-bottom: 16px; }
.chip-scroller > .chip-row { margin-bottom: 0; scroll-behavior: smooth; }
.chip-scroller:not(.can-right) > .chip-row { mask-image: none; -webkit-mask-image: none; }
.chip-scroller.can-left > .chip-row {
  mask-image: linear-gradient(to right, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
}
.chip-scroller.can-left:not(.can-right) > .chip-row {
  mask-image: linear-gradient(to right, transparent 0, black 28px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 28px);
}
.chip-arrow {
  position: absolute; top: calc(50% - 2px); transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 999px; border: none;
  background: var(--card); color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  font-size: 24px; font-weight: 700; line-height: 1; padding: 0 0 3px; cursor: pointer;
  align-items: center; justify-content: center;
}
.chip-arrow.left { left: -4px; }
.chip-arrow.right { right: -4px; }
.chip-arrow:hover { background: var(--brand); color: #fff; }
/* Shown on every device: on phones a row that only swipes looked like it had
   no more categories. Touch screens get a slightly smaller button. */
.chip-arrow { display: flex; }
@media (hover: none), (pointer: coarse) {
  .chip-arrow { width: 32px; height: 32px; font-size: 22px; }
  .chip-arrow:hover { background: var(--card); color: var(--brand); }
}
/* Short preset lists inside forms: show every option, no scrolling. */
.chip-row-wrap { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; }
.chip {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  font-family: var(--font);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.chip.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(50,110,171,0.35); }

/* Program card */
.program-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform .15s ease;
}
.program-card:active { transform: scale(0.98); }

.program-banner {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: var(--img-placeholder);
}

.program-icon-badge {
  position: absolute;
  bottom: 9px; left: 9px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

.status-badge {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--text);
}
.status-badge.aktif { color: var(--brand); }
.status-badge.selesai { color: var(--blue); }
.status-badge.menunggu_review { color: var(--orange); }
.status-badge.draft { color: var(--text-secondary); }
.status-badge.ditolak { color: var(--red); }

.program-body { padding: 14px; }
.program-kat { font-size: 11.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.4px; }
.program-nama { font-size: 15.5px; font-weight: 700; margin: 3px 0 10px; line-height: 1.3; }

/* 2-column grid for program lists (beranda) */
.program-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.program-grid .program-card { margin-bottom: 0; }
.program-grid .program-banner { height: 76px; font-size: 30px; }
.program-grid .status-badge { font-size: 9px; padding: 3px 7px; top: 7px; right: 7px; }
.program-grid .program-icon-badge { width: 22px; height: 22px; font-size: 11px; bottom: 6px; left: 6px; }
.program-grid .program-body { padding: 10px; }
.program-grid .program-kat { font-size: 9.5px; }
.program-grid .program-nama {
  font-size: 12.5px;
  margin: 3px 0 8px;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.program-grid .progress-track { height: 5px; margin-bottom: 6px; }
.program-grid .progress-meta { font-size: 10px; flex-direction: column; align-items: flex-start; gap: 2px; }
.program-grid .progress-meta b { font-size: 11.5px; }

/* 1 column (Admin → Program → Tampilan Beranda): one program per row, photo left. */
.program-grid.program-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.program-grid.program-list .program-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
.program-grid.program-list .program-banner { height: auto; min-height: 116px; font-size: 32px; }
.program-grid.program-list .status-badge { top: 6px; left: 6px; right: auto; }
.program-grid.program-list .program-icon-badge { display: none; }
.program-grid.program-list .program-body { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.program-grid.program-list .program-kat { font-size: 10.5px; }
.program-grid.program-list .program-nama { font-size: 14px; min-height: 0; margin: 3px 0 10px; }
.program-grid.program-list .progress-meta { font-size: 11px; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 6px; }
.program-grid.program-list .progress-meta b { font-size: 12.5px; }

.progress-track {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-light), var(--brand)); transition: width .3s ease; }
.progress-remaining { height: 100%; background: var(--border); transition: width .3s ease; }

.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.progress-meta b { color: var(--text); font-size: 13px; }

/* Buttons */
.btn {
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: opacity .15s ease, transform .1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(50,110,171,0.3); }
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 80px; font-family: var(--font); }

/* Dropdowns: drop the native control (white box in dark mode) for a themed
   field with its own chevron. */
select {
  -webkit-appearance: none; appearance: none;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--card);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 36px 8px 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
select:hover:not(:disabled) { border-color: var(--brand-light); }
select:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }
select:disabled { opacity: .5; cursor: not-allowed; }
select option { background: var(--card); color: var(--text); }
.field select { padding-right: 38px; }

/* Compact pill dropdown, matching .btn-sm (e.g. role picker in Kelola User) */
.select-pill {
  width: auto;
  padding: 7px 32px 7px 14px;
  border-radius: 999px;
  border-color: transparent;
  background-color: var(--brand-bg);
  background-image: var(--chevron-brand);
  background-position: right 11px center;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}
.select-pill:hover:not(:disabled) { border-color: var(--brand); }

.radio-option, .check-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); margin-bottom: 8px; cursor: pointer;
  font-size: 14.5px;
}
.radio-option.selected, .check-option.selected { border-color: var(--brand); background: var(--brand-bg); }

.amount-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.amount-chip {
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 13.5px; font-weight: 600;
  cursor: pointer; background: var(--card); color: var(--text-secondary);
}
.amount-chip.selected { border-color: var(--brand); background: var(--brand); color: #fff; }

/* Bottom nav */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--header-bg);
  box-shadow: 0 -1px 0 var(--border), 0 -4px 14px rgba(0,0,0,0.05);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  transition: background .25s ease;
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px;
  border: none; background: none;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
}
.tab-item.active { color: var(--brand); }
.tab-icon { font-size: 20px; }
.tab-label { font-size: 10.5px; font-weight: 600; }

/* Modal / sheet */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
}
.sheet {
  background: var(--gray-bg);
  width: 100%; max-width: 480px;
  border-radius: 24px 24px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 10px 18px 24px;
  animation: sheet-up .22s ease;
}
@keyframes sheet-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 36px; height: 5px; background: var(--border); border-radius: 999px; margin: 6px auto 14px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close { background: var(--border); border: none; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; cursor: pointer; color: var(--text-secondary); }

/* Image lightbox — full-screen photo viewer on the top layer; slides between photos */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 1100; overflow: hidden;
  animation: lightbox-in .18s ease;
}
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pinch-zoom; }
.lightbox-track { display: flex; height: 100%; transition: transform .28s cubic-bezier(.2,0,0,1); will-change: transform; }
.lightbox-track.dragging { transition: none; }
.lightbox-slide {
  flex: 0 0 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: max(64px, env(safe-area-inset-top, 0px)) 16px max(56px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.lightbox-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.lightbox-close {
  position: fixed; top: max(16px, env(safe-area-inset-top, 0px)); right: 16px;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 2;
}
.lightbox-counter {
  position: fixed; top: max(16px, env(safe-area-inset-top, 0px)); left: 16px; z-index: 2;
  height: 44px; display: flex; align-items: center; padding: 0 14px;
  background: rgba(255,255,255,0.15); color: #fff; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%; font-size: 24px; line-height: 1; padding: 0 0 3px; cursor: pointer; z-index: 2;
}
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-dots {
  position: fixed; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 2;
  display: flex; justify-content: center; gap: 6px;
}
.lightbox-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px; background: rgba(255,255,255,0.4); cursor: pointer; transition: all .2s ease; }
.lightbox-dot.active { width: 20px; background: #fff; }
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay { animation: none; }
  .lightbox-track { transition: none; }
}
/* Photos that open the viewer */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.list-row:last-child { border-bottom: none; }

.badge {
  font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge-green { background: var(--brand-bg); color: var(--brand); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--border); color: var(--text-secondary); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 14px; }
.stat-card-button { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 48px; }
.stat-card-button:hover { background: var(--gray-bg); }
.stat-card-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stat-value { font-size: 20px; font-weight: 700; }
.stat-label { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state .emoji { font-size: 36px; margin-bottom: 10px; }

.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: rgba(28,28,30,0.92); color: #fff; padding: 12px 20px;
  border-radius: 999px; font-size: 13.5px; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%,0); } }

.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back-btn {
  background: var(--card); border: none; width: 34px; height: 34px; border-radius: 50%;
  box-shadow: var(--shadow); font-size: 15px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

.donor-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.donor-row .name { font-size: 13.5px; font-weight: 600; }
.donor-row .date { font-size: 11px; color: var(--text-secondary); }
.donor-row .amount { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--brand); }
/* Donor note (catatan) + replies under a donor row; indented to the name (small avatar 22px + gap 10px). */
.donor-item { padding-bottom: 6px; }
.donor-note { margin: -2px 0 6px 32px; font-size: 13px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.donor-replies { margin: 0 0 4px 32px; padding-left: 10px; border-left: 2px solid var(--border); }
.donor-reply { font-size: 12.5px; line-height: 1.5; padding: 4px 0; white-space: pre-line; overflow-wrap: anywhere; }
.donor-reply-name { font-weight: 600; }
.donor-reply-date { font-size: 11px; color: var(--text-secondary); }
.donor-reply-btn { margin: -6px -12px -4px 20px; font-size: 12.5px; }
.donor-reply-form { margin: 4px 0 4px 32px; }
.donor-reply-form textarea { width: 100%; min-height: 60px; margin-bottom: 8px; }
.donor-reply-form .btn-row { justify-content: flex-end; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 24px; }
.card-head-title { font-weight: 700; font-size: 14.5px; }
.text-btn {
  background: none; border: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 12px; margin: -10px -12px; border-radius: 20px; cursor: pointer; min-height: 40px;
}
.text-btn:hover { background: var(--brand-bg); }
.text-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card-note { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
.feed-item { padding: 8px 0; }
.feed-item + .feed-item { border-top: 1px solid var(--border); padding-top: 10px; }
.feed-item-body { font-size: 13px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.feed-item-body.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.result-hero {
  text-align: center; padding: 30px 10px 10px;
}
.result-icon { font-size: 56px; margin-bottom: 10px; }
.result-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.result-sub { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 20px; }

.linkish { color: var(--brand); font-weight: 600; font-size: 13.5px; background: none; border: none; cursor: pointer; font-family: var(--font); padding: 0; }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* Program video + gallery */
.video-embed-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.video-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed-wrap.portrait { max-width: 320px; margin-left: auto; margin-right: auto; padding-top: 0; aspect-ratio: 9 / 16; }
.program-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.program-gallery-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.program-gallery-item { position: relative; }
.program-gallery-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 12px; cursor: pointer; line-height: 1;
}

/* Toko */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease;
}
.product-card:active { transform: scale(0.98); }
.product-banner {
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--img-placeholder);
  position: relative;
}
.product-terlaris {
  position: absolute; top: 8px; left: 8px;
  font-size: 9.5px; font-weight: 700; color: #fff;
  background: var(--orange); padding: 3px 8px; border-radius: 999px;
}
.product-body { padding: 10px 12px 12px; }
.product-nama {
  font-size: 12.5px; font-weight: 700; line-height: 1.3; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px;
}
.product-harga { font-size: 14px; font-weight: 700; color: var(--brand); }
.product-terjual { font-size: 10.5px; color: var(--text-secondary); margin-top: 2px; }

.cart-fab {
  position: fixed;
  right: 16px; bottom: 88px;
  max-width: 480px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(50,110,171,0.4);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 25;
}
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--gray-bg);
}

.qty-stepper { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.qty-btn:disabled { opacity: 0.4; }
.qty-value { font-size: 15px; font-weight: 700; min-width: 24px; text-align: center; }

.cart-item-row { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item-row:last-child { border-bottom: none; }
.cart-item-thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); background-size: cover; background-position: center; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-nama { font-size: 13px; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.cart-item-harga { font-size: 12px; color: var(--text-secondary); }
.cart-item-remove { background: none; border: none; color: var(--red); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); padding: 4px; }

.info-banner {
  background: var(--brand-bg);
  color: var(--brand);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.tracking-item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.tracking-item:last-child { padding-bottom: 0; }
.tracking-item:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: -2px; width: 2px; background: var(--border);
}
.tracking-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex-shrink: 0; margin-top: 2px; z-index: 1; }
.tracking-dot.pending { background: var(--border); }
.tracking-label { font-size: 13.5px; font-weight: 600; }
.tracking-time { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }

/* Visually hidden, still read by screen readers (aria-live announcements). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.field-hint { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a.btn { text-decoration: none; }
.btn-secondary:disabled, .btn-outline:disabled { opacity: 0.5; }

/* Payment channel logo — bank logos are drawn for light backgrounds, so the
   tile stays white in dark mode too. */
.channel-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 36px; padding: 4px 6px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
}
.channel-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.channel-logo.small { width: 34px; height: 22px; padding: 2px 3px; border-radius: 5px; }
.channel-logo.fill { width: 100%; height: 40px; }

/* Payment method picker (grouped accordion) */
.method-group {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.method-group.open, .method-group.has-selected { border-color: var(--brand); }
.method-group-head {
  width: 100%; min-height: 56px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); color: var(--text); text-align: left;
}
.method-group-title { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.method-group-hint { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.35; }
.method-group-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.method-more { font-size: 11px; font-weight: 700; color: var(--text-secondary); padding: 0 4px; }
.method-fee { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.method-fee.free { color: var(--brand); }
.method-chevron { color: var(--text-secondary); flex-shrink: 0; transition: transform .2s ease; }
.method-group.open .method-chevron { transform: rotate(180deg); }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 14px 14px; }
.method-option {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 10px 8px;
  background: var(--card); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); text-align: center; cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.method-option:hover { border-color: var(--brand); }
.method-option:active { transform: scale(0.98); }
.method-option.wide { grid-column: 1 / -1; }
.method-option-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.method-selected { display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 14px; }
.method-change { min-height: 48px; padding: 0 12px; flex-shrink: 0; }
.method-group-head:focus-visible, .method-option:focus-visible, .method-change:focus-visible,
.copy-btn:focus-visible, .howto summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Bill breakdown under the picker */
.totals { padding: 12px 16px; }
.totals .divider { margin: 8px 0; }
.totals-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 3px 0; font-size: 13.5px; color: var(--text-secondary);
}
.totals-row span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals-row.strong { font-size: 15.5px; font-weight: 700; color: var(--text); }
.totals-row.strong span:last-child { color: var(--brand); font-weight: 700; }

/* Payment screen */
.sim-banner, .pay-note {
  background: var(--orange-bg); color: var(--orange-text);
  border-radius: var(--radius-md); padding: 12px 14px;
  font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
}
.pay-kicker { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.pay-total { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pay-breakdown { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.pay-countdown {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 10px 12px;
  background: var(--orange-bg); color: var(--orange-text);
  border-radius: var(--radius-sm);
}
.pay-countdown-label { font-size: 13px; font-weight: 600; }
.pay-countdown-time { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-countdown-until { display: block; font-size: 11.5px; }
.pay-meta { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 0; font-size: 12.5px; }
.pay-meta dt { color: var(--text-secondary); }
.pay-meta dd { margin: 0; font-weight: 600; word-break: break-all; }

.pay-channel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pay-channel-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.pay-waiting { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--orange-text); margin-top: 2px; }
.pay-waiting::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
  animation: pay-pulse 1.6s ease-in-out infinite;
}
@keyframes pay-pulse { 50% { opacity: 0.3; } }

.pay-number-box { background: var(--gray-bg); border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.pay-number {
  font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 1px;
  margin-top: 6px; word-break: break-all; font-variant-numeric: tabular-nums;
}
.pay-amount { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.copy-btn {
  position: relative; flex-shrink: 0;
  min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--brand);
  background: transparent; color: var(--brand);
  font-family: var(--font); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
/* Stretches the tap area to 48px without making the pill look bulky. */
.copy-btn::after { content: ""; position: absolute; inset: -6px; }

.pay-qris { text-align: center; }
/* QR codes need a white quiet zone to scan, so the box stays white in dark mode too. */
.qr-box {
  display: block; width: min(100%, 268px); margin: 0 auto 12px; padding: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
}
.qr-box img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qr-fallback {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1;
  font-size: 12.5px; line-height: 1.5; color: #4A4A4F; padding: 16px;
}
.pay-help { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; }
.pay-qris .btn-sm { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; }
.pay-footnote { font-size: 12px; color: var(--text-secondary); text-align: center; margin: 12px 0 0; }
.pay-section-title { font-size: 16px; font-weight: 700; margin: 18px 2px 10px; }

/* "Cara bayar" accordion */
.howto { margin-bottom: 14px; }
.howto details { background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.howto summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 12px 14px;
  font-size: 14px; font-weight: 600;
}
.howto summary::-webkit-details-marker { display: none; }
.howto summary svg { color: var(--text-secondary); flex-shrink: 0; transition: transform .2s ease; }
.howto details[open] summary svg { transform: rotate(180deg); }
.howto ol { list-style: none; margin: 0; padding: 0 14px 12px; }
.howto li { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.howto li strong { color: var(--text); }
.step-num {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-bg); color: var(--brand); font-size: 12px; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .method-chevron, .howto summary svg, .method-option { transition: none; }
  .pay-waiting::before { animation: none; }
}

textarea, input, select, button { font-size: 16px; }
@media (max-width: 480px) {
  textarea, input, select { font-size: 16px; }
}

/* ---------- Back-office desktop shell (admin, superadmin, staff, staff_keuangan) ----------
   Window size classes per M3: compact (<600px) keeps the phone layout and
   bottom bar; medium (600px+) switches to a navigation rail; expanded
   (840px+) uses the same permanent drawer for every back-office role, so
   the sidebar width and content column match across roles. Bottom sheets
   become centred dialogs on medium and up. */
@media (min-width: 600px) {
  body:has(.backoffice, .backoffice-page) { padding: 0; }

  .phone.backoffice,
  .phone.backoffice-page {
    max-width: none;
    min-height: 100vh;
    border-radius: 0;
    overflow: visible; /* `hidden` would break the sticky app bar and rail */
    box-shadow: none;
  }
  .backoffice-page > .content { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 24px 40px; }

  .backoffice {
    --bo-appbar-h: 64px;
    --bo-nav-w: 88px;
    display: grid;
    grid-template-columns: var(--bo-nav-w) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .backoffice > .appbar { grid-column: 1 / -1; grid-row: 1; height: var(--bo-appbar-h); padding: 0 24px; }

  /* Navigation rail */
  .backoffice > .tabbar {
    grid-column: 1; grid-row: 2;
    position: sticky; top: var(--bo-appbar-h); align-self: start;
    height: calc(100vh - var(--bo-appbar-h));
    max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 12px; padding: 16px 0; overflow-y: auto;
    box-shadow: 1px 0 0 var(--border);
  }
  .backoffice .tab-item { flex: 0 0 auto; gap: 4px; padding: 0; min-height: 56px; justify-content: center; }
  .backoffice .tab-icon {
    width: 56px; height: 32px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s ease;
  }
  .backoffice .tab-item:hover .tab-icon { background: var(--gray-bg); }
  .backoffice .tab-item.active .tab-icon { background: var(--brand-bg); }
  .backoffice .tab-label { font-size: 12px; }
  .backoffice .tab-item:focus-visible { outline: none; }
  .backoffice .tab-item:focus-visible .tab-icon { outline: 2px solid var(--brand); outline-offset: 2px; }

  /* Content: cards flow into as many columns as fit; anything that isn't a
     card (titles, filters, empty states, sheets) spans the full row. */
  .backoffice > .content {
    grid-column: 2; grid-row: 2;
    width: 100%;
    padding: 24px 24px 40px; overflow: visible;
  }
  .backoffice .content div:has(> .card, > .card-flat) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    align-items: start;
  }
  .backoffice .content div:has(> .card, > .card-flat) > :not(.card):not(.card-flat) { grid-column: 1 / -1; }
  .backoffice .content div:has(> .card, > .card-flat) > :is(.card, .card-flat) { margin-bottom: 0; }
  .backoffice .content div:has(> .card, > .card-flat) > .section-title { margin-bottom: 0; }
  .backoffice .stat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  .backoffice .toast, .backoffice-page .toast { bottom: 24px; }

  /* Bottom sheets -> centred dialogs */
  .backoffice .sheet-overlay, .backoffice-page .sheet-overlay { align-items: center; padding: 24px; }
  .backoffice .sheet, .backoffice-page .sheet {
    max-width: 560px; max-height: calc(100vh - 48px);
    border-radius: 28px; padding: 20px 24px 24px;
    animation: dialog-in .18s ease;
  }
  .backoffice .sheet-handle, .backoffice-page .sheet-handle { display: none; }
}

@media (min-width: 840px) {
  .backoffice > .content { padding: 28px 32px 48px; }

  /* Permanent navigation drawer */
  .backoffice:has(> .tabbar-drawer) { --bo-nav-w: 256px; }
  .backoffice > .tabbar-drawer { gap: 2px; padding: 12px; }
  .backoffice .tabbar-drawer .tab-item {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 56px; padding: 0 16px; border-radius: 28px;
    transition: background .2s ease;
  }
  .backoffice .tabbar-drawer .tab-icon { width: 24px; height: 24px; background: none; }
  .backoffice .tabbar-drawer .tab-item:hover { background: var(--gray-bg); }
  .backoffice .tabbar-drawer .tab-item:hover .tab-icon,
  .backoffice .tabbar-drawer .tab-item.active .tab-icon { background: none; }
  .backoffice .tabbar-drawer .tab-item.active { background: var(--brand-bg); }
  .backoffice .tabbar-drawer .tab-label { font-size: 14px; }
  .backoffice .tabbar-drawer .tab-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
  .backoffice .tabbar-drawer .tab-item:focus-visible .tab-icon { outline: none; }
}

@keyframes dialog-in { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .backoffice .sheet, .backoffice-page .sheet { animation: none; }
}

/* ---------- Revisi 2026-10: aktivitas, saldo & keuangan, kelola user ---------- */

/* Bottom navigation: M3 active indicator pill behind the icon. */
.tab-icon {
  width: 56px; height: 30px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.tab-item { min-height: 56px; }
.tab-item.active .tab-icon { background: var(--brand-bg); }
.tab-item:focus-visible { outline: none; }
.tab-item:focus-visible .tab-icon { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 599px) {
  /* Back-office roles can have more destinations than fit a phone bar. */
  .tabbar-drawer { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .tabbar-drawer::-webkit-scrollbar { display: none; }
  .tabbar-drawer .tab-item { flex: 1 0 64px; }
}

/* Password show/hide */
.password-field { position: relative; }
.field .password-field input, .password-field input { padding-right: 52px; }
.password-toggle {
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  width: 48px; height: 48px; border: none; background: none; border-radius: 50%;
  color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--brand); }
.password-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }
.locked-email {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--gray-bg); border: 1px solid var(--border);
  font-size: 15px; word-break: break-all;
}
.locked-email .linkish { min-height: 32px; flex-shrink: 0; }

/* Segmented toggle (two/three views of one tab) */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  overflow-x: auto; scrollbar-width: none; /* many options on a narrow phone: swipe instead of clipping */
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1; min-width: max-content; min-height: 40px; padding: 0 12px; border: none; border-radius: 999px; background: none; cursor: pointer;
  font-family: var(--font); font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
}
.segmented button.active { background: var(--brand); color: #fff; }
.segmented button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.subsection-title { font-size: 15px; font-weight: 700; margin: 18px 2px 10px; }

/* Activity cards */
.activity-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 420px) { .activity-grid { grid-template-columns: 1fr 1fr; } }
.activity-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; width: 100%;
  background: var(--card); border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; font-family: var(--font); color: var(--text);
  transition: transform .15s ease;
}
.activity-card:active { transform: scale(0.98); }
.activity-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.activity-banner {
  position: relative; height: 104px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-bg), var(--blue-bg));
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.activity-banner.large { height: 180px; border-radius: var(--radius-lg); margin-bottom: 14px; }
.activity-banner-icon { font-size: 38px; }
.activity-price {
  position: absolute; top: 9px; left: 9px; padding: 4px 10px; border-radius: 999px;
  background: var(--card); color: var(--brand); font-size: 11.5px; font-weight: 700; box-shadow: var(--shadow);
}
.activity-price.free { color: var(--green); }
.activity-closed {
  position: absolute; bottom: 9px; right: 9px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 10.5px; font-weight: 600;
}
.activity-body { display: flex; flex-direction: column; gap: 3px; padding: 12px; }
.activity-nama {
  font-size: 14px; font-weight: 700; line-height: 1.3; margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.activity-meta { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 14px; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row > span:first-child { font-size: 18px; line-height: 1.3; width: 24px; text-align: center; }
.info-row-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.info-row-sub { font-size: 12.5px; color: var(--text-secondary); }

/* Join flow steps */
.join-steps { list-style: none; display: flex; gap: 6px; margin: 0 0 16px; padding: 0; }
.join-steps li {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--text-secondary); position: relative;
}
.join-steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 13px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--border);
}
.join-steps li.done:not(:last-child)::after { background: var(--brand); }
.join-step-num {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 2px solid var(--border); font-size: 12.5px; font-weight: 700;
}
.join-steps li.current { color: var(--brand); }
.join-steps li.current .join-step-num { border-color: var(--brand); color: var(--brand); }
.join-steps li.done .join-step-num { background: var(--brand); border-color: var(--brand); color: #fff; }

.community-btn { display: block; }
a.btn-sm.community-btn { display: inline-block; }
.reg-card { cursor: pointer; }
.reg-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.reg-done { border: 1.5px solid var(--green); }

/* Two fields side by side, stacked on narrow screens */
.field-pair { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
@media (min-width: 420px) { .field-pair { grid-template-columns: 1fr 1fr; } }

/* Generic list inside one surface (not .card, so the back-office grid leaves it full-width) */
.list-card {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 14px;
}
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%;
  border: none; border-bottom: 1px solid var(--border); background: none; text-align: left;
  font-family: var(--font); color: var(--text); min-height: 56px;
}
.list-item:last-child { border-bottom: none; }
.list-item-button { cursor: pointer; }
.list-item-button:hover { background: var(--gray-bg); }
.list-item-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.list-item-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; overflow-wrap: anywhere; }
.list-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; text-align: right; font-size: 14px; }
.list-item-end small { font-size: 11px; color: var(--text-secondary); }
.list-thumb {
  width: 56px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--brand-bg) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.list-subitems { background: var(--gray-bg); border-bottom: 1px solid var(--border); padding: 4px 14px 4px 50px; }
.list-subitem { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 13px; }
.list-subitem + .list-subitem { border-top: 1px solid var(--border); }
.list-subitem small { display: block; font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

/* Balance */
.saldo-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff; border-radius: var(--radius-lg); padding: 18px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.saldo-hero-label { font-size: 12.5px; font-weight: 600; opacity: 0.9; }
.saldo-hero-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.saldo-hero-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; opacity: 0.95; margin-bottom: 14px; }
.btn-light { background: #fff; color: #23527F; }
.btn-light:disabled { opacity: 0.6; }
.saldo-inline {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: var(--brand-bg); color: var(--brand); font-size: 13px;
}
.saldo-inline b { font-size: 15px; }

/* Filters */
.search-input {
  width: 100%; min-height: 48px; margin-bottom: 12px; padding: 12px 14px 12px 40px;
  font-family: var(--font); font-size: 15px; color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px 18px;
}
.search-input:focus { outline: none; border-color: var(--brand); }
.filter-panel { margin-bottom: 4px; }
.chip-divider { width: 1px; flex-shrink: 0; background: var(--border); margin: 4px 2px; }
.date-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.date-range label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.date-range input {
  min-height: 44px; padding: 8px 10px; font-family: var(--font); font-size: 14px; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color-scheme: light dark;
}
.date-presets { display: flex; gap: 14px; align-items: center; min-height: 44px; }
.date-presets .linkish { font-size: 13px; }

/* Ledger */
.stat-value.mutasi-in, .mutasi-amount-cell.masuk, .mutasi-amount.masuk { color: var(--green); }
.stat-value.mutasi-out, .mutasi-amount-cell.keluar, .mutasi-amount.keluar { color: var(--red); }
.mutasi-amount { font-size: 26px; font-weight: 800; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.mutasi-head { display: none; }
.mutasi-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who amount" "what what" "when when";
  gap: 3px 12px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  border: none; border-bottom: 1px solid var(--border); background: none; font-family: var(--font); color: var(--text);
}
.mutasi-row:last-child { border-bottom: none; }
.mutasi-row:hover { background: var(--gray-bg); }
.mutasi-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mutasi-when { grid-area: when; font-size: 11.5px; color: var(--text-secondary); }
.mutasi-who { grid-area: who; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.mutasi-who small, .mutasi-amount-cell small { font-size: 11.5px; color: var(--text-secondary); font-weight: 400; overflow-wrap: anywhere; }
.mutasi-what { grid-area: what; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); min-width: 0; }
.mutasi-what > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mutasi-tag { flex-shrink: 0; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--border); color: var(--text-secondary); }
.mutasi-tag.donasi { background: var(--green-bg); color: var(--green); }
.mutasi-tag.aktivitas { background: var(--blue-bg); color: var(--blue); }
.mutasi-tag.toko { background: var(--orange-bg); color: var(--orange-text); }
.mutasi-tag.pencairan { background: var(--red-bg); color: var(--red); }
.mutasi-amount-cell { grid-area: amount; display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* User management list */
.user-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  width: 100%; min-height: 60px; padding: 10px 14px; text-align: left; cursor: pointer;
  border: none; border-bottom: 1px solid var(--border); background: none; font-family: var(--font); color: var(--text);
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--gray-bg); }
.user-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.user-row.inactive .user-name-text b { color: var(--text-secondary); text-decoration: line-through; }
.user-row-head { display: none; }
.user-cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell-name .avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.user-name-text { display: flex; flex-direction: column; min-width: 0; }
.user-name-text b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name-text small { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell-contact, .user-cell-status, .user-cell-date { display: none; }
.user-cell-role { justify-self: end; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.on { background: var(--green); }
.status-dot.off { background: var(--red); }
.user-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.user-hero .avatar { width: 56px; height: 56px; font-size: 20px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.user-actions .btn-sm { min-height: 40px; }

@media (min-width: 840px) {
  .backoffice .mutasi-head, .backoffice .mutasi-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas: "when who what amount";
  }
  .backoffice .mutasi-head {
    display: grid; gap: 12px; padding: 10px 14px; background: var(--gray-bg);
    font-size: 11.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-secondary);
  }
  .backoffice .mutasi-head span:last-child { text-align: right; }
  .backoffice .mutasi-row { align-items: center; gap: 12px; }
  .backoffice .mutasi-when { font-size: 12.5px; }
}
/* Log API — reuses the ledger's row grid; the last cell is outcome + HTTP status. */
.apilog-result { grid-area: amount; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.apilog-result small { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
.apilog-pre {
  margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text);
  background: var(--gray-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
/* The selected method's hint is a sentence (e.g. PaySim's), not a fee — let it wrap. */
.method-selected .method-fee { white-space: normal; }

/* Back-office data tables (DataTable in app.js) — admin, superadmin & staff on
   expanded windows (840px+); same header and row treatment as the user table. */
.dt { overflow-x: auto; }
.dt-row {
  display: grid; grid-template-columns: var(--dt-cols); align-items: center; gap: 8px 20px;
  min-width: var(--dt-min, 760px);
  min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.dt-row:last-child { border-bottom: none; }
.dt-head {
  min-height: 0; background: var(--gray-bg);
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-secondary);
}
.dt-clickable { cursor: pointer; }
.dt-clickable:hover { background: var(--gray-bg); }
.dt-clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dt-row.dt-muted { color: var(--text-secondary); }
.dt-cell { min-width: 0; overflow-wrap: anywhere; }
.dt-end { justify-self: end; text-align: right; }
.dt-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-muted-text { color: var(--text-secondary); }
.dt-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dt-stack { display: flex; flex-direction: column; min-width: 0; }
.dt-stack small { font-size: 12px; color: var(--text-secondary); }
.dt-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dt-title-text { display: flex; flex-direction: column; min-width: 0; }
.dt-title-text b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-title-text small { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-thumb {
  width: 48px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--brand-bg) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.dt-progress { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dt-progress .progress-track { margin: 0; }
/* Action column stays in view when a narrow window scrolls the table sideways. */
.dt-sticky {
  position: sticky; right: 0; z-index: 1; align-self: stretch; justify-self: stretch;
  display: flex; align-items: center; justify-content: flex-end;
  margin: -10px -14px -10px 0; padding: 10px 14px 10px 12px;
  background: var(--card); box-shadow: -10px 0 10px -10px rgba(0, 0, 0, .18);
}
.dt-head .dt-sticky { background: var(--gray-bg); }
.dt-clickable:hover .dt-sticky { background: var(--gray-bg); }
.dt-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; cursor: default; }
.dt-actions .btn-sm { min-height: 36px; padding: 6px 12px; }

/* Icon-only action buttons (IconButton) with a hover/focus tooltip. */
.icon-btn {
  position: relative; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: var(--card); color: var(--brand); box-shadow: var(--shadow); cursor: pointer;
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--brand-bg); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn-warn { color: var(--orange-text, var(--orange)); }
.icon-btn-warn:hover { background: var(--orange-bg); }
.icon-btn-ok { color: var(--green); }
.icon-btn-ok:hover { background: var(--green-bg); }
.icon-btn-danger { color: var(--red); }
.icon-btn-danger:hover { background: var(--red-bg); }
.icon-tip {
  position: fixed; z-index: 1000; transform: translateY(calc(-100% - 8px)); pointer-events: none;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--text); color: var(--card); font-size: 12px; font-weight: 600; font-family: var(--font);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.dt-actions:has(.icon-btn) { gap: 4px; flex-wrap: nowrap; }

/* Server-rendered page (App\Core\Seo) inside #root: what crawlers, AI answer
   engines and link previews read, and what a visitor sees for the moment
   before the app mounts over it. */
.ssr { max-width: 720px; margin: 0 auto; padding: 0 16px 32px; font-family: var(--font); color: var(--text); line-height: 1.6; }
.ssr-header { display: flex; align-items: center; min-height: 64px; }
.ssr-brand { font-size: 22px; font-weight: 800; color: var(--brand); text-decoration: none; letter-spacing: -0.3px; }
.ssr-crumbs { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.ssr-crumbs a { color: var(--brand); text-decoration: none; }
.ssr-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; overflow: hidden; }
.ssr-card h1 { font-size: 24px; line-height: 1.3; margin: 4px 0 12px; }
.ssr-card h2 { font-size: 18px; margin: 0 0 12px; }
.ssr-hero { display: block; width: calc(100% + 40px); max-width: none; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; margin: -20px -20px 16px; background: var(--brand-bg); }
.ssr-chip { display: inline-block; margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--brand-bg); color: var(--brand); font-size: 12px; font-weight: 700; }
.ssr-progress { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 8px 0; }
.ssr-progress span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.ssr-stats { font-size: 15px; margin: 8px 0; }
.ssr-owner { font-size: 13px; color: var(--text-secondary); margin: 4px 0 12px; }
.ssr-cta { display: inline-block; padding: 12px 24px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.ssr-body { font-size: 15px; overflow-wrap: anywhere; }
.ssr-list { list-style: none; margin: 0; padding: 0; }
.ssr-list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.ssr-list li:last-child { border-bottom: none; }
.ssr-list a { color: var(--text); font-size: 15px; text-decoration: none; }
.ssr-links { margin: 0; padding-left: 18px; }
.ssr-links a { color: var(--brand); }
.ssr details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.ssr summary { font-weight: 600; cursor: pointer; }
.ssr details p { margin: 8px 0 0; color: var(--text-secondary); font-size: 14px; }
.ssr-footer { font-size: 12px; color: var(--text-secondary); text-align: center; padding: 16px 0; }

/* Share sheet (ShareSheet) and the post-payment invitation to share. */
.share-intro { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 12px; }
.share-preview {
  white-space: pre-line; font-size: 13px; line-height: 1.5; color: var(--text);
  background: var(--gray-bg); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
  max-height: 180px; overflow-y: auto;
}
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 76px; padding: 10px 4px;
  border: none; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
}
.share-btn:hover { background: var(--gray-bg); }
.share-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.share-dot {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.share-cta {
  background: var(--brand-bg); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; text-align: center;
}
.share-cta-title { font-size: 15px; font-weight: 800; color: var(--brand); margin-bottom: 4px; }
.share-cta-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }

/* Boot: when JS runs (html.js, set inline in <head>) the server-rendered
   content stays in the DOM for crawlers but is visually hidden, and a brand
   splash shows until React replaces #root. */
.boot-splash { display: none; }
.js .boot-splash {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--outer-bg);
}
.boot-logo { display: block; width: 153px; height: auto; }
.boot-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--brand-bg); border-top-color: var(--brand);
  animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-spinner { animation-duration: 2.4s; } }
.js .ssr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Panduan (in-app guide) */
.panduan-intro { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.panduan-item { border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.panduan-q {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 52px;
  padding: 12px 14px; border: none; background: none; text-align: left; cursor: pointer;
  font-family: var(--font); font-size: 14.5px; font-weight: 700; color: var(--text);
}
.panduan-q:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.panduan-chev { font-size: 20px; color: var(--text-secondary); transition: transform .15s ease; }
.panduan-item.open .panduan-chev { transform: rotate(90deg); }
.panduan-item.open .panduan-q { color: var(--brand); }
.panduan-steps { margin: 0; padding: 0 16px 14px 34px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.panduan-steps li + li { margin-top: 6px; }

/* Berita (news) */
.berita-list { display: flex; flex-direction: column; gap: 12px; }
.berita-card {
  display: flex; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
  border: none; border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow);
  font-family: var(--font); color: var(--text);
}
.berita-card:hover { background: var(--gray-bg); }
.berita-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.berita-thumb {
  width: 104px; height: 78px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--brand-bg) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.berita-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.berita-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.berita-title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.berita-excerpt {
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.berita-hero {
  display: block; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 12px; padding: 0; border: none; cursor: zoom-in;
  border-radius: var(--radius-lg); background: var(--brand-bg) center / cover no-repeat;
}
.berita-h1 { font-size: 22px; line-height: 1.3; margin: 0 0 12px; }
.berita-isi { font-size: 15px; line-height: 1.7; color: var(--text); margin-bottom: 14px; overflow-wrap: anywhere; }
.berita-isi a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.berita-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.berita-link-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none;
}
.berita-link-btn:hover { background: var(--gray-bg); }
.berita-link-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.berita-link-btn .share-dot { width: 32px; height: 32px; font-size: 14px; }
.berita-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px; }
.berita-gallery-item {
  aspect-ratio: 4 / 3; padding: 0; border: none; cursor: zoom-in;
  border-radius: var(--radius-sm); background: var(--brand-bg) center / cover no-repeat;
}
.berita-gallery-item:focus-visible, .berita-hero:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (min-width: 840px) {
  .backoffice .berita-list, .content .berita-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
  .berita-gallery { grid-template-columns: repeat(4, 1fr); }
}
.img-remove-btn {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: none;
  background: var(--red); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}
.ssr-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.ssr-gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
