/* =========================================================
 * style.css — Kuttab Darul Ulum
 * Tema: hijau zamrud (emerald), putih, aksen emas lembut
 * ========================================================= */
:root {
  --em-50: #ecfdf5; --em-100: #d1fae5; --em-200: #a7f3d0; --em-300: #6ee7b7; --em-400: #34d399;
  --em-500: #10b981; --em-600: #059669; --em-700: #047857; --em-800: #065f46; --em-900: #064e3b; --em-950: #022c22;
  --gold: #c9a227; --gold-soft: #e9d48b; --gold-50: #fbf6e3; --gold-dark: #9a7a12;
  --ink: #0f1f1a; --ink-2: #334155; --muted: #64748b; --line: #e3ebe7; --line-2: #eef3f0;
  --bg: #f5f8f6; --card: #ffffff;
  --red: #dc2626; --red-50: #fef2f2; --amber: #d97706; --amber-50: #fffbeb; --blue: #2563eb; --blue-50: #eff6ff;
  --radius: 14px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(6, 78, 59, .06), 0 1px 3px rgba(6, 78, 59, .05);
  --shadow: 0 4px 20px rgba(6, 78, 59, .08);
  --shadow-lg: 0 18px 50px rgba(6, 78, 59, .16);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px; --side-w: 264px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--em-700); text-decoration: none; }
