/* ============================================================
   VibeCoder theme — Pangkalan Data RT
   Palette: indigo #4F46E5 → violet #8B5CF6, ink #1F1B3A
   ============================================================ */
:root {
  --indigo: #4F46E5;
  --violet: #8B5CF6;
  --sky: #0EA5E9;
  --teal: #14B8A6;
  --pink: #EC4899;
  --ink: #1F1B3A;
  --muted: #635F82;
  --line: rgba(79, 70, 229, .14);
  --bg: #F3F0FF;
  --card: rgba(255, 255, 255, .62);
  --card-solid: rgba(255, 255, 255, .86);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -20px rgba(31, 27, 58, .28), 0 4px 14px -8px rgba(31, 27, 58, .12);
  --shadow-sm: 0 8px 24px -14px rgba(31, 27, 58, .35);
  --font: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.req { color: #DC2626; }

/* ---------- Latar dekoratif ---------- */
.bg-blobs { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.bg-blobs .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.bg-blobs .b1 { width: 620px; height: 620px; background: #C7D2FE; top: -220px; left: -160px; }
.bg-blobs .b2 { width: 520px; height: 520px; background: #FBCFE8; bottom: -200px; right: -120px; }
.bg-blobs .b3 { width: 460px; height: 460px; background: #BAE6FD; top: 32%; right: 22%; opacity: .38; }

/* ---------- Struktur umum ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 22px; }

.card {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 0 0 26px;
}
.card-head { margin-bottom: 16px; }
.card-head h2 { margin: 0 0 2px; }
.card-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--violet); margin: 0 0 14px; }

.grid { display: grid; gap: 22px; margin-bottom: 26px; }
.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)); }
.grid > .card { margin-bottom: 0; }
/* Item grid/flex boleh menyusut di bawah lebar kontennya, agar tabel lebar
   di dalam kartu bisa discroll di .table-wrap dan tidak mendorong layout. */
.grid > *, .hero > *, .grid-form > * { min-width: 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: rgba(255, 255, 255, .8); color: var(--ink); text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 12px 26px -14px rgba(79, 70, 229, .9); }
.btn-primary:hover { box-shadow: 0 16px 30px -14px rgba(79, 70, 229, .95); }
.btn-ghost { background: rgba(255, 255, 255, .6); border-color: var(--line); color: var(--indigo); }
.btn-danger { background: #DC2626; color: #fff; }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .75);
  color: var(--ink); cursor: pointer; font-size: 13px; text-decoration: none;
}
.btn-ic:hover { background: #fff; text-decoration: none; }
.btn-ic.danger:hover { background: #FEE2E2; border-color: #FCA5A5; }

/* ---------- Alert / badge ---------- */
.alert { padding: 12px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid; font-size: 14px; }
.alert-sukses { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert-info { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-indigo { background: #EEF2FF; color: #4338CA; }
.badge-hijau { background: #ECFDF5; color: #047857; }
.badge-kuning { background: #FFFBEB; color: #B45309; }
.badge-merah { background: #FEF2F2; color: #B91C1C; }
.badge-abu { background: #F1F5F9; color: #475569; }

/* ---------- Topbar publik ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .72); backdrop-filter: blur(18px) saturate(180%); border-bottom: 1px solid rgba(255, 255, 255, .8); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 24px; line-height: 1; }
.brand-txt { display: flex; flex-direction: column; }
.brand-txt strong { font-size: 15px; }
.brand-txt small { color: var(--muted); font-size: 11.5px; }
.nav-publik { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav-publik a { padding: 8px 13px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; }
.nav-publik a:hover { background: rgba(79, 70, 229, .08); color: var(--indigo); text-decoration: none; }
.nav-publik a.aktif { background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(139, 92, 246, .16)); color: var(--indigo); font-weight: 600; }
.topbar-act { display: flex; gap: 8px; align-items: center; }
main.wrap { padding-top: 30px; padding-bottom: 40px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; align-items: center; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(238, 242, 255, .7)); }
.pill { display: inline-block; padding: 5px 13px; border-radius: 999px; background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .04em; margin-bottom: 14px; }
.hero h1 { font-size: 34px; letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: 15px; }
.hero-visi { font-size: 14px; color: var(--ink); background: rgba(255, 255, 255, .7); border-left: 3px solid var(--violet); padding: 12px 16px; border-radius: 0 12px 12px 0; }
.hero-act { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ring-stat { background: rgba(255, 255, 255, .82); border: 1px solid rgba(255, 255, 255, .9); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--c, var(--indigo)); }
.rs-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.rs-nilai { font-size: 26px; font-weight: 700; color: var(--c, var(--indigo)); margin: 4px 0 2px; letter-spacing: -.02em; }
.rs-sub { font-size: 12px; color: var(--muted); }

/* ---------- Stat kotak ---------- */
.stat { background: var(--card); backdrop-filter: blur(18px) saturate(180%); border: 1px solid rgba(255, 255, 255, .75); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-ikon { font-size: 20px; }
.stat-nilai { font-size: 25px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.02em; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat-indigo { border-left: 4px solid var(--indigo); }
.stat-ungu { border-left: 4px solid var(--violet); }
.stat-biru { border-left: 4px solid var(--sky); }
.stat-pink { border-left: 4px solid var(--pink); }
.stat-teal { border-left: 4px solid var(--teal); }
.stat-hijau { border-left: 4px solid #22C55E; }
.stat-merah { border-left: 4px solid #EF4444; }

/* ---------- Donut & bars ---------- */
.donut-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut { width: var(--sz, 190px); height: var(--sz, 190px); border-radius: 50%; position: relative; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.donut-hole { position: absolute; inset: 22%; border-radius: 50%; background: rgba(255, 255, 255, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 16px -8px rgba(31, 27, 58, .4); }
.donut-hole span { font-size: 20px; font-weight: 700; }
.donut-hole small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1 1 190px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.legend .lg-label { flex: 1; color: var(--ink); }
.legend .lg-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .lg-pct { color: var(--muted); width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

.bars { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.bars li { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr 64px; gap: 12px; align-items: center; font-size: 13px; }
.bar-label { color: var(--ink); }
.bar-track { display: block; height: 11px; border-radius: 999px; background: rgba(79, 70, 229, .1); overflow: hidden; position: relative; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-indigo { background: linear-gradient(90deg, var(--indigo), var(--violet)); }
.bar-ungu { background: linear-gradient(90deg, var(--violet), var(--pink)); }
.bar-teal { background: linear-gradient(90deg, var(--teal), var(--sky)); }
.bar-biru { background: linear-gradient(90deg, var(--sky), var(--indigo)); }
.bar-pink { background: linear-gradient(90deg, var(--pink), var(--violet)); }
.bar-hijau { background: linear-gradient(90deg, #22C55E, var(--teal)); }
.bar-merah { background: linear-gradient(90deg, #EF4444, var(--pink)); }
.bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sub-judul { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.tabel { width: 100%; border-collapse: separate; border-spacing: 0; background: rgba(255, 255, 255, .72); border-radius: var(--radius-sm); overflow: hidden; font-size: 13.5px; }
.tabel th, .tabel td { padding: 11px 13px; text-align: left; border-bottom: 1px solid rgba(79, 70, 229, .09); vertical-align: middle; }
.tabel th { background: rgba(79, 70, 229, .08); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--indigo); font-weight: 700; white-space: nowrap; }
.tabel tbody tr:hover td { background: rgba(255, 255, 255, .8); }
.tabel td.kosong, .tabel td[colspan] .kosong { text-align: center; color: var(--muted); }
.tabel .kosong { text-align: center; color: var(--muted); }
.tabel tr.sub td { background: rgba(139, 92, 246, .1); font-weight: 700; }
.tabel.tabel-ringkas td[rowspan] { font-weight: 600; background: rgba(79, 70, 229, .05); vertical-align: top; }
.th-act, .td-act { width: 1%; white-space: nowrap; text-align: right; }
.td-act { display: flex; gap: 6px; justify-content: flex-end; }
.inline { display: inline; }

/* ---------- Ringkasan kecil ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.mini-stats div { background: rgba(255, 255, 255, .75); border: 1px solid rgba(255, 255, 255, .9); border-radius: 14px; padding: 12px 14px; }
.mini-stats strong { display: block; font-size: 17px; }
.mini-stats small { color: var(--muted); font-size: 11.5px; }
.angka-besar { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.angka-besar small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ---------- List proyek & feed ---------- */
.list-proyek { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lp-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.feed { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.feed li { border-left: 3px solid var(--violet); padding-left: 14px; }
.feed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.feed-tgl { font-size: 12px; color: var(--muted); font-weight: 600; }
.feed p { margin: 3px 0 0; font-size: 13.5px; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(79, 70, 229, .1), rgba(139, 92, 246, .14)); }
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; }

/* ---------- Footer ---------- */
.footer { margin-top: 30px; padding: 34px 0 26px; background: rgba(255, 255, 255, .6); border-top: 1px solid rgba(255, 255, 255, .9); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-grid strong { display: block; margin-bottom: 6px; }
.footer-grid p { font-size: 13px; margin: 0; }
.copyright { text-align: center; font-size: 12.5px; color: var(--muted); margin: 24px 0 0; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin .shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: rgba(255, 255, 255, .78); backdrop-filter: blur(20px) saturate(180%); border-right: 1px solid rgba(255, 255, 255, .9); padding: 20px 14px; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-brand strong { display: block; font-size: 15px; }
.side-brand small { color: var(--muted); font-size: 11.5px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-titel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--violet); font-weight: 700; margin: 16px 8px 6px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; color: var(--ink); font-size: 14px; font-weight: 500; }
.side-item:hover { background: rgba(79, 70, 229, .08); text-decoration: none; }
.side-item.aktif { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 10px 22px -14px rgba(79, 70, 229, .9); }
.si-icon { width: 20px; text-align: center; }
.side-toggle { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.admin-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 26px; background: rgba(255, 255, 255, .7); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255, 255, 255, .9); position: sticky; top: 0; z-index: 30; }
.admin-top .pt { font-size: 19px; margin: 0; flex: 1 1 200px; min-width: 0; }
.admin-top-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.uc-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.uc-txt strong, .uc-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-txt strong { font-size: 13px; }
.uc-txt small { color: var(--muted); font-size: 11px; }
.content { padding: 26px; flex: 1; }
.admin-foot { padding: 16px 26px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.btn-menu { display: none; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; }

/* Toolbar daftar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0; }
.toolbar .spacer { flex: 1; }

/* ---------- Form ---------- */
.form-grup { margin-bottom: 22px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-form .col-span { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld label { font-size: 13px; font-weight: 600; color: var(--ink); }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=time], input[type=email], input[type=file], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 11px; border: 1px solid rgba(79, 70, 229, .22);
  background: rgba(255, 255, 255, .9); font: inherit; font-size: 14px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(79, 70, 229, .35); outline-offset: 1px; border-color: var(--indigo); }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 11.5px; }
.input-uang { display: flex; align-items: center; gap: 8px; }
.input-uang span { font-size: 13px; color: var(--muted); font-weight: 600; }
.form-act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 30px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .slider { width: 42px; height: 24px; border-radius: 999px; background: #D8D6E8; position: relative; transition: background .18s; flex: 0 0 auto; }
.switch .slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--indigo), var(--violet)); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.sw-txt { font-size: 13px; color: var(--muted); }

/* Detail */
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 26px; margin: 0; }
.detail-list dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 2px 0 0; font-size: 14.5px; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a { padding: 9px 15px; border-radius: 11px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.tabs a:hover { text-decoration: none; background: #fff; }
.tabs a.aktif { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; }

/* Pager */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pager .pg { padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.pager .pg:hover { text-decoration: none; background: #fff; }
.pager .pg.aktif { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; font-weight: 700; }
.pager .pg.off { opacity: .45; pointer-events: none; }
.pager .pg.sep { border: 0; background: none; color: var(--muted); }
.pg-info { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.login-card { width: 100%; max-width: 430px; }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .brand-logo { font-size: 38px; display: block; margin-bottom: 8px; }
.login-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.login-demo { background: rgba(255, 255, 255, .75); border: 1px dashed rgba(79, 70, 229, .35); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.login-demo code { background: #EEF2FF; padding: 1px 5px; border-radius: 5px; color: #4338CA; }

/* Kartu login publik */
.kartu-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.ki-item { background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.ki-item h3 { margin: 0 0 6px; font-size: 14.5px; }
.ki-item p { margin: 0; font-size: 13px; color: var(--muted); }

/* Matriks hak akses */
.matriks { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: rgba(255, 255, 255, .75); border-radius: var(--radius-sm); overflow: hidden; }
.matriks th, .matriks td { padding: 9px 12px; border-bottom: 1px solid rgba(79, 70, 229, .09); text-align: center; }
.matriks th:first-child, .matriks td:first-child { text-align: left; white-space: nowrap; }
.matriks th { background: rgba(79, 70, 229, .08); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--indigo); }
.matriks tr.grup td { background: rgba(139, 92, 246, .09); font-weight: 700; text-align: left; }
.matriks input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--indigo); }

/* Import */
.step { display: flex; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.step span { padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .75); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-weight: 600; }
.step span.on { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; }
.map-table select { min-width: 190px; }
.preview-scroll { max-height: 420px; overflow: auto; }

/* Cetak */
.cetak-head { display: none; }
@media print {
  .topbar, .sidebar, .admin-top, .admin-foot, .no-print, .pager, .tabs, .footer { display: none !important; }
  .bg-blobs { display: none; }
  body { background: #fff; font-size: 12px; }
  .admin .shell { display: block; }
  .card { box-shadow: none; border: 1px solid #ddd; background: #fff; break-inside: avoid; padding: 14px; margin-bottom: 14px; }
  .cetak-head { display: block; text-align: center; margin-bottom: 18px; }
  .cetak-head h1 { font-size: 18px; margin-bottom: 2px; }
  .cetak-head p { margin: 0; font-size: 12px; }
  .tabel { font-size: 11px; }
  .tabel th, .tabel td { padding: 5px 7px; }
  @page { margin: 12mm; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .side-toggle { display: block; margin-bottom: 10px; }
  .btn-menu { display: inline-flex; }
  .nav-publik { order: 3; width: 100%; margin: 0; }
  .topbar-in { flex-wrap: wrap; padding-bottom: 8px; }
}
@media (max-width: 720px) {
  /* minmax(0,1fr) dipakai supaya kolom bisa menyusut — dengan `1fr` biasa,
     tabel lebar di dalam kartu memaksa kolom melebihi layar (overflow horizontal). */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .detail-list { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 26px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
  .content { padding: 18px; }
  .bars li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bar-val { text-align: left; }
  .wrap { padding: 0 16px; }
  /* Topbar admin: judul turun ke baris sendiri, nama pengguna dipotong
     bila panjang supaya tidak ada overflow horizontal di layar kecil. */
  .admin-top { padding: 12px 16px; gap: 10px; }
  .admin-top .pt { order: 3; flex: 1 1 100%; font-size: 18px; }
  .admin-top-act { flex: 1 1 auto; justify-content: flex-end; }
  .uc-txt strong, .uc-txt small { max-width: 110px; }
  .admin-foot { padding: 14px 16px; }
  .surat-lembar { padding: 22px 18px; }
  .surat-isi td:first-child { width: 130px; }
  .surat { font-size: 13px; }
}

/* ---------- Lembar form cetak (format buku Dasa Wisma / PKK) ---------- */
.lembar .cetak-head { display: block; text-align: center; margin-bottom: 16px; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.lembar .cetak-head h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: .02em; }
.lembar .cetak-head p { margin: 0; font-size: 13px; color: var(--muted); }
.form-lembar td { vertical-align: top; overflow-wrap: anywhere; }
.form-lembar .pil { margin-right: 12px; }
.form-lembar .f-no { width: 34px; color: var(--muted); font-weight: 600; }
.form-lembar .f-lbl { width: 32%; font-weight: 600; }
.form-lembar .f-sep { width: 12px; color: var(--muted); }
.form-lembar .f-isi { font-variant-numeric: tabular-nums; }
.pil { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; white-space: nowrap; }
.pil .tanda { display: inline-block; width: 15px; height: 15px; border: 1px solid var(--muted); border-radius: 3px; text-align: center; line-height: 14px; font-size: 11px; font-weight: 700; color: transparent; }
.pil.on { font-weight: 700; }
.pil.on .tanda { color: #fff; background: linear-gradient(135deg, var(--indigo), var(--violet)); border-color: transparent; }
.wilayah { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .55); }
.wilayah > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.wilayah span { color: var(--muted); }
.ttd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; text-align: center; font-size: 13.5px; }
.ttd p { margin: 0 0 6px; color: var(--muted); }
.ttd-nama { margin-top: 54px !important; font-weight: 700; color: var(--ink) !important; border-top: 1px dashed var(--line); padding-top: 6px; }
.tabel-rekap { font-size: 12px; }
.tabel-rekap th, .tabel-rekap td { padding: 6px 7px; white-space: nowrap; }
.tabel-rekap thead th { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.tabel-rekap td.num { text-align: right; }
.tabel-rekap thead tr:first-child th[rowspan] { vertical-align: middle; }

@media print {
  .lembar .cetak-head { border-bottom: 2px solid #333; }
  .pil .tanda { border-color: #333; }
  .pil.on .tanda { background: #333; }
  .wilayah { background: #fff; }
  .form-lembar .f-lbl { width: 30%; }
  .ttd { break-inside: avoid; }
}

/* ---------- Surat Pengantar (satu halaman A4) ---------- */
.surat-lembar { max-width: 820px; margin: 18px auto 30px; padding: 34px 40px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); color: #111; }
.surat { font-family: "Times New Roman", Cambria, Georgia, serif; font-size: 14.5px; line-height: 1.55; color: #111; }
.surat-kop { text-align: center; border-bottom: 3px double #333; padding-bottom: 8px; margin-bottom: 16px; }
.surat-kop strong { display: block; font-size: 16px; letter-spacing: .03em; }
.surat-kop strong:nth-child(2) { font-size: 15px; }
.surat-kop strong:nth-child(3) { font-size: 15px; }
.surat-kop span { display: block; font-size: 12px; margin-top: 4px; font-family: var(--font); }
.surat-judul { text-align: center; margin: 18px 0 20px; }
.surat-judul h1 { font-size: 20px; letter-spacing: .12em; text-decoration: underline; margin: 0 0 4px; }
.surat-judul p { margin: 0; font-size: 14.5px; }
.surat-para { margin: 0 0 14px; }
.surat-isi { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.surat-isi td { padding: 3px 0; vertical-align: top; font-size: 14.5px; }
.surat-isi td:first-child { width: 190px; }
.surat-isi td:nth-child(2) { width: 12px; }
.surat-ttd { margin-top: 26px; }
.surat-tanggal { text-align: right; margin-bottom: 10px; }
.surat-mengetahui { text-align: right; margin-bottom: 6px; }
.surat-kolom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: center; }
.surat-jabatan { margin: 0 0 62px; }
.surat-nama { margin: 0; font-weight: 700; text-decoration: underline; }
@media print {
  .surat-lembar { max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .surat { font-size: 12.5pt; line-height: 1.45; }
  .surat-isi, .surat-ttd { break-inside: avoid; }
  .surat-jabatan { margin-bottom: 52px; }
}
