/* =========================================================
   SMS Yayasan — Design tokens (v2, upgraded)
   Institutional / utilitarian data tool. Navy + teal, hairline
   borders, dense tables — refined with subtle depth, icons, and
   interactive motion. Still no shadow-card-kit or cream/terracotta.
   ========================================================= */
:root {
  --color-bg: #F6F7F9;
  --color-surface: #FFFFFF;
  --color-ink: #1C232B;
  --color-ink-muted: #5B6572;
  --color-ink-faint: #8A93A0;
  --color-border: #E2E5EA;
  --color-border-strong: #C3C9D1;

  --color-primary: #1E3A5F;
  --color-primary-hover: #16304C;
  --color-primary-tint: #EAF0F6;
  --color-primary-soft: #2C4E78;

  --color-accent: #3D7068;
  --color-accent-tint: #E7F1EF;
  --color-accent-strong: #2E5951;

  --color-warning: #C97A2B;
  --color-warning-tint: #FBF0E4;

  --color-danger: #B4443C;
  --color-danger-tint: #FAEBE9;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --sidebar-width: 252px;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 30, 45, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 30, 45, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--color-ink);
  background: var(--color-bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

h1, h2, h3 { font-weight: 600; margin: 0 0 4px; letter-spacing: -0.012em; color: var(--color-ink); }
h1 { font-size: 23px; }
h2 { font-size: 17px; }
h3 { font-size: 13.5px; color: var(--color-ink-muted); font-weight: 500; margin-bottom: 22px; }

/* ---------- Icons ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon--sm { width: 15px; height: 15px; }
.icon--xl { width: 34px; height: 34px; }
.icon--input { width: 17px; height: 17px; color: var(--color-ink-faint); }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--color-primary) 0%, #16283F 100%);
  color: #E7ECF1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}
.sidebar__brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar__brand-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar__brand-icon .icon { width: 20px; height: 20px; color: #fff; }
.sidebar__brand strong { display: block; font-size: 14.5px; color: #fff; line-height: 1.3; }
.sidebar__brand span { display: block; font-size: 11.5px; color: #93A7BB; margin-top: 2px; }

.sidebar__nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar__link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  color: #B9C7D6;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.sidebar__link .icon { color: #7F93A9; transition: color .15s var(--ease); }
.sidebar__link:hover { background: rgba(255,255,255,0.07); text-decoration: none; color: #fff; transform: translateX(2px); }
.sidebar__link:hover .icon { color: #fff; }
.sidebar__link.is-active {
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--color-warning);
}
.sidebar__link.is-active .icon { color: var(--color-warning); }

/* Grup menu collapsible (<details>/<summary>) — tanpa JS, native browser. */
.sidebar__group { margin-bottom: 2px; }
.sidebar__group summary {
  list-style: none;
}
.sidebar__group summary::-webkit-details-marker { display: none; }
.sidebar__group-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7E93A8;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.sidebar__group-label:hover { background: rgba(255,255,255,0.05); color: #C3D2E0; }
.sidebar__group-chevron { width: 13px; height: 13px; transition: transform .18s var(--ease); }
.sidebar__group[open] > .sidebar__group-label .sidebar__group-chevron { transform: rotate(90deg); }
.sidebar__group .sidebar__link { margin-left: 4px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 5;
}
.topbar__left { display: flex; align-items: center; gap: 14px; }
.topbar__title { font-size: 18px; font-weight: 600; }
.topbar__menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  flex-shrink: 0;
}
.topbar__menu-btn .icon { width: 19px; height: 19px; }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.topbar__user { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--color-ink-muted); }
.topbar__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-primary-tint); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12.5px;
}

.content { padding: 26px 28px 60px; }

