/* Edu Finance — gaya antarmuka */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1c2626;
  --ink-2: #4b5656;
  --muted: #7c8585;
  --line: #e3dfd5;
  --line-2: #efece4;
  --primary: #0f5c57;
  --primary-ink: #ffffff;
  --primary-soft: #e3efed;
  --accent: #b7791f;
  --accent-soft: #fbf1df;
  --ok: #217a4b;
  --ok-soft: #e4f3ea;
  --warn: #9a6400;
  --warn-soft: #fdf2d9;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --info: #24589c;
  --info-soft: #e5eefa;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 38, 38, .05), 0 4px 16px rgba(28, 38, 38, .04);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Kerangka aplikasi ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: 60px 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.05rem; min-width: calc(var(--sidebar) - 40px); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 800; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; line-height: 1; }
.unit-switch { display: flex; align-items: center; gap: 8px; }
.unit-switch label { font-size: .8rem; color: var(--muted); }
.unit-switch select { min-width: 220px; }
.topbar .spacer { flex: 1; }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; color: inherit; }
.usermenu > button:hover { border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.usermenu .who { text-align: left; line-height: 1.15; }
.usermenu .who small { color: var(--muted); display: block; }
.usermenu .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 200px; padding: 6px; }
.usermenu.open .menu { display: block; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: none; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }

.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px 40px; overflow-y: auto; position: sticky; top: 60px; height: calc(100vh - 60px); }
.nav-section { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 10px 6px; }
.nav-section:first-child { margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; flex: none; }
.nav a.active .dot { opacity: 1; }

.main { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi .value { font-size: 1.35rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .sub { color: var(--muted); font-size: .8rem; }
.kpi.neg .value { color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #0b4a46; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--bad); border-color: #efc7c3; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-link { background: none; border: none; color: var(--primary); padding: 0; font-weight: 600; cursor: pointer; font: inherit; }
.inline { display: inline; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--line-2); color: var(--muted); }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: #175c37; border-color: #c8e6d4; }
.alert-error { background: var(--bad-soft); color: #8a1d17; border-color: #f2cbc7; }
.alert-warn { background: var(--warn-soft); color: #7a5000; border-color: #f2dfb0; }
.alert-info { background: var(--info-soft); color: #1d477e; border-color: #c9daf2; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:hover td { background: #fcfbf8; }
.table tfoot td, .table tr.total td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--line); }
.table tr.subtotal td { font-weight: 700; }
.table tr.head td { font-weight: 700; background: #fbfaf6; }
.table td.indent-1 { padding-left: 24px; }
.table td.indent-2 { padding-left: 40px; }
.table td.indent-3 { padding-left: 56px; }
.table td.indent-4 { padding-left: 72px; }
.table .actions { text-align: right; white-space: nowrap; }
.table.compact th, .table.compact td { padding: 6px 10px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px !important; }

/* ---------- Formulir ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d6d1c5; border-radius: 8px; background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 92, 87, .25); border-color: var(--primary); }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.req::after { content: " *"; color: var(--bad); }

.lines td { padding: 6px 6px; }
.lines input, .lines select { padding: 6px 8px; }
.lines .remove { color: var(--bad); background: none; border: none; cursor: pointer; font-size: 1.1rem; }
.balance-ok { color: var(--ok); font-weight: 700; }
.balance-bad { color: var(--bad); font-weight: 700; }

/* ---------- Grafik batang sederhana ---------- */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 180px; padding-top: 8px; }
.bars .col { display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.bars .bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.bars .bar.in { background: var(--primary); }
.bars .bar.out { background: var(--accent); }
.bars-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; font-size: .72rem; color: var(--muted); text-align: center; margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Langkah wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.steps .s { flex: 1; min-width: 120px; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.steps .s b { display: block; color: var(--ink-2); }
.steps .s.done { border-color: #bfdcd8; background: var(--primary-soft); }
.steps .s.now { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.steps .s.now b { color: var(--primary); }

/* ---------- Halaman tamu ---------- */
.guest { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.guest-side { background: var(--primary); color: #e9f3f1; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.guest-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.guest-side h1 { color: #fff; font-size: 2rem; max-width: 460px; letter-spacing: -.02em; }
.guest-side ul { padding-left: 18px; max-width: 440px; }
.guest-side li { margin-bottom: 8px; }
.guest-side .brand { color: #fff; }
.guest-side .brand-mark { background: #fff; color: var(--primary); }
.guest-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.guest-card { width: 100%; max-width: 440px; }
.guest-card h1 { font-size: 1.5rem; }
.guest-card .card { padding: 24px; }
.guest-card .field { margin-bottom: 14px; }
.guest-links { margin-top: 14px; display: flex; justify-content: space-between; font-size: .9rem; }

/* ---------- Landing ---------- */
.landing-hero { padding: 72px 24px 48px; max-width: 1080px; margin: auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.landing-hero h1 { font-size: 2.5rem; letter-spacing: -.03em; }
.landing-hero p { font-size: 1.1rem; color: var(--ink-2); }
.landing-nav { max-width: 1080px; margin: auto; display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.feature-grid { max-width: 1080px; margin: 0 auto 60px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-grid .card h3 { color: var(--primary); }
.price-grid { max-width: 1080px; margin: 0 auto 80px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price { font-size: 1.6rem; font-weight: 800; }

/* ---------- Laporan / cetak ---------- */
.report-head { text-align: center; margin-bottom: 16px; }
.report-head .org { font-weight: 800; font-size: 1.05rem; }
.report-head .title { font-weight: 800; font-size: 1.15rem; margin-top: 6px; text-transform: uppercase; }
.report-head .period { color: var(--muted); }
.signatures { display: flex; justify-content: space-between; margin-top: 40px; gap: 40px; }
.signatures .sig { text-align: center; min-width: 200px; }
.signatures .sig .space { height: 64px; }
.print-only { display: none; }
.check-line { margin-top: 10px; font-size: .85rem; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11.5px; }
  .topbar, .sidebar, .no-print, .page-actions, .filters, .alert, .banner-wrap { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  .print-only { display: block; }
  .table thead th { position: static; background: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 60px; width: 270px; transform: translateX(-100%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-block; }
  .brand { min-width: 0; }
  .brand small, .usermenu .who { display: none; }
  .unit-switch label { display: none; }
  .unit-switch select { min-width: 140px; max-width: 46vw; }
  .main { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .form-grid, .feature-grid, .price-grid, .landing-hero { grid-template-columns: minmax(0, 1fr); }
  .card { overflow-x: auto; }
  .brand > span:last-child { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .page-head { align-items: flex-start; }
  .guest { grid-template-columns: 1fr; }
  .guest-side { display: none; }
  .landing-hero h1 { font-size: 1.9rem; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 1.05rem; }
}
