/* ═══════════════════════════════════════════
   MANAJEMEN JAMAAH UMROH — Global Stylesheet
   Tema: Merah Hati · Putih · Hitam
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --red:        #8B1A1A;
  --red-dark:   #5c1010;
  --red-light:  #b52020;
  --red-pale:   #f9eaea;
  --red-muted:  #c97070;
  --black:      #111111;
  --black-soft: #1e1e1e;
  --gray-dark:  #333333;
  --gray:       #666666;
  --gray-mid:   #999999;
  --gray-light: #cccccc;
  --gray-pale:  #f4f4f4;
  --white:      #ffffff;
  --border:     #e0e0e0;
  --border-red: #d4a0a0;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --radius:     4px;
  --radius-lg:  8px;
  --font-body:  'Plus Jakarta Sans', sans-serif;
  --font-display: 'Amiri', serif;
  --sidebar-w:  240px;
  --topbar-h:   60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-pale);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-mid); }

/* ══ LAYOUT ══ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand .brand-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  display: block;
}
.sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white);
  line-height: 1.3;
}
.sidebar-brand .brand-sub {
  font-size: 0.68rem;
  color: var(--red-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2px;
  text-align: center;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.25);
  padding: 10px 20px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}
.nav-item.active {
  color: var(--white);
  background: rgba(139,26,26,0.35);
  border-left-color: var(--red-light);
}
.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item .nav-icon svg {
  width: 18px;
  height: 18px;
}
.nav-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-icon-svg svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}
.sidebar-username {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600;
  padding: 7px 10px; border-radius: 6px;
  margin-bottom: 8px; transition: all .15s;
  text-decoration: none;
}
.sidebar-username.admin-link {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.07);
  cursor: pointer;
}
.sidebar-username.admin-link:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.sidebar-username.guest-name {
  color: rgba(255,255,255,0.35);
  cursor: default;
}
.sidebar-username-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}
.sidebar-username-arrow {
  margin-left: auto;
  font-size: 1rem;
  opacity: 0.5;
}
.sidebar-footer .btn-logout {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  cursor: pointer;
  border: none; background: none;
  font-family: var(--font-body);
  padding: 4px 0;
  transition: color 0.2s;
}
.sidebar-footer .btn-logout:hover { color: var(--red-muted); }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  min-height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--black);
  line-height: 1.2;
}
.topbar-sub {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--gray);
  margin-top: 2px;
}
.topbar-right {
  display: flex; align-items: center; gap: 14px;
}
.topbar-date {
  font-size: 0.78rem;
  color: var(--gray);
}

/* ── Page Body ── */
.page-body {
  flex: 1;
  padding: 28px;
}

/* ══ COMPONENTS ══ */

/* Card */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--black);
}
.card-subtitle {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 2px;
}

