/* =============================================================
   Panel pengelola TPU Kampung Yuwanain
   ============================================================= */

:root {
  --forest-950: #05201A;
  --forest-900: #0A2E21;
  --forest-800: #0E3D2C;
  --forest-700: #145238;
  --forest-600: #1B6A48;
  --leaf: #4FA96A;
  --leaf-soft: #DCEEDC;
  --blue: #2A6FB0;
  --sun: #E9B44C;
  --sun-soft: #FBF1DA;
  --bg: #F2F5EF;
  --paper: #FFFFFF;
  --ink: #12241C;
  --muted: #5E7369;
  --line: #E1E9DF;
  --danger: #B33A2B;
  --shadow: 0 16px 34px -26px rgba(10, 46, 33, .55);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--forest-700); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }

/* ---------- Login ---------- */
.a-login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 18px;
  background:
    radial-gradient(800px 400px at 88% -10%, rgba(79, 169, 106, .28), transparent 60%),
    linear-gradient(150deg, var(--forest-900), var(--forest-700));
}
.a-login {
  width: 100%; max-width: 420px; background: var(--paper); border-radius: 22px;
  padding: 30px 28px 24px; box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .6);
}
.a-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.a-login-brand strong { display: block; font-family: var(--font-display); font-size: 17px; }
.a-login-brand small { color: var(--muted); font-size: 12px; }
.a-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--forest-600), var(--forest-900)); color: var(--sun); flex: 0 0 auto;
}
.a-login h1 { font-family: var(--font-display); font-size: 25px; margin-bottom: 6px; }
.a-login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.a-login-foot { margin-top: 18px; font-size: 13px; text-align: center; }

