/* WINZAKAT - gaya tampilan */
:root {
    --bg: #f5f7f4;
    --surface: #ffffff;
    --surface-2: #eef4ef;
    --text: #1d2a24;
    --muted: #5b6b63;
    --line: #dbe4dd;
    --brand: #0b6b4f;
    --brand-2: #0e8a66;
    --brand-ink: #ffffff;
    --accent: #c9a227;
    --ok: #0b7a4b;
    --ok-bg: #e2f5ea;
    --no: #9a5b00;
    --no-bg: #fff3dc;
    --hl: #0b4fa8;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 16px rgba(16, 40, 30, .06);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: Consolas, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1613;
        --surface: #16201b;
        --surface-2: #1c2a23;
        --text: #e5ece8;
        --muted: #9db0a6;
        --line: #2a3a32;
        --brand: #2fb487;
        --brand-2: #3cc897;
        --brand-ink: #062419;
        --ok: #5fd6a0;
        --ok-bg: #12382a;
        --no: #f0b85a;
        --no-bg: #3a2b10;
        --hl: #7fb2ff;
        --shadow: none;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(135deg, #0b6b4f, #0a5640);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(255,255,255,.14); font-weight: 700; color: #ffe08a;
}
.brand-name { font-weight: 700; letter-spacing: .5px; font-size: 1.1rem; }
.brand-sub { display: block; font-size: .72rem; opacity: .8; font-weight: 400; letter-spacing: 0; }
.nav-toggle {
    margin-left: auto; display: none; background: transparent; color: #fff;
    border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer;
}
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-tools .nav-toggle { margin-left: 0; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 2px; }
.lang-switch a {
    color: rgba(255,255,255,.85); text-decoration: none; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
    padding: 3px 10px; border-radius: 999px; line-height: 1.4;
}
.lang-switch a:hover { color: #fff; }
.lang-switch a.active { background: #fff; color: #0b6b4f; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.site-nav { background: #0a5640; border-top: 1px solid rgba(255,255,255,.08); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a {
    display: block; padding: 10px 12px; color: rgba(255,255,255,.88); text-decoration: none;
    font-size: .9rem; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.site-nav a.active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Menu dropdown "Aplikasi Lain" ---------- */
.site-nav li.nav-drop { position: relative; }
.nav-drop details { position: relative; }
.nav-drop summary {
    list-style: none; cursor: pointer; padding: 10px 12px; color: rgba(255,255,255,.88);
    font-size: .9rem; border-bottom: 3px solid transparent; user-select: none;
}
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary::after { content: "\25BE"; margin-left: 6px; font-size: .75em; opacity: .8; }
.nav-drop summary:hover, .nav-drop details[open] summary { color: #fff; background: rgba(255,255,255,.06); }
.nav-drop details > ul {
    position: absolute; top: 100%; left: 0; z-index: 30; min-width: 220px; display: block;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; margin: 0;
}
.nav-drop details > ul li { display: block; }
.site-nav .nav-drop details > ul a {
    color: var(--text); border-bottom: 0; border-radius: 6px; padding: 8px 12px; font-size: .9rem;
}
.site-nav .nav-drop details > ul a::after { content: " \2197"; color: var(--muted); font-size: .8em; }
.site-nav .nav-drop details > ul a:hover { background: var(--surface-2); color: var(--brand); }

/* ---------- Main ---------- */
main { padding: 24px 0 48px; }
.page-head { margin-bottom: 18px; }
.page-head p { color: var(--muted); margin: 0; max-width: 760px; }
.page-title { display: flex; align-items: center; gap: 14px; margin: 2px 0 8px; }
.page-title h1 { margin: 0; }
.page-ico { width: 60px; height: 60px; margin: 0; flex: 0 0 auto; }
@media (max-width: 720px) { .page-ico { width: 48px; height: 48px; } .page-ico svg { width: 28px; height: 28px; } }
.eyebrow { color: var(--brand); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.layout > aside { position: sticky; top: 120px; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card > h2, .card > h3 { display: flex; align-items: center; gap: 8px; }
.card .num-badge {
    width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
    background: var(--surface-2); color: var(--brand); font-size: .8rem; font-weight: 700;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Form ---------- */
.field { display: grid; grid-template-columns: 1fr 210px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: 0; }
.field label, .field .lbl { color: var(--text); }
.field small { display: block; color: var(--muted); font-size: .8rem; }
.field.total { font-weight: 600; }
.field.is-disabled { opacity: .5; }
.input, input.num, select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--text); font: inherit; text-align: right;
    font-variant-numeric: tabular-nums;
}
input.num:focus, select:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: transparent; }
.prefix { position: relative; }
.prefix::before {
    content: attr(data-prefix); position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .85rem; pointer-events: none;
}
.prefix input.num { padding-left: 34px; }
.suffix { position: relative; }
.suffix::after {
    content: attr(data-suffix); position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .85rem; pointer-events: none;
}
.suffix input.num { padding-right: 38px; }
.calc {
    display: block; text-align: right; padding: 9px 11px; border-radius: 8px; background: var(--surface-2);
    font-variant-numeric: tabular-nums; font-weight: 600;
}
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-no { background: var(--no-bg); color: var(--no); }

.choice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 10px; }
.choice .opt { display: inline-flex; align-items: center; gap: 6px; }
.choice input[type=radio] { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; cursor: pointer; }
.choice label { cursor: pointer; padding: 4px 14px 4px 2px; }
.choice input[type=radio]:checked + label { color: var(--brand); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn {
    appearance: none; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: var(--surface-2); color: var(--brand); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover, .btn-secondary:hover { border-color: var(--brand); }

/* ---------- Info panel ---------- */
details.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); }
details.info summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.info summary::-webkit-details-marker { display: none; }
details.info summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; }
details.info[open] summary::after { content: "\2212"; }
.info-ico {
    width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
    background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-style: italic; font-family: Georgia, serif;
}
.info-body { padding: 0 14px 12px; color: var(--muted); font-size: .9rem; }
.info-body p { margin: 0 0 .7em; }

/* ---------- Hasil ---------- */
.hasil {
    background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius);
    padding: 18px; margin-top: 8px; box-shadow: var(--shadow); scroll-margin-top: 120px;
}
.hasil-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.hasil-head h2 { margin: 0; }
.badge { padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-no { background: var(--no-bg); color: var(--no); }
dl.ringkasan { margin: 0 0 12px; }
dl.ringkasan .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
dl.ringkasan dt { color: var(--muted); }
dl.ringkasan dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
dl.ringkasan .row.utama dt { color: var(--text); font-weight: 600; }
dl.ringkasan .row.utama dd { color: var(--hl); font-size: 1.15rem; }
details.proses summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.proses pre {
    margin: 6px 0 0; padding: 14px; background: var(--surface-2); border-radius: 8px; overflow-x: auto;
    font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.catatan { margin-top: 12px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .9rem; }
.catatan ul { margin: 4px 0 0; padding-left: 18px; }
.hasil-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Beranda ---------- */
.hero {
    background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--line);
    border-radius: 16px; padding: 28px; margin-bottom: 22px;
}
.hero h1 { font-size: 1.9rem; }
.hero .ayat { font-style: italic; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 12px; margin: 14px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile {
    display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile-ico {
    --ic: var(--brand); --ic-bg: var(--surface-2);
    display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px;
    border-radius: 14px; background: var(--ic-bg); color: var(--ic);
    transition: background .15s, color .15s, transform .15s;
}
.tile:hover .tile-ico { background: var(--ic); color: #fff; transform: scale(1.05); }
/* Warna ikon per jenis zakat */
.ic-1 { --ic: #b7791f; --ic-bg: rgba(183,121,31,.12); }   /* Fitrah    - beras  */
.ic-2 { --ic: #a8841a; --ic-bg: rgba(201,162,39,.16); }   /* Maal      - emas   */
.ic-3 { --ic: #2b6cb0; --ic-bg: rgba(43,108,176,.12); }   /* Profesi   - kerja  */
.ic-4 { --ic: #0e8a66; --ic-bg: rgba(14,138,102,.12); }   /* Investasi - tumbuh */
.ic-5 { --ic: #c0456b; --ic-bg: rgba(192,69,107,.12); }   /* Hadiah    - kado   */
.ic-6 { --ic: #6b46c1; --ic-bg: rgba(107,70,193,.12); }   /* Perniagaan- toko   */
.ic-7 { --ic: #2f855a; --ic-bg: rgba(47,133,90,.14); }    /* Pertanian - padi   */
.ic-8 { --ic: #8b5a2b; --ic-bg: rgba(139,90,43,.14); }    /* Ternak    - sapi   */
@media (prefers-color-scheme: dark) {
    .ic-1 { --ic: #f0b75a; } .ic-2 { --ic: #e8c65a; } .ic-3 { --ic: #7fb2ff; } .ic-4 { --ic: #3cc897; }
    .ic-5 { --ic: #f08aa8; } .ic-6 { --ic: #b69cf5; } .ic-7 { --ic: #68d391; } .ic-8 { --ic: #d6a676; }
    .tile:hover .tile-ico { color: #10170f; }
}
.tile h3 { color: var(--brand); margin-bottom: 4px; }
.tile p { color: var(--muted); margin: 0; font-size: .88rem; }
.tile .kadar { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--brand); padding: 2px 8px; border-radius: 999px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
table.data th { background: var(--surface-2); color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Penghitung footer ---------- */
.footer-counter { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.footer-counter a { color: var(--muted); text-decoration: none; }
.footer-counter a:hover { color: var(--brand); }
.footer-counter strong { color: var(--brand); }
.footer-counter .sep { opacity: .6; }

/* ---------- Statistik (Pengunjung.aspx) ---------- */
.ws-section { font-size: 1.15rem; margin: 26px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); display: inline-block; }
.ws-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ws-kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ws-kpi span { display: block; font-size: .8rem; color: var(--muted); }
.ws-kpi strong { display: block; font-size: 1.55rem; color: var(--brand); line-height: 1.3; font-variant-numeric: tabular-nums; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; align-items: start; }
.ws-grid > .ws-wide { grid-column: 1 / -1; }
.ws-muted { color: var(--muted); }
.ws-small { font-size: .85rem; }
.ws-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ws-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 4px 6px; }
.ws-table td { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: middle; }
.ws-table tr:last-child td { border-bottom: 0; }
.ws-table .num { text-align: right; white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
.ws-label { display: block; margin-bottom: 3px; }
.ws-flag { display: inline-block; min-width: 22px; margin-right: 6px; font-size: 1.05rem; line-height: 1; }
.ws-bar { display: block; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.ws-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 3px; }
.ws-pager { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.ws-pager a, .ws-pager span { min-width: 30px; text-align: center; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; }
.ws-pager .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.card > p:first-child { margin-top: 0; }
.ws-note { padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.ws-note code { font-family: var(--mono); font-size: .85em; }

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .layout > aside { position: static; }
}
@media (max-width: 720px) {
    .nav-toggle { display: inline-block; }
    .site-nav { display: none; }
    body.nav-open .site-nav { display: block; }
    .nav-drop details > ul { position: static; box-shadow: none; background: rgba(255,255,255,.06); border: 0; margin: 0 0 6px 12px; }
    .site-nav .nav-drop details > ul a { color: rgba(255,255,255,.88); }
    .site-nav .nav-drop details > ul a:hover { background: rgba(255,255,255,.1); color: #fff; }
    .site-nav ul { flex-direction: column; }
    .grid-2 { grid-template-columns: 1fr; }
    .field { grid-template-columns: 1fr; gap: 4px; }
    .hero { padding: 20px; }
    .hero h1 { font-size: 1.5rem; }
    dl.ringkasan .row { flex-direction: column; gap: 2px; }
    dl.ringkasan dd { text-align: left; }
}

/* ---------- Cetak ---------- */
@media print {
    .site-header, .site-nav, .site-footer, .no-print, aside, .form-area, .page-head p { display: none !important; }
    body { background: #fff; color: #000; }
    .layout { display: block; }
    .hasil { border: 0; box-shadow: none; padding: 0; }
    details.proses pre { background: #fff; border: 1px solid #ccc; }
}
