/* =====================================================================
   Sistem Informasi Desa Terintegrasi — gaya situs publik
   Tema: hijau agraris
   ===================================================================== */

:root {
  --primary: #16A34A;
  --primary-dark: #15803D;
  --primary-soft: #E7F6EC;
  --secondary: #065F46;
  --accent: #F59E0B;
  --ink: #0F2C1E;
  --ink-2: #2F4A3C;
  --muted: #64748B;
  --line: #E2EDE6;
  --bg: #F4FAF6;
  --surface: #FFFFFF;
  --ok: #16A34A;
  --warn: #F59E0B;
  --bad: #EF4444;
  --info: #0EA5E9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 44, 30, .07);
  --shadow-lg: 0 20px 55px rgba(15, 44, 30, .13);
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-size: 15.5px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
svg { width: 1.05em; height: 1.05em; flex: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 10px 16px; border-radius: 8px; z-index: 999; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 8px 20px rgba(22, 163, 74, .28); }
.btn-primary:hover { color: #fff; box-shadow: 0 12px 26px rgba(22, 163, 74, .36); }
.btn-accent { background: var(--accent); color: #4A2B00; }
.btn-accent:hover { color: #4A2B00; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary-dark); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.btn-sm { padding: 7px 14px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ---------------- Topbar & header ---------------- */
.topbar { background: var(--secondary); color: #D7EFE0; font-size: .82rem; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 38px; flex-wrap: wrap; }
.topbar a { color: #D7EFE0; }
.topbar a:hover { color: #fff; }
.topbar-info, .topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar-info span, .topbar-right span { display: inline-flex; align-items: center; gap: 6px; }
.topbar-cart { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-count { background: var(--accent); color: #4A2B00; border-radius: 999px; padding: 0 6px; font-weight: 700; font-size: .72rem; }
.clock-mini { font-variant-numeric: tabular-nums; }

.site-header {
  position: sticky; top: 0; z-index: 120;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand img { height: 46px; width: auto; }
.brand-initials {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
  font-weight: 800; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.06rem; }
.brand-text small { color: var(--muted); font-size: .76rem; }
.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-item > a {
  display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px;
  border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .9rem;
}
.nav-item > a:hover, .nav-item.is-active > a { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item .chev svg { width: .85em; height: .85em; transition: transform .2s; }
.nav-item.has-sub:hover .chev svg { transform: rotate(180deg); }
.sub {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; list-style: none; margin: 0; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease; z-index: 40;
}
.nav-item.has-sub:hover .sub, .nav-item.has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: translateY(0); }
.sub a { display: block; padding: 9px 12px; border-radius: 9px; font-size: .89rem; font-weight: 500; color: var(--ink-2); }
.sub a:hover, .sub li.is-active a { background: var(--primary-soft); color: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.burger { display: none; flex-direction: column; gap: 4px; width: 42px; height: 42px; align-items: center; justify-content: center; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.burger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-drawer-extra { display: none; }
.nav-scrim { position: fixed; inset: 0; background: rgba(9, 30, 20, .5); z-index: 90; }

/* ---------------- Main / sections ---------------- */
.site-main { min-height: 60vh; }
.section { padding: 62px 0; }
.section.tight { padding: 44px 0; }
.section.alt { background: #fff; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { margin: 0; position: relative; padding-bottom: 10px; }
.section-head h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 54px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 68ch; }
.link-more { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }

.page-hero {
  background: linear-gradient(135deg, var(--secondary), var(--primary) 130%);
  color: #fff; padding: 46px 0 42px;
}
.page-hero h1 { color: #fff; margin: 10px 0 6px; }
.page-hero p { color: #D8F1E0; margin: 0; max-width: 72ch; }
.crumbs { display: flex; gap: 8px; font-size: .84rem; color: #C7E8D5; flex-wrap: wrap; }
.crumbs a { color: #fff; }

/* ---------------- Hero beranda ---------------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(140deg, #0B3D28 0%, #14683E 45%, #1E9A55 100%); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.hero::before { width: 420px; height: 420px; background: #4ADE80; top: -140px; right: -80px; }
.hero::after { width: 360px; height: 360px; background: #FBBF24; bottom: -160px; left: -80px; opacity: .32; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 44px; align-items: center; padding: 66px 0 72px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28); padding: 7px 15px; border-radius: 999px; font-size: .82rem; margin-bottom: 18px;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 14px; }
.hero-lead { color: #DCF3E4; font-size: 1.02rem; max-width: 58ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.hero-stat { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; padding: 12px 14px; }
.hero-stat strong { display: block; font-size: 1.4rem; color: #fff; line-height: 1.1; }
.hero-stat span { font-size: .76rem; color: #CBEBD7; }
.hero-visual { position: relative; }
.hero-photo { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 4px solid rgba(255, 255, 255, .22); aspect-ratio: 4/3; background: rgba(255,255,255,.1); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-clock {
  position: absolute; bottom: -22px; left: 22px; right: 22px;
  background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: 16px; padding: 14px 18px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.hero-clock .hc-day { font-size: .82rem; color: var(--muted); }
.hero-clock .hc-time { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--secondary); }
.hero-clock .hc-tz { font-size: .78rem; color: var(--muted); }
.hero-clock > div { display: flex; flex-direction: column; line-height: 1.25; }

/* ---------------- Kartu umum ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 22px; }
.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-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 18px; }
.quick-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px;
  display: flex; flex-direction: column; gap: 10px; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s;
}
.quick-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow-lg); color: var(--ink); }
.quick-ic { width: 46px; height: 46px; border-radius: 13px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; }
.quick-ic svg { width: 22px; height: 22px; }
.quick-card strong { font-size: .98rem; }
.quick-card span { color: var(--muted); font-size: .82rem; }
.quick-card small { color: var(--primary-dark); font-weight: 600; font-size: .76rem; }

/* Kartu info (sambutan) */
.welcome-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: center; }
.welcome-photo { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/5; background: var(--primary-soft); }
.welcome-photo img { width: 100%; height: 100%; object-fit: cover; }
.quote { border-left: 4px solid var(--primary); padding-left: 18px; color: var(--ink-2); font-style: italic; }
.sign { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.sign strong { font-size: 1.05rem; }
.sign span { color: var(--muted); font-size: .85rem; }

/* Statistik angka */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; gap: 16px; align-items: center; }
.stat-card .sic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); }
.stat-card .sic svg { width: 24px; height: 24px; }
.stat-card strong { display: block; font-size: 1.55rem; line-height: 1.1; }
.stat-card span { color: var(--muted); font-size: .84rem; }

/* Berita */
.news-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s, box-shadow .2s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-thumb { aspect-ratio: 16/10; background: var(--primary-soft); overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-thumb img { transform: scale(1.05); }
.news-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.news-body h3 { font-size: 1.04rem; margin: 0; }
.news-body h3 a { color: var(--ink); }
.news-body h3 a:hover { color: var(--primary-dark); }
.news-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .79rem; }
.news-meta span { display: inline-flex; align-items: center; gap: 5px; }
.news-body p { color: var(--ink-2); font-size: .89rem; margin: 0; }
.news-body .link-more { margin-top: auto; font-size: .85rem; }

/* Artikel detail */
.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.article-body { color: var(--ink-2); }
.article-body p { margin: 0 0 1.1em; }
.article-cover { border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.side-list li { display: flex; gap: 12px; }
.side-list .sl-thumb { width: 74px; height: 60px; border-radius: 10px; overflow: hidden; background: var(--primary-soft); flex: none; }
.side-list .sl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-list a { font-size: .9rem; font-weight: 600; color: var(--ink); }
.side-list small { color: var(--muted); font-size: .76rem; }

/* Agenda */
.agenda-item { display: flex; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.agenda-date { width: 62px; flex: none; text-align: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); padding: 8px 0; }
.agenda-date strong { display: block; font-size: 1.4rem; line-height: 1; }
.agenda-date span { font-size: .74rem; }
.agenda-body { flex: 1; min-width: 0; }
.agenda-body h4 { margin: 0 0 4px; font-size: 1rem; }
.agenda-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.agenda-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* UMKM & produk */
.umkm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.umkm-head { display: flex; gap: 14px; padding: 18px; align-items: center; }
.umkm-logo { width: 58px; height: 58px; border-radius: 14px; overflow: hidden; background: var(--primary-soft); flex: none; display: grid; place-items: center; }
.umkm-logo img { width: 100%; height: 100%; object-fit: cover; }
.umkm-head h3 { margin: 0; font-size: 1rem; }
.umkm-head span { color: var(--muted); font-size: .8rem; display: block; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.product-thumb { aspect-ratio: 1/1; background: var(--primary-soft); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h4 { margin: 0; font-size: .96rem; }
.price { font-weight: 800; color: var(--secondary); font-size: 1.02rem; }
.price small { font-weight: 500; color: var(--muted); font-size: .74rem; }
.seller { color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 5px; }
.product-actions { display: flex; gap: 8px; margin-top: auto; }

/* Galeri */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gallery-card { border-radius: var(--radius); overflow: hidden; position: relative; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); cursor: zoom-in; }
.gallery-card .gc-photo { aspect-ratio: 4/3; background: var(--primary-soft); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery-card:hover img { transform: scale(1.06); }
.gallery-cap { padding: 12px 14px; }
.gallery-cap strong { font-size: .9rem; display: block; }
.gallery-cap span { color: var(--muted); font-size: .76rem; }

/* Musrenbang */
.proposal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.proposal-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.proposal-top h3 { margin: 0 0 6px; font-size: 1.04rem; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .79rem; }
.vote-box { text-align: center; min-width: 82px; border-radius: 12px; background: var(--primary-soft); padding: 10px; color: var(--primary-dark); }
.vote-box strong { display: block; font-size: 1.5rem; line-height: 1; }
.vote-box span { font-size: .72rem; }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--secondary); color: #fff; font-size: .8rem; font-weight: 700; }

/* Pembangunan / progress */
.prog { display: flex; flex-direction: column; gap: 7px; }
.prog-top { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-2); }
.prog-track { height: 10px; border-radius: 999px; background: #E7EFEA; overflow: hidden; }
.prog-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #4ADE80); transition: width .5s ease; }
.prog-fill.prog-ok { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.prog-fill.prog-warn { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.prog-fill.prog-low { background: linear-gradient(90deg, #EF4444, #FCA5A5); }
.program-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.program-card h3 { margin: 0; font-size: 1.02rem; }
.program-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: .84rem; }
.program-facts div { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.program-facts span { display: block; color: var(--muted); font-size: .74rem; }
.program-facts strong { color: var(--ink); }
.program-photos { display: flex; gap: 8px; overflow-x: auto; }
.program-photos img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }

/* Tabel */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: #F1F8F3; font-weight: 700; color: var(--secondary); white-space: nowrap; font-size: .82rem; letter-spacing: .01em; }
table.data tbody tr:hover { background: #FAFDFB; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: #F6FBF7; }

/* Badge, alert, empty */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: #DCFCE7; color: #15803D; }
.badge-warn { background: #FEF3C7; color: #92400E; }
.badge-bad { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #E0F2FE; color: #075985; }
.badge-muted { background: #EEF2F0; color: #475569; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chips { display: flex; gap: 9px; flex-wrap: wrap; }

.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: 14px; margin: 0 0 18px; font-size: .9rem; border: 1px solid; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert-info { background: #EFF9F2; border-color: #CDEBD8; color: #14532D; }
.alert-success { background: #EAFBF0; border-color: #BBF7D0; color: #14532D; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.flash-stack { position: sticky; top: 78px; z-index: 60; max-width: var(--maxw); margin: 14px auto 0; padding: 0 20px; }
.flash { display: flex; gap: 12px; padding: 13px 18px; border-radius: 14px; margin-bottom: 10px; font-size: .9rem; box-shadow: var(--shadow); border: 1px solid; }
.flash-ic svg { width: 20px; height: 20px; }
.flash-success { background: #ECFDF3; border-color: #A7F3D0; color: #14532D; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.flash-warning { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.flash-info { background: #EFF9F2; border-color: #CDEBD8; color: #14532D; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-ic { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 12px; }
.empty-ic svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 6px; color: var(--ink); }

.media-fallback { display: grid; place-items: center; gap: 6px; background: linear-gradient(135deg, var(--primary-soft), #F3FAF5); color: var(--primary-dark); min-height: 90px; width: 100%; height: 100%; }
.media-fallback svg { width: 26px; height: 26px; }
.media-fallback span { font-size: .76rem; padding: 0 10px; text-align: center; }

/* Formulir */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-weight: 600; font-size: .87rem; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: .78rem; }
.field .req { color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(22, 163, 74, .13); }
textarea { min-height: 110px; resize: vertical; }
select { color-scheme: light; }
option, optgroup { background: #fff; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; }
.checkbox input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 10px; }
.upload-box { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 14px; background: #FBFEFC; }
.file-link { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--primary-dark); }

/* Pencarian & filter */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 24px; }
.filter-bar .field { margin: 0; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search-input input { padding-left: 42px; }

/* Pager */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pager-item { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .86rem; color: var(--ink-2); }
.pager-item.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pager-item.is-disabled { opacity: .45; }

/* Grafik */
.chart { width: 100%; }
.chart-bar { display: flex; gap: 14px; align-items: flex-end; height: var(--ch-height, 240px); padding: 8px 4px 0; }
.cb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.cb-val { font-size: .74rem; font-weight: 700; color: var(--secondary); }
.cb-track { width: 100%; max-width: 62px; flex: 1; display: flex; align-items: flex-end; background: #F1F7F3; border-radius: 10px 10px 4px 4px; overflow: hidden; }
.cb-fill { display: block; width: 100%; border-radius: 10px 10px 4px 4px; }
.cb-label { font-size: .74rem; color: var(--muted); text-align: center; line-height: 1.2; }
.chart-donut { display: grid; grid-template-columns: minmax(160px, 210px) 1fr; gap: 26px; align-items: center; }
.donut-svg { width: 100%; height: auto; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-size: .87rem; }
.dot-c { width: 11px; height: 11px; border-radius: 3px; }
.dl-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.dl-pct { color: var(--muted); font-size: .8rem; min-width: 48px; text-align: right; }
.chart-line { background: #fff; }
.line-svg { width: 100%; height: auto; }
.chart-compare { display: flex; gap: 18px; align-items: flex-end; height: var(--ch-height, 260px); }
.cc-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.cc-bars { display: flex; gap: 6px; align-items: flex-end; flex: 1; width: 100%; justify-content: center; }
.cc-bar { width: 26px; display: block; border-radius: 8px 8px 3px 3px; position: relative; }
.cc-a { background: linear-gradient(180deg, #34D399, var(--primary)); }
.cc-b { background: linear-gradient(180deg, #FCD34D, var(--accent)); }
.cc-label { font-size: .73rem; color: var(--muted); text-align: center; line-height: 1.2; }
.cc-pct { font-size: .74rem; font-weight: 700; color: var(--secondary); }
.chart-legend { display: flex; gap: 18px; font-size: .82rem; color: var(--muted); margin-top: 12px; justify-content: center; }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; }

/* Kartu angka keuangan */
.fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.fin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-left: 5px solid var(--primary); }
.fin-card span { color: var(--muted); font-size: .82rem; display: block; }
.fin-card strong { font-size: 1.34rem; display: block; margin-top: 4px; }
.fin-card small { color: var(--muted); font-size: .76rem; }
.fin-card.is-accent { border-left-color: var(--accent); }
.fin-card.is-bad { border-left-color: var(--bad); }
.fin-card.is-info { border-left-color: var(--info); }

/* Timeline struktur */
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 0; }
.org-level { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; position: relative; padding-top: 26px; }
.org-level::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 26px; background: var(--line); }
.org-node { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-align: center; box-shadow: var(--shadow); min-width: 190px; }
.org-node.is-root { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-color: transparent; }
.org-node.is-root .org-role, .org-node.is-root .org-nip { color: #D5F1DF; }
.org-photo { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 10px; overflow: hidden; background: var(--primary-soft); display: grid; place-items: center; }
.org-photo img { width: 100%; height: 100%; object-fit: cover; }
.org-name { font-weight: 700; font-size: .95rem; }
.org-role { color: var(--primary-dark); font-size: .8rem; font-weight: 600; }
.org-nip { color: var(--muted); font-size: .74rem; }
.org-connector { width: 2px; height: 22px; background: var(--line); }

/* Tabel keuangan & kartu */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* Footer */
.site-footer { background: #0B2A1B; color: #C7E4D2; margin-top: 70px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding: 54px 20px 40px; }
.foot-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.foot-brand strong { color: #fff; font-size: 1.05rem; }
.foot-col h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.foot-col p { font-size: .86rem; line-height: 1.7; }
.foot-list, .foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .86rem; }
.foot-list li { display: flex; gap: 9px; align-items: flex-start; }
.foot-links a, .foot-list a, .site-footer a { color: #C7E4D2; }
.foot-links a:hover, .site-footer a:hover { color: #fff; }
.foot-social { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.foot-social a { background: rgba(255, 255, 255, .1); padding: 5px 12px; border-radius: 999px; font-size: .78rem; }
.foot-clock .clock-box { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.foot-clock .clock-time { font-size: 1.6rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.foot-clock .clock-day { font-size: .8rem; color: #A9D9BC; }
.foot-clock .clock-tz { font-size: .74rem; color: #8CC7A5; }
.foot-note { font-size: .78rem; margin-top: 10px; color: #9BC9AE; }
.foot-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 0; font-size: .82rem; }
.foot-bottom-in { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.foot-meta { display: flex; gap: 10px; align-items: center; }
.dot { opacity: .5; }
.build-id { opacity: .65; font-size: .74rem; }

/* Tombol WhatsApp mengambang */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  width: 54px; height: 54px; border-radius: 50%; background: #25D366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 12px 28px rgba(37, 211, 102, .42);
}
.wa-float svg { width: 28px; height: 28px; }
.wa-float:hover { color: #fff; transform: translateY(-2px); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(6, 20, 14, .9); z-index: 200; display: grid; place-items: center; padding: 24px; }
.lb-body img { max-width: 92vw; max-height: 84vh; border-radius: 12px; }
.lb-close { position: absolute; top: 18px; right: 24px; background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.8rem; cursor: pointer; line-height: 1; }
[hidden] { display: none !important; }

/* Reveal animasi */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Keranjang */
.cart-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { width: 78px; height: 68px; border-radius: 10px; overflow: hidden; background: var(--primary-soft); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 32px; height: 32px; background: #fff; border: 0; cursor: pointer; font-size: 1.05rem; color: var(--ink); }
.qty input { width: 52px; border: 0; text-align: center; padding: 6px 0; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .9rem; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.05rem; }

/* Tab */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1.5px solid var(--line); margin-bottom: 22px; }
.tab { padding: 10px 18px; border-radius: 10px 10px 0 0; font-weight: 600; color: var(--muted); font-size: .9rem; }
.tab.is-active { background: #fff; color: var(--primary-dark); border: 1.5px solid var(--line); border-bottom-color: #fff; margin-bottom: -1.5px; }

/* Modal / popup formulir */
.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; background: rgba(9, 30, 20, .55); overflow-y: auto; }
.modal-card {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: calc(100vh - 40px); animation: modalIn .18s ease;
}
.modal-card.is-wide { max-width: 780px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line);
  padding: 18px 22px 14px; border-radius: 18px 18px 0 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.modal-head h3 { margin: 0; font-size: 1.06rem; display: flex; align-items: center; gap: 9px; }
.modal-head h3 svg { width: 20px; height: 20px; color: var(--primary-dark); }
.modal-body { padding: 20px 22px 22px; overflow-y: auto; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
body.modal-open { overflow: hidden; }
@media (max-width: 560px) {
  .modal { padding: 10px; align-items: flex-start; }
  .modal-card { max-height: calc(100vh - 20px); }
  .modal-head { padding: 14px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}
@media print { .modal { display: none !important; } }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #0B2A1B; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .88rem; box-shadow: var(--shadow-lg); }

/* Timeline riwayat */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-soft); }
.tl-item h5 { margin: 0 0 3px; font-size: .95rem; }
.tl-item span { color: var(--muted); font-size: .78rem; }

/* Utilitas */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 10px; } .mt2 { margin-top: 20px; } .mt3 { margin-top: 30px; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 10px; } .mb2 { margin-bottom: 20px; } .mb3 { margin-bottom: 30px; }
.flex { display: flex; } .between { justify-content: space-between; } .gap { gap: 12px; } .wrapflex { flex-wrap: wrap; }
.items-center { align-items: center; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 22px; }
.panel h3 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.sticky-side { position: sticky; top: 92px; }

/* ---------------- Responsif ---------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-visual { order: -1; }
  .welcome-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: 1fr; }
  .chart-donut { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 860px) {
  .site-header { backdrop-filter: none; }
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); margin: 0;
    background: #FFFFFF; z-index: 130; padding: 18px; overflow-y: auto;
    transform: translateX(102%); transition: transform .28s ease; box-shadow: -14px 0 40px rgba(9, 30, 20, .22);
    display: flex; flex-direction: column;
  }
  body.nav-open .nav { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-item > a { justify-content: space-between; padding: 13px 14px; border-radius: 12px; font-size: .96rem; }
  .sub {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-left: 2.5px solid var(--primary-soft); border-radius: 0; padding: 0 0 0 12px;
    margin: 2px 0 6px 12px; max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .nav-item.open .sub { max-height: 520px; }
  .nav-item.open .chev svg { transform: rotate(180deg); }
  .nav-drawer-extra { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .header-actions .btn-light { display: none; }
  .burger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 44px 0; }
  .topbar-info .hide-sm { display: none; }
  .hide-sm { display: none; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .chart-bar { gap: 8px; }
  .cb-val { font-size: .66rem; }
  .topbar-user { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .hero-grid { padding: 40px 0 48px; }
  .hero-clock { position: static; margin-top: 16px; left: auto; right: auto; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .quick-card { padding: 16px 14px; }
  .stat-cards { grid-template-columns: 1fr; }
  .fin-cards { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .chart-compare { gap: 8px; }
  .cc-bar { width: 15px; }
  .article { padding: 20px; }
  .panel { padding: 18px; }
  .program-facts { grid-template-columns: 1fr; }
  .donut-legend li { grid-template-columns: 12px 1fr auto; }
  .dl-pct { display: none; }
}

@media print {
  .site-header, .topbar, .site-footer, .wa-float, .flash-stack, .nav-scrim, .header-actions, .pager { display: none !important; }
  body { background: #fff; }
  .panel, .card, .article { box-shadow: none; border-color: #ddd; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------ *
 * Halaman detail progres pembangunan (/musrenbang/program/<id>)
 * Tahapan yang BELUM tercapai tampil redup; blok ini sengaja ditaruh di
 * akhir berkas supaya tidak mengganggu aturan lain.
 * ------------------------------------------------------------------ */
.tl-item.is-off::before { background: #CBD5E1; box-shadow: none; }
.tl-item.is-off h5 { color: var(--muted); font-weight: 600; }
.program-card .program-more { font-size: .85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.program-card .program-more svg { width: 15px; height: 15px; }
