/* ============================================================
   PERSATUAN PENDUDUK VILLA IMPIANA (PPVI)
   Design System — Corporate Modern
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  --navy-900: #0b1e42;
  --navy-800: #0f2a5c;
  --navy-700: #14356f;
  --navy-600: #1e3a8a;
  --navy-500: #2b4c9b;

  --navy-100: #e7edfa;
  --blue-50:  #eef3fb;
  --blue-100: #dbe6f7;
  --blue-200: #c3d4f0;
  --blue-300: #a9c2e8;

  --grey-900: #0f172a;
  --grey-800: #1e293b;
  --grey-700: #334155;
  --grey-600: #475569;
  --grey-500: #64748b;
  --grey-400: #94a3b8;
  --grey-300: #cbd5e1;
  --grey-200: #e2e8f0;
  --grey-100: #f1f5f9;
  --grey-50:  #f8fafc;

  --white: #ffffff;

  --green-600: #15803d;
  --green-500: #16a34a;
  --green-50:  #ecfdf3;
  --green-100: #d1fae5;

  --orange-600: #c2410c;
  --orange-500: #ea580c;
  --orange-50:  #fff7ed;
  --orange-100: #ffedd5;

  --red-600: #b91c1c;
  --red-500: #dc2626;
  --red-50:  #fef2f2;
  --red-100: #fee2e2;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow:    0 4px 12px rgba(15, 23, 42, .08);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .14);

  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --sidebar-w: 262px;
  --topbar-h: 66px;
  --container: 1180px;
}

/* ---------- 2. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--grey-700);
  background: var(--grey-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0 0 .5rem; color: var(--grey-900); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy-500); }
img, svg { vertical-align: middle; }
ul, ol { margin: 0; padding-left: 1.1rem; }
small { font-size: .8rem; }
hr { border: none; border-top: 1px solid var(--grey-200); margin: 1.25rem 0; }

/* icons sizing */
svg { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 26px; height: 26px; }
.ico-xl { width: 34px; height: 34px; }

/* ---------- 3. Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .4rem; } .gap-2 { gap: .75rem; } .gap-3 { gap: 1.25rem; } .gap-4 { gap: 2rem; }
.grow { flex: 1 1 auto; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}
.text-center{text-align:center}.text-right{text-align:right}
.text-muted{color:var(--grey-500)}.text-sm{font-size:.85rem}.text-xs{font-size:.76rem}
.text-success{color:var(--green-600)}.text-danger{color:var(--red-600)}.text-warning{color:var(--orange-600)}
.text-navy{color:var(--navy-700)}.fw-600{font-weight:600}.fw-700{font-weight:700}
.w-100{width:100%}.hidden{display:none!important}
.eyebrow{ text-transform:uppercase; letter-spacing:.12em; font-size:.72rem; font-weight:700; color:var(--navy-500); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .68rem 1.15rem; font-family: var(--font); font-size: .9rem; font-weight: 600;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: all .16s ease; text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--blue-200); outline-offset: 1px; }
.btn-primary { background: var(--navy-700); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--navy-600); color: #fff; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn-secondary { background: var(--white); color: var(--navy-700); border-color: var(--grey-300); }
.btn-secondary:hover { background: var(--grey-50); border-color: var(--grey-400); color: var(--navy-700); }
.btn-success { background: var(--green-500); color: #fff; }
.btn-success:hover { background: var(--green-600); color: #fff; }
.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger:hover { background: var(--red-600); color: #fff; }
.btn-warning { background: var(--orange-500); color: #fff; }
.btn-warning:hover { background: var(--orange-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--grey-600); }
.btn-ghost:hover { background: var(--grey-100); color: var(--grey-900); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { padding: .42rem .8rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: .9rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; }

.spinner {
  display: inline-block; width: 20px; height: 20px; border: 2.5px solid var(--grey-300);
  border-top-color: var(--navy-600); border-radius: 50%; animation: spin .7s linear infinite;
}
.spinner-light { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 5. Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 1.4rem 1.5rem; }
.card-header {
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card-header h3 { margin: 0; font-size: 1.05rem; }
.card-header .sub { font-size: .82rem; color: var(--grey-500); margin-top: 2px; }
.card-body { padding: 1.4rem 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--grey-200); background: var(--grey-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Stat cards */
.stat {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.stat:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem; }
.stat__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-50); color: var(--navy-600);
}
.stat__icon.green { background: var(--green-50); color: var(--green-600); }
.stat__icon.orange{ background: var(--orange-50); color: var(--orange-600); }
.stat__icon.red   { background: var(--red-50); color: var(--red-600); }
.stat__label { font-size: .82rem; color: var(--grey-500); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 1.85rem; font-weight: 800; color: var(--grey-900); line-height: 1.1; letter-spacing: -.02em; }
.stat__hint { font-size: .8rem; color: var(--grey-500); margin-top: .3rem; }
.stat--accent { border-left: 4px solid var(--navy-600); }
.stat--accent.green { border-left-color: var(--green-500); }
.stat--accent.orange{ border-left-color: var(--orange-500); }
.stat--accent.red   { border-left-color: var(--red-500); }