/* ---------- Kerangka ---------- */
.a-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.a-side {
  background: var(--forest-950); color: #C9DFD0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px;
}
.a-side-head { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.a-side-head strong { display: block; color: #fff; font-size: 13.5px; font-weight: 600; }
.a-side-head small { color: #8CAE99; font-size: 11.5px; }
.a-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.a-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  color: #BBD3C4; font-size: 13.5px; font-weight: 500;
}
.a-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-nav a.on { background: var(--forest-600); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.a-nav a b { margin-left: auto; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.a-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.a-side-foot a, .a-linkbtn {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  color: #BBD3C4; font-size: 13px; background: none; border: 0; font-family: var(--font-body);
  cursor: pointer; width: 100%; text-align: left;
}
.a-side-foot a:hover, .a-linkbtn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-side-foot form { margin: 0; }

.a-main { min-width: 0; display: flex; flex-direction: column; }
.a-top {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 14px 24px;
}
.a-burger { display: none; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px; cursor: pointer; color: var(--ink); }
.a-top-title h1 { font-family: var(--font-display); font-size: 21px; }
.a-top-title p { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.a-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.a-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--leaf-soft);
  color: var(--forest-700); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
}
.a-content { padding: 22px 24px 46px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Tombol, alert ---------- */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; transition: background .15s ease, box-shadow .15s ease;
}
.a-btn-primary { background: linear-gradient(135deg, var(--forest-600), var(--forest-800)); color: #fff; box-shadow: var(--shadow); }
.a-btn-primary:hover { color: #fff; background: linear-gradient(135deg, var(--forest-600), var(--forest-900)); }
.a-btn-ghost { background: var(--paper); border-color: var(--line); color: var(--forest-800); }
.a-btn-ghost:hover { background: var(--leaf-soft); color: var(--forest-800); }
.a-btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.a-btn-full { width: 100%; }
.a-btn[disabled] { opacity: .55; cursor: not-allowed; }
.a-alert { padding: 12px 15px; border-radius: 11px; font-size: 13.5px; border: 1px solid; }
.a-alert.ok { background: #EAF7EC; border-color: #BFE3C6; color: #17603A; }
.a-alert.err { background: #FCEDEC; border-color: #F2C6C2; color: #8B2B22; }

/* ---------- KPI & kartu ---------- */
.a-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.a-kpi {
  display: flex; align-items: center; gap: 13px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 15px; padding: 16px 18px; box-shadow: var(--shadow); border-left: 4px solid var(--forest-600);
}
.a-kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--leaf-soft); color: var(--forest-700); flex: 0 0 auto; }
.a-kpi small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.a-kpi strong { font-family: var(--font-display); font-size: 25px; line-height: 1.1; }
.a-kpi.k-islam { border-left-color: #1F8A4C; }
.a-kpi.k-kristen { border-left-color: var(--blue); }
.a-kpi.k-kristen .a-kpi-ico { background: #E4EEF9; color: var(--blue); }
.a-kpi.k-warn { border-left-color: var(--sun); }
.a-kpi.k-warn .a-kpi-ico { background: var(--sun-soft); color: #9A6E12; }

.a-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.a-stack { display: flex; flex-direction: column; gap: 16px; }
.a-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.a-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.a-card-head-wrap { flex-wrap: wrap; align-items: flex-start; }
.a-card-head h2 { font-family: var(--font-display); font-size: 17.5px; display: flex; align-items: center; gap: 8px; }
.a-card-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 64ch; }
.a-count { background: var(--leaf-soft); color: var(--forest-700); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-family: var(--font-body); }
.a-mini-link { font-size: 12.5px; font-weight: 600; }
.a-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-empty { color: var(--muted); font-size: 13.5px; padding: 10px 0; }

/* bar */
.a-bars { display: flex; flex-direction: column; gap: 11px; }
.a-bar-row { display: grid; grid-template-columns: 172px minmax(0, 1fr) 62px; align-items: center; gap: 10px; font-size: 13px; }
.a-bar-label { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.a-bar-label .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.a-bar-track { height: 9px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.a-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--forest-600); min-width: 4px; }
.a-bar-row b { text-align: right; font-size: 12.5px; }

.a-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #7A621F; background: var(--sun-soft); border: 1px solid #F0E0B6; border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.a-hint .ico { margin-top: 1px; }
.a-hint-block { margin: 0 0 16px; }
.a-hint-block code { background: rgba(255, 255, 255, .6); }
.a-pre { margin: 8px 0 0; padding: 10px 12px; background: rgba(255, 255, 255, .7); border-radius: 8px; font-size: 11.5px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.a-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.a-quick-btn {
  display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); background: var(--bg);
}
.a-quick-btn:hover { background: var(--leaf-soft); color: var(--forest-900); }
.a-quick-btn .ico { color: var(--forest-600); }
.a-quick-btn span { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; }
.a-quick-btn small { font-weight: 400; font-size: 11.5px; color: var(--muted); }

.a-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; max-height: 300px; overflow: auto; }
.a-log li { display: flex; gap: 10px; font-size: 12.5px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.a-log li:last-child { border-bottom: 0; padding-bottom: 0; }
.a-log-time { color: var(--muted); flex: 0 0 92px; font-variant-numeric: tabular-nums; }
.a-log-body { min-width: 0; }
.a-note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.a-note-list li { display: flex; gap: 8px; align-items: flex-start; }
.a-note-list .ico { color: var(--forest-500, #218459); margin-top: 2px; }

/* ---------- Peta ---------- */
.a-map { height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #DDE7DB; z-index: 1; }
.a-map-besar { height: 470px; }
.a-map-pick { height: 250px; }
.a-map-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.a-titik-info {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  background: var(--leaf-soft); border: 1px solid #C7E0C5; border-radius: 11px; padding: 11px 14px;
  margin-top: 12px; font-size: 13px; color: #17402A;
}
.a-titik-info > span { display: inline-flex; align-items: center; gap: 7px; }
.a-batas-form { margin-top: 16px; }

/* ---------- Tabel ---------- */
.a-filter { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.a-filter input[type="search"], .a-filter select {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; font-family: var(--font-body);
  font-size: 13px; background: var(--paper); color: var(--ink);
}
.a-filter input[type="search"] { min-width: 190px; }
.a-tbl-wrap { overflow-x: auto; border-radius: 12px; }
.a-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.a-tbl th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.a-tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a-tbl tr:last-child td { border-bottom: 0; }
.a-tbl tr:hover td { background: #FAFCF8; }
.a-makam { display: flex; align-items: center; gap: 10px; }
.a-makam b { display: block; font-size: 13.5px; }
.a-makam small { color: var(--muted); font-size: 11.5px; }
.a-thumb {
  width: 38px; height: 38px; border-radius: 9px; background: var(--leaf-soft); color: var(--forest-700);
  display: grid; place-items: center; overflow: hidden; flex: 0 0 auto;
}
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-coord { font-size: 11.5px; white-space: nowrap; }
.a-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.a-tag.kat-islam { background: #E9F6EC; color: #17663B; }
.a-tag.kat-kristen { background: #E8F1FA; color: #1F5588; }
.a-tag.ok { background: #E9F6EC; color: #17663B; }
.a-tag.warn { background: var(--sun-soft); color: #8A6210; }
.a-td-aksi { white-space: nowrap; text-align: right; }
.a-td-aksi form { display: inline; }
.a-ico-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--forest-700); cursor: pointer;
}
.a-ico-btn:hover { background: var(--leaf-soft); }
.a-ico-btn.danger { color: var(--danger); }
.a-ico-btn.danger:hover { background: #FCEDEC; }

/* ---------- Form ---------- */
.a-form { display: flex; flex-direction: column; gap: 12px; }
.a-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.a-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.a-form-grid .span2 { grid-column: span 2; }
.a-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.a-field > span, .a-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.a-field > span i { color: var(--danger); font-style: normal; }
.a-field input[type="text"], .a-field input[type="email"], .a-field input[type="password"],
.a-field input[type="date"], .a-field input[type="number"], .a-field input[type="search"],
.a-field select, .a-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 13.5px; background: var(--paper); color: var(--ink);
}
.a-field textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.a-field input[type="file"] { font-size: 12.5px; padding: 8px; background: var(--bg); border: 1px dashed #C8D8C6; border-radius: 10px; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus { outline: 2px solid var(--leaf); border-color: transparent; }
.a-field-hint { font-size: 11.5px; color: var(--muted); }
.a-field input[type="date"] { min-height: 41px; }
.a-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); }
.a-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.a-koord-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.a-koord-row label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.a-koord-row small { font-size: 11px; color: var(--muted); }
.a-koord-row input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-size: 13.5px; }
.a-upload { display: flex; flex-direction: column; gap: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.a-upload-prev { display: flex; align-items: center; gap: 12px; }
.a-upload-prev img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- Drawer ---------- */
.a-veil { position: fixed; inset: 0; background: rgba(6, 24, 18, .45); z-index: 70; }
.a-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100%; background: var(--paper);
  z-index: 80; display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(0, 0, 0, .5);
  transform: translateX(100%); transition: transform .22s ease;
}
.a-drawer.buka { transform: none; }
.a-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.a-drawer-head h2 { font-family: var(--font-display); font-size: 19px; }
.a-drawer-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.a-drawer-body { padding: 16px 20px 0; overflow: auto; gap: 14px; flex: 1 1 auto; }
.a-drawer-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: var(--paper); position: sticky; bottom: 0;
}
.a-foot-inline { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-top: 0; background: transparent; padding: 8px 0 0; }
.a-foot-inline .a-hint { margin: 0; max-width: 46ch; }

/* ---------- Paginasi (dipakai di tabel makam) ---------- */
.paginasi { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.paginasi a, .paginasi .pg-off { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; }
.paginasi span.pg-off { color: #A6B5AA; }
.pg-info { color: var(--muted); }

/* Leaflet */
.leaflet-container { font-family: var(--font-body); }

/* ---------- Responsif ---------- */
@media (max-width: 1180px) {
  .a-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .a-shell { grid-template-columns: minmax(0, 1fr); }
  .a-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 258px; z-index: 90;
    transform: translateX(-100%); transition: transform .2s ease; height: 100vh;
  }
  .a-side.buka { transform: none; }
  .a-burger { display: inline-flex; }
  .a-content { padding: 18px 16px 40px; }
  .a-top { padding: 12px 16px; }
}
@media (max-width: 700px) {
  .a-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .a-form-grid, .a-form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .a-form-grid .span2 { grid-column: span 1; }
  .a-quick { grid-template-columns: minmax(0, 1fr); }
  .a-bar-row { grid-template-columns: 132px minmax(0, 1fr) 48px; font-size: 12.5px; }
  .a-top-title p { display: none; }
  .a-chip { display: none; }
  .a-drawer { width: 100%; }
  .a-top-right .a-btn span { display: none; }
  .a-map-besar { height: 380px; }
  .a-map { height: 260px; }
}