/* ---------- Flash messages ---------- */
.flash {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 9px;
}
.flash--success { background: var(--color-accent-tint); color: #234F49; border-color: #BFDCD8; }
.flash--error { background: var(--color-danger-tint); color: #7C2C26; border-color: #E7B9B5; }
.flash .icon { flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: var(--color-ink-muted); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); box-shadow: var(--shadow-md); }
.btn--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--lg { padding: 12px 18px; font-size: 14.5px; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Panels ---------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel__header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel__body { padding: 20px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat {
  flex: 1; min-width: 180px;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  display: flex; align-items: center; gap: 14px;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat__icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--color-primary-tint); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat__value { font-size: 26px; font-weight: 700; color: var(--color-ink); line-height: 1.1; }
.stat__label { font-size: 12.5px; color: var(--color-ink-muted); margin-top: 2px; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; padding: 10px 14px;
  border-bottom: 1.5px solid var(--color-border-strong);
  color: var(--color-ink-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover td { background: var(--color-primary-tint); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.badge--active { background: var(--color-accent-tint); color: var(--color-accent-strong); }
.badge--pending { background: var(--color-warning-tint); color: #7A4A19; }
.badge--inactive { background: #EEF0F2; color: var(--color-ink-muted); }
.badge--danger { background: var(--color-danger-tint); color: #7C2C26; }

/* ---------- Forms ---------- */
.form { max-width: 560px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--color-ink-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  background: var(--color-surface);
  color: var(--color-ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-tint);
  border-color: var(--color-primary);
}
.field .error { color: var(--color-danger); font-size: 12px; margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.search-input { padding: 9px 13px 9px 36px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font-size: 13.5px; min-width: 230px; transition: box-shadow .15s var(--ease), border-color .15s var(--ease); }
.search-input:focus { outline: none; box-shadow: 0 0 0 3px var(--color-primary-tint); border-color: var(--color-primary); }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap .icon { position: absolute; left: 11px; color: var(--color-ink-faint); pointer-events: none; }

.pagination { display: flex; gap: 6px; margin-top: 18px; }
.pagination a, .pagination span {
  padding: 6px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 13px;
  transition: background .15s var(--ease);
}
.pagination a:hover { background: var(--color-primary-tint); text-decoration: none; }
.pagination .is-current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.empty-state { padding: 48px 20px; text-align: center; color: var(--color-ink-muted); }

/* =========================================================
   Login / Auth screen — split panel concept, navy brand palette.
   ========================================================= */
.auth-body { background: var(--color-bg); }
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.05), transparent 40%),
    linear-gradient(135deg, #16283F 0%, #1E3A5F 55%, #234769 100%);
}
.auth-card {
  width: 100%; max-width: 920px;
  min-height: 520px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  overflow: hidden;
}
.auth-panel { padding: 46px 42px; display: flex; flex-direction: column; }
.auth-panel--brand {
  flex: 1.05;
  background: linear-gradient(160deg, var(--color-primary) 0%, #142A42 100%);
  color: #E7ECF1;
  position: relative;
  justify-content: center;
  overflow: hidden;
}
.auth-panel__glow {
  position: absolute; inset: -40% -20% auto auto; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
  pointer-events: none;
}
.auth-brand-icon {
  width: 56px; height: 56px; border-radius: var(--radius);
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px; color: #fff;
}
.auth-brand-title { color: #fff; font-size: 24px; margin-bottom: 12px; }
.auth-brand-subtitle { color: #AEC0D3; font-size: 13.5px; line-height: 1.65; margin-bottom: 30px; max-width: 340px; }
.auth-feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.auth-feature-list li { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; color: #D3DEE9; }
.auth-feature-list .icon { color: var(--color-warning); margin-top: 1px; }

.auth-panel--form { flex: 1; justify-content: center; }
.auth-form-title { font-size: 21px; margin-bottom: 4px; }
.auth-form-subtitle { color: var(--color-ink-muted); font-size: 13px; margin: 0 0 26px; }
.auth-form .field { margin-bottom: 18px; }
.field--icon .field__input-wrap { position: relative; display: flex; align-items: center; }
.field--icon .icon--input { position: absolute; left: 12px; }
.field--icon input { padding-left: 38px; }

@media (max-width: 780px) {
  .auth-card { flex-direction: column; min-height: 0; }
  .auth-panel { padding: 34px 28px; }
  .auth-panel--brand { flex: none; }
  .auth-feature-list { display: none; }
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 16, 26, 0.5);
  z-index: 15;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.sidebar-overlay.is-visible { display: block; opacity: 1; }

/* =========================================================
   Loading overlay global — muncul di setiap GET/POST/submit,
   hilang otomatis begitu halaman baru selesai render (page load).
   ========================================================= */
.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(246, 247, 249, 0.7);
  backdrop-filter: blur(1px);
  z-index: 9999;
  align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .12s var(--ease);
}
.loading-overlay.is-visible { display: flex; opacity: 1; }
.loading-overlay__spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--color-primary-tint);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 20; height: 100%;
    transform: translateX(-100%);
    transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .topbar__menu-btn { display: flex; }
  .content { padding: 18px; }
  .field-row { flex-direction: column; }
}

/* =========================================================
   PPDB — halaman pembayaran publik (invoice & selesai)
   ========================================================= */
.pay-steps { display: flex; align-items: center; gap: 0; margin: 0 0 26px; padding: 0; list-style: none; }
.pay-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-ink-faint); position: relative; }
.pay-steps li + li::before { content: ''; flex: 1; height: 2px; background: var(--color-border); margin-right: 8px; min-width: 14px; }
.pay-steps__dot { width: 24px; height: 24px; border-radius: 50%; background: var(--color-border); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; transition: background .3s var(--ease); }
.pay-steps li.is-current { color: var(--color-ink); font-weight: 600; }
.pay-steps li.is-current .pay-steps__dot { background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-tint); }
.pay-steps li.is-done { color: var(--color-accent-strong); }
.pay-steps li.is-done .pay-steps__dot { background: var(--color-accent); }
.pay-steps li.is-done + li::before, .pay-steps li.is-current + li::before { background: var(--color-border); }
.pay-steps li.is-done + li::before { background: var(--color-accent); }
.pay-steps__label { white-space: nowrap; }

.invoice { border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); background: var(--color-surface); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.invoice__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-soft) 100%); color: #fff; }
.invoice__head small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #AFC3D8; }
.invoice__head strong { display: block; font-size: 17px; letter-spacing: .01em; margin-top: 2px; }
.invoice__status { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; white-space: nowrap; }
.invoice__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; padding: 18px 20px; border-bottom: 1px dashed var(--color-border-strong); }
.invoice__meta dt { font-size: 11.5px; color: var(--color-ink-faint); margin: 0 0 2px; }
.invoice__meta dd { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--color-ink); word-break: break-word; }
.invoice__lines { width: 100%; border-collapse: collapse; }
.invoice__lines th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--color-ink-faint); padding: 12px 20px 6px; text-transform: uppercase; letter-spacing: .04em; }
.invoice__lines th:last-child, .invoice__lines td:last-child { text-align: right; }
.invoice__lines td { padding: 8px 20px; font-size: 13.5px; }
.invoice__lines td small { display: block; color: var(--color-ink-muted); font-size: 12px; }
.invoice__sum td { border-top: 1px solid var(--color-border); color: var(--color-ink-muted); }
.invoice__total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px; background: var(--color-primary-tint); border-top: 1px solid var(--color-border); }
.invoice__total span { font-size: 13px; color: var(--color-ink-muted); font-weight: 500; }
.invoice__total strong { font-size: 24px; font-weight: 700; color: var(--color-primary); letter-spacing: -.01em; }

