/* SIPERMAP-SPAM — tema modern (Bootstrap 5.3 + kustom) */
:root {
  --sp-primary: #0369a1;
  --sp-primary-2: #0ea5e9;
  --sp-accent: #14b8a6;
  --sp-bg: #f1f5f9;
  --sp-card: #ffffff;
  --sp-border: #e2e8f0;
  --sp-text: #0f172a;
  --sp-muted: #64748b;
  --sp-sidebar: #0b1e33;
  --sp-sidebar-2: #0f2a47;
  --sp-radius: 16px;
  --sp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-bs-theme="dark"] {
  --sp-bg: #0b1220;
  --sp-card: #111a2b;
  --sp-border: #1e293b;
  --sp-text: #e2e8f0;
  --sp-muted: #94a3b8;
  --sp-sidebar: #060d18;
  --sp-sidebar-2: #0a1628;
  --sp-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --bs-body-bg: #0b1220;
}

body { background: var(--sp-bg); color: var(--sp-text); font-size: .925rem; }

/* ---------- Layout ---------- */
.sp-shell { display: flex; min-height: 100vh; }
.sp-sidebar {
  width: 260px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--sp-sidebar) 0%, var(--sp-sidebar-2) 100%);
  color: #cbd5e1; padding: 1.25rem .9rem; z-index: 1040;
}
.sp-brand { display: flex; align-items: center; gap: .7rem; padding: .25rem .5rem 1.25rem; color: #fff; text-decoration: none; }
.sp-brand-logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem;
  background: linear-gradient(135deg, var(--sp-primary-2), var(--sp-accent)); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(14, 165, 233, .7);
}
.sp-brand b { display: block; font-size: 1.05rem; letter-spacing: .3px; }
.sp-brand small { color: #7dd3fc; font-size: .7rem; letter-spacing: .4px; }
.sp-nav-title { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: #64748b; margin: 1rem .75rem .4rem; }
.sp-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .58rem .75rem; border-radius: 10px;
  color: #cbd5e1; text-decoration: none; font-weight: 500; transition: all .15s;
}
.sp-nav a i { font-size: 1.05rem; opacity: .85; }
.sp-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sp-nav a.active { background: linear-gradient(90deg, rgba(14, 165, 233, .25), rgba(20, 184, 166, .08)); color: #fff; box-shadow: inset 3px 0 0 var(--sp-primary-2); }
.sp-nav .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sp-sidebar-foot { margin-top: 1.5rem; padding: .85rem; border-radius: 12px; background: rgba(255, 255, 255, .04); font-size: .75rem; color: #94a3b8; }

.sp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-topbar {
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.75rem; background: color-mix(in srgb, var(--sp-bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--sp-border);
}
.sp-topbar h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.sp-topbar .crumb { color: var(--sp-muted); font-size: .78rem; }
.sp-content { padding: 1.5rem 1.75rem 3rem; }

/* ---------- Komponen ---------- */
.sp-card { background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); box-shadow: var(--sp-shadow); }
.sp-card-h { padding: 1rem 1.25rem; border-bottom: 1px solid var(--sp-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sp-card-h h2, .sp-card-h h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.sp-card-b { padding: 1.25rem; }

.sp-hero {
  border-radius: 20px; padding: 1.6rem 1.75rem; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(1200px 300px at 100% 0%, rgba(20, 184, 166, .55), transparent 60%),
              linear-gradient(120deg, #075985 0%, #0369a1 45%, #0e7490 100%);
}
.sp-hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
}
.sp-hero h2 { font-weight: 800; font-size: 1.55rem; margin-bottom: .25rem; }
.sp-hero p { opacity: .85; margin: 0; max-width: 680px; }

.stat { padding: 1.1rem 1.2rem; display: flex; gap: 1rem; align-items: center; height: 100%; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-v { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-l { color: var(--sp-muted); font-size: .8rem; font-weight: 500; }

.spam-card { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; text-decoration: none; color: inherit; display: block; height: 100%; }
.spam-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -16px rgba(2, 132, 199, .45); color: inherit; }
.spam-card .band { height: 5px; }
.spam-card .total { font-size: 2rem; font-weight: 800; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--bs-tertiary-bg); }
.chip i { font-size: .85rem; }

.jenis-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 8px; font-size: .75rem; font-weight: 600; color: #fff; }

.kondisi-Baik { background: #dcfce7; color: #166534; }
.kondisi-Rusak-Ringan { background: #fef3c7; color: #92400e; }
.kondisi-Rusak-Berat { background: #fee2e2; color: #991b1b; }
[data-bs-theme="dark"] .kondisi-Baik { background: rgba(34, 197, 94, .15); color: #86efac; }
[data-bs-theme="dark"] .kondisi-Rusak-Ringan { background: rgba(245, 158, 11, .15); color: #fcd34d; }
[data-bs-theme="dark"] .kondisi-Rusak-Berat { background: rgba(239, 68, 68, .15); color: #fca5a5; }
.pill { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }

.tbl { margin: 0; }
.tbl thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--sp-muted); font-weight: 700; background: var(--bs-tertiary-bg); border-bottom: 1px solid var(--sp-border); white-space: nowrap; }
.tbl td { vertical-align: middle; border-color: var(--sp-border); }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--sp-primary-2) 6%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix td.num { font-weight: 700; font-size: 1rem; }
.matrix tfoot td { font-weight: 800; background: var(--bs-tertiary-bg); }

.warn-dot { width: 8px; height: 8px; border-radius: 50%; background: #f97316; display: inline-block; box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }

.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-2)); border: 0; }
.btn-primary:hover { filter: brightness(1.08); }
.form-control, .form-select { border-radius: 10px; }
.form-label { font-weight: 600; font-size: .82rem; color: var(--sp-muted); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--sp-border); }
.timeline li { position: relative; padding: 0 0 1.1rem 44px; }
.timeline .tl-dot { position: absolute; left: 6px; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; color: #fff; background: var(--sp-primary-2); box-shadow: 0 0 0 4px var(--sp-card); }


.alert-placeholder { border-radius: 12px; border: 1px dashed #f59e0b; background: rgba(245, 158, 11, .08); color: inherit; }

/* ---------- Peta ---------- */
.map-wrap { position: relative; height: calc(100vh - 166px); min-height: 520px; border-radius: var(--sp-radius); overflow: hidden; border: 1px solid var(--sp-border); box-shadow: var(--sp-shadow); }
.map-wrap #map { position: absolute; inset: 0; }
.map-panel {
  position: absolute; top: 14px; left: 14px; z-index: 600; width: 300px; max-height: calc(100% - 28px); overflow-y: auto;
  background: color-mix(in srgb, var(--sp-card) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--sp-border); border-radius: 14px; padding: 1rem; box-shadow: var(--sp-shadow);
}
.map-panel h6 { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--sp-muted); font-weight: 700; margin: .9rem 0 .5rem; }
.map-panel h6:first-child { margin-top: 0; }
.layer-row { display: flex; align-items: center; gap: .55rem; padding: .28rem .2rem; cursor: pointer; border-radius: 8px; font-size: .85rem; }
.layer-row:hover { background: var(--bs-tertiary-bg); }
.layer-row .cnt { margin-left: auto; font-size: .72rem; color: var(--sp-muted); font-weight: 700; }
.mk { position: relative;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.mk i { transform: rotate(45deg); color: #fff; font-size: .85rem; }
.mk.warn::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #f97316; border: 2px solid #fff; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--bs-body-font-family); }
.pp-title { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.pp-table td { padding: .1rem .5rem .1rem 0; font-size: .8rem; }
.pp-table td:first-child { color: #64748b; }
.kec-label { background: transparent; border: 0; box-shadow: none; font-weight: 800; font-size: .72rem; color: #0f172a; text-shadow: 0 0 3px #fff, 0 0 3px #fff; text-transform: uppercase; letter-spacing: .5px; }
.kec-label::before { display: none; }
.legend-box { background: var(--sp-card); padding: .6rem .8rem; border-radius: 10px; box-shadow: var(--sp-shadow); font-size: .78rem; color: var(--sp-text); }

/* ---------- Responsif ---------- */
.sp-burger { display: none; }
@media (max-width: 991.98px) {
  .sp-sidebar { position: fixed; left: -280px; transition: left .2s; }
  .sp-sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .sp-burger { display: inline-flex; }
  .sp-content, .sp-topbar { padding-left: 1rem; padding-right: 1rem; }
  .map-panel { width: calc(100% - 28px); max-height: 45%; }
}

/* ---------- Login / instalasi ---------- */
.auth-body { min-height: 100vh; }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-side {
  flex: 1.1; color: #fff; padding: 4rem; align-items: center;
  background: radial-gradient(900px 400px at 100% 100%, rgba(20, 184, 166, .45), transparent 60%),
              linear-gradient(140deg, #0b1e33 0%, #075985 60%, #0e7490 100%);
}
.auth-side h1 { max-width: 560px; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card-wide { max-width: 640px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--sp-primary), var(--sp-accent)); }

/* Peran tamu: sembunyikan tombol/form ubah data */
.peran-tamu form[method="post"]:not(.keep), .peran-tamu .wr { display: none !important; }

/* ---------- Google Maps ---------- */
.kec-label-g { font-weight: 800; font-size: .7rem; color: #0f172a; text-transform: uppercase; letter-spacing: .5px; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; white-space: nowrap; }
.dot-mk { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); transform: translateY(50%); }
.gmap-error { padding: 1.5rem; margin: 1rem; border-radius: 12px; background: #fef2f2; color: #991b1b; font-size: .85rem; }
.gm-style .gm-style-iw-c { border-radius: 14px; }
.gm-style .gm-style-iw-d { font-family: var(--bs-body-font-family); }

/* ---------- Edit data GIS di peta (v1.4) ---------- */
.ged-toolbar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1001; }
.ged-menu { max-height: calc(100vh - 260px); overflow-y: auto; min-width: 280px; font-size: .85rem; }
.ged-menu .dropdown-header { font-size: .66rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.ged-draw-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1002; width: min(560px, calc(100% - 28px));
  background: var(--sp-card, #fff); border: 1px solid var(--sp-border); border-radius: 12px; padding: .7rem .9rem; font-size: .85rem; }
.ged-toast { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 1003; padding: .45rem .9rem; border-radius: 10px; font-size: .85rem; max-width: calc(100% - 28px); }
.ged-pin { width: 26px; height: 26px; border-radius: 50%; background: #f43f5e; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; cursor: move; }
.ged-v { width: 14px; height: 14px; border-radius: 3px; background: #fff; border: 2.5px solid #f43f5e; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: move; }
.ged-m { width: 12px; height: 12px; border-radius: 50%; background: #f43f5e; opacity: .45; border: 2px solid #fff; cursor: copy; }
.ged-draw, .ged-draw .leaflet-interactive { cursor: crosshair !important; }
.ged-pop .btn { font-size: .75rem; padding: .2rem .4rem; }
.pipa-legend { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; font-size: .78rem; }
.pipa-legend .ln { width: 26px; border-radius: 3px; }
.form-map { height: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--sp-border); }
@media (max-width: 767px) { .ged-toolbar { left: 14px; transform: none; top: auto; bottom: 14px; } }

/* ---------- v1.5: peta penuh saat tambah / ubah (sidebar tetap terlihat) ---------- */
body.peta-penuh .map-wrap,
.form-penuh {
  position: fixed; top: 0; right: 0; bottom: 0; left: 260px; z-index: 1035;
  height: auto; min-height: 0; border-radius: 0; border: 0; box-shadow: none; background: var(--sp-bg);
}
body.peta-penuh { overflow: hidden; }
.form-penuh #map { position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; }
.form-penuh .fp-panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px; width: 400px; max-width: calc(100% - 24px); z-index: 1001;
  display: flex; flex-direction: column; background: var(--sp-card, #fff); color: var(--sp-text);
  border: 1px solid var(--sp-border); border-radius: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.45);
}
.form-penuh .fp-head { padding: .7rem .9rem; border-bottom: 1px solid var(--sp-border); }
.form-penuh .fp-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.form-penuh .fp-body { padding: .8rem .9rem; overflow-y: auto; flex: 1; }
.form-penuh .fp-foot { padding: .6rem .9rem; border-top: 1px solid var(--sp-border); display: flex; gap: .4rem; flex-wrap: wrap; }
.form-penuh .fp-mapbar {
  position: absolute; top: 12px; left: 424px; right: 60px; z-index: 1001; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: var(--sp-card, #fff); color: var(--sp-text); border: 1px solid var(--sp-border); border-radius: 12px; padding: .45rem .7rem;
  font-size: .82rem; box-shadow: 0 6px 18px -8px rgba(0,0,0,.4); width: fit-content; max-width: calc(100% - 484px);
}
.form-penuh .fp-mapbar #ginfo { margin: 0 !important; }
.form-penuh .fp-mapbar .ged-v { display: none; }
@media (max-width: 991.98px) {
  body.peta-penuh .map-wrap, .form-penuh { left: 0; }
  .form-penuh .fp-panel { top: auto; height: 52%; left: 8px; right: 8px; bottom: 8px; width: auto; }
  .form-penuh .fp-mapbar { left: 8px; right: 8px; max-width: none; top: 8px; }
}
body.peta-penuh .map-wrap .map-panel { display: none; }

/* ---------- v1.6: foto aset & perbesar peta/foto (80% layar) ---------- */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.foto-thumb { position: relative; padding: 0; border: 1px solid var(--sp-border); border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--sp-bg); cursor: zoom-in; }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.foto-thumb:hover img { transform: scale(1.06); }
.foto-utama { position: absolute; left: 6px; top: 6px; font-size: .65rem; font-weight: 700; background: rgba(14,165,233,.9); color: #fff; border-radius: 6px; padding: 1px 6px; }
.zoom-latar { position: fixed; inset: 0; background: rgba(2, 6, 23, .72); z-index: 1060; }
.peta-kartu.besar { position: fixed; top: 10vh; left: 10vw; width: 80vw; height: 80vh; z-index: 1065; margin: 0 !important; display: flex; flex-direction: column; }
.peta-kartu.besar #map { flex: 1; height: auto !important; }
.foto-lihat { position: fixed; top: 10vh; left: 10vw; width: 80vw; height: 80vh; z-index: 1065; background: #0b1220; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); }
.foto-lihat.d-none { display: none !important; }
.fl-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; background: rgba(255,255,255,.06); color: #e2e8f0; font-size: .85rem; }
.fl-kanvas { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; }
.fl-kanvas img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; user-select: none; transition: transform .08s; }
.fl-kanvas.bisa-geser { cursor: grab; }
.fl-kanvas.bisa-geser:active { cursor: grabbing; }
.fl-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.85); color: #0f172a; font-size: 1.2rem; }
.fl-prev { left: 12px; } .fl-next { right: 12px; }
.fl-ket { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; padding: .25rem .7rem; border-radius: 8px; max-width: 80%; }
@media (max-width: 767px) { .peta-kartu.besar, .foto-lihat { top: 5vh; left: 4vw; width: 92vw; height: 90vh; } }

/* ---------- v1.7: footer tetap, GPS & Street View ---------- */
.sp-footer { position: fixed; left: 260px; right: 0; bottom: 0; z-index: 1025; height: 26px; line-height: 26px; padding: 0 1rem;
  font-size: .72rem; text-align: center; color: var(--sp-muted); background: color-mix(in srgb, var(--sp-card) 92%, transparent);
  border-top: 1px solid var(--sp-border); backdrop-filter: blur(6px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-footer-auth { left: 0; }
@media (max-width: 991.98px) { .sp-footer { left: 0; } }
.gpsv-ctl { display: flex; flex-direction: column; gap: 6px; margin: 10px 10px 0 0; }
.gpsv-btn { display: flex; align-items: center; gap: 6px; border: 2px solid rgba(0,0,0,.2); background: #fff; color: #0f172a; border-radius: 8px;
  padding: 4px 9px; font-size: .78rem; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.gpsv-btn i { font-size: 1rem; }
.gpsv-btn:hover { background: #f1f5f9; }
.gpsv-btn.on { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.gpsv-btn[data-gpsv=sv].on { background: #f59e0b; border-color: #d97706; color: #111827; }
.gps-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.35), 0 1px 6px rgba(0,0,0,.4);
  animation: gpsdenyut 1.8s infinite; }
@keyframes gpsdenyut { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.55), 0 1px 6px rgba(0,0,0,.4); } 100% { box-shadow: 0 0 0 16px rgba(37,99,235,0), 0 1px 6px rgba(0,0,0,.4); } }
.gps-label { background: #e11d48 !important; color: #fff !important; border: 0 !important; border-radius: 8px !important; padding: 2px 8px !important;
  font-weight: 700; font-size: .78rem; box-shadow: 0 2px 8px rgba(0,0,0,.3) !important; white-space: nowrap; }
.leaflet-tooltip.gps-label::before { display: none; }
.gps-info { position: absolute; right: 14px; bottom: 28px; z-index: 1001; width: min(340px, calc(100% - 28px)); background: var(--sp-card, #fff); color: var(--sp-text);
  border: 1px solid var(--sp-border); border-radius: 12px; padding: .6rem .8rem; font-size: .85rem; }
.gps-led { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.gps-utama { border-left: 3px solid #e11d48; padding-left: .55rem; }
.gps-utama.dekat { border-left-color: #22c55e; }
.gps-jarak { font-size: 1.35rem; font-weight: 800; color: #e11d48; line-height: 1.2; }
.gps-utama.dekat .gps-jarak { color: #16a34a; }
.sv-mode, .sv-mode .leaflet-interactive { cursor: crosshair !important; }
.sv-pin { width: 28px; height: 28px; border-radius: 50%; background: #f59e0b; border: 3px solid #fff; color: #111827; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); font-size: 1rem; }
.sv-lihat { position: fixed; top: 10vh; left: 10vw; width: 80vw; height: 80vh; z-index: 1065; background: #0b1220; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); }
.sv-lihat.d-none { display: none !important; }
.sv-pano { flex: 1; }
.sv-pesan { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #cbd5e1; padding: 2rem; }
@media (max-width: 767px) { .sv-lihat { top: 5vh; left: 4vw; width: 92vw; height: 90vh; } .gps-info { bottom: 70px; } }

/* ---------- v1.8: foto rumah pelanggan (seukuran peta lokasi) ---------- */
.foto-besar { position: relative; display: block; width: 100%; height: 420px; padding: 0; border: 0; background: #0b1220; cursor: zoom-in; overflow: hidden; }
.foto-besar img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.foto-besar:hover img { transform: scale(1.03); }
.foto-besar-ket { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .78rem; padding: .2rem .6rem; border-radius: 8px; max-width: calc(100% - 20px); }
.foto-kosong { height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--sp-muted);
  background: repeating-linear-gradient(45deg, var(--sp-bg), var(--sp-bg) 12px, transparent 12px, transparent 24px); border-bottom: 1px solid var(--sp-border); }
.foto-kosong i { font-size: 2.4rem; opacity: .6; }
.foto-strip { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: 2px; }
.foto-strip .foto-thumb { flex: 0 0 96px; }

/* ---------- v1.9: panduan GPS ke titik pelanggan ---------- */
.pd-tombol { display: flex; flex-direction: column; gap: 6px; }
.pd-panel { width: min(330px, calc(100vw - 60px)); background: var(--sp-card, #fff); color: var(--sp-text); border: 1px solid var(--sp-border);
  border-radius: 12px; padding: .55rem .75rem; font-size: .84rem; margin-bottom: 8px !important; }
.pd-panel a { color: var(--sp-primary, #0284c7); }
.gps-led.mati { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.25); }
.pd-angka { display: flex; gap: 1rem; margin: .2rem 0; }
.pd-angka b { font-size: 1.25rem; font-weight: 800; color: #2563eb; line-height: 1.15; }
.pd-tiba { font-weight: 700; color: #16a34a; font-size: 1rem; margin: .25rem 0; }
.pd-kartu.pd-penuh { position: fixed; top: 0; left: 260px; right: 0; bottom: 0; z-index: 1035; margin: 0 !important; border-radius: 0;
  display: flex; flex-direction: column; }
.pd-kartu.pd-penuh #map { flex: 1; height: auto !important; }
body.pd-penuh-aktif { overflow: hidden; }
@media (max-width: 991.98px) { .pd-kartu.pd-penuh { left: 0; } }

/* ---------- v2.0: responsif (HP, tablet, desktop) ---------- */
.sp-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.sp-actions:empty { display: none; }
.sp-actions > form { margin: 0; }
.sp-judul { min-width: 0; }
.sp-judul h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
img, video { max-width: 100%; }
/* v2.0.1: jangan batasi kanvas & ubin peta (Leaflet/Google) agar layer GIS tampil */
.leaflet-container canvas, .leaflet-container img, .leaflet-container svg, .gm-style img, .gm-style canvas { max-width: none !important; max-height: none !important; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.map-panel-toggle { display: none; }
@media (max-width: 1199.98px) {
  .sp-topbar { flex-wrap: wrap; row-gap: .5rem; }
  .sp-actions { order: 5; width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .sp-actions > * { flex-shrink: 0; }
}
@media (max-width: 991.98px) {
  .sp-topbar { padding-top: .6rem; padding-bottom: .6rem; gap: .5rem; }
  .sp-topbar .crumb { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .sp-content { padding-top: 1rem; }
  .map-wrap { height: calc(100dvh - 190px); min-height: 420px; }
}
@media (max-width: 575.98px) {
  body { font-size: .9rem; }
  .sp-topbar h1 { font-size: 1.05rem; }
  .sp-content { padding-left: .75rem; padding-right: .75rem; }
  .sp-card-h { padding: .75rem .9rem; flex-wrap: wrap; gap: .4rem; }
  .sp-card-b { padding: .85rem .9rem; }
  .stat { padding: .85rem; gap: .7rem; }
  .stat-ic { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-v { font-size: clamp(1.1rem, 5.5vw, 1.5rem); overflow-wrap: anywhere; }
  .table { font-size: .82rem; }
  .btn-sm { padding: .3rem .55rem; }
  .map-wrap { height: calc(100dvh - 170px); min-height: 380px; border-radius: 12px; }
  /* panel layer peta jadi laci yang bisa dibuka-tutup */
  .map-panel { display: none; width: auto; left: 8px; right: 8px; top: 56px; max-height: calc(100% - 70px); }
  .map-panel.open { display: block; }
  .map-panel-toggle { display: inline-flex; position: absolute; top: 10px; left: 10px; z-index: 650; }
  .map-wrap .legend-box { display: none; }
  .ged-toolbar { top: 10px; bottom: auto; left: auto; right: 64px; transform: none; }
  .foto-besar, .foto-kosong { height: 300px; }
  .gps-info { left: 8px; right: 8px; width: auto; bottom: 30px; }
  .pd-panel { width: calc(100vw - 48px); }
  .form-penuh .fp-mapbar { font-size: .75rem; }
  .sp-footer { font-size: .66rem; height: 22px; line-height: 22px; }
}
@media (max-width: 1199.98px) { .sp-judul { flex: 1 1 0; } }
@media (max-width: 575.98px) { .map-panel.open { z-index: 1010; box-shadow: 0 12px 32px -8px rgba(0,0,0,.45); } }