/* ---------- 6. Badges & Pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .38rem; padding: .3rem .68rem;
  font-size: .76rem; font-weight: 700; border-radius: 999px; line-height: 1.3; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--green-50); color: var(--green-600); }
.badge-warning { background: var(--orange-50); color: var(--orange-600); }
.badge-danger  { background: var(--red-50); color: var(--red-600); }
.badge-info    { background: var(--blue-50); color: var(--navy-600); }
.badge-muted   { background: var(--grey-100); color: var(--grey-600); }

.pill { display:inline-flex;align-items:center;gap:.35rem;padding:.28rem .7rem;border-radius:999px;background:var(--blue-50);color:var(--navy-700);font-size:.78rem;font-weight:600; }

/* ---------- 7. Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--grey-800); margin-bottom: .38rem; }
label .req { color: var(--red-500); }
.form-hint { font-size: .78rem; color: var(--grey-500); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--red-600); margin-top: .3rem; }

.input, .select, .form-control, textarea.input, textarea.form-control {
  width: 100%; padding: .68rem .85rem; font-family: var(--font); font-size: .9rem; color: var(--grey-900);
  background: var(--white); border: 1px solid var(--grey-300); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .form-control::placeholder { color: var(--grey-400); }
.input:focus, .select:focus, .form-control:focus, textarea.input:focus, textarea.form-control:focus {
  outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(43,76,155,.15);
}
.input.is-invalid, .select.is-invalid, .form-control.is-invalid { border-color: var(--red-500); }
textarea.input, textarea.form-control { resize: vertical; min-height: 88px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem; }
.form-check { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .9rem; }
.form-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--navy-600); flex: none; }
.form-check label { margin: 0; font-weight: 500; font-size: .88rem; color: var(--grey-700); cursor: pointer; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem; }

.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--grey-400); pointer-events: none; z-index: 1; }
.input-icon .form-control, .input-icon .input { padding-left: 2.5rem; }
.input-icon .input-toggle, .input-icon .toggle-pass { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--grey-400); padding: .2rem; display: grid; place-items: center; }
.input-icon .input-toggle:hover, .input-icon .toggle-pass:hover { color: var(--grey-600); }
.input-icon .input-toggle svg, .input-icon .toggle-pass svg { position: static; transform: none; pointer-events: auto; }

.stack { display: grid; gap: 1.2rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.plain-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .87rem; color: var(--grey-600); }
.plain-list li svg { color: var(--green-500); margin-top: 2px; flex: none; }
.is-invalid-check .form-check label { color: var(--red-600); }
.table .form-check { margin-bottom: 0; }
.form-check--card {
  align-items: center; gap: .75rem; margin-bottom: 0; padding: .8rem .95rem; background: #fff;
  border: 1px solid var(--grey-200); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-check--card:hover { border-color: var(--blue-300); background: var(--grey-50); }
.form-check--card input { margin-top: 0; }
.form-check--card > span { display: flex; flex-direction: column; gap: .1rem; }
.form-check--card strong { font-size: .9rem; color: var(--grey-900); font-weight: 600; }
.form-check--card em { font-style: normal; font-size: .78rem; color: var(--grey-500); }
.form-check--card:has(input:checked) { border-color: var(--navy-500); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(43,76,155,.10); }
.ml-1 { margin-left: .35rem; }

/* ---------- Payment accordion ---------- */
.pay-item { border: 1px solid var(--grey-200); border-radius: var(--radius); background: #fff; overflow: hidden; }
.pay-item[open] { border-color: var(--blue-200); box-shadow: var(--shadow-xs); }
.pay-item > summary { list-style: none; cursor: pointer; padding: .9rem 1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.pay-item > summary::-webkit-details-marker { display: none; }
.pay-item__main { display: flex; flex-direction: column; gap: .15rem; min-width: 180px; flex: 1 1 220px; }
.pay-item__ref { font-weight: 700; color: var(--navy-700); font-size: .9rem; }
.pay-item__meta { font-size: .78rem; color: var(--grey-500); }
.pay-item__amt { font-weight: 700; color: var(--grey-900); font-size: .98rem; margin-left: auto; }
.pay-item__chev { color: var(--grey-400); transition: transform .15s; display: grid; place-items: center; }
.pay-item[open] .pay-item__chev { transform: rotate(180deg); color: var(--navy-600); }
.pay-item__body { border-top: 1px dashed var(--grey-200); padding: .9rem 1rem; background: var(--grey-50); }
.pay-item__body .table { background: #fff; }



/* ---------- Status & misc blocks ---------- */
.success-ring { width: 84px; height: 84px; border-radius: 50%; background: var(--green-50); color: var(--green-600); display: grid; place-items: center; margin: 0 auto; }
.success-ring svg { width: 44px; height: 44px; }
.ref-box { display:inline-block; font-size:1.35rem; font-weight:800; letter-spacing:.06em; color:var(--navy-700); background:var(--blue-50); border:1px dashed var(--blue-300); border-radius:var(--radius); padding:.7rem 1.4rem; }
.status-banner { display:flex; gap:.8rem; align-items:flex-start; text-align:left; padding:1rem 1.2rem; border-radius:var(--radius); background:var(--orange-50); border:1px solid #fcd9a8; color:#8a4b00; }
.status-banner svg { flex:none; margin-top:2px; }
.status-banner.success { background:var(--green-50); border-color:#a7e6c1; color:#1a6b3c; }
.status-banner.danger { background:var(--red-50); border-color:#f4b6b6; color:#a11b1b; }
.mini-step { display:flex; gap:.6rem; align-items:flex-start; }
.mini-step > span { width:26px;height:26px;border-radius:50%;background:var(--navy-100);color:var(--navy-700);display:grid;place-items:center;font-weight:800;font-size:.8rem;flex:none; }



.checkbox { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-weight: 500; color: var(--grey-700); font-size: .88rem; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy-600); flex: none; }

.form-grid { display: grid; gap: 1rem 1.1rem; grid-template-columns: repeat(2, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.form-section-title { display:flex; align-items:center; gap:.6rem; font-size:.82rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--navy-600); margin:0 0 1rem; padding-bottom:.55rem; border-bottom:1px solid var(--grey-200); }
.form-section-title .num { width:22px;height:22px;border-radius:50%;background:var(--navy-600);color:#fff;display:grid;place-items:center;font-size:.72rem; }

/* ---------- 8. Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.table thead th {
  text-align: left; padding: .8rem 1rem; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--grey-500); background: var(--grey-50); border-bottom: 1px solid var(--grey-200); white-space: nowrap;
}
.table tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--grey-100); color: var(--grey-700); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--grey-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .fw-600 { color: var(--grey-900); }

/* ---------- 9. Alerts ---------- */
.alert { display: flex; gap: .75rem; padding: .9rem 1.1rem; border-radius: var(--radius); font-size: .88rem; align-items: flex-start; border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 1px; }
.alert-success { background: var(--green-50); color: var(--green-600); border-color: var(--green-100); }
.alert-danger  { background: var(--red-50); color: var(--red-600); border-color: var(--red-100); }
.alert-warning { background: var(--orange-50); color: var(--orange-600); border-color: var(--orange-100); }
.alert-info    { background: var(--blue-50); color: var(--navy-700); border-color: var(--blue-100); }

/* ---------- 10. Toast ---------- */
.toast-stack { position: fixed; top: 1.1rem; right: 1.1rem; z-index: 2000; display: flex; flex-direction: column; gap: .7rem; max-width: 360px; width: calc(100% - 2rem); }
.toast {
  display: flex; gap: .7rem; align-items: flex-start; padding: .95rem 1.05rem; background: var(--white);
  border: 1px solid var(--grey-200); border-left: 4px solid var(--navy-600); border-radius: var(--radius);
  box-shadow: var(--shadow-md); animation: toastIn .28s cubic-bezier(.2,.8,.3,1); font-size: .88rem;
}
.toast.leaving { animation: toastOut .25s ease forwards; }
.toast__icon { flex: none; margin-top: 1px; }
.toast__body { flex: 1 1 auto; }
.toast__title { font-weight: 700; color: var(--grey-900); font-size: .9rem; }
.toast__msg { color: var(--grey-600); }
.toast__close { background: none; border: none; cursor: pointer; color: var(--grey-400); padding: 0; }
.toast__close:hover { color: var(--grey-600); }
.toast.success { border-left-color: var(--green-500); } .toast.success .toast__icon { color: var(--green-600); }
.toast.error   { border-left-color: var(--red-500); }   .toast.error .toast__icon { color: var(--red-600); }
.toast.warning { border-left-color: var(--orange-500); }.toast.warning .toast__icon { color: var(--orange-600); }
.toast.info    { border-left-color: var(--navy-600); }  .toast.info .toast__icon { color: var(--navy-600); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- 11. Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px);
  z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1.2rem;
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.2,.8,.3,1);
  max-height: 92vh; overflow: auto;
}
.modal-overlay.open .modal { transform: none; }
.modal__head { padding: 1.3rem 1.4rem .4rem; display: flex; gap: .9rem; align-items: flex-start; }
.modal__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--orange-50); color: var(--orange-600); }
.modal__icon.danger { background: var(--red-50); color: var(--red-600); }
.modal__icon.info { background: var(--blue-50); color: var(--navy-600); }
.modal__title { font-size: 1.1rem; font-weight: 700; color: var(--grey-900); margin: 0; }
.modal__text { color: var(--grey-600); font-size: .9rem; margin: .35rem 0 0; }
.modal__body { padding: 1rem 1.4rem; }
.modal__foot { padding: .6rem 1.4rem 1.4rem; display: flex; gap: .7rem; justify-content: flex-end; }

/* ---------- 12. Empty & Loading states ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--grey-500); }
.empty__icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--grey-100); color: var(--grey-400); }
.empty__icon svg { width: 30px; height: 30px; }
.empty h3 { color: var(--grey-800); font-size: 1.05rem; margin-bottom: .3rem; }
.loading-inline { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2.5rem; color: var(--grey-500); }

/* ---------- 13. Avatar ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--navy-600); color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .02em;
}
.avatar.lg { width: 60px; height: 60px; font-size: 1.15rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.grey { background: var(--grey-200); color: var(--grey-600); }

/* ---------- 14. Pagination ---------- */
.pager { display: flex; gap: .35rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--grey-200); border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; color: var(--grey-600); background: #fff;
}
.pager a:hover { border-color: var(--navy-500); color: var(--navy-600); }
.pager .active { background: var(--navy-600); color: #fff; border-color: var(--navy-600); }
.pager .disabled { opacity: .5; pointer-events: none; }

/* ============================================================
   PUBLIC SITE
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-200);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; }
.brand img { width: auto; height: 52px; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__sub { font-size: .7rem; color: var(--grey-500); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a.nav-link { padding: .5rem .85rem; border-radius: var(--radius-sm); color: var(--grey-600); font-weight: 600; font-size: .9rem; }
.site-nav a.nav-link:hover { background: var(--grey-100); color: var(--navy-700); }
.site-nav a.nav-link.active { color: var(--navy-700); background: var(--blue-50); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--grey-200); border-radius: var(--radius-sm); padding: .5rem; cursor: pointer; color: var(--grey-700); }

/* Hero */
.hero { position: relative; background: linear-gradient(160deg, var(--navy-900), var(--navy-700) 60%, var(--navy-600)); color: #fff; overflow: hidden; }
.hero::before { content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 82% 18%, rgba(255,255,255,.10), transparent 42%), radial-gradient(circle at 12% 88%, rgba(147,180,255,.14), transparent 40%); }
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding-top: 4.2rem; padding-bottom: 4.6rem; }
.hero h1 { color: #fff; font-size: 2.75rem; line-height: 1.13; margin-bottom: 1rem; }
.hero .lead { font-size: 1.08rem; color: #c7d6f2; max-width: 44ch; margin-bottom: 1.8rem; }
.hero-badge { display:inline-flex; align-items:center; gap:.5rem; padding:.4rem .9rem; border-radius:999px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); font-size:.78rem; font-weight:600; margin-bottom:1.4rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-trust { display:flex; gap:2rem; margin-top:2.6rem; flex-wrap:wrap; }
.hero-trust .t-val { font-size:1.6rem; font-weight:800; color:#fff; }
.hero-trust .t-lbl { font-size:.78rem; color:#a9bde3; }

.hero-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-xl);
  padding: 1.6rem; backdrop-filter: blur(6px); box-shadow: 0 30px 60px rgba(0,0,0,.25); overflow: hidden;
}
/* Foto muka depan (bleed ke tepi kad) */
.hero-card__media { position: relative; margin: -1.6rem -1.6rem 1.3rem; background: var(--navy-800); }
.hero-card__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 240px; object-fit: cover; object-position: center 42%; }
.hero-card__media::after { content:""; position:absolute; inset:0; pointer-events:none; background: linear-gradient(180deg, rgba(15,42,92,.12), rgba(15,42,92,.55)); }
.hero-card__tag {
  position: absolute; left: .9rem; bottom: .9rem; z-index: 1;
  display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border-radius: 999px;
  background: rgba(15,42,92,.55); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: .72rem; font-weight: 600;
}
.hero-card__row { display:flex; align-items:center; justify-content:space-between; padding:.85rem 0; border-bottom:1px solid rgba(255,255,255,.12); }
.hero-card__row:last-child { border-bottom:none; }
.hero-card__label { font-size:.85rem; color:#c7d6f2; }
.hero-card__val { font-weight:700; color:#fff; }
.hero-card__val.green { color:#6ee7a8; }
.hero-card__val.red { color:#ff9b9b; }
.hero-card__val.orange { color:#ffc07a; }

/* Section */
.section { padding: 4.2rem 0; }
.section.alt { background: var(--white); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 2.6rem; }
.section-head h2 { font-size: 1.85rem; }
.section-head p { color: var(--grey-500); font-size: 1rem; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; }
.feature {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg); padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-xs); transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--navy-600); margin-bottom: 1rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature p { color: var(--grey-500); font-size: .9rem; margin: 0; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; counter-reset: step; }
.step { position: relative; padding-top: 1rem; }
.step__num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--navy-600); color: #fff; margin-bottom: .9rem; font-size: 1rem;
}
.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step p { font-size: .87rem; color: var(--grey-500); margin: 0; }
.step:not(:last-child)::after { content:""; position:absolute; top:1.9rem; left:52px; right:-1rem; height:2px; background: linear-gradient(90deg, var(--blue-200), transparent); }

/* Fee table band */
.fee-card { background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.fee-row { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--grey-100); }
.fee-row:last-child { border-bottom: none; }
.fee-row .name { font-weight: 600; color: var(--grey-800); }
.fee-row .desc { font-size: .82rem; color: var(--grey-500); }
.fee-row .price { font-weight: 800; color: var(--navy-700); font-size: 1.15rem; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); border-radius: var(--radius-xl); padding: 2.6rem 2.4rem; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color:#fff; margin-bottom:.3rem; }
.cta-band p { color:#c7d6f2; margin:0; }

/* Footer */
.site-footer { background: var(--navy-900); color: #a9bde3; padding: 3.4rem 0 1.6rem; }
.site-footer .f-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.4rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.site-footer a { color: #a9bde3; font-size: .88rem; display: block; padding: .28rem 0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand__sub { color:#8aa2cf; }
.f-contact { display: flex; gap: .6rem; align-items: flex-start; padding: .3rem 0; font-size: .88rem; }
.f-contact svg { margin-top: 3px; color: #6f8dc4; }
.f-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.4rem; padding-top: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }
.f-bottom a { display: inline; }
.f-bottom .links { display: flex; gap: 1.2rem; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-aside { position: relative; background: linear-gradient(160deg, var(--navy-900), var(--navy-700) 55%, var(--navy-600)); color: #fff; padding: 3rem 3rem 2.5rem; display: flex; flex-direction: column; overflow: hidden; }
.auth-aside::before { content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 80% 15%, rgba(255,255,255,.1), transparent 45%); }
.auth-aside__inner { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; }
.auth-aside h2 { color: #fff; font-size: 2rem; line-height: 1.2; }
.auth-aside p { color: #c7d6f2; }
.auth-aside .aside-list { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .9rem; }
.auth-aside .aside-list li { display: flex; gap: .7rem; align-items: flex-start; color: #d6e1f7; font-size: .92rem; }
.auth-aside .aside-list svg { color: #8fb0ee; margin-top: 2px; flex: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--grey-50); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { justify-content: center; margin-bottom: 1.6rem; }
.auth-card .brand img { height: 62px; }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-card .subtitle { text-align: center; color: var(--grey-500); margin-bottom: 1.8rem; }
.auth-switch { text-align: center; margin-top: 1.4rem; font-size: .89rem; color: var(--grey-500); }
.auth-foot { margin-top: 1.6rem; text-align: center; }
.auth-foot a { font-size: .85rem; }

.login-tabs { display: flex; background: var(--grey-100); border-radius: var(--radius); padding: .3rem; margin-bottom: 1.6rem; }
.login-tabs button {
  flex: 1; border: none; background: none; padding: .6rem; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: .88rem; color: var(--grey-500); display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.login-tabs button.active { background: #fff; color: var(--navy-700); box-shadow: var(--shadow-xs); }

/* ============================================================
   PORTAL (member & admin)
   ============================================================ */
.portal { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--navy-900); color: #c3d1ea; flex: none;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1100;
  transition: transform .25s ease;
}
.sidebar__brand { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; padding: 1.15rem 1.3rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__brand img { width: auto; height: 46px; display: block; }
.sidebar__brand .brand__sub { color: #8aa2cf; }
.sidebar__nav { padding: 1rem .8rem; overflow-y: auto; flex: 1 1 auto; }
.sidebar__section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6f88b8; padding: .9rem .8rem .4rem; font-weight: 700; }
.sidebar__link {
  display: flex; align-items: center; gap: .75rem; padding: .68rem .85rem; border-radius: var(--radius);
  color: #c3d1ea; font-size: .9rem; font-weight: 500; margin-bottom: .15rem; transition: background .15s ease, color .15s ease;
}
.sidebar__link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar__link.active { background: var(--navy-600); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar__link .badge { margin-left: auto; }
.sidebar__foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar__user { display: flex; align-items: center; gap: .7rem; padding: .5rem; border-radius: var(--radius); }
.sidebar__user .avatar { width: 38px; height: 38px; background: var(--navy-600); }
.sidebar__user .u-name { font-size: .85rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar__user .u-role { font-size: .72rem; color: #8aa2cf; }

.portal__main { flex: 1 1 auto; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.4rem; position: sticky; top: 0; z-index: 800;
}
.topbar__toggle { display: none; background: none; border: 1px solid var(--grey-200); border-radius: var(--radius-sm); padding: .45rem; cursor: pointer; color: var(--grey-700); }
.topbar__title { font-weight: 700; color: var(--grey-900); font-size: 1.05rem; }
.topbar__sub { font-size: .78rem; color: var(--grey-500); }
.topbar__spacer { flex: 1 1 auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--grey-200); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--grey-600); position: relative; transition: background .15s ease;
}
.icon-btn:hover { background: var(--grey-50); color: var(--navy-700); }
.icon-btn .badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--red-500); border: 2px solid #fff; }

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .5rem; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .16s ease; z-index: 900;
}
.dropdown.open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.dropdown__item { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: var(--radius-sm); color: var(--grey-700); font-size: .88rem; font-weight: 500; width: 100%; background: none; border: none; cursor: pointer; text-align: left; }
.dropdown__item:hover { background: var(--grey-100); color: var(--navy-700); }
.dropdown__item.danger { color: var(--red-600); }
.dropdown__item.danger:hover { background: var(--red-50); }
.dropdown__head { padding: .7rem .75rem; border-bottom: 1px solid var(--grey-100); margin-bottom: .4rem; }
.dropdown__divider { height: 1px; background: var(--grey-100); margin: .4rem 0; }

.portal__content { padding: 1.7rem 1.6rem 3rem; flex: 1 1 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.page-head .desc { color: var(--grey-500); font-size: .9rem; }
.breadcrumb { font-size: .8rem; color: var(--grey-400); margin-bottom: .3rem; }
.breadcrumb a { color: var(--grey-500); }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1050; display: none; }
.sidebar-backdrop.show { display: block; }

/* Info list (profil) */
.info-list { display: grid; gap: 0; }
.info-row { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--grey-100); }
.info-row:last-child { border-bottom: none; }
.info-row dt { color: var(--grey-500); font-size: .86rem; font-weight: 500; margin: 0; }
.info-row dd { color: var(--grey-900); font-size: .9rem; font-weight: 600; margin: 0; }

/* Timeline */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content:""; position:absolute; left:6px; top:4px; bottom:4px; width:2px; background: var(--grey-200); }
.timeline__item { position: relative; padding-bottom: 1.2rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position:absolute; left:-1.6rem; top:3px; width:14px; height:14px; border-radius:50%; background:#fff; border:3px solid var(--navy-500); }
.timeline__dot.green { border-color: var(--green-500); }
.timeline__dot.orange { border-color: var(--orange-500); }
.timeline__dot.red { border-color: var(--red-500); }
.timeline__title { font-weight: 600; color: var(--grey-900); font-size: .9rem; }
.timeline__meta { font-size: .8rem; color: var(--grey-500); }

/* Receipt */
.receipt { background: #fff; max-width: 760px; margin: 0 auto; padding: 2.4rem; border: 1px solid var(--grey-200); border-radius: var(--radius-lg); }
.receipt__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding-bottom: 1.4rem; border-bottom: 2px solid var(--navy-700); flex-wrap: wrap; }
.receipt__logo { display: flex; gap: .8rem; align-items: center; }
.receipt__logo img { width: 54px; height: 54px; }
.receipt__meta { text-align: right; }
.receipt__meta .ref { font-weight: 800; color: var(--navy-700); font-size: 1.1rem; }
.receipt table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; }
.receipt table th { text-align: left; padding: .7rem .9rem; background: var(--grey-50); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grey-500); }
.receipt table td { padding: .75rem .9rem; border-bottom: 1px solid var(--grey-100); }
.receipt .total-row td { font-weight: 800; font-size: 1.15rem; color: var(--navy-700); border-top: 2px solid var(--navy-700); }
.receipt__sign { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.4rem; }
.receipt__sign .line { border-top: 1px solid var(--grey-400); padding-top: .4rem; font-size: .82rem; color: var(--grey-500); min-width: 180px; }

/* ---------- 15. Portal utilities ---------- */
.filter-bar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 170px; }
.filter-bar .grow { min-width: 200px; }
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; }
.month-cell {
  border: 1px solid var(--grey-200); border-radius: var(--radius-sm); padding: .55rem .3rem;
  text-align: center; font-size: .78rem; font-weight: 700; line-height: 1.3;
}
.month-cell .m { display: block; font-size: .68rem; font-weight: 600; color: var(--grey-500); text-transform: uppercase; letter-spacing: .04em; }
.month-cell.paid    { background: var(--green-50);  border-color: var(--green-100);  color: var(--green-600); }
.month-cell.unpaid  { background: var(--red-50);    border-color: var(--red-100);    color: var(--red-600); }
.month-cell.pending { background: var(--orange-50); border-color: var(--orange-100); color: var(--orange-600); }
.month-cell.waived  { background: var(--grey-100);  color: var(--grey-500); }
.month-cell.empty   { background: var(--grey-50);   color: var(--grey-300); }
.month-cell .m-hint { display:block; font-size:.62rem; font-weight:600; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 1.2rem; }
.bank-box { background: var(--blue-50); border: 1px dashed var(--blue-200); border-radius: var(--radius); padding: 1rem 1.1rem; }
.bank-box dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: .3rem .8rem; font-size: .88rem; }
.bank-box dt { color: var(--grey-500); font-weight: 600; }
.bank-box dd { margin: 0; color: var(--grey-900); font-weight: 600; }
.progress-bar { height: 9px; border-radius: 999px; background: var(--grey-200); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--green-500); border-radius: 999px; }
.check-row { display: flex; align-items: center; gap: .7rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--navy-600); flex: none; }
.section-title { font-size: .95rem; font-weight: 700; color: var(--grey-900); margin: 0 0 .9rem; display: flex; align-items: center; gap: .5rem; }
@media (max-width: 720px) { .bank-box dl { grid-template-columns: 1fr; } .month-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .step:not(:last-child)::after { display: none; }
  .site-footer .f-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero h1 { font-size: 2.2rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .portal__main { margin-left: 0; }
  .topbar__toggle { display: grid; place-items: center; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .site-nav {
    position: fixed; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 1rem; gap: .3rem; border-bottom: 1px solid var(--grey-200); box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: all .2s ease;
  }
  .site-nav.open { transform: none; opacity: 1; visibility: visible; }
  .site-nav a.nav-link { padding: .75rem .9rem; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-actions .btn-hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .site-footer .f-grid { grid-template-columns: 1fr; }
  .info-row { grid-template-columns: 1fr; gap: .15rem; }
  .hero-trust { gap: 1.4rem; }
  .toast-stack { left: 1rem; right: 1rem; max-width: none; }
  .portal__content { padding: 1.2rem 1rem 2.5rem; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: 1.85rem; }
  .hero-cta .btn { width: 100%; }
  .cta-band { padding: 1.8rem; }
}

/* Print */
@media print {
  .sidebar, .topbar, .no-print, .site-header, .site-footer { display: none !important; }
  .portal__main { margin-left: 0; }
  .receipt { border: none; box-shadow: none; }
  body { background: #fff; }
}










/* ============================================================
   PRINT: RESIT PEMBAYARAN
   ============================================================ */
.receipt-page { background: var(--grey-100); padding: 1.6rem 1rem; min-height: 100vh; margin: 0; }
.receipt-actions { max-width: 780px; margin: 0 auto 1rem; display: flex; gap: .6rem; justify-content: flex-end; }
.receipt { max-width: 780px; margin: 0 auto; background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius-lg); padding: 2.2rem 2.4rem; box-shadow: var(--shadow-sm); }
.receipt__head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; border-bottom: 2px solid var(--navy-700); padding-bottom: 1.2rem; }
.receipt__brand { display: flex; gap: .8rem; align-items: center; }
.receipt__brand img { width: auto; height: 42px; }
.receipt__org { font-weight: 800; color: var(--navy-800); font-size: 1rem; }
.receipt__addr { font-size: .78rem; color: var(--grey-500); line-height: 1.5; max-width: 320px; }
.receipt__title { text-align: right; }
.receipt__title h1 { font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-800); margin: 0 0 .2rem; }
.receipt__title span { font-size: .8rem; color: var(--grey-500); }
.receipt__meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem 2rem; margin: 1.4rem 0; }
.receipt__meta dl { margin: 0; font-size: .85rem; display: grid; grid-template-columns: 120px 1fr; gap: .25rem .7rem; }
.receipt__meta dt { color: var(--grey-500); font-weight: 600; }
.receipt__meta dd { margin: 0; color: var(--grey-900); font-weight: 600; word-break: break-word; }
.receipt__total { display: flex; justify-content: space-between; align-items: center; background: var(--blue-50); border-radius: var(--radius); padding: .9rem 1.1rem; margin-top: 1rem; }
.receipt__total span { font-size: .85rem; color: var(--grey-600); font-weight: 600; }
.receipt__total strong { font-size: 1.25rem; color: var(--navy-800); }
.receipt__sign { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.4rem; }
.receipt__sign > div { flex: 1; border-top: 1px dashed var(--grey-300); padding-top: .5rem; font-size: .78rem; color: var(--grey-500); text-align: center; }
.receipt__foot { margin-top: 1.6rem; font-size: .72rem; color: var(--grey-400); text-align: center; line-height: 1.6; }
.receipt__stamp { display: inline-block; border: 2px solid var(--green-500); color: var(--green-600); font-weight: 800; font-size: .72rem; padding: .35rem .8rem; border-radius: var(--radius-sm); letter-spacing: .08em; text-transform: uppercase; }
@media print {
  body.receipt-page { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .receipt { border: none; box-shadow: none; border-radius: 0; max-width: none; padding: 0; }
}
@media (max-width: 640px) {
  .receipt { padding: 1.4rem; }
  .receipt__head { flex-direction: column; }
  .receipt__title { text-align: left; }
  .receipt__meta { grid-template-columns: 1fr; }
}



/* ============================================================
   ADMIN: BAR CHART & RANK LIST
   ============================================================ */
.chart { display: flex; align-items: flex-end; gap: .45rem; height: 190px; padding-top: .6rem; }
.chart__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .35rem; height: 100%; }
.chart__bar { width: 100%; max-width: 46px; border-radius: 6px 6px 0 0; min-height: 4px; background: linear-gradient(180deg, var(--navy-500), var(--navy-700)); }
.chart__bar.green { background: linear-gradient(180deg, var(--green-500), var(--green-600)); }
.chart__val { font-size: .68rem; color: var(--grey-500); font-weight: 600; white-space: nowrap; }
.chart__label { font-size: .68rem; color: var(--grey-500); text-transform: uppercase; letter-spacing: .04em; }
.chart__col.is-current .chart__label { color: var(--navy-700); font-weight: 700; }

.rank-list { display: grid; gap: .7rem; }
.rank-item { display: flex; align-items: center; gap: .75rem; }
.rank-item__idx { width: 26px; height: 26px; border-radius: 50%; background: var(--grey-100); color: var(--grey-600); display: grid; place-items: center; font-size: .72rem; font-weight: 700; flex: none; }
.rank-item__main { flex: 1 1 auto; min-width: 0; }
.rank-item__name { font-size: .85rem; font-weight: 600; color: var(--grey-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item__sub { font-size: .72rem; color: var(--grey-500); }
.rank-item__amt { font-size: .82rem; font-weight: 700; color: var(--red-600); white-space: nowrap; }


/* ============================================================
   ADMIN: REJECT / INLINE FORM BOXES
   ============================================================ */
.reject-box { border: 1px dashed var(--grey-300); border-radius: var(--radius); background: var(--grey-50); padding: .45rem .6rem; }
.reject-box > summary { cursor: pointer; list-style: none; font-size: .78rem; font-weight: 600; color: var(--grey-600); display: flex; align-items: center; gap: .35rem; }
.reject-box > summary::-webkit-details-marker { display: none; }
.reject-box[open] > summary { color: var(--red-600); margin-bottom: .4rem; }
.reject-box .form-group { margin-bottom: .5rem; }
.form-control-sm { padding: .4rem .6rem; font-size: .82rem; }


/* ============================================================
   MOBILE APP LAYER (PWA)
   Lapisan gaya untuk pengalaman gaya aplikasi mudah alih.
   Diaktifkan pada skrin kecil (<= 900px & <= 640px).
   ============================================================ */
:root {
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --appbar-h: 56px;
}

/* Navigasi bawah (lalai: tersembunyi pada desktop) */
.app-tabbar { display: none; }
.sidebar__close { display: none; }
.app-install { display: none; }

/* Elak zoom dua-ketuk pada telefon */
.btn, .icon-btn, .app-tab, .nav-toggle, .topbar__toggle, .modal__foot .btn,
.sidebar__link, .dropdown__item, .pager a, .pager span, a.nav-link { touch-action: manipulation; }

@media (max-width: 900px) {
  html { -webkit-tap-highlight-color: transparent; }

  /* ---- Bar atas gaya app bar ---- */
  .topbar {
    height: auto;
    min-height: calc(var(--appbar-h) + var(--safe-top));
    padding: calc(var(--safe-top) + .5rem) calc(.9rem + var(--safe-right)) .5rem calc(.9rem + var(--safe-left));
    gap: .7rem;
  }
  .topbar__title { font-size: .98rem; }
  .topbar__sub { display: none; }
  .topbar__toggle, .icon-btn { width: 42px; height: 42px; }
  .topbar .avatar { width: 38px; height: 38px; }

  /* ---- Laci sisi (drawer) ---- */
  .sidebar {
    width: min(86vw, 310px);
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    box-shadow: var(--shadow-lg);
  }
  .sidebar__brand { position: relative; }
  .sidebar__close {
    display: grid; place-items: center; position: absolute; top: .95rem; right: .7rem;
    width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #dce6f8;
  }
  .sidebar__link { padding: .78rem .9rem; font-size: .95rem; }

  /* ---- Kandungan: beri ruang untuk tab bar & safe area ---- */
  .portal__content {
    padding: 1.1rem calc(1rem + var(--safe-right)) calc(var(--tabbar-h) + var(--safe-bottom) + 2.2rem) calc(1rem + var(--safe-left));
  }

  /* ---- Tab bar bawah ---- */
  .app-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    display: flex; align-items: stretch;
    padding: .3rem calc(.35rem + var(--safe-right)) calc(.3rem + var(--safe-bottom)) calc(.35rem + var(--safe-left));
    background: rgba(255,255,255,.95);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--grey-200);
    box-shadow: 0 -8px 26px rgba(15,23,42,.10);
  }
  .app-tab {
    flex: 1 1 0; min-width: 0; min-height: 50px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    padding: .3rem .15rem; border: none; background: none; border-radius: 12px;
    color: var(--grey-500); font-family: var(--font); font-size: .66rem; font-weight: 700;
    letter-spacing: .01em; text-align: center; text-decoration: none; cursor: pointer;
    transition: color .15s ease, background .15s ease, transform .12s ease;
  }
  .app-tab:active { transform: scale(.93); }
  .app-tab__icon { position: relative; display: grid; place-items: center; }
  .app-tab__icon svg { width: 22px; height: 22px; }
  .app-tab__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-tab.active { color: var(--navy-700); background: var(--blue-50); }
  .app-tab__badge {
    position: absolute; top: -4px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--red-500); color: #fff;
    font-size: .6rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff;
  }

  /* ---- Toast & dropdown tidak dilindungi tab bar ---- */
  .toast-stack { top: auto; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + .7rem); }
  .dropdown__menu { width: min(86vw, 330px); }

  /* ---- Butang pasang aplikasi ---- */
  .app-install {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    width: 100%; margin-bottom: .7rem; padding: .55rem .8rem;
    background: rgba(255,255,255,.10); color: #dce6f8; border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius); font-family: var(--font); font-size: .82rem; font-weight: 600; cursor: pointer;
  }
  .app-install:active { background: rgba(255,255,255,.18); }

  /* ---- Susun atur dua-lajur kolaps ----
     minmax(0, 1fr) + min-width: 0 menghalang "grid blowout":
     tanpa ini, saiz minimum automatik (auto) setiap item grid mengikut
     lebar min-kandungan (jadual 560px / carta 12x34px) sehingga trek
     melebihi lebar skrin dan menyebabkan limpahan mendatar. */
  .layout-split { grid-template-columns: minmax(0, 1fr) !important; gap: 1.1rem !important; }
  .grid, .row, .stack, .layout-split, .portal__content { min-width: 0; }
  .grid > *, .row > *, .stack > *, .layout-split > * { min-width: 0; }

  /* ---- Jadual tanpa label: kekal skrol sisi ---- */
  table.table:not(.table--labels) { min-width: 520px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* ---- Laman awam: ruang untuk tab bar bawah ---- */
  .site-footer { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 1.4rem); }
  .site-header { padding-top: var(--safe-top); }
  .section { padding-left: calc(.2rem + var(--safe-left)); padding-right: calc(.2rem + var(--safe-right)); }

  /* ---- Halaman auth: kad penuh & selesa pada telefon ---- */
  .auth-wrap { padding-bottom: var(--safe-bottom); }
  .auth-aside__inner { padding-top: var(--safe-top); }
}

@media (max-width: 640px) {
  /* ---- Input 16px menghalang zoom automatik iOS ---- */
  .input, .select, .form-control, textarea.input, textarea.form-control { font-size: 16px; }
  .form-control-sm { font-size: 14px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* ---- Jadual dipaparkan sebagai kad berlabel ---- */
  table.table--labels { min-width: 0; }
  table.table--labels thead { display: none; }
  table.table--labels,
  table.table--labels tbody,
  table.table--labels tr,
  table.table--labels td { display: block; width: 100%; }
  table.table--labels tbody tr {
    border: 1px solid var(--grey-200); border-radius: var(--radius); background: #fff;
    margin-bottom: .7rem; padding: .28rem 0; box-shadow: var(--shadow-xs);
  }
  table.table--labels tbody tr:last-child { margin-bottom: 0; }
  table.table--labels tbody tr:hover { background: #fff; }
  table.table--labels tbody td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    border: none; padding: .42rem .95rem; text-align: right;
  }
  table.table--labels tbody td::before {
    content: attr(data-label); flex: 0 0 38%; text-align: left;
    font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--grey-500); padding-top: .14rem;
  }
  table.table--labels tbody td:not([data-label]) { display: block; text-align: left; }
  table.table--labels tbody td:not([data-label])::before { display: none; }
  .table-wrap:has(> table.table--labels) { padding: .85rem .8rem .15rem; }
  .card > .table-wrap:has(> table.table--labels) { padding: .9rem .85rem .15rem; }
  .pay-item__body .table-wrap:has(> table.table--labels) { padding: .7rem .5rem .1rem; }
  .card > table.table--labels { margin: .9rem .85rem .15rem; }

  /* ---- Kad, header & tindakan penuh lebar ---- */
  .card-header { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .card-header .btn { width: 100%; }
  .card-body, .card-pad { padding: 1.1rem 1rem; }
  .page-head { margin-bottom: 1.1rem; }
  .page-head h1 { font-size: 1.32rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: .7rem; }
  .filter-bar .form-group, .filter-bar .grow { min-width: 0; width: 100%; }
  .filter-bar .btn { width: 100%; }
  .grid-3, .grid-4 { gap: .8rem; }
  .stat { padding: 1rem 1.05rem; }
  .stat__value { font-size: 1.5rem; }

  /* ---- Modal sebagai bottom sheet ---- */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; border-radius: 18px 18px 0 0;
    transform: translateY(100%); max-height: 88vh;
  }
  .modal-overlay.open .modal { transform: none; }
  .modal__head { padding: 1.1rem 1.2rem .3rem; }
  .modal__body { padding: .9rem 1.2rem; }
  .modal__foot { padding: .5rem 1.2rem calc(1.1rem + var(--safe-bottom)); }

  /* ---- Dropdown penuh lebar ---- */
  .dropdown__menu { right: 0; left: auto; width: min(92vw, 360px); }

  /* ---- Carta boleh skrol sisi ----
     Trade-off: kekalkan lebar kolum minimum supaya label bulan terbaca,
     tetapi hadkan lebar carta kepada 100% dan biarkan ia skrol di dalam kad. */
  .chart { height: 158px; overflow-x: auto; max-width: 100%; min-width: 0; padding-bottom: .3rem; }
  .chart__col { min-width: 34px; }
  .chart__val { font-size: .6rem; }
  .chart__label { font-size: .62rem; }

  /* ---- Lain-lain ---- */
  .month-grid { gap: .4rem; }
  .pay-item > summary { padding: .8rem .85rem; gap: .6rem; }
  .pay-item__amt { margin-left: 0; }
  .info-row { padding: .7rem 0; }
  .pager a, .pager span { min-width: 34px; height: 34px; }
  .breadcrumb { font-size: .72rem; }
}

@media (max-width: 480px) {
  .app-tab { font-size: .62rem; }
  .app-tab__icon svg { width: 21px; height: 21px; }
  .stat__value { font-size: 1.4rem; }
  .brand img { height: 44px; }
  .brand__sub { font-size: .62rem; letter-spacing: .06em; }
}

/* Mod aplikasi dipasang (standalone) */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  .site-header, .topbar { padding-top: calc(var(--safe-top) + .5rem); }
}

/* Pergerakan minimum (aksesibiliti) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

