/* Layout: header berwarna hijau madrasah, konten satu kolom dengan kartu; tabel isian lebar menggulir sendiri. */
:root {
  --bg: #f3f6f3; --surface: #ffffff; --ink: #17211b; --muted: #5b6a61; --line: #dbe3dd;
  --brand: #1f5135; --brand-ink: #ffffff; --brand-soft: #e3efe7; --gold: #a87a12; --gold-soft: #fbf1d8;
  --good: #1d7a46; --good-soft: #dff3e6; --warn: #8a5a00; --warn-soft: #fdf0d2; --bad: #b3261e; --bad-soft: #fbe3e1;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411; --surface: #161e19; --ink: #e6ede8; --muted: #9aaba1; --line: #27332c;
    --brand: #2e6b48; --brand-ink: #ffffff; --brand-soft: #1c2e23; --gold: #e0b44c; --gold-soft: #2e2615;
    --good: #6fd197; --good-soft: #193323; --warn: #f0c060; --warn-soft: #33290f; --bad: #ff8a80; --bad-soft: #3a1c1a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: #7fd1a3; } }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; margin-top: 1.1em; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.wrap.wide { max-width: 1320px; }
main.wrap { padding-block: 24px 40px; display: grid; gap: 18px; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .mono { font-family: var(--mono); font-size: .86em; font-variant-numeric: tabular-nums; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--gold); margin-bottom: .4em; }
.eyebrow a { color: inherit; text-decoration: none; }

/* header */
.top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 5; }
.topin { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--gold); color: #1b1300; font-weight: 800; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { color: rgba(255,255,255,.82); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.nav a.btn { background: var(--gold); color: #1b1300; }
.out .link { color: rgba(255,255,255,.8); }
.imp { background: var(--gold); color: #1b1300; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.imp button { background: #1b1300; color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; font: inherit; font-weight: 600; cursor: pointer; }

/* blok */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head.sm { align-items: center; } .head.sm h3 { margin: 0; }
.head > div { min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.flash { padding: 12px 16px; border-radius: var(--r); font-weight: 600; }
.flash.ok { background: var(--good-soft); color: var(--good); } .flash.err { background: var(--bad-soft); color: var(--bad); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); padding: 12px 16px; border-radius: var(--r); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pill { color: #9fe0bb; } }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }

/* tombol & form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 6px 12px; font-size: .86rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, .danger { color: var(--bad); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 2px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: .86rem; min-width: 0; }
.form label.inline, label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .9rem; }
.form label.full { grid-column: 1 / -1; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=file] { padding: 7px; width: auto; max-width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
.form { display: grid; gap: 14px; }
.g2, .g3, .g4 { display: grid; gap: 12px 14px; align-items: start; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.form h3 { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; margin: 4px 0 0; }
.form h3:first-child { border: 0; padding: 0; margin: 0; }
.logo { display: grid; gap: 6px; font-weight: 600; font-size: .86rem; }
.logo img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sticky { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 12px 0; backdrop-filter: blur(6px); }

/* tabel data */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.act { text-align: right; white-space: nowrap; }
.empty { text-align: center !important; color: var(--muted); padding: 28px !important; }
.filter select { width: auto; }
.danger-zone { text-align: right; }

/* tabel isian dokumen */
table.grid { border-collapse: collapse; min-width: 100%; font-size: .88rem; }
table.grid th { background: var(--bg); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.grid th.calc { color: var(--gold); }
table.grid td { border-bottom: 1px solid var(--line); padding: 3px; }
table.grid td.no { width: 34px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
table.grid input, table.grid select { border-color: transparent; border-radius: 6px; padding: 7px 8px; min-width: 70px; background: transparent; }
table.grid input:hover, table.grid select:hover { border-color: var(--line); }
table.grid input:focus, table.grid select:focus { background: var(--surface); }
table.grid input.w-l { min-width: 200px; } table.grid input.w-n { min-width: 64px; width: 76px; text-align: center; }
table.grid td.calcv { color: var(--gold); font-weight: 700; padding: 7px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid td.chk { text-align: center; }
table.grid button.del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; }
table.grid button.del:hover { color: var(--bad); background: var(--bad-soft); }

/* beranda madrasah */
ol.check { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
ol.check li { display: flex; gap: 10px; align-items: center; }
ol.check li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
ol.check li.done::before { background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10l3 3 7-7' fill='none' stroke='white' stroke-width='2.4'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--good); }
ol.check li.done a { color: var(--muted); }
.asps { display: grid; gap: 4px; }
.asp { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.asp:last-child { border-bottom: 0; }
.asp > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.asp small { color: var(--muted); white-space: nowrap; }
.bar { height: 6px; border-radius: 9px; background: var(--brand-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
@media (prefers-color-scheme: dark) { .bar i { background: #5fb486; } }

/* daftar dokumen */
.docs { display: grid; }
.doc { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc:first-child { border-top: 0; padding-top: 4px; }
.dtx { flex: 1 1 380px; min-width: 0; }
.dtx p { margin: 4px 0; color: var(--muted); font-size: .9rem; }
.dt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code { font-family: var(--mono); font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); padding: 2px 7px; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .code { color: #9fe0bb; } }
.dact { display: flex; gap: 8px; align-items: center; }

/* developer */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; }
.tile small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.tile b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pkg { display: grid; gap: 12px; }
.created { border-color: var(--good); background: var(--good-soft); }

/* publik */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); letter-spacing: -.02em; }
.lead { font-size: 1.06rem; color: var(--muted); max-width: 60ch; }
.paper { background: #fff; color: #111; border-radius: 4px; padding: 22px 22px 26px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px rgba(20,40,30,.35); transform: rotate(1.2deg); font-size: 9px; line-height: 1.35; min-width: 0; }
.paper .kop { display: flex; gap: 10px; align-items: center; border-bottom: 3px double #111; padding-bottom: 8px; text-align: center; }
.paper .kop i { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #c9a227 0 30%, #1f5135 31% 100%); flex: none; }
.paper .kop div { flex: 1; display: grid; }
.paper .kop .big { font-size: 13px; }
.paper .ttl { text-align: center; font-weight: 800; margin: 12px 0 8px; display: grid; }
.paper .ttl small { font-weight: 400; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th, .paper td { border: 1px solid #111; padding: 2px 4px; }
.paper th { background: #e8ece9; }
.paper .sig { margin: 12px 0 0 55%; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.steps div { border-top: 3px solid var(--brand); padding-top: 12px; }
.steps span { font-family: var(--mono); color: var(--gold); font-weight: 700; margin-right: 6px; }
.steps p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.doclist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doclist li { display: grid; gap: 2px; }
.doclist span { color: var(--muted); font-size: .9rem; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 12px; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 6px; align-content: start; }
.price.hl { border: 2px solid var(--brand); }
.pname { font-weight: 700; } .pval { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pdur { color: var(--gold); font-weight: 700; font-size: .85rem; }
.price p { color: var(--muted); font-size: .9rem; }
.auth { max-width: 460px; width: 100%; margin: 24px auto; }
.foot { color: var(--muted); font-size: .82rem; padding-block: 8px 28px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .paper { transform: none; }
  .topin { flex-wrap: wrap; padding-block: 8px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .out { margin-left: auto; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