.pay-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--color-border-strong); border-radius: var(--radius); font-size: 13px; cursor: pointer; margin-bottom: 16px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.pay-confirm:hover { border-color: var(--color-primary); }
.pay-confirm.is-checked { border-color: var(--color-accent); background: var(--color-accent-tint); }
.pay-confirm input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--color-accent); flex-shrink: 0; }
.pay-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-actions .btn--primary[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.pay-note { font-size: 12px; color: var(--color-ink-muted); margin-top: 16px; line-height: 1.6; }
.pay-banner { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.pay-banner--warn { background: var(--color-warning-tint); border-color: #EBCFAE; color: #7A4A19; }
.pay-banner--danger { background: var(--color-danger-tint); border-color: #E7B9B5; color: #7C2C26; }
.pay-banner .icon { flex-shrink: 0; margin-top: 1px; }

/* ---------- Halaman selesai ---------- */
.done-body { min-height: 100vh; margin: 0; display: flex; align-items: flex-start; justify-content: center; padding: 34px 16px 60px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--done-tint, var(--color-accent-tint)) 0%, transparent 60%), var(--color-bg); }
.done-body[data-state="pending"] { --done-tint: var(--color-warning-tint); --done-color: var(--color-warning); }
.done-body[data-state="failed"], .done-body[data-state="unknown"] { --done-tint: var(--color-danger-tint); --done-color: var(--color-danger); }
.done-body[data-state="success"], .done-body[data-state="no_payment"] { --done-tint: var(--color-accent-tint); --done-color: var(--color-accent); }
.done-wrap { width: 100%; max-width: 560px; }
.done-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-size: 13px; color: var(--color-ink-muted); }
.done-brand .sidebar__brand-icon { background: var(--color-primary-tint); color: var(--color-primary); width: 32px; height: 32px; }
.done-brand strong { color: var(--color-ink); }
.done-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 30px 28px; text-align: center; animation: done-rise .5s var(--ease) both; }
@keyframes done-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.done-icon { width: 92px; height: 92px; margin: 0 auto 14px; display: block; overflow: visible; }
.done-icon * { fill: none; stroke: var(--done-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done-icon__circle { stroke-dasharray: 152; stroke-dashoffset: 152; animation: done-draw .7s .1s var(--ease) forwards; }
.done-icon__mark { stroke-dasharray: 44; stroke-dashoffset: 44; animation: done-draw .45s .7s var(--ease) forwards; }
.done-icon__pulse { stroke-width: 1.5; opacity: 0; animation: done-pulse 1.6s 1.1s ease-out 2; transform-origin: 26px 26px; }
@keyframes done-draw { to { stroke-dashoffset: 0; } }
@keyframes done-pulse { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
.done-icon__hand { transform-origin: 26px 26px; animation: done-spin 6s linear infinite; }
.done-icon__hand--min { animation-duration: 1.2s; }
@keyframes done-spin { to { transform: rotate(360deg); } }
.done-card h1 { font-size: 24px; margin-bottom: 8px; }
.done-lead { color: var(--color-ink-muted); font-size: 14px; line-height: 1.65; margin: 0 auto 22px; max-width: 440px; }
.done-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #7A4A19; background: var(--color-warning-tint); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.done-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-warning); animation: done-blink 1.2s ease-in-out infinite; }
@keyframes done-blink { 50% { opacity: .25; } }

.done-receipt { text-align: left; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); padding: 6px 18px; margin: 0 0 22px; background: #FCFDFD; }
.done-receipt__row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--color-border); }
.done-receipt__row:last-child { border-bottom: 0; }
.done-receipt__row span { color: var(--color-ink-muted); flex-shrink: 0; }
.done-receipt__row b { font-weight: 500; text-align: right; word-break: break-word; }
.done-receipt__row--total b { font-size: 16px; color: var(--color-primary); font-weight: 700; }
.done-copy { border: 0; background: var(--color-primary-tint); color: var(--color-primary); font: inherit; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; cursor: pointer; margin-left: 6px; transition: background .15s var(--ease); }
.done-copy:hover { background: #D9E5F1; }

.done-timeline { list-style: none; margin: 0 0 24px; padding: 0; text-align: left; }
.done-timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; font-size: 13px; }
.done-timeline li:last-child { padding-bottom: 0; }
.done-timeline li::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--color-border); }
.done-timeline li:last-child::before { display: none; }
.done-timeline__dot { width: 24px; height: 24px; border-radius: 50%; background: var(--color-border); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.done-timeline li.is-done .done-timeline__dot { background: var(--color-accent); }
.done-timeline li.is-done::before { background: var(--color-accent); }
.done-timeline li.is-current .done-timeline__dot { background: var(--color-warning); box-shadow: 0 0 0 4px var(--color-warning-tint); }
.done-timeline strong { display: block; font-weight: 600; color: var(--color-ink); }
.done-timeline small { color: var(--color-ink-muted); font-size: 12px; line-height: 1.5; }
.done-timeline li.is-todo strong { color: var(--color-ink-faint); font-weight: 500; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.done-help { margin-top: 18px; font-size: 12px; color: var(--color-ink-faint); }
.done-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

@media (max-width: 520px) {
  .invoice__meta { grid-template-columns: 1fr; }
  .pay-steps__label { display: none; }
  .pay-steps li.is-current .pay-steps__label { display: inline; }
  .done-card { padding: 28px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .done-card, .done-icon__circle, .done-icon__mark, .done-icon__pulse, .done-icon__hand, .done-live__dot { animation: none !important; }
  .done-icon__circle, .done-icon__mark { stroke-dashoffset: 0; }
}
@media print {
  .no-print, .loading-overlay, .done-confetti, .done-actions, .done-help, .done-brand { display: none !important; }
  body, .done-body, .auth-body { background: #fff !important; }
  .done-card, .auth-card, .invoice { box-shadow: none !important; }
  .done-card { border: 0; animation: none; }
  .done-icon__circle, .done-icon__mark { animation: none; stroke-dashoffset: 0; }
  .invoice__head { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
  .invoice__head small { color: #444; }
  .invoice__status { border: 1px solid #000; background: #fff; color: #000; }
}

/* =========================================================
   Dashboard analitik
   ========================================================= */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { margin-bottom: 4px; }
.dash-filter { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-filter label { font-size: 11.5px; color: var(--color-ink-faint); display: flex; flex-direction: column; gap: 4px; }
.dash-filter select { min-width: 160px; }
.dash-section { font-size: 15px; letter-spacing: .01em; margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); color: var(--color-primary); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin-bottom: 8px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--color-primary-tint); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi--accent .kpi__icon { background: var(--color-accent-tint); color: var(--color-accent-strong); }
.kpi--warn .kpi__icon { background: var(--color-warning-tint); color: var(--color-warning); }
.kpi__value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; color: var(--color-ink); }
.kpi__label { font-size: 12.5px; color: var(--color-ink-muted); margin-top: 2px; }
.kpi__sub { font-size: 11.5px; color: var(--color-ink-faint); margin-top: 4px; }
.trend--up { color: var(--color-accent-strong); font-weight: 600; }
.trend--down { color: var(--color-danger); font-weight: 600; }

.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dash-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid > .panel { margin-bottom: 0; min-width: 0; }
.chart-box { position: relative; height: 300px; }
.chart-box--sm { height: 240px; }
.chart-note { font-size: 11.5px; color: var(--color-ink-faint); line-height: 1.55; margin: 10px 0 0; }

.funnel__row { margin-bottom: 14px; }
.funnel__label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; color: var(--color-ink-muted); }
.funnel__label b { color: var(--color-ink); font-weight: 600; }
.funnel__label small { color: var(--color-ink-faint); font-weight: 400; margin-left: 4px; }
.funnel__bar { height: 10px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.funnel__bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--color-primary), var(--color-primary-soft)); transition: width .6s var(--ease); }
.funnel__row:last-child .funnel__bar span { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong)); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.mini-stats > div { padding: 14px 8px; border: 1px solid var(--color-border); border-radius: var(--radius); background: #FCFDFD; }
.mini-stats b { display: block; font-size: 24px; color: var(--color-primary); }
.mini-stats span { display: block; font-size: 12px; color: var(--color-ink-muted); margin-top: 2px; }
.mini-stats small { color: var(--color-ink-faint); font-size: 11.5px; }

.fill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 22px; }
.fill__top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.fill__top b { font-weight: 600; }
.fill__bar { height: 8px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.fill__bar span { display: block; height: 100%; border-radius: 999px; }
.fill__bar--ok { background: var(--color-accent); }
.fill__bar--warn { background: var(--color-warning); }
.fill__bar--danger { background: var(--color-danger); }
.fill__bar--muted { background: var(--color-border-strong); }

@media (max-width: 1100px) { .dash-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dash-grid--2, .dash-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .dash-head { align-items: flex-start; }
  .chart-box { height: 260px; }
}
@media print { .dash-filter, .kpi:hover { display: none; transform: none; } }

/* Kotak akun demo di halaman login */
.demo-account { margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); background: var(--color-primary-tint); }
.demo-account__title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--color-primary); margin-bottom: 8px; }
.demo-account__list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; }
.demo-account__list dt { color: var(--color-ink-muted); }
.demo-account__list dd { margin: 0; }
.demo-account__list code { font-family: ui-monospace, Consolas, monospace; background: #fff; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--color-border); user-select: all; }
