:root {
  --green: #16a765;
  --green-dark: #087a46;
  --green-soft: #e8f6ee;
  --ink: #1c2836;
  --muted: #6b7680;
  --line: #e4e9e7;
  --bg: #f4f7f6;
  --card: #ffffff;
  --blue: #2f6fdb;
  --blue-soft: #eaf1fd;
  --amber: #b7791f;
  --amber-soft: #fdf4e3;
  --red: #d64545;
  --red-soft: #fdecec;
  --violet: #7a55d6;
  --violet-soft: #f1ecfd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 30, 0.05), 0 4px 16px rgba(16, 40, 30, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--green) 0 38%, var(--bg) 38%); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 32px 28px; box-shadow: 0 20px 50px rgba(8, 60, 35, 0.18); }
.login-card h1 { margin: 12px 0 4px; font-size: 24px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--green); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0f2a1e; color: #d6e8de; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.sidebar .brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
.sidebar .brand small { display: block; color: #9cc2ad; font-size: 12px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #cfe3d8; text-decoration: none; font-weight: 600; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); }
.nav-link.active { background: var(--green); color: #fff; }
.nav-link .badge { margin-left: auto; background: #f59e0b; color: #1c1300; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.nav-link.nav-pro { border: 1px solid rgba(242, 179, 61, 0.45); color: #f6d58e; margin-bottom: 8px; }
.nav-link[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: 13px; padding: 10px 12px; color: #9cc2ad; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar .who strong { color: #fff; display: block; }
.shell > div { min-width: 0; }
main { padding: 28px 32px 48px; min-width: 0; }
.page-head .toolbar .input { width: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
td .toolbar { flex-wrap: nowrap; }

.topbar { display: none; }

/* ---------- Komponen ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.green .value { color: var(--green-dark); }
.stat.amber .value { color: var(--amber); }
.stat.blue .value { color: var(--blue); }
.stat.red .value { color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; background: var(--green); color: #fff; text-decoration: none; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f1f5f3; }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: #3c4954; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid #d5ddd9; background: #fff; border-radius: 10px; padding: 9px 12px; }
.input:focus { outline: 2px solid rgba(22, 167, 101, 0.35); border-color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; background: #fff; font-weight: 600; font-size: 13px; }
.error-text { color: var(--red); font-weight: 600; font-size: 14px; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7faf9; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted, .muted { color: var(--muted); }
td.wrap { white-space: normal; min-width: 220px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.pill.hadir { background: var(--green-soft); color: var(--green-dark); }
.pill.terlambat { background: var(--red-soft); color: var(--red); }
.pill.izin, .pill.pending { background: var(--blue-soft); color: var(--blue); }
.pill.sakit { background: var(--amber-soft); color: var(--amber); }
.pill.dinas { background: var(--violet-soft); color: var(--violet); }
.pill.alpa, .pill.rejected, .pill.nonaktif { background: #eef0f2; color: #5b6670; }
.pill.belum { background: #fff; border: 1px dashed #c9d2ce; color: var(--muted); }
.pill.approved, .pill.aktif { background: var(--green-soft); color: var(--green-dark); }
.pill.admin { background: #0f2a1e; color: #fff; }

.empty { padding: 32px; text-align: center; color: var(--muted); }
.notice { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: #6b4a12; margin-bottom: 16px; font-weight: 600; }
.notice.info { background: var(--blue-soft); color: #1d4b99; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,0.25); }
dialog::backdrop { background: rgba(10, 25, 18, 0.45); }
.dialog-body { padding: 22px 24px 8px; }
.dialog-body h2 { margin: 0 0 16px; font-size: 19px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: 380px; background: #0f2a1e; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); font-weight: 600; z-index: 50; }
.toast.error { background: var(--red); }

/* ---------- Responsif ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #0f2a1e; color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  main { padding: 20px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- v1.1 ---------- */
.brand-mark { overflow: hidden; flex-shrink: 0; }
.brand-mark.has-logo { background: #fff; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark.large { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.brand-mark.logo-preview { width: 112px; height: 112px; border-radius: 24px; font-size: 44px; border: 1px solid var(--line); }
.logo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.section-title { font-size: 16px; margin: 26px 0 10px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.method-sub { margin: -4px 0 12px 26px; padding-left: 12px; border-left: 3px solid var(--green-soft); }
.method-sub.disabled { opacity: 0.45; pointer-events: none; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: #eef0f2; color: #4a5661; vertical-align: middle; }
.tag-qr, .tag-kode { background: var(--violet-soft); color: var(--violet); }
.tag-self { background: var(--green-soft); color: var(--green-dark); }
.tag-admin { background: var(--amber-soft); color: var(--amber); }
.day-block h3 { margin: 22px 0 8px; font-size: 15px; color: var(--green-dark); }
.error-list { margin: 8px 0 0; padding-left: 18px; font-weight: 500; max-height: 30vh; overflow: auto; }
.photo-full { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 12px; }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
.card.narrow { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.code-input { font-size: 26px; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; max-width: 220px; }
.text-red { color: var(--red); }
td .btn.small { padding: 3px 8px; }
@media (max-width: 860px) { .form-grid.three { grid-template-columns: 1fr; } }
.card.narrow + div > .card { margin-top: 16px; }

.credit { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted, #8a968f); margin: 18px 0 0; letter-spacing: 0.02em; }
.sidebar .credit { margin: 8px 0 4px; text-align: left; padding-left: 12px; }

.service-banner { border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; font-weight: 600; font-size: 14px; line-height: 1.45; background: #fff7e0; color: #6b4a00; border: 1px solid #f2d48a; }
.service-banner.grace, .service-banner.expired { background: #fdecec; color: #8a1f1f; border-color: #f3b9b9; }
.service-banner.demo { background: #e8f6ee; color: #0a5c38; border-color: #b9e3cb; }
.login-card .service-banner { margin: 12px 0 0; }
.demo-box { margin: 16px 0 6px; padding: 14px 16px; border-radius: 12px; background: #e8f6ee; border: 1px solid #b9e3cb; color: #0a5c38; }
.demo-box p { margin: 6px 0 10px; font-size: 14px; }
.demo-box .small { font-size: 12px; margin: 10px 0 0; color: #3e5a4c; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-buttons .btn { flex: 1 1 140px; }

.quota { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px; }
.quota-text span { color: var(--red, #b42318); font-weight: 600; }
.quota-track { height: 8px; border-radius: 99px; background: #e6ece9; margin-top: 8px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--green); border-radius: 99px; }
.quota.near .quota-fill { background: #e39b2d; }
.quota.full { border-color: #f3b9b9; background: #fff6f5; }
.quota.full .quota-fill { background: var(--red, #b42318); }

/* ---------- Modul Presensi Santri ---------- */
.nav-group { margin: 14px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.muted.small, .small { font-size: 12.5px; }
.alert { color: var(--red); font-weight: 700; }
.avatar { flex: none; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person { display: flex; align-items: center; gap: 10px; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.act-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); }
.act-card.active { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft), var(--shadow); }
.act-card .act-name { font-weight: 800; }
.act-card .act-count { margin: 6px 0 2px; font-size: 15px; }
.act-card .act-count strong { font-size: 26px; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.mark-buttons { display: flex; gap: 4px; }
.mark-buttons .btn.small { min-width: 30px; padding: 4px 8px; }
.page-head.compact { margin-bottom: 4px; }
.page-head.compact h2 { margin: 0; }
.toolbar.filters { margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.two-col .card + .card { margin-top: 0; }
.two-col + .card { margin-top: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.group-list { list-style: none; margin: 0 0 12px; padding: 0; }
.group-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.day-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.day-picks .check { margin-bottom: 0; }
.photo-preview { display: grid; place-items: center; margin-bottom: 12px; }
.photo-preview img { max-height: 260px; border-radius: 12px; }

/* Kartu santri: 8 kartu (85 × 54 mm) per A4 */
#print-cards { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body.printing > *:not(#print-cards) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print-cards { display: grid; grid-template-columns: repeat(2, 85mm); gap: 6mm 8mm; justify-content: center; }
  .pc { width: 85mm; height: 54mm; border: 0.3mm solid #9fb3aa; border-radius: 3mm; overflow: hidden; display: flex; flex-direction: column; break-inside: avoid; font-size: 8.5pt; color: #10251b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pc-head { display: flex; align-items: center; gap: 2mm; background: #12935A; color: #fff; padding: 1.6mm 3mm; }
  .pc-head img { width: 7mm; height: 7mm; object-fit: contain; background: #fff; border-radius: 1.5mm; }
  .pc-head strong { display: block; font-size: 8.5pt; line-height: 1.1; }
  .pc-head span { display: block; font-size: 6.5pt; letter-spacing: .08em; opacity: .9; }
  .pc-body { flex: 1; display: flex; align-items: center; gap: 2.5mm; padding: 2mm 3mm; }
  .pc-photo { width: 19mm; height: 24mm; flex: none; border-radius: 2mm; background: #e8f6ee; color: #087a46; display: grid; place-items: center; font-weight: 800; font-size: 14pt; overflow: hidden; }
  .pc-photo img { width: 100%; height: 100%; object-fit: cover; }
  .pc-info { flex: 1; min-width: 0; line-height: 1.35; }
  .pc-name { font-weight: 800; font-size: 10pt; line-height: 1.15; margin-bottom: 1mm; }
  .pc-qr { width: 26mm; height: 26mm; flex: none; }
  .pc-qr svg { width: 100%; height: 100%; display: block; }
  .pc-foot { background: #f2b33d; color: #3d2a00; font-size: 6pt; text-align: center; padding: 0.8mm; font-weight: 700; letter-spacing: .03em; }
}
.sidebar { overflow-y: auto; }
.toolbar.filters .input, .card .toolbar > .input, .page-head .toolbar .input { width: auto; flex: 1 1 170px; max-width: 300px; }
.demo-visitor { display: grid; gap: 8px; margin: 0 0 10px; }
.register-link { margin-top: 12px; text-decoration: none; background: #f2b33d; color: #3d2a00; }

/* ---------- Hudur Pro ---------- */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.link-button:hover strong { color: var(--green-dark); text-decoration: underline; }
.bulk-bar { position: sticky; top: 0; z-index: 2; background: var(--green-soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }
.bulk-bar[hidden] { display: none; }
.pager { justify-content: center; margin-top: 12px; }
dialog.wide { width: min(880px, calc(100vw - 24px)); max-width: none; }
.form-section { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; }
.form-section legend { font-weight: 800; font-size: 13px; padding: 0 6px; color: var(--green-dark); }
.form-section textarea.input { width: 100%; resize: vertical; }
.guardians { display: grid; gap: 8px; margin-bottom: 8px; }
.guardian-row { display: grid; grid-template-columns: 90px 1.4fr 1fr 1fr auto auto; gap: 6px; align-items: center; }
.guardian-row .check { margin: 0; white-space: nowrap; }
@media (max-width: 720px) { .guardian-row { grid-template-columns: 1fr 1fr; } }
.tag-role { background: var(--blue-soft); color: #1d4b99; margin: 0 4px 4px 0; }
.role-help { font-size: 13px; color: var(--muted); }
.role-boxes { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.small { font-size: 12px; }

/* ===== Hudur Pro tahap 2: keuangan, dompet, kasir, laundry ===== */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tab { padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--green-dark); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.stat .value.money { font-size: 22px; }
.text-green { color: var(--green-dark); }
tr.void td { opacity: .55; text-decoration: line-through; }
tr.void td .toolbar, tr.void td .text-red { text-decoration: none; }
.picker { position: relative; margin-bottom: 10px; }
.picker-row { display: flex; gap: 8px; }
.picker-row .input { flex: 1; }
.scan-input { font-size: 16px; padding: 12px 14px; }
.pick-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 260px; overflow: auto; }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; }
.pick-item:hover { border-color: var(--green); background: var(--green-soft); }
.student-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0 12px; background: #fbfdfc; }
.student-card .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.student-card .num { text-align: right; }
video.cam { width: 100%; max-width: 420px; border-radius: 12px; background: #000; }
.invoice-picks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.stock-lines { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.stock-line { display: grid; grid-template-columns: 2fr 90px 1fr auto; gap: 6px; }
.laundry-form { margin-bottom: 18px; }
.laundry-form h2 { margin-top: 0; }

/* Kasir */
.pos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.pos-left .input[type=search] { font-size: 16px; padding: 11px 14px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 62vh; overflow: auto; padding-right: 2px; }
.pos-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 86px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; cursor: pointer; font: inherit; }
.pos-item:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(18,147,90,.12); }
.pos-item:active { transform: scale(.98); }
.pos-item .n { font-weight: 700; font-size: 14px; line-height: 1.25; }
.pos-item .p { color: var(--green-dark); font-weight: 800; margin-top: auto; }
.pos-item .s { font-size: 12px; color: var(--muted); }
.pos-item.out { opacity: .45; cursor: not-allowed; }
.pos-right { position: sticky; top: 12px; }
.pos-right h2 { margin: 0 0 8px; font-size: 17px; }
.pos-cart-items { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow: auto; }
.cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; align-items: center; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.cart-row .qty { display: flex; align-items: center; gap: 6px; }
.cart-row .qty span { min-width: 22px; text-align: center; font-weight: 700; }
.cart-row .num { text-align: right; }
.empty-cart { padding: 18px 0; text-align: center; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; margin: 12px 0 6px; padding-top: 8px; border-top: 2px solid var(--line); }
.pos-total strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.pos-pay { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 9px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--green-soft); color: var(--green-dark); }
.btn.big { padding: 14px; font-size: 17px; }
.sale-done { text-align: center; }
.sale-done .big { font-size: 34px; font-weight: 800; color: var(--green-dark); }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } .pos-right { position: static; } }

/* Cetak kuitansi & struk */
#print-sheet { display: none; }
@media print {
  body.printing-sheet > *:not(#print-sheet) { display: none !important; }
  body.printing-sheet { background: #fff; }
  body.printing-sheet #print-sheet { display: block; color: #000; }
  .kwitansi { font-size: 11pt; }
  .kwitansi .kw-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 4mm; font-size: 13pt; }
  .kwitansi h2 { text-align: center; letter-spacing: .1em; font-size: 13pt; margin: 4mm 0; }
  .kwitansi table { width: 100%; border-collapse: collapse; }
  .kw-meta td { padding: 1mm 0; vertical-align: top; }
  .kw-meta td:first-child { width: 35mm; }
  .kw-items { margin-top: 4mm; }
  .kw-items th, .kw-items td { border: 0.3mm solid #000; padding: 1.5mm 2mm; text-align: left; }
  .kw-items .num { text-align: right; }
  .kw-items tfoot td { font-weight: 700; }
  .kw-terbilang { margin: 3mm 0; }
  .kw-sign { display: flex; justify-content: flex-end; text-align: center; }
  .kw-space { height: 16mm; }
  .struk { width: 54mm; font: 9pt/1.35 "Courier New", monospace; }
  .struk .c { text-align: center; }
  .struk .b { font-weight: 700; }
  .struk .row { display: flex; justify-content: space-between; gap: 2mm; }
  .struk .line { border-top: 1px dashed #000; margin: 1.5mm 0; }
}
.grid-stats:has(.money) { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.stat .value.money { font-size: clamp(17px, 1.5vw, 21px); overflow-wrap: anywhere; line-height: 1.25; margin-top: 2px; }
.toolbar > input.input, .toolbar > select.input { width: auto; }
[hidden] { display: none !important; }

/* ===== Hudur Pro tahap 2b: honor & gaji ===== */
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.step { flex: 1 1 180px; padding: 8px 12px; border-radius: 10px; background: #eef0f2; color: var(--muted); font-weight: 700; font-size: 13px; }
.step.done { background: var(--green-soft); color: var(--green-dark); }
.step.now { outline: 2px solid var(--green); }
.chip-x { border: 0; background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer; padding: 0 0 0 2px; }
@media print {
  .slips { display: block; }
  .slip { break-inside: avoid; page-break-inside: avoid; border-bottom: 0.4mm dashed #000; padding: 4mm 0 6mm; margin-bottom: 4mm; font-size: 9.5pt; }
  .slip:nth-child(2n) { page-break-after: always; break-after: page; border-bottom: 0; }
  .slip .kw-head { display: flex; justify-content: space-between; gap: 6mm; border-bottom: 0.6mm solid #000; font-size: 11pt; padding-bottom: 2mm; }
  .slip table { width: 100%; border-collapse: collapse; }
  .slip .kw-meta td { padding: 0.8mm 0; border: 0; }
  .slip .kw-items th { background: #fff; color: #000; font-size: 9pt; text-transform: none; letter-spacing: 0; }
  .slip .kw-meta td:first-child { width: 32mm; }
  .slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-top: 2mm; align-items: start; }
  .slip-cols .kw-items { margin-top: 0; }
  .slip-net { display: flex; justify-content: space-between; border: 0.4mm solid #000; padding: 2mm 3mm; margin-top: 3mm; font-size: 12pt; font-weight: 700; }
  .slip-foot { display: flex; justify-content: space-between; margin-top: 2mm; font-size: 8.5pt; }
}

/* ===== Hudur Pro 1.12: pimpinan, persetujuan, grafik, foto ===== */
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }
.person { display: flex; align-items: center; gap: 10px; }
.photo-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-field p { margin: 0; flex-basis: 100%; }
.tag-new { background: var(--amber-soft); color: var(--amber); }
tr.unseen td { background: #fffaf0; }

.today-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.today { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.today.green { border-left-color: var(--green); } .today.blue { border-left-color: var(--blue); } .today.amber { border-left-color: var(--amber); }
.today span { color: var(--muted); font-size: 13px; font-weight: 600; }
.today strong { font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.today small { color: var(--muted); font-size: 12.5px; }
.attention { margin-bottom: 16px; }
.attention h3 { margin: 0 0 8px; font-size: 15px; }
.attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attention li { border-radius: 10px; padding: 8px 12px; background: var(--blue-soft); }
.attention li.red { background: var(--red-soft); } .attention li.amber { background: var(--amber-soft); }
.attention li a { color: inherit; font-weight: 700; text-decoration: none; }
.attention li.red a { color: var(--red); } .attention li.amber a { color: #6b4a12; } .attention li.blue a { color: #1d4b99; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; align-items: start; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { margin: 0; padding: 14px 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-head h3 { margin: 0; font-size: 15px; }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: #e7ecea; stroke-width: 1; }
svg.chart .ax { fill: #7b878f; font-size: 11px; }
svg.chart .lbl { fill: #33463c; font-size: 12.5px; font-weight: 600; }
svg.chart .in { fill: #fff; font-size: 11.5px; font-weight: 700; }
.top5 { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.top5 li { display: flex; justify-content: space-between; gap: 8px; }

.approval-list { display: flex; flex-direction: column; gap: 12px; }
.approval { margin: 0; border-left: 5px solid var(--blue); }
.approval.red { border-left-color: var(--red); } .approval.amber { border-left-color: var(--amber); }
.approval h3 { margin: 6px 0 4px; font-size: 16px; }
.approval p { margin: 0 0 6px; }
.approval-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.approval-amount { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
td .toolbar.row-actions { flex-wrap: wrap; max-width: 220px; }
.tag-ketua { background: #efe7fb; color: #5b2ea6; }
.ketua-box { border: 1px dashed #c9b4ef; border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #faf7ff; }
.nota-preview img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }
.nota-link { color: var(--blue); font-size: 13px; }
img.photo-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }

/* ---------- v1.14 siap pakai: persiapan, saldo awal, laporan, tutup buku, backup ---------- */
.setup-card { border: 1px solid #cfe9db; background: linear-gradient(180deg, #f3fbf6, #fff 70%); margin-bottom: 18px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.setup-head h2 { margin: 0 0 4px; font-size: 18px; }
.setup-bar { height: 8px; border-radius: 99px; background: #e3ece7; overflow: hidden; margin: 12px 0 14px; }
.setup-bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.setup-list li a { font-weight: 700; }
.setup-list li.done { color: var(--muted); }
.setup-list .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #c9d4cf; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.setup-list li.done .tick { background: var(--green); border-color: var(--green); }
.setup-step { margin-bottom: 12px; }
.setup-step .step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.setup-step .step-head h3 { margin: 0; font-size: 16px; }
.setup-step .step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; }
.setup-step.done .step-no { background: var(--green); color: #fff; }
.books-card { margin-bottom: 14px; }
.books-status { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.books-status strong { font-size: 17px; }
.backup-card { margin-bottom: 16px; }
.backup-card.ok { border-left: 4px solid var(--green); }
.backup-card.warn { border-left: 4px solid var(--amber); background: var(--amber-soft); }
.report .rep-h { font-size: 16px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.rep-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.rep-table.wide { margin-top: 12px; }
.rep-table th { text-align: left; background: #f6f8f7; padding: 8px 10px; font-size: 13px; }
.rep-table td { padding: 6px 10px; border-top: 1px solid var(--line); }
.rep-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-table tr.in td.num { color: var(--green-dark); }
.rep-table tr.out td.num { color: var(--red); }
.rep-table tr.total td, .rep-table tfoot td { font-weight: 800; background: #f6f8f7; }
#print-sheet .report-print { font-size: 10.5pt; }
#print-sheet .rep-title { text-align: center; margin-bottom: 8mm; position: relative; }
#print-sheet .rep-title h1 { font-size: 15pt; margin: 4mm 0 1mm; letter-spacing: .5px; }
#print-sheet .rep-stamp { display: inline-block; margin-top: 3mm; border: 2px solid #087a46; color: #087a46; padding: 1mm 4mm; font-weight: 800; transform: rotate(-2deg); }
#print-sheet .rep-draft { margin-top: 3mm; color: #b7791f; font-weight: 700; }
#print-sheet .rep-grid { grid-template-columns: 1fr 1fr; gap: 4mm; }
#print-sheet .rep-table { border-radius: 0; font-size: 9.5pt; break-inside: avoid; }
#print-sheet .rep-table td, #print-sheet .rep-table th { padding: 1.2mm 2mm; }
#print-sheet .report .rep-h { font-size: 11.5pt; margin: 6mm 0 2mm; break-after: avoid; }
#print-sheet .muted { color: #555; }
#print-sheet .rep-sign { display: flex; justify-content: space-around; text-align: center; margin-top: 12mm; break-inside: avoid; }
#print-sheet .rep-sign .kw-space { height: 18mm; }
#print-sheet .rep-foot { margin-top: 8mm; text-align: center; color: #777; }
@media (max-width: 640px) { .setup-head { flex-direction: column; } .books-status { align-items: flex-start; } }

/* v1.15: PSB */
.stat.selected { outline: 3px solid var(--green); }
a.stat { text-decoration: none; color: inherit; }
.psb-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.avatar.xl { width: 96px; height: 120px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
table.kv { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 15px; }
table.kv td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td:first-child { width: 160px; }
.tag-ok { background: #e6f4ec; color: #0e7a4a; }