a:hover { color: var(--em-600); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--em-950); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.text-right { text-align: right; } .text-center { text-align: center; } .nowrap { white-space: nowrap; }
.arabic { font-family: "Amiri", serif; }
.hide { display: none !important; }
::selection { background: var(--em-200); }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid transparent; border-radius: 10px; padding: .62em 1.1em; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; transition: .18s; white-space: nowrap; line-height: 1.2; color: var(--ink); background: #fff; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--em-600), var(--em-800)); color: #fff; box-shadow: 0 4px 14px rgba(5, 150, 105, .28); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); color: #fff; transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, #e6c65a, var(--gold)); color: #3b2f05; box-shadow: 0 4px 14px rgba(201, 162, 39, .3); }
.btn-gold:hover { filter: brightness(1.05); color: #3b2f05; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-light:hover:not(:disabled) { border-color: var(--em-300); color: var(--em-800); background: var(--em-50); }
.btn-outline { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { filter: brightness(1.05); color: #fff; }
.btn-sm { padding: .45em .8em; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .85em 1.5em; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 1rem; transition: .15s; }
.icon-btn:hover { background: var(--em-50); color: var(--em-700); }
.icon-btn.danger:hover { background: var(--red-50); color: var(--red); }
.link-btn { border: 0; background: none; color: var(--em-700); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- Forms ---------------- */
.input { width: 100%; font: inherit; font-size: .92rem; padding: .6em .8em; border: 1px solid #d5e1dc; border-radius: 10px; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s; min-height: 40px; }
.input:focus { outline: none; border-color: var(--em-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.input-sm { padding: .35em .55em; min-height: 32px; font-size: .85rem; border-radius: 8px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23647488' d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .65em center; padding-right: 2em; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-all { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group > label, .lbl { font-weight: 600; font-size: .84rem; color: var(--ink-2); }
.form-group small, .hint { color: var(--muted); font-size: .78rem; }
.req { color: var(--red); }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 .75em; background: var(--line-2); border: 1px solid #d5e1dc; border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.input-group .input { border-radius: 0 10px 10px 0; }
.chk { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk span { width: 18px; height: 18px; border: 2px solid #b6c7c0; border-radius: 5px; display: inline-grid; place-items: center; transition: .15s; background: #fff; }
.chk input:checked + span { background: var(--em-600); border-color: var(--em-600); }
.chk input:checked + span::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.chk input:focus-visible + span { box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 40px; height: 22px; border-radius: 99px; background: #cbd5d1; position: relative; transition: .2s; flex: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--em-600); }
.switch input:checked + i::after { left: 21px; }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 .55em; border-radius: 8px; border: 1px solid #d5e1dc; font-weight: 700; font-size: .82rem; color: var(--muted); background: #fff; transition: .12s; }
.pills input:checked + span { color: #fff; }
.pills input[value=A]:checked + span, .pills input[value=Baik]:checked + span { background: var(--em-600); border-color: var(--em-600); }
.pills input[value=B]:checked + span, .pills input[value=Cukup]:checked + span { background: #0ea5e9; border-color: #0ea5e9; }
.pills input[value=C]:checked + span, .pills input[value=Kurang]:checked + span { background: var(--amber); border-color: var(--amber); }
.pills input:checked + span.any { background: var(--em-700); border-color: var(--em-700); }

/* ---------------- Badges / chips ---------------- */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .22em .62em; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.badge-green { background: var(--em-100); color: var(--em-800); }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #eef2f1; color: #475569; }
.badge-gold { background: var(--gold-50); color: var(--gold-dark); border: 1px solid var(--gold-soft); }
.badge-teal { background: #ccfbf1; color: #115e59; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.chip { display: inline-block; padding: .15em .6em; border-radius: 6px; background: var(--line-2); font-size: .78rem; font-weight: 600; margin: 2px; }
.chip-req { background: var(--em-100); color: var(--em-800); }

/* ---------------- Cards ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: .5em; }
.card-head h3 i { color: var(--em-600); }
.card-body { padding: 18px 20px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.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)); }
.sub-title { font-size: .95rem; margin: 18px 0 10px; display: flex; align-items: center; gap: .45em; color: var(--em-900); }
.sub-title i { color: var(--em-600); }
.note { background: var(--gold-50); border: 1px solid var(--gold-soft); color: #6b5410; padding: 10px 14px; border-radius: 10px; font-size: .86rem; }
.note-green { background: var(--em-50); border-color: var(--em-200); color: var(--em-900); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty i { font-size: 2.4rem; color: var(--em-300); display: block; margin-bottom: 6px; }
.empty p { margin: 0; }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--em-500), var(--em-700)); border-radius: 99px; transition: width .4s; }
.progress.gold > div { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }

/* ---------------- KPI ---------------- */
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--em-50); z-index: 0; }
.kpi > * { position: relative; z-index: 1; }
.kpi-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; background: var(--em-100); color: var(--em-700); flex: none; }
.kpi-icon.gold { background: var(--gold-50); color: var(--gold-dark); }
.kpi-icon.red { background: #fee2e2; color: var(--red); }
.kpi-icon.blue { background: #dbeafe; color: var(--blue); }
.kpi-icon.purple { background: #ede9fe; color: #6d28d9; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.45rem; font-weight: 800; color: var(--em-950); line-height: 1.2; }
.kpi-sub { font-size: .76rem; color: var(--muted); }

/* ---------------- Table ---------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: #fff; scrollbar-width: thin; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.table thead th { background: #f3f8f5; color: var(--em-900); font-weight: 700; font-size: .8rem; text-transform: none; white-space: nowrap; position: sticky; top: 0; z-index: 2; user-select: none; }
.table thead th[data-sort] { cursor: pointer; }
.table thead th[data-sort]:hover { color: var(--em-600); }
.table thead th i { margin-left: 4px; font-size: .7rem; color: var(--em-600); }
.table tbody tr:hover td { background: #f8fcfa; }
.table tbody tr.selected td { background: #ecfdf5; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: #f3f8f5; font-weight: 700; border-top: 2px solid var(--line); }
.table-compact th, .table-compact td { padding: 7px 9px; }
.table .col-check { width: 42px; text-align: center; padding-left: 14px; padding-right: 4px; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .c { text-align: center; }
.row-actions { display: inline-flex; gap: 2px; }
.td-empty { padding: 0 !important; }
.td-name { font-weight: 600; color: var(--em-950); min-width: 170px; }
.td-name small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; }
thead .sticky-col { z-index: 3; background: #f3f8f5; }
.table tbody tr.selected .sticky-col { background: #ecfdf5; }

.dt-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dt-filters, .dt-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dt-filters .input { width: auto; min-width: 140px; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }
.search-box .input { padding-left: 2.1em; min-width: 230px; }
.dt-bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, var(--em-50), #fff); border: 1px solid var(--em-200); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; animation: slideIn .2s; }
.dt-bulk[hidden] { display: none; }
.dt-bulk-info { font-size: .88rem; color: var(--em-900); }
.dt-bulk-info i { color: var(--em-600); }
.dt-bulk-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.dt-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.dt-size { display: flex; align-items: center; gap: 8px; }
.dt-size .input { width: 72px; }
.pager { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pg { min-width: 34px; height: 34px; padding: 0 .6em; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.pg:hover:not(:disabled) { border-color: var(--em-400); color: var(--em-700); }
.pg.active { background: var(--em-700); color: #fff; border-color: var(--em-700); }
.pg:disabled { opacity: .45; cursor: not-allowed; }
.pg-dots { padding: 0 4px; }

/* Pembayaran sel */
.cell-input { width: 92px; min-height: 30px; padding: .3em .45em; font-size: .82rem; text-align: right; border: 1px solid transparent; border-radius: 7px; background: transparent; font-variant-numeric: tabular-nums; font-family: inherit; color: var(--ink); }
.cell-input:hover { border-color: #d5e1dc; background: #fff; }
.cell-input:focus { outline: none; border-color: var(--em-500); background: #fff; box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.cell-input.wide { width: 170px; text-align: left; }
td.st-lunas { background: #ecfdf5 !important; }
td.st-sebagian { background: #fffbeb !important; }
td.st-belum { background: #fef2f2 !important; }
td.st-future { background: #fafafa !important; }
.saved-flash { animation: flash .8s; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 2px var(--em-500); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }

/* ---------------- Modal ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 44, 34, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 14px; z-index: 1000; opacity: 0; transition: opacity .2s; overflow-y: auto; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; transform: translateY(14px) scale(.98); transition: transform .2s; display: flex; flex-direction: column; max-height: none; }
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 420px; } .modal-lg { max-width: 820px; } .modal-xl { max-width: 1120px; } .modal-full { max-width: 1300px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.modal-header h3 { margin: 0; font-size: 1.06rem; display: flex; align-items: center; gap: .5em; }
.modal-header h3 i { color: var(--em-600); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; background: #fafcfb; border-radius: 0 0 18px 18px; }
.confirm-box { text-align: center; }
.confirm-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--em-100); color: var(--em-700); font-size: 1.5rem; }
.confirm-icon.danger { background: #fee2e2; color: var(--red); }

/* ---------------- Toast ---------------- */
#toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: #fff; border-left: 4px solid var(--em-600); box-shadow: var(--shadow-lg); padding: 12px 16px; border-radius: 12px; font-size: .88rem; font-weight: 500; transform: translateX(120%); transition: transform .25s; max-width: 400px; }
.toast.show { transform: none; }
.toast i { font-size: 1.15rem; color: var(--em-600); }
.toast-error { border-color: var(--red); } .toast-error i { color: var(--red); }
.toast-warning { border-color: var(--amber); } .toast-warning i { color: var(--amber); }
.toast-info { border-color: var(--blue); } .toast-info i { color: var(--blue); }

/* ---------------- Import ---------------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed var(--em-300); border-radius: 16px; padding: 34px 16px; background: var(--em-50); cursor: pointer; text-align: center; transition: .15s; }
.dropzone:hover, .dropzone.over { background: var(--em-100); border-color: var(--em-500); }
.dropzone i { font-size: 2.5rem; color: var(--em-600); }
.dropzone small { color: var(--muted); }
.import-help { margin-top: 14px; font-size: .88rem; }
.import-meta { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.import-meta .form-group { width: 200px; }
.imp-file { padding: 9px 12px; background: var(--em-50); border-radius: 10px; font-weight: 600; color: var(--em-800); font-size: .86rem; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.map-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.map-item label { font-size: .8rem; font-weight: 700; }
.map-item.ok { border-color: var(--em-300); background: #f6fdf9; }
.map-item.missing { border-color: #fca5a5; background: var(--red-50); }
.preview-wrap { max-height: 320px; }

/* =========================================================
 * PUBLIC SITE
 * ========================================================= */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-nav { position: sticky; top: 0; z-index: 500; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid rgba(6, 95, 70, .08); transition: box-shadow .2s; }
.site-nav.scrolled { box-shadow: 0 6px 24px rgba(6, 78, 59, .08); }
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--em-900); min-width: 0; }
.brand img { width: 42px; height: 42px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 1.05rem; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.brand-text small { font-size: .7rem; color: var(--gold-dark); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; }
.nav-links a { padding: .55em 1em; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: .4em; }
.nav-links a:hover { color: var(--em-700); background: var(--em-50); }
.nav-links a.active { color: var(--em-800); background: var(--em-100); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--em-500), var(--em-800)); color: #fff; font-weight: 800; font-size: .85rem; flex: none; }
.hamburger { display: none; }
.mobile-menu { display: none; }

.hero { position: relative; min-height: 560px; display: flex; align-items: center; color: #fff; overflow: hidden; background: var(--em-900); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center right; transform: scale(1.02); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(2, 44, 34, .94) 0%, rgba(6, 78, 59, .82) 38%, rgba(6, 78, 59, .25) 75%, rgba(6, 78, 59, .05) 100%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M40 0l11.7 28.3L80 40 51.7 51.7 40 80 28.3 51.7 0 40l28.3-11.7z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3C/g%3E%3C/svg%3E"); }
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 620px; padding: 70px 0; animation: fadeUp .7s ease both; }
.hero-badge { display: inline-flex; align-items: center; gap: .5em; padding: .4em 1em; border-radius: 99px; background: rgba(233, 212, 139, .16); border: 1px solid rgba(233, 212, 139, .45); color: var(--gold-soft); font-size: .82rem; font-weight: 600; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; letter-spacing: -.8px; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--gold-soft); }
.hero p { color: rgba(255, 255, 255, .86); font-size: 1.05rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-bismillah { font-family: "Amiri", serif; font-size: 1.5rem; color: var(--gold-soft); margin-bottom: 6px; }

.stats-band { position: relative; z-index: 3; margin-top: -54px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.stat { padding: 24px 20px; display: flex; align-items: center; gap: 14px; border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat .kpi-icon { width: 52px; height: 52px; }
.stat b { display: block; font-size: 1.75rem; font-weight: 800; color: var(--em-900); line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--muted); font-weight: 600; }

.section { padding: 80px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 42px; }
.eyebrow { display: inline-flex; align-items: center; gap: .5em; color: var(--gold-dark); font-weight: 700; font-size: .8rem; letter-spacing: 1.6px; text-transform: uppercase; margin-bottom: 10px; }
.eyebrow::before, .eyebrow::after { content: ""; width: 22px; height: 2px; background: var(--gold); border-radius: 2px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.5px; }
.section-head p { color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; transition: .25s; position: relative; overflow: hidden; }
.feature::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: linear-gradient(90deg, var(--em-500), var(--gold)); transform: scaleX(0); transform-origin: left; transition: .3s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature:hover::before { transform: scaleX(1); }
.feature .kpi-icon { margin-bottom: 16px; }
.feature h3 { font-size: 1.08rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

.sambutan { display: grid; grid-template-columns: 340px 1fr; gap: 50px; align-items: center; }
.sambutan-photo { position: relative; }
.sambutan-photo .ph { aspect-ratio: 4/5; border-radius: 24px; background: linear-gradient(160deg, var(--em-600), var(--em-900)); display: grid; place-items: center; color: rgba(255, 255, 255, .9); font-size: 6rem; overflow: hidden; box-shadow: var(--shadow-lg); }
.sambutan-photo .ph img { width: 100%; height: 100%; object-fit: cover; }
.sambutan-photo::after { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--gold-soft); border-radius: 24px; z-index: -1; }
.sambutan-name { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sambutan-name b { display: block; font-size: 1.05rem; color: var(--em-900); }
.sambutan-name span { color: var(--gold-dark); font-weight: 600; font-size: .88rem; }
.quote-mark { font-family: Georgia, serif; font-size: 5rem; line-height: .6; color: var(--gold-soft); }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); transition: .25s; display: flex; flex-direction: column; color: inherit; }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: inherit; }
.article-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--em-500), var(--em-900)); position: relative; overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.article-card:hover .article-thumb img { transform: scale(1.05); }
.article-thumb .badge { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .95); color: var(--em-800); }
.article-thumb .ph-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: rgba(255, 255, 255, .5); }
.article-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.article-meta { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.article-body h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--em-950); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-body p { color: var(--muted); font-size: .88rem; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin-top: auto; font-weight: 700; font-size: .86rem; color: var(--em-700); display: inline-flex; align-items: center; gap: .3em; }

.cta-band { background: linear-gradient(135deg, var(--em-800), var(--em-950)); color: #fff; border-radius: 26px; padding: 50px; display: flex; align-items: center; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 240px; height: 240px; border-radius: 50%; border: 40px solid rgba(233, 212, 139, .12); }
.cta-band h2 { color: #fff; font-size: 1.65rem; }
.cta-band p { color: rgba(255, 255, 255, .8); margin: 0; }

.page-hero { background: linear-gradient(135deg, var(--em-800), var(--em-950)); color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M40 0l11.7 28.3L80 40 51.7 51.7 40 80 28.3 51.7 0 40l28.3-11.7z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3C/g%3E%3C/svg%3E"); }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 6px; }
.page-hero p { color: rgba(255, 255, 255, .8); margin: 0; }
.crumb { font-size: .82rem; color: var(--gold-soft); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--gold-soft); }
.page-body { margin-top: -30px; position: relative; z-index: 2; padding-bottom: 70px; }

.profil-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.prose { font-size: 1rem; line-height: 1.8; color: var(--ink-2); }
.prose h2, .prose h3 { margin-top: 1.2em; }
.prose blockquote { margin: 1.2em 0; padding: 14px 20px; border-left: 4px solid var(--gold); background: var(--gold-50); border-radius: 0 12px 12px 0; font-style: italic; color: #5b4810; }
.prose img { border-radius: 12px; height: auto; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose iframe { max-width: 100%; border-radius: 12px; }
.visi-box { background: linear-gradient(135deg, var(--em-700), var(--em-900)); color: #fff; border-radius: 18px; padding: 26px; position: relative; overflow: hidden; }
.visi-box h3 { color: var(--gold-soft); }
.visi-box p { font-size: 1.12rem; font-weight: 600; margin: 0; }
.struktur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.person { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.person b { display: block; font-size: .9rem; color: var(--em-950); line-height: 1.3; }
.person span { font-size: .78rem; color: var(--gold-dark); font-weight: 600; }
.person.lead { background: var(--em-50); border-color: var(--em-200); }
.list-icon { display: grid; gap: 12px; }
.list-icon .li { display: flex; gap: 12px; align-items: flex-start; }
.list-icon .li i { width: 36px; height: 36px; border-radius: 10px; background: var(--em-100); color: var(--em-700); display: grid; place-items: center; flex: none; }
.list-icon .li b { display: block; color: var(--em-950); }
.list-icon .li span { color: var(--muted); font-size: .88rem; }
.map-frame { width: 100%; aspect-ratio: 16/10; border: 0; border-radius: 14px; background: var(--line-2); }
.tabs-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--line-2); border-radius: 14px; margin-bottom: 18px; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn { flex: 1; min-width: max-content; border: 0; background: transparent; padding: .7em 1.1em; border-radius: 10px; font: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; display: inline-flex; gap: .5em; align-items: center; justify-content: center; }
.tab-btn.active { background: #fff; color: var(--em-800); box-shadow: var(--shadow-sm); }
.tab-btn i { font-size: 1rem; }

/* Cek Online & Security Gate */
.input-uppercase { text-transform: uppercase !important; font-weight: 600; letter-spacing: 0.5px; }
.gate-card { max-width: 580px; margin: 0 auto 28px; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1.5px solid var(--em-200); }
.gate-header { background: linear-gradient(135deg, var(--em-700), var(--em-900)); color: #fff; padding: 26px 28px; text-align: center; }
.gate-header .gate-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .15); display: grid; place-items: center; margin: 0 auto 12px; font-size: 1.6rem; color: var(--gold-soft); border: 1px solid rgba(233, 212, 139, .4); }
.gate-header h2 { color: #fff; font-size: 1.35rem; margin-bottom: 4px; }
.gate-header p { color: rgba(255, 255, 255, .82); font-size: .88rem; margin: 0; }
.gate-body { padding: 28px; background: #fff; }
.gate-alert { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; padding: 12px 16px; border-radius: 12px; font-size: .88rem; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.demo-gate-box { max-width: 880px; margin: 0 auto; }
.demo-gate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 768px) {
  .demo-gate-grid { grid-template-columns: 1fr; }
}
.demo-card-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; position: relative; }
.demo-card-item:hover { border-color: var(--em-400); box-shadow: var(--shadow-sm); }
.demo-card-item b { color: var(--em-950); }

.cek-search { padding: 22px; }
.cek-search .form-grid { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
.suggest { position: relative; }
.suggest-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; max-height: 320px; overflow-y: auto; }
.suggest-item { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line-2); }
.suggest-item:hover, .suggest-item.active { background: var(--em-50); }
.suggest-item b { font-size: .9rem; } .suggest-item small { color: var(--muted); }
.student-head { display: flex; gap: 16px; align-items: center; padding: 18px 22px; flex-wrap: wrap; }
.student-head .avatar { width: 56px; height: 56px; font-size: 1.2rem; }
.student-head h2 { margin: 0; font-size: 1.25rem; }
.student-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.student-meta b { color: var(--ink-2); }
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.month { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; background: #fff; }
.month .m-name { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.month .m-val { font-size: .8rem; color: var(--muted); margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.month.lunas { border-color: var(--em-200); background: #f3fdf8; }
.month.sebagian { border-color: #fcd34d; background: var(--amber-50); }
.month.belum { border-color: #fecaca; background: var(--red-50); }
.month.future { opacity: .65; }
.summary-list { display: grid; gap: 8px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.summary-list > div b { font-variant-numeric: tabular-nums; }
.summary-list .total { border-bottom: 0; font-size: 1.02rem; font-weight: 800; color: var(--red); }
.summary-list .total.ok { color: var(--em-700); }
.aspek-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.aspek { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.aspek .n { width: 24px; height: 24px; border-radius: 7px; background: var(--line-2); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.aspek .t { flex: 1; }
.big-stat { text-align: center; padding: 16px; border-radius: 14px; background: var(--em-50); }
.big-stat b { display: block; font-size: 1.6rem; color: var(--em-800); }
.big-stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* Artikel publik */
.info-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.cat-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-pill { border: 1px solid var(--line); background: #fff; padding: .45em 1em; border-radius: 99px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cat-pill.active, .cat-pill:hover { background: var(--em-700); border-color: var(--em-700); color: #fff; }
.article-full { max-width: 820px; margin: 0 auto; }
.article-full .cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: 18px; margin-bottom: 22px; box-shadow: var(--shadow); }
.article-full h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); align-items: center; }

/* Footer */
.site-footer { background: var(--em-950); color: rgba(255, 255, 255, .78); padding: 60px 0 0; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: var(--gold-soft); font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: #fff; }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-brand img { width: 52px; height: 52px; }
.footer-brand b { color: #fff; font-size: 1.15rem; display: block; }
.footer-brand small { color: var(--gold-soft); }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-list li { display: flex; gap: 10px; align-items: flex-start; }
.footer-list i { color: var(--gold-soft); margin-top: 2px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding: 18px 0; font-size: .8rem; text-align: center; color: rgba(255, 255, 255, .55); }
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 8px 24px rgba(37, 211, 102, .45); z-index: 400; }
.wa-float:hover { color: #fff; transform: scale(1.06); }

/* Login */
.login-page { min-height: calc(100vh - var(--nav-h)); display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: linear-gradient(160deg, rgba(6, 78, 59, .9), rgba(2, 44, 34, .96)), url("../assets/img/hero.jpg") center/cover; color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.login-art h2 { color: #fff; font-size: 2rem; }
.login-art p { color: rgba(255, 255, 255, .8); }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 1.6rem; }
.demo-accounts { margin-top: 20px; border: 1px dashed var(--em-300); border-radius: 14px; padding: 14px; background: var(--em-50); }
.demo-accounts h4 { font-size: .86rem; margin-bottom: 8px; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-list button { text-align: left; border: 1px solid var(--em-200); background: #fff; border-radius: 9px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: .78rem; line-height: 1.3; }
.demo-list button:hover { border-color: var(--em-500); }
.demo-list button b { display: block; color: var(--em-800); font-size: .82rem; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* =========================================================
 * PANEL (dashboard)
 * ========================================================= */
.panel-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: linear-gradient(180deg, var(--em-900), var(--em-950)); color: rgba(255, 255, 255, .8); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 600; transition: transform .25s; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.sidebar-brand img { width: 40px; height: 40px; }
.sidebar-brand b { display: block; font-size: 1rem; color: #fff; line-height: 1.2; }
.sidebar-brand small { color: var(--gold-soft); font-size: .72rem; }
.side-menu { flex: 1; overflow-y: auto; padding: 10px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.side-group { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold-soft); opacity: .8; font-weight: 700; padding: 16px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: .62em .85em; border-radius: 10px; color: rgba(255, 255, 255, .78); font-weight: 600; font-size: .9rem; margin-bottom: 2px; transition: .15s; }
.side-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(16, 185, 129, .32), rgba(16, 185, 129, .1)); color: #fff; box-shadow: inset 3px 0 0 var(--gold-soft); }
.side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a { color: rgba(255, 255, 255, .7); font-size: .85rem; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.side-foot a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.panel-main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 400; }
.topbar .menu-toggle { display: none; }
.topbar-title { font-weight: 700; color: var(--em-900); font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 99px; cursor: pointer; border: 1px solid var(--line); background: #fff; position: relative; }
.user-chip .info { line-height: 1.2; padding-right: 6px; }
.user-chip .info b { display: block; font-size: .84rem; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .info small { color: var(--muted); font-size: .72rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; display: none; z-index: 50; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font: inherit; font-size: .88rem; border: 0; background: none; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--em-50); color: var(--em-800); }
.panel-content { padding: 24px 22px 50px; flex: 1; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.45rem; margin: 0 0 2px; font-weight: 800; letter-spacing: -.3px; }
.page-header p { margin: 0; color: var(--muted); font-size: .88rem; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; }
.filter-bar .form-group { min-width: 150px; }
.sidebar-overlay { display: none; }
.welcome { background: linear-gradient(120deg, var(--em-700), var(--em-900)); color: #fff; border-radius: 20px; padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; position: relative; overflow: hidden; margin-bottom: 20px; }
.welcome::after { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M40 0l11.7 28.3L80 40 51.7 51.7 40 80 28.3 51.7 0 40l28.3-11.7z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3C/g%3E%3C/svg%3E"); }
.welcome > * { position: relative; z-index: 1; }
.welcome h2 { color: #fff; margin: 0 0 4px; font-size: 1.35rem; }
.welcome p { margin: 0; color: rgba(255, 255, 255, .82); }
.welcome .arabic { font-size: 1.6rem; color: var(--gold-soft); }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }
.mini-list { display: grid; }
.mini-list .mi { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.mini-list .mi:last-child { border-bottom: 0; }
.mini-list .mi img, .mini-list .mi .ph { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--em-100); flex: none; }
.mini-list .mi b { display: block; font-size: .88rem; line-height: 1.35; }
.mini-list .mi small { color: var(--muted); }

/* Panel: rapot form */
.sikap-table td { padding: 7px 10px; }
.sikap-table .pills span { min-width: 32px; height: 28px; }
.rapot-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.santri-list { max-height: 72vh; overflow-y: auto; }
.santri-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.santri-item:hover { background: #f8fcfa; }
.santri-item.active { background: var(--em-50); box-shadow: inset 3px 0 0 var(--em-600); }
.santri-item .avatar { width: 32px; height: 32px; font-size: .75rem; }
.santri-item .nm { flex: 1; min-width: 0; }
.santri-item .nm b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.santri-item .nm small { color: var(--muted); font-size: .74rem; }
.prog-ring { font-size: .72rem; font-weight: 800; color: var(--em-700); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }
.nilai-input { width: 66px; text-align: center; }
.kol-table td, .kol-table th { white-space: nowrap; }
.kol-table .pills span { min-width: 26px; height: 26px; font-size: .74rem; }
.kol-table select.input-sm { min-width: 84px; }

/* Panel: artikel editor */
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.title-input { font-size: 1.5rem; font-weight: 800; border: 0; padding: 14px 18px; width: 100%; font-family: inherit; color: var(--em-950); border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; }
.title-input:focus { outline: none; background: #fcfffd; }
#editor { min-height: 420px; font-size: 1rem; font-family: var(--font); }
.ql-toolbar.ql-snow { border: 0 !important; border-bottom: 1px solid var(--line-2) !important; position: sticky; top: 64px; background: #fff; z-index: 5; flex-wrap: wrap; }
.ql-container.ql-snow { border: 0 !important; font-family: var(--font) !important; font-size: 1rem !important; }
.ql-editor { min-height: 420px; line-height: 1.75; }
.thumb-drop { aspect-ratio: 16/9; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: #fafcfb; color: var(--muted); text-align: center; position: relative; }
.thumb-drop img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb-drop:hover { border-color: var(--em-400); }
.img-picker { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.img-picker .prev { width: 120px; height: 72px; border-radius: 10px; border: 1px solid var(--line); background: #f3f6f5 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.img-picker .prev.sq { width: 72px; }
.img-picker .prev img { width: 100%; height: 100%; object-fit: contain; }
.repeater-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.repeater-item.three { grid-template-columns: 140px 1fr 2fr auto; }
.setting-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; background: var(--bg-subtle, #f1f5f9); padding: 6px; border-radius: 12px; border: 1px solid var(--line); }
.setting-nav .tab-btn { border-radius: 8px; padding: 10px 18px; font-weight: 700; transition: all 0.2s ease; }
.setting-nav .tab-btn.active { background: var(--card, #fff); color: var(--em-700); box-shadow: var(--shadow-sm); }
.mapel-table .input-sm { min-width: 0; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeUp .35s ease both; }

/* =========================================================
 * RESPONSIVE
 * ========================================================= */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profil-grid { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .cek-search .form-grid { grid-template-columns: 1fr 1fr; }
  .cek-search .form-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .nav-links, .nav-right .hide-m { display: none; }
  .hamburger { display: inline-grid; }
  .mobile-menu { display: block; position: fixed; top: var(--nav-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 10px 16px 18px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .2s; z-index: 499; }
  .mobile-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .mobile-menu a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-weight: 600; color: var(--ink-2); }
  .mobile-menu a.active { background: var(--em-50); color: var(--em-800); }
  .mobile-menu .btn { margin-top: 8px; width: 100%; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .panel-shell.side-open .sidebar { transform: none; }
  .panel-shell.side-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(2, 44, 34, .4); z-index: 550; }
  .panel-main { margin-left: 0; }
  .topbar .menu-toggle { display: inline-grid; }
  .user-chip .info { display: none; }
  .sambutan { grid-template-columns: 1fr; gap: 34px; }
  .sambutan-photo { max-width: 300px; margin: 0 auto; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .rapot-layout { grid-template-columns: 1fr; }
  .santri-list { max-height: 260px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .month-grid { grid-template-columns: repeat(4, 1fr); }
  .cta-band { flex-direction: column; text-align: center; padding: 36px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .brand-text small { display: none; }
  .brand img { width: 38px; height: 38px; }
  .hero { min-height: 520px; }
  .hero::before { background: linear-gradient(180deg, rgba(2, 44, 34, .78), rgba(6, 78, 59, .92)); }
  .hero-bg { background-position: 70% center; }
  .hero-content { padding: 50px 0 90px; }
  .section { padding: 56px 0; }
  .feature-grid, .article-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4.kpis, .grid-2.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-4.kpis .kpi, .grid-2.kpis .kpi { flex-direction: column; align-items: flex-start; padding: 14px; gap: 8px; }
  .kpi-value { font-size: 1.15rem; }
  .stat { padding: 16px 14px; flex-direction: column; text-align: center; gap: 8px; }
  .stat b { font-size: 1.4rem; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .cek-search .form-grid { grid-template-columns: 1fr; }
  .panel-content { padding: 16px 12px 40px; }
  .topbar { padding: 0 12px; }
  .card-head, .card-body { padding: 14px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; }
  .modal-body { overflow-y: auto; padding: 16px; }
  .modal-footer { border-radius: 0; }
  .modal-footer .btn { flex: 1; }
  .dt-toolbar { flex-direction: column; align-items: stretch; }
  .dt-filters .input, .search-box, .search-box .input { width: 100%; min-width: 0; }
  .dt-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .dt-filters .search-box { grid-column: 1 / -1; }
  .dt-actions .btn span { display: none; }
  .dt-actions .btn { padding: .55em .75em; }
  .dt-footer { justify-content: center; }
  .pg-text { display: none; }
  .dt-bulk-actions { margin-left: 0; width: 100%; }
  .dt-bulk-actions .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .month-grid { grid-template-columns: repeat(3, 1fr); }
  .aspek-list { grid-template-columns: 1fr; }
  .demo-list { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.2rem; }
  .welcome { flex-direction: column; align-items: flex-start; padding: 20px; }
  .filter-bar .form-group { min-width: calc(50% - 6px); flex: 1; }
  .repeater-item, .repeater-item.three { grid-template-columns: 1fr; }
  .wa-float { width: 48px; height: 48px; font-size: 1.4rem; }
  .student-head { padding: 14px; }
  .bio-grid { grid-template-columns: 1fr; }
  .surat-paper { padding: 24px 18px; }
  .passbook-head { flex-direction: column; text-align: center; }
}

/* =========================================================
 * TAMBAHAN FITUR: BIODATA, TABUNGAN, SURAT RESMI & CUSTOM THEME
 * ========================================================= */

/* Dark Mode Variables & Overrides */
[data-theme="dark"] {
  --bg: #0b1411;
  --card: #14221c;
  --ink: #f1f5f3;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --line: #22372e;
  --line-2: #1b2c25;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .card { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .site-nav { background: rgba(11, 20, 17, 0.94); border-bottom-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .sidebar { background: #08120e; border-right-color: var(--line); }
[data-theme="dark"] .topbar { background: var(--card); border-bottom-color: var(--line); }
[data-theme="dark"] .input, [data-theme="dark"] select.input, [data-theme="dark"] textarea.input {
  background: #0f1c16; border-color: #263e33; color: #fff;
}
[data-theme="dark"] .table th { background: #0f1c16; border-color: var(--line); color: #cbd5e1; }
[data-theme="dark"] .table td { border-color: var(--line); color: #e2e8f0; }
[data-theme="dark"] .btn-light { background: #182821; border-color: var(--line); color: #f1f5f3; }
[data-theme="dark"] .month { background: #12201a; border-color: var(--line); }
[data-theme="dark"] .stats { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .stat { border-right-color: var(--line); }
[data-theme="dark"] .modal-content, [data-theme="dark"] .modal { background: var(--card); }

/* Sub-tabs Navigation */
.sub-tabs-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--line-2);
  border-radius: 12px; margin-bottom: 20px; scrollbar-width: none;
}
.sub-tabs-nav::-webkit-scrollbar { display: none; }
.sub-tab-btn {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 9px;
  font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.sub-tab-btn.active { background: #fff; color: var(--em-700); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .sub-tab-btn.active { background: #1c3027; color: #fff; }

/* Biodata Santri Card */
.bio-card {
  border-radius: 18px; border: 1px solid var(--line); background: var(--card);
  overflow: hidden; margin-bottom: 24px;
}
.bio-head-banner {
  background: linear-gradient(135deg, var(--em-700), var(--em-900)); color: #fff;
  padding: 24px 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.bio-avatar-wrap {
  width: 90px; height: 90px; border-radius: 20px; background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(233, 212, 139, 0.6); display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800; color: var(--gold-soft); flex: none; overflow: hidden;
}
.bio-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.bio-head-info { flex: 1; min-width: 240px; }
.bio-head-info h2 { color: #fff; font-size: 1.45rem; margin: 0 0 6px; }
.bio-chips { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.84rem; }
.bio-chip {
  padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.14);
  color: #fff; display: inline-flex; align-items: center; gap: 5px;
}
.bio-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; padding: 24px 28px;
}
.bio-group-title {
  grid-column: 1 / -1; font-size: 0.95rem; font-weight: 800; color: var(--em-800);
  border-bottom: 1.5px solid var(--em-200); padding-bottom: 6px; margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .bio-group-title { color: var(--gold-soft); border-bottom-color: var(--line); }
.bio-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.88rem; }
.bio-field .lbl { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.bio-field .val { font-weight: 700; color: var(--ink); }

/* Buku Tabungan Digital */
.passbook-card {
  border-radius: 18px; border: 1.5px solid var(--em-200); background: #fff;
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 24px;
}
.passbook-head {
  background: linear-gradient(135deg, var(--em-800), var(--em-950)); color: #fff;
  padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
.passbook-brand { display: flex; align-items: center; gap: 12px; }
.passbook-brand b { font-size: 1.15rem; display: block; }
.passbook-brand small { color: var(--gold-soft); }
.passbook-saldo {
  text-align: right; background: rgba(255, 255, 255, 0.12); padding: 10px 18px;
  border-radius: 12px; border: 1px solid rgba(233, 212, 139, 0.3);
}
.passbook-saldo small { color: rgba(255, 255, 255, 0.78); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.passbook-saldo h3 { color: var(--gold-soft); font-size: 1.5rem; margin: 4px 0 0; font-family: monospace; }

/* Surat Pengantar / Keterangan Resmi Standar A4 */
.surat-container { max-width: 820px; margin: 0 auto; }
.surat-paper {
  background: #fff; color: #111; padding: 15mm 20mm; border-radius: 4px;
  border: 1px solid #cbd5e1; box-shadow: 0 10px 35px rgba(0,0,0,0.06); font-family: "Times New Roman", Times, serif;
  line-height: 1.45; font-size: 11pt; box-sizing: border-box;
}
.surat-kop {
  display: flex; align-items: center; gap: 14px; border-bottom: 3px double #111;
  padding-bottom: 8px; margin-bottom: 16px; text-align: center;
}
.surat-kop img { width: 78px; height: 78px; object-fit: contain; }
.surat-kop-text { flex: 1; }
.surat-kop-text h2 { margin: 0; font-size: 14pt; font-weight: 800; letter-spacing: 0.5px; color: #064e3b; text-transform: uppercase; }
.surat-kop-text h3 { margin: 2px 0; font-size: 12pt; font-weight: 700; color: #111; }
.surat-kop-text p { margin: 0; font-size: 9pt; color: #333; line-height: 1.3; }
.surat-title-block { text-align: center; margin: 14px 0 16px; }
.surat-title-block h4 {
  margin: 0; font-size: 12pt; font-weight: 800; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 4px; letter-spacing: 0.8px;
}
.surat-title-block .surat-no { font-size: 9.5pt; font-weight: 600; margin-top: 3px; }
.surat-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 10.5pt; }
.surat-table td { padding: 3px 5px; vertical-align: top; }
.surat-table td:first-child { width: 190px; }
.surat-table td:nth-child(2) { width: 15px; }
.surat-ttd-block {
  margin-top: 24px; display: flex; justify-content: flex-end; text-align: center;
}
.surat-ttd-box { width: 230px; position: relative; font-size: 10.5pt; }
.surat-stempel-img {
  position: absolute; width: 110px; height: 110px; opacity: 0.85; left: 10px; top: 25px; pointer-events: none;
}
.surat-ttd-img {
  width: 120px; height: 50px; object-fit: contain; margin: 2px auto; display: block;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0mm !important;
  }
  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .no-print, nav, aside, header, footer, button, .print\:hidden,
  .site-nav,
  .site-footer,
  .wa-float,
  .gate-card,
  .tabs-nav,
  .filter-bar,
  .sidebar,
  .topbar {
    display: none !important;
  }
  .a4-print-page {
    width: 210mm !important;
    height: 297mm !important;
    padding: 10mm 14mm !important; /* Padding khusus agar rapi di dalam kertas A4 */
    margin: 0 auto !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: always;
    page-break-inside: avoid;
    overflow: hidden;
  }
  .a4-print-page.surat-paper,
  .surat-paper {
    padding: 15mm 20mm !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Theme Customizer */
.theme-preset-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.theme-preset-card {
  border: 2px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: 0.15s; background: var(--card);
}
.theme-preset-card:hover { border-color: var(--em-500); transform: translateY(-2px); }
.theme-preset-card.active { border-color: var(--em-600); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2); }
.color-swatches { display: flex; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.1); }