/* Stat Card */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.red   { background: var(--red-pale); }
.stat-icon.dark  { background: #f0f0f0; }
.stat-icon.green { background: #eaf5ea; }
.stat-icon.gold  { background: #fdf7e8; }
.stat-info { flex: 1; }
.stat-label { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--black); line-height: 1.2; margin-top: 2px; }
.stat-sub   { font-size: 0.75rem; color: var(--gray-mid); margin-top: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 600;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.btn-primary   { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-light); }
.btn-secondary { background: var(--white); color: var(--black); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--gray-pale); border-color: var(--gray-mid); }
.btn-dark      { background: var(--black-soft); color: var(--white); }
.btn-dark:hover { background: var(--gray-dark); }
.btn-danger    { background: #c0392b; color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-ghost     { background: transparent; color: var(--red); border: 1px solid var(--border-red); }
.btn-ghost:hover { background: var(--red-pale); }
.btn-sm        { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon-only { padding: 6px 8px; }
.btn:disabled  { opacity: 0.45; cursor: not-allowed; }

/* Badge */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.badge-red    { background: var(--red-pale); color: var(--red); }
.badge-green  { background: #eaf5ea; color: #2a7a2a; }
.badge-gray   { background: var(--gray-pale); color: var(--gray); }
.badge-gold   { background: #fdf7e8; color: #8a6a00; }
.badge-black  { background: var(--black-soft); color: var(--white); }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
table.data-table thead th {
  background: var(--black-soft);
  color: rgba(255,255,255,0.8);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
table.data-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
table.data-table thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
table.data-table tbody tr:hover { background: #fafafa; }
table.data-table tbody td {
  padding: 10px 14px;
  color: var(--black);
  vertical-align: middle;
}
table.data-table tbody td.td-num {
  font-family: 'Courier Prime', monospace;
  text-align: right; white-space: nowrap;
}
table.data-table tfoot td {
  padding: 10px 14px;
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: var(--gray-pale);
}

/* Action buttons in table */
.action-group { display: flex; align-items: center; gap: 5px; }
.btn-action {
  width: 30px; height: 30px; font-size: 1rem;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font-body); transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.btn-action.view   { background: #e8f0fe; color: #1a56c4; }
.btn-action.view:hover { background: #c4d4fc; }
.btn-action.edit   { background: #fff8e1; color: #8a6a00; }
.btn-action.edit:hover { background: #fde99a; }
.btn-action.kwit   { background: var(--red-pale); color: var(--red); }
.btn-action.kwit:hover { background: #f0c4c4; }
.btn-action.del    { background: #fde8e8; color: #b52020; }
.btn-action.del:hover { background: #f9bfbf; }
/* Badge status lunas/cashback */
.badge-lunas, .badge-cashback, .badge-kurang {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 700; width: 100%;
  text-align: center; box-sizing: border-box;
}
.badge-lunas    { background: #1b5e20; color: #fff; letter-spacing: 0.06em; }
.badge-cashback { background: #4a148c; color: #fff; letter-spacing: 0.04em; }
.badge-kurang   { background: #fde8e8; color: #b52020; font-family: 'Courier Prime', monospace; }
/* Gender badge — lingkaran L/P */
.gender-badge { display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;font-size:0.72rem;font-weight:800;flex-shrink:0; }
.gender-badge.l { background:#e3f2fd;color:#1565c0; }
.gender-badge.p { background:#fce4ec;color:#c62828; }

/* Keterangan Icons */
.ket-icons { display: flex; gap: 5px; align-items: center; }
.ket-icon {
  width: 26px; height: 26px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  background: var(--gray-pale);
  color: var(--gray-mid);
  border: 1px solid var(--border);
  transition: all 0.2s;
  title: '';
  cursor: default;
}
.ket-icon.active-paspor { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.ket-icon.active-koper  { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.ket-icon.active-vaksin { background: #fff8e1; color: #f57f17; border-color: #ffe082; }

/* Form */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.single { grid-template-columns: 1fr; }

label.form-label {
  font-size: 0.73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gray);
}
input.form-input, select.form-input, textarea.form-input {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem; color: var(--black);
  outline: none; transition: border-color 0.2s;
  width: 100%;
}
input.form-input:focus, select.form-input:focus, textarea.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.08);
}
textarea.form-input { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.72rem; color: var(--gray-mid); margin-top: 3px; }

/* Checkbox */
.check-group {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer;
}
.check-group input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--red);
  cursor: pointer; flex-shrink: 0;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal {
  transform: translateY(0);
}
.modal.modal-xs { max-width: 260px; }
.modal.modal-sm { max-width: 400px; }
.modal.modal-md { max-width: 500px; }
.modal.modal-lg { max-width: 720px; }
.modal.modal-xl { max-width: 860px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem; color: var(--black);
}
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--gray-pale);
  border-radius: 50%; cursor: pointer;
  font-size: 1rem; color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--black); }
.modal-body  { padding: 22px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--gray-pale);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Alert / Toast */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--black-soft);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  min-width: 260px;
}
.toast.success { border-left: 3px solid #4caf50; }
.toast.error   { border-left: 3px solid var(--red-light); }
.toast.info    { border-left: 3px solid #2196f3; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-mid);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.4; }
.empty-state .empty-title { font-size: 1rem; font-weight: 600; color: var(--gray); margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: 0.83rem; }

/* Section title */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.4rem; color: var(--black);
  margin-bottom: 6px;
}
.section-sub {
  font-size: 0.82rem; color: var(--gray);
  margin-bottom: 22px;
}

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Rupiah display */
.rp { font-family: 'Courier Prime', monospace; white-space: nowrap; }
.rp-red   { color: var(--red); font-weight: 700; }
.rp-green { color: #2a7a2a; font-weight: 700; }

/* Paket Card */
.paket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.paket-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.paket-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.paket-card-top {
  background: var(--black-soft);
  padding: 16px 18px;
  position: relative;
}
.paket-card-name {
  font-family: var(--font-display);
  font-size: 1.05rem; color: var(--white);
  margin-bottom: 4px;
}
.paket-card-date { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.paket-card-body { padding: 14px 18px; }
.paket-card-row  { display: flex; justify-content: space-between; font-size: 0.83rem; margin-bottom: 6px; }
.paket-card-row .lbl { color: var(--gray); }
.paket-card-row .val { font-weight: 600; color: var(--black); }
.paket-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}
.card-menu-wrap { position: relative; }
.card-menu-trigger { font-size: 1rem; letter-spacing: 2px; line-height: 1; }
.card-menu-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  min-width: 148px;
  overflow: hidden;
}
.card-menu-dropdown.open { display: block; }
.card-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  font-size: 0.82rem; font-family: inherit;
  background: none; border: none; cursor: pointer;
  color: var(--black); text-align: left;
  transition: background 0.12s;
}
.card-menu-item:hover:not(:disabled) { background: var(--gray-pale); }
.card-menu-item:disabled { opacity: 0.4; cursor: not-allowed; }
.card-menu-item.danger { color: var(--red); }
.card-menu-item + .card-menu-item { border-top: 1px solid var(--border); }

/* Konfirmasi delete */
.confirm-danger {
  background: #fde8e8;
  border: 1px solid #f5b0b0;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #8B1A1A;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}

/* Guest banner */
.guest-banner {
  background: var(--black-soft);
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  padding: 8px 28px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Detail jamaah */
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; font-size: 0.88rem; }
.detail-label { color: var(--gray); font-weight: 600; }
.detail-value { color: var(--black); }

/* Riwayat transaksi */
.riwayat-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; margin-top: 8px; }
.riwayat-table th {
  text-align: left; padding: 7px 10px;
  background: var(--gray-pale);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.riwayat-table td { padding: 7px 10px; border-bottom: 1px dotted var(--border); }
.riwayat-table td.num { text-align: right; font-family: 'Courier Prime', monospace; }
.riwayat-table tr:last-child td { border-bottom: none; }

/* Utility */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray); }
.text-red    { color: var(--red); }
.text-green  { color: #2a7a2a; }
.fw-bold     { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.hidden { display: none !important; }

/* ══ IKON EKSTRA — Border Warna Status ══ */
.ikon-hijau  { border: 2px solid #000000 !important; background: #e8f5e9 !important; }
.ikon-merah  { border: 2px solid #FF0000 !important; background: #ffebee !important; }
.ikon-ungu   { border: 2px solid #6a1b9a !important; background: #f3e5f5 !important; }
.ikon-oren   { border: 2px solid #FFC000 !important; background: #fff3e0 !important; }
.ikon-kuning { border: 2px solid #FFFF00 !important; background: #fffde7 !important; }
.ikon-biru   { border: 2px solid #0070C0 !important; background: #e3f2fd !important; }
.ikon-abu    { border: 2px solid #bdbdbd !important; background: #fafafa !important; color: #9e9e9e !important; }

/* Inline edit di riwayat transaksi */
.riwayat-inline-edit {
  display: none;
  background: #fffde7;
  border-top: 1px dashed #f9a825;
}
.riwayat-inline-edit.open { display: table-row; }
.riwayat-inline-edit td { padding: 8px 10px; }
.riwayat-inline-edit input, .riwayat-inline-edit select {
  padding: 5px 8px; font-size: 0.82rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); background: white;
  outline: none;
}
.riwayat-inline-edit input:focus, .riwayat-inline-edit select:focus {
  border-color: var(--red);
}
.btn-inline {
  padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font-body); transition: all 0.15s;
}
.btn-inline.save   { background: var(--red); color: white; }
.btn-inline.save:hover { background: var(--red-light); }
.btn-inline.cancel { background: var(--gray-pale); color: var(--gray); }
.btn-inline.cancel:hover { background: var(--border); }

/* Tooltip legend warna */
.legend-warna {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  background: var(--gray-pale); border-radius: var(--radius);
  font-size: 0.72rem;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot  {
  width: 14px; height: 14px; border-radius: 3px; border: 2px solid;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════
   KWITANSI ENGINE
   Form + Output 5 Seksi — dipakai di kwitansi.html & jamaah.html
══════════════════════════════════════════════════════════════ */

:root {
  --kw-ink: #1a1208; --kw-paper: #faf7f0; --kw-cream: #f0ead8;
  --kw-gold: #c8963e; --kw-rust: #8b3a2a; --kw-green: #2a6644;
  --kw-border: #d4c9a8; --kw-muted: #8a7d65;
}

/* ── Form: Tab ── */
.kw-tab-nav { display: flex; border-bottom: 2px solid var(--kw-gold); }
.kw-tab-btn {
  flex: 1; padding: 10px 16px; background: #f5f0e8; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.83rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--kw-muted); transition: all .2s; border-top: 2px solid transparent;
}
.kw-tab-btn.active { background: var(--kw-paper); color: var(--kw-ink); font-weight: 600; border-top: 2px solid var(--kw-gold); }
.kw-tab-panel { display: none; background: var(--kw-paper); border: 1px solid var(--kw-border); border-top: none; padding: 22px; }
.kw-tab-panel.active { display: block; }

/* ── Form: Section title, grid, input ── */
.kw-sec-title {
  font-family: 'Playfair Display', serif; font-size: .92rem; color: var(--kw-rust);
  border-bottom: 1px solid var(--kw-border); padding-bottom: 5px; margin: 18px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.kw-sec-title:first-of-type { margin-top: 0; }
.kw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 11px; }
.kw-form-row.s1 { grid-template-columns: 1fr; }
.kw-fg { display: flex; flex-direction: column; gap: 4px; }
.kw-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--kw-muted); font-weight: 600; }
.kw-inp {
  background: #fff; border: 1px solid var(--kw-border); padding: 7px 10px;
  font-family: inherit; font-size: .88rem; color: var(--kw-ink); outline: none;
  transition: border-color .2s; border-radius: 2px; width: 100%;
}
.kw-inp:focus { border-color: var(--kw-gold); }
.kw-sel {
  background: #fff; border: 1px solid var(--kw-border); padding: 7px 10px;
  font-family: inherit; font-size: .88rem; color: var(--kw-ink); outline: none;
  border-radius: 2px; cursor: pointer; width: 100%;
}
.kw-utama {
  background: #f5f0e8; border: 1px solid var(--kw-gold); border-left: 4px solid var(--kw-gold);
  padding: 14px 16px 8px; border-radius: 2px; margin-bottom: 4px;
}

/* ── Form: Toggle switch ── */
.kw-toggle-wrap {
  display: flex; align-items: center; gap: 7px; font-family: inherit; font-size: .72rem;
  color: var(--kw-muted); text-transform: uppercase; letter-spacing: .08em; margin-left: auto; cursor: pointer;
}
.kw-toggle-wrap input { display: none; }
.kw-toggle-track {
  width: 32px; height: 17px; background: var(--kw-border); border-radius: 9px;
  position: relative; transition: background .2s; cursor: pointer;
}
.kw-toggle-track::after {
  content: ''; position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: white; top: 3px; left: 3px; transition: transform .2s;
}
input:checked + .kw-toggle-track { background: var(--kw-green); }
input:checked + .kw-toggle-track::after { transform: translateX(15px); }

/* ── Form: Rincian input table ── */
.kw-rincian-wrap { overflow-x: auto; margin-bottom: 7px; }
table.kw-rt { width: 100%; border-collapse: collapse; min-width: 460px; table-layout: fixed; }
table.kw-rt thead th {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--kw-muted);
  font-weight: 600; padding: 5px 6px; border-bottom: 1px solid var(--kw-border); background: var(--kw-cream); text-align: left;
}
table.kw-rt thead th.n { text-align: right; }
table.kw-rt tbody td { padding: 3px 2px; vertical-align: middle; }
table.kw-rt tbody td.rn { font-size: .75rem; color: var(--kw-muted); text-align: center; padding: 3px 6px; width: 36px; }
table.kw-rt tbody td input {
  width: 100%; padding: 5px 6px; font-size: .83rem; background: #fff;
  border: 1px solid var(--kw-border); border-radius: 2px; outline: none; font-family: inherit;
}
table.kw-rt tbody td input:focus { border-color: var(--kw-gold); }
table.kw-rt tbody td.rs { text-align: right; font-family: 'Courier Prime', monospace; font-size: .84rem; color: var(--kw-ink); white-space: nowrap; padding: 4px 8px; }
table.kw-rt tfoot td { padding: 7px 8px; font-size: .85rem; border-top: 2px solid var(--kw-border); }
table.kw-rt tfoot td.tl { text-align: right; color: var(--kw-muted); }
table.kw-rt tfoot td.tv { text-align: right; font-family: 'Courier Prime', monospace; font-weight: 700; color: var(--kw-rust); white-space: nowrap; }

/* ── Form: Buttons ── */
.kw-bi {
  background: none; border: 1px solid var(--kw-border); width: 26px; height: 26px; cursor: pointer;
  color: var(--kw-rust); font-size: .95rem; display: flex; align-items: center; justify-content: center;
  border-radius: 2px; transition: all .2s;
}
.kw-bi:hover { background: var(--kw-rust); color: white; border-color: var(--kw-rust); }
.kw-ba { background: none; border: 1px dashed var(--kw-gold); color: var(--kw-gold); padding: 5px 13px; cursor: pointer; font-family: inherit; font-size: .78rem; letter-spacing: .05em; border-radius: 2px; transition: all .2s; }
.kw-ba:hover { background: var(--kw-gold); color: white; }

/* ── Form: Bertahap section ── */
.kw-bertahap { display: none; background: #f5f0e8; border: 1px solid var(--kw-border); border-left: 3px solid var(--kw-gold); padding: 13px; margin-bottom: 11px; border-radius: 2px; }
.kw-bertahap.vis { display: block; }
.kw-bh { display: grid; grid-template-columns: 1fr 150px 135px 28px; gap: 5px; padding-bottom: 5px; border-bottom: 1px solid var(--kw-border); margin-bottom: 5px; }
.kw-bh span { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--kw-muted); font-weight: 600; }
.kw-bh span.n { text-align: right; }
.kw-bl { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }
.kw-bi-row { display: grid; grid-template-columns: 1fr 150px 135px 28px; gap: 5px; align-items: center; }
.kw-bi-row input { margin: 0; padding: 6px 8px; font-size: .83rem; background: #fff; border: 1px solid var(--kw-border); border-radius: 2px; outline: none; font-family: inherit; }
.kw-bi-row input:focus { border-color: var(--kw-gold); }
.kw-bi-row input.ni { text-align: right; font-family: 'Courier Prime', monospace; }
.kw-sisa { background: white; border: 1px solid var(--kw-border); padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; font-size: .83rem; margin-top: 7px; border-radius: 2px; }
.kw-sisa-lbl { color: var(--kw-muted); }
.kw-sisa-val { font-weight: 700; font-family: 'Courier Prime', monospace; }

/* ── Form: Payment summary ── */
.kw-psum { border: 1px solid var(--kw-border); padding: 9px 13px; font-size: .81rem; display: flex; flex-direction: column; gap: 4px; background: #fff; margin-top: 3px; }
.kw-ps-r { display: flex; justify-content: space-between; align-items: center; }
.kw-ps-l { color: var(--kw-muted); }
.kw-ps-v { font-family: 'Courier Prime', monospace; font-weight: 600; color: var(--kw-ink); white-space: nowrap; }
.kw-ps-r.k .kw-ps-v { color: var(--kw-rust); }
.kw-ps-r.l .kw-ps-v { color: var(--kw-green); }
.kw-ps-r.d .kw-ps-v { color: var(--kw-gold); }
.kw-ps-div { border: none; border-top: 1px solid var(--kw-border); margin: 1px 0; }

/* ── Form: Collapsible & CTA ── */
.kw-cb { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.kw-cb input[type=checkbox] { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--kw-rust); flex-shrink: 0; }
.kw-col { overflow: hidden; max-height: 0; transition: max-height .3s, opacity .3s; opacity: 0; }
.kw-col.open { max-height: 700px; opacity: 1; }
.kw-btn-go { background: var(--kw-rust); border: none; color: white; padding: 10px 26px; font-family: 'Playfair Display', serif; font-size: .92rem; cursor: pointer; letter-spacing: .05em; margin-top: 18px; width: 100%; transition: background .2s; border-radius: 2px; }
.kw-btn-go:hover { background: #a0452f; }
.kw-pv-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 13px; }
.kw-btn-sv { background: var(--kw-green); border: none; color: white; padding: 8px 18px; font-family: inherit; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; border-radius: 2px; transition: background .2s; }
.kw-btn-sv:hover { background: #1e5035; }

/* ── Output: Container & Watermark ── */
.kw-doc { background: white; border: 1px solid #ddd; padding: 28px 34px; position: relative; font-family: 'Source Sans 3', sans-serif; }
.kw-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-30deg); font-size: 5rem; font-family: 'Playfair Display', serif; color: rgba(200,150,62,.06); font-weight: 700; letter-spacing: .3em; pointer-events: none; white-space: nowrap; }

/* ── Output: SEKSI 1 — HEADER ── */
.kw-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px double var(--kw-gold); padding-bottom: 14px; margin-bottom: 16px; }
.kw-company { display: flex; align-items: center; gap: 16px; }
.kw-logo { width: 80px; height: 80px; flex-shrink: 0; overflow: hidden; }
.kw-logo img { width: 100%; height: 100%; object-fit: contain; }
.kw-company-name { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--kw-rust); font-weight: 700; }
.kw-company-detail { font-size: 0.76rem; color: var(--kw-muted); line-height: 1.8; margin-top: 4px; }
.kw-title-block { text-align: right; }
.kw-title { font-family: 'Playfair Display', serif; font-size: 1.7rem; color: var(--kw-ink); letter-spacing: 0.1em; }
.kw-nomor { font-size: 0.76rem; color: var(--kw-muted); letter-spacing: 0.05em; margin-top: 2px; }
.kw-badge { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; margin-top: 5px; }
.kw-badge.lunas  { background: var(--kw-green); color: white; }
.kw-badge.dp     { background: var(--kw-gold);  color: white; }
.kw-badge.cicilan  { background: #4a72a0; color: white; }
.kw-badge.tagihan  { background: var(--kw-rust); color: white; }

/* ── Output: SEKSI 2 — ISI ── */
.kw-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin-bottom: 14px; font-size: 0.88rem; }
.kw-meta-label { color: var(--kw-muted); white-space: nowrap; }
.kw-meta-value { color: var(--kw-ink); font-weight: 600; border-bottom: 1px dotted var(--kw-border); }
.kw-meta-nominal { font-family: 'Courier Prime', monospace; font-size: 0.95rem; color: var(--kw-rust); }
.kw-meta-terbilang { font-weight: 400; font-style: italic; color: var(--kw-muted); font-size: 0.82rem; }

/* ── Output: SEKSI 3 — TABEL RINCIAN ── */
.kw-rincian { width: 100%; border-collapse: collapse; font-size: 0.84rem; table-layout: fixed; }
.rp-cell { padding: 5px 9px !important; }
.rp-split { display: flex; justify-content: space-between; gap: 4px; font-family: 'Courier Prime', monospace; white-space: nowrap; }
.rp-prefix { color: var(--kw-muted); flex-shrink: 0; }
.rp-amount { text-align: right; flex: 1; }
.kw-rincian th { background: var(--kw-ink); color: var(--kw-cream); padding: 6px 9px; text-align: left; font-weight: 600; letter-spacing: 0.04em; font-size: 0.74rem; text-transform: uppercase; }
.kw-rincian th.num { text-align: right; }
.kw-rincian td { padding: 5px 9px; border-bottom: 1px solid var(--kw-border); color: var(--kw-ink); }
.kw-rincian tbody td:first-child { text-align: center; color: var(--kw-muted); font-size: .78rem; }
.kw-rincian td.num { text-align: right; font-family: 'Courier Prime', monospace; }
.kw-rincian tr:nth-child(even) td { background: #fafaf5; }
tfoot.kw-tfoot tr td { padding: 5px 9px; border-bottom: none; font-size: 0.83rem; color: var(--kw-muted); text-align: left; }
tfoot.kw-tfoot tr td.num { text-align: right; font-family: 'Courier Prime', monospace; }
tfoot.kw-tfoot tr.row-subtotal td { border-top: 1px solid var(--kw-border); background: #f8f5ee; color: var(--kw-ink); font-weight: 600; }
tfoot.kw-tfoot tr.row-dp td { color: var(--kw-green); }
tfoot.kw-tfoot tr.row-tagihan td { color: var(--kw-rust); border-top: 2px solid var(--kw-gold); font-weight: 700; font-size: 0.9rem; }
tfoot.kw-tfoot tr.row-diterima td { background: var(--kw-ink); color: white; font-weight: 700; }
tfoot.kw-tfoot tr.row-diterima td.num { font-family: 'Courier Prime', monospace; }
tfoot.kw-tfoot tr.row-sisa td { color: var(--kw-rust); font-weight: 700; border-top: 2px solid var(--kw-gold); }

/* ── Output: SEKSI 4 — TABEL RIWAYAT ── */
.kw-riwayat { margin-top: 14px; border: 1px solid var(--kw-border); border-left: 3px solid var(--kw-gold); padding: 10px 14px; }
.kw-riwayat-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--kw-muted); font-weight: 600; margin-bottom: 7px; }
.kw-riwayat table { width: 100%; border-collapse: collapse; font-size: 0.81rem; }
.kw-riwayat th { color: var(--kw-muted); font-weight: 600; text-align: left; padding-bottom: 4px; font-size: 0.73rem; border-bottom: 1px solid var(--kw-border); }
.kw-riwayat th.num { text-align: right; }
.kw-riwayat td { padding: 5px 0; border-bottom: 1px dotted var(--kw-border); }
.kw-riwayat td.num { text-align: right; font-family: 'Courier Prime', monospace; }
.kw-riwayat tr:last-child td { border-bottom: none; }

/* ── Output: SEKSI 5 — FOOTER ── */
.kw-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--kw-border); }
.kw-catatan { flex: 1; font-size: 0.79rem; color: var(--kw-muted); line-height: 1.5; max-width: 55%; }
.kw-catatan strong { display: block; color: var(--kw-ink); margin-bottom: 3px; font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.1em; }
.kw-ttd { text-align: center; min-width: 155px; position: relative; }
.kw-ttd-label { font-size: 0.73rem; color: var(--kw-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.kw-ttd-date { font-size: 0.82rem; color: var(--kw-ink); margin-bottom: 54px; }
.kw-ttd-name { border-top: 1px solid var(--kw-ink); padding-top: 6px; font-weight: 600; font-size: 0.88rem; color: var(--kw-ink); }

/* ── Output: Stempel ── */
.kw-stamp-wrap { position: absolute; bottom: -20px; left: 30%; transform: translateX(-50%); width: 210px; height: 130px; pointer-events: none; z-index: 10; display: none; }
.kw-stamp-wrap.visible { display: block; }
.kw-stamp-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; transform: rotate(-20deg); transform-origin: center center; opacity: .88; }

/* ── Utility classes ── */
.flex-fill  { flex: 1; min-width: 0; }
.col-full   { grid-column: 1 / -1; }
.lbl        { font-size: 0.72rem; font-weight: 700; color: #555; margin-bottom: 4px; display: block; }
.lbl-sm     { font-size: 0.7rem;  font-weight: 600; color: #555; margin-bottom: 4px; display: block; }
.hint       { font-weight: 400; color: var(--gray); }
.sub-lbl    { font-size: 0.7rem; color: var(--gray); margin-bottom: 3px; }
.sub-lbl-xs { font-size: 0.68rem; color: var(--gray); margin-bottom: 2px; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.flex-8     { display: flex; gap: 8px; }
.text-muted-sm { color: var(--gray); font-size: 0.8rem; }
.mb-0  { margin-bottom: 0 !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-14 { margin-bottom: 14px !important; }
.mb-16 { margin-bottom: 16px !important; }
