:root {
  --bg:      #f0f4f8;
  --sf:      #ffffff;
  --sf2:     #f7f9fc;
  --sf3:     #eef2f7;
  --bd:      #dde3ec;
  --bdh:     #b0bac8;
  --tx:      #1a2030;
  --txs:     #4a5568;
  --txd:     #8a96a8;

  --spbu-24-fill:    #22c55e;
  --spbu-24-bg:      rgba(34,197,94,.10);
  --spbu-24-ring:    rgba(34,197,94,.25);
  --spbu-ltd-fill:   #f87171;
  --spbu-ltd-bg:     rgba(248,113,113,.10);
  --spbu-ltd-ring:   rgba(248,113,113,.25);

  --jalan-nas:   #f97316;
  --jalan-nas-bg: rgba(249,115,22,.10);
  --jalan-nas-ring: rgba(249,115,22,.28);
  --jalan-prov:  #3b82f6;
  --jalan-prov-bg: rgba(59,130,246,.10);
  --jalan-prov-ring: rgba(59,130,246,.28);
  --jalan-kab:   #10b981;
  --jalan-kab-bg: rgba(16,185,129,.10);
  --jalan-kab-ring: rgba(16,185,129,.28);

  --shm-stroke: #d97706; --shm-fill: #fef3c7; --shm-bg: rgba(217,119,6,.10); --shm-ring: rgba(217,119,6,.28);
  --hgb-stroke: #8b5cf6; --hgb-fill: #ede9fe; --hgb-bg: rgba(139,92,246,.10); --hgb-ring: rgba(139,92,246,.28);
  --hgu-stroke: #0891b2; --hgu-fill: #cffafe; --hgu-bg: rgba(8,145,178,.10);  --hgu-ring: rgba(8,145,178,.28);
  --hp-stroke:  #ec4899; --hp-fill:  #fce7f3; --hp-bg:  rgba(236,72,153,.10); --hp-ring:  rgba(236,72,153,.28);

  --green:   #16a34a;
  --greenb:  rgba(22,163,74,.10);
  --greenr:  rgba(22,163,74,.25);
  --red:     #dc2626;
  --redb:    rgba(220,38,38,.10);
  --redr:    rgba(220,38,38,.25);
  --blue:    #2563eb;
  --blueb:   rgba(37,99,235,.10);
  --bluer:   rgba(37,99,235,.25);
  --amber:   #d97706;
  --amberb:  rgba(217,119,6,.10);
  --amberr:  rgba(217,119,6,.25);
  --purple:  #7c3aed;
  --purpleb: rgba(124,58,237,.10);
  --purpler: rgba(124,58,237,.25);
  --indigo:  #4f46e5;
  --indigob: rgba(79,70,229,.10);
  --indigor: rgba(79,70,229,.25);

  --sh-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --sh:    0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  --sh-lg: 0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);

  --sidebar: 275px;
  --topbar:  52px;
  --radius:  10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px; background: var(--bg); color: var(--tx);
  -webkit-font-smoothing: antialiased;
}
#app { display: flex; height: 100vh; }

/* ── LOADING ── */
#loading { position:fixed; inset:0; z-index:9999; background:var(--bg); display:flex; align-items:center; justify-content:center; }
.ld-inner { display:flex; flex-direction:column; align-items:center; gap:14px; }
.ld-inner p { font-size:13px; color:var(--txd); }
.spin { width:32px; height:32px; border:3px solid var(--bd); border-top-color:var(--green); border-radius:50%; animation:rot .7s linear infinite; }
@keyframes rot { to { transform:rotate(360deg); } }

/* ── SIDEBAR ── */
#sidebar { width:var(--sidebar); min-width:var(--sidebar); background:var(--sf); border-right:1px solid var(--bd); display:flex; flex-direction:column; box-shadow:var(--sh-sm); z-index:900; }
.sb-header { padding:14px 16px; border-bottom:1px solid var(--bd); }
.sb-brand { display:flex; align-items:center; gap:10px; }
.sb-icon { width:36px; height:36px; border-radius:9px; flex-shrink:0; background:var(--greenb); border:1px solid var(--greenr); display:flex; align-items:center; justify-content:center; color:var(--green); font-size:18px; }
.sb-title { font-size:14px; font-weight:800; }
.sb-sub { font-size:10px; color:var(--txd); margin-top:1px; }
.sb-scroll { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:14px; }
.sb-scroll::-webkit-scrollbar { width:4px; }
.sb-scroll::-webkit-scrollbar-thumb { background:var(--bd); border-radius:4px; }
.sb-section { display:flex; flex-direction:column; gap:6px; }
.sb-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--txd); }

/* ── LEGEND CARD ── */
.legend-card { background:var(--sf2); border:1px solid var(--bd); border-radius:var(--radius); padding:10px 12px; display:flex; flex-direction:column; gap:7px; }
.leg-row { display:flex; align-items:center; gap:9px; font-size:12px; color:var(--txs); font-weight:500; }
.leg-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; border:2px solid rgba(0,0,0,.08); }
.leg-dot.spbu-24  { background:var(--spbu-24-fill);  box-shadow:0 0 0 3px var(--spbu-24-bg); }
.leg-dot.spbu-ltd { background:var(--spbu-ltd-fill); box-shadow:0 0 0 3px var(--spbu-ltd-bg); }
.leg-line { width:24px; height:4px; border-radius:3px; flex-shrink:0; }
.leg-line.jalan-nas  { background:var(--jalan-nas); }
.leg-line.jalan-prov { background:var(--jalan-prov); }
.leg-line.jalan-kab  { background:var(--jalan-kab); }
.leg-poly { width:18px; height:13px; border-radius:3px; flex-shrink:0; border:2px solid; }
.leg-poly.parsil-shm { background:var(--shm-fill); border-color:var(--shm-stroke); }
.leg-poly.parsil-hgb { background:var(--hgb-fill); border-color:var(--hgb-stroke); }
.leg-poly.parsil-hgu { background:var(--hgu-fill); border-color:var(--hgu-stroke); }
.leg-poly.parsil-hp  { background:var(--hp-fill);  border-color:var(--hp-stroke); }

/* ── STATS ── */
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.stat-item { background:var(--sf2); border:1px solid var(--bd); border-radius:var(--radius); padding:10px; text-align:center; }
.stat-item.green  { background:var(--greenb); border-color:var(--greenr); }
.stat-item.blue   { background:var(--blueb);  border-color:var(--bluer); }
.stat-item.purple { background:var(--purpleb);border-color:var(--purpler); }
.stat-num { font-size:22px; font-weight:800; font-family:'Fira Code',monospace; color:var(--tx); }
.stat-item.green  .stat-num { color:var(--green); }
.stat-item.blue   .stat-num { color:var(--blue); }
.stat-item.purple .stat-num { color:var(--purple); }
.stat-lbl { font-size:10px; color:var(--txd); margin-top:2px; }

/* ── SPBU LIST ── */
.spbu-item { background:var(--sf); border:1px solid var(--bd); border-radius:var(--radius); padding:9px 11px; cursor:pointer; transition:border-color .18s, background .18s; margin-bottom:5px; display:flex; flex-direction:column; gap:6px; }
.spbu-item:hover { border-color:var(--green); background:var(--greenb); }
.si-top { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.si-name { font-size:13px; font-weight:700; display:flex; align-items:center; gap:7px; }
.si-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.si-dot.dot-green { background:var(--spbu-24-fill); box-shadow:0 0 0 2px var(--spbu-24-bg); }
.si-dot.dot-red   { background:var(--spbu-ltd-fill); box-shadow:0 0 0 2px var(--spbu-ltd-bg); }
.si-actions { display:flex; gap:4px; flex-shrink:0; }
.empty { text-align:center; padding:24px 0; font-size:12px; color:var(--txd); }

/* ── ICON BUTTONS ── */
.ib { width:34px; height:34px; border-radius:8px; background:var(--sf2); border:1px solid var(--bd); color:var(--txs); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .18s; flex-shrink:0; font-size:13px; }
.ib.edt { background:linear-gradient(180deg,#fff8f0,#fff1e6); border-color:rgba(217,119,6,.12); color:var(--amber); }
.ib.del { background:linear-gradient(180deg,#fff7f7,#fff0f0); border-color:rgba(220,38,38,.08); color:var(--red); }
.ib:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(10,20,40,.06); }

/* ── BADGE ── */
.badge { display:inline-flex; align-items:center; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; border:1px solid; }
.badge.bg  { background:var(--spbu-24-bg);  border-color:var(--spbu-24-ring);  color:#15803d; }
.badge.br  { background:var(--spbu-ltd-bg); border-color:var(--spbu-ltd-ring); color:#dc2626; }
.badge.bb-orange { background:var(--jalan-nas-bg);  border-color:var(--jalan-nas-ring);  color:#c2410c; }
.badge.bb-blue   { background:var(--jalan-prov-bg); border-color:var(--jalan-prov-ring); color:#1d4ed8; }
.badge.bb-green  { background:var(--jalan-kab-bg);  border-color:var(--jalan-kab-ring);  color:#065f46; }
.badge.bp-shm { background:var(--shm-bg); border-color:var(--shm-ring); color:var(--shm-stroke); }
.badge.bp-hgb { background:var(--hgb-bg); border-color:var(--hgb-ring); color:var(--hgb-stroke); }
.badge.bp-hgu { background:var(--hgu-bg); border-color:var(--hgu-ring); color:var(--hgu-stroke); }
.badge.bp-hp  { background:var(--hp-bg);  border-color:var(--hp-ring);  color:var(--hp-stroke); }

/* ── GEOM SELECTOR ── */
.geom-selector { display:flex; gap:3px; background:var(--sf2); border:1px solid var(--bd); border-radius:9px; padding:3px; }
.geom-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:5px; padding:6px 8px; border-radius:7px; border:none; background:transparent; color:var(--txs); font-family:'Plus Jakarta Sans',sans-serif; font-size:11px; font-weight:600; cursor:pointer; transition:all .18s; white-space:nowrap; }
.geom-btn:hover { background:var(--sf); color:var(--tx); }
.geom-btn.active { background:var(--green); color:#fff; box-shadow:0 2px 8px rgba(22,163,74,.3); }
.geom-hint { font-size:10px; color:var(--txd); text-align:left; margin-top:4px; min-height:14px; padding-left:2px; transition:color .18s; display:flex; align-items:center; gap:5px; }
.geom-hint .gh-dot { width:6px; height:6px; border-radius:50%; background:var(--bdh); flex-shrink:0; transition:background .18s; }
.geom-hint.on { color:var(--green); font-weight:600; }
.geom-hint.on .gh-dot { background:var(--green); box-shadow:0 0 0 2px rgba(22,163,74,.2); }

/* ── MAIN ── */
#main { flex:1; display:flex; flex-direction:column; overflow:hidden; position:relative; }
#topbar { height:var(--topbar); min-height:var(--topbar); background:var(--sf); border-bottom:1px solid var(--bd); display:flex; align-items:center; padding:0 12px; gap:8px; box-shadow:var(--sh-sm); overflow:visible; position:relative; z-index:850; }
.coord-pill { flex:0 0 auto; font-family:'Fira Code',monospace; font-size:11px; color:var(--txd); background:var(--sf2); border:1px solid var(--bd); border-radius:7px; padding:4px 10px; display:flex; align-items:center; gap:5px; white-space:nowrap; }
.pill-sep { color:var(--bdh); }

/* ── SEARCH ── */
#search-wrap {
  flex: 1;
  position: relative;
  max-width: 340px;
  z-index: 1300;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--sf2);
  border: 1.5px solid var(--bd);
  border-radius: 9px;
  padding: 0 10px;
  height: 34px;
  transition: border-color .18s, box-shadow .18s;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.08);
}

.search-icon { font-size: 13px; flex-shrink: 0; opacity: .6; }

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--tx);
}

#search-input::placeholder { color: var(--txd); }

#search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 11px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s;
  max-height: 320px;
  overflow-y: auto;
}

#search-results.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .14s;
  border-bottom: 1px solid var(--sf3);
}

.sr-item:last-child { border-bottom: none; }

.sr-item:hover { background: var(--sf2); }

.sr-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--sf2);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sr-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sr-label { font-size: 13px; font-weight: 700; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: 10px; color: var(--txd); font-weight: 500; }
.sr-empty { padding: 16px 12px; font-size: 12px; color: var(--txd); text-align: center; }

/* ── LAYER DROPDOWN ── */
.layer-wrap { position:relative; flex-shrink:0; z-index:1100; }
.layer-btn { height:34px; padding:0 12px; border-radius:8px; background:var(--sf2); border:1px solid var(--bd); color:var(--txs); font-size:12px; font-weight:600; font-family:'Plus Jakarta Sans',sans-serif; cursor:pointer; display:flex; align-items:center; gap:6px; transition:all .18s; white-space:nowrap; }
.layer-btn:hover { border-color:var(--bdh); color:var(--tx); }
.layer-menu { position:absolute; top:calc(100% + 6px); right:0; background:var(--sf); border:1px solid var(--bd); border-radius:11px; padding:6px; min-width:200px; box-shadow:var(--sh-lg); z-index:1200; opacity:0; pointer-events:none; transform:translateY(6px); transition:opacity .18s, transform .18s; }
.layer-menu.open { opacity:1; pointer-events:all; transform:translateY(0); }
.lm-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--txd); padding:4px 8px 6px; }
.lm-item { width:100%; display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:7px; border:none; background:transparent; color:var(--txs); font-size:12px; font-family:'Plus Jakarta Sans',sans-serif; cursor:pointer; transition:all .15s; text-align:left; }
.lm-item:hover { background:var(--sf2); color:var(--tx); }
.lm-item.active { color:var(--tx); font-weight:600; }

/* ── MAP ── */
#map-wrap { flex:1; position:relative; overflow:hidden; }
#map { width:100%; height:100%; }
.leaflet-container.crosshair-cursor { cursor:crosshair !important; }

/* ── DRAW TOOLBAR ── */
#draw-toolbar, #geom-edit-toolbar {
  position:absolute; bottom:28px; left:50%; transform:translateX(-50%) translateY(12px);
  z-index:1000; display:flex; align-items:center; gap:5px;
  background:var(--sf); border:1px solid var(--bd); border-radius:14px;
  padding:8px 14px; box-shadow:var(--sh-lg);
  pointer-events:all; opacity:0; visibility:hidden;
  transition:opacity .22s, transform .22s, visibility .22s;
}
#draw-toolbar.visible, #geom-edit-toolbar.visible {
  opacity:1; visibility:visible; transform:translateX(-50%) translateY(0);
}

/* geom-edit toolbar sits a bit higher so they don't overlap */
#geom-edit-toolbar { bottom: 28px; }
#draw-toolbar.visible ~ #geom-edit-toolbar.visible { bottom: 90px; }

.dt-hint { font-size:12px; font-weight:600; color:var(--txs); padding:0 4px; white-space:nowrap; }
.dt-counter { font-family:'Fira Code',monospace; font-size:12px; font-weight:600; color:var(--blue); background:var(--blueb); border:1px solid var(--bluer); border-radius:7px; padding:4px 10px; white-space:nowrap; }
.geom-edit-counter { color:var(--indigo); background:var(--indigob); border-color:var(--indigor); min-width:120px; }
.dt-btn { display:flex; align-items:center; gap:5px; padding:7px 13px; border-radius:9px; border:1.5px solid var(--bd); background:var(--sf2); color:var(--txs); font-family:'Plus Jakarta Sans',sans-serif; font-size:12px; font-weight:600; cursor:pointer; transition:all .18s; white-space:nowrap; flex-shrink:0; }
.dt-btn:hover { border-color:var(--bdh); background:var(--sf); color:var(--tx); }
.dt-btn:disabled { opacity:.4; cursor:not-allowed; }
.dt-btn.undo:hover   { background:var(--amberb); border-color:var(--amberr); color:var(--amber); }
.dt-btn.redo:hover   { background:var(--blueb); border-color:var(--bluer); color:var(--blue); }
.dt-btn.cancel { background:var(--redb); border-color:var(--redr); color:var(--red); }
.dt-btn.cancel:hover { background:var(--red); color:#fff; border-color:var(--red); }
.dt-btn.finish { background:var(--greenb); border-color:var(--greenr); color:var(--green); }
.dt-btn.finish:hover { background:var(--green); color:#fff; border-color:var(--green); }

/* ── POPUP ── */
.leaflet-popup-content-wrapper { background:var(--sf) !important; border:1px solid var(--bd) !important; border-radius:14px !important; box-shadow:var(--sh-lg) !important; padding:0 !important; overflow:hidden !important; color:var(--tx) !important; }
.leaflet-popup-content { margin:0 !important; width:auto !important; }
.leaflet-popup-tip-container { display:none; }
.leaflet-popup-close-button { top:10px !important; right:12px !important; width:26px !important; height:26px !important; font-size:14px !important; line-height:26px !important; color:var(--txd) !important; background:var(--sf2) !important; border-radius:8px !important; border:1px solid var(--bd) !important; }

/* ── POPUP DETAIL CARD ── */
.pcard-detail { min-width:280px; max-width:360px; font-family:'Plus Jakarta Sans',sans-serif; }
.pcd-title { font-size:16px; font-weight:800; color:var(--tx); padding:12px 16px 4px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--bd); margin-bottom:8px; }
.pcd-title[data-type="spbu"]::before   { content:"⛽"; font-size:18px; }
.pcd-title[data-type="jalan"]::before  { content:"🛣️"; font-size:18px; }
.pcd-title[data-type="parsil"]::before { content:"🗺️"; font-size:18px; }
.pcd-rows { display:flex; flex-direction:column; gap:10px; padding:0 16px 12px; }
.pcd-row { display:flex; align-items:center; justify-content:space-between; background:var(--sf2); padding:8px 12px; border-radius:12px; border:1px solid var(--bd); transition:all .2s; }
.pcd-row:hover { background:var(--sf); border-color:var(--bdh); }
.pcd-label { font-size:12px; font-weight:600; color:var(--txd); display:flex; align-items:center; gap:6px; }
.pcd-val { font-size:13px; font-weight:700; color:var(--tx); text-align:right; word-break:break-word; max-width:180px; }
.pcd-actions { display:flex; gap:7px; padding:8px 16px 16px; border-top:1px solid var(--bd); margin-top:4px; flex-wrap:wrap; }

/* ── POPUP BUTTONS ── */
.pbtn {
  flex: 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.pbtn-edit {
  background: linear-gradient(135deg, #fffbeb, #fff3e0);
  color: #d97706;
  border: 1.5px solid #fde68a;
}
.pbtn-edit:hover {
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(217,119,6,.15);
}

.pbtn-move {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
  border: 1.5px solid #c7d2fe;
}
.pbtn-move:hover {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79,70,229,.15);
}

.pbtn-del {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
  border: 1.5px solid #fecaca;
}
.pbtn-del:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220,38,38,.15);
}

/* ── OVERLAY / MODAL ── */
.overlay { position:fixed; inset:0; z-index:2000; background:rgba(15,20,35,.45); backdrop-filter:blur(6px); display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .22s; }
.overlay.open { opacity:1; pointer-events:all; }
.modal { background:var(--sf); border:1px solid var(--bd); border-radius:var(--radius-lg); padding:22px; width:460px; max-width:96vw; box-shadow:var(--sh-lg); transform:translateY(14px) scale(.98); transition:transform .22s; }
.overlay.open .modal { transform:translateY(0) scale(1); }
.modal-head { display:flex; align-items:center; gap:11px; margin-bottom:16px; }
.modal-head h2 { font-size:15px; font-weight:800; }
.form-group { margin-bottom:12px; }
.form-group label { display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--txd); margin-bottom:5px; }
.form-group input, .form-group select { width:100%; padding:10px 12px; background:var(--sf2); border:1.5px solid var(--bd); border-radius:10px; color:var(--tx); font-size:14px; font-family:'Plus Jakarta Sans',sans-serif; outline:none; transition:border-color .18s, box-shadow .18s; appearance:none; }
.form-group input:focus, .form-group select:focus { border-color:var(--green); box-shadow:0 0 0 3px rgba(22,163,74,.08); }
.form-group input::placeholder { color:var(--txd); }
.form-group select { cursor:pointer; background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%234a5568" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>'); background-repeat:no-repeat; background-position:right 10px center; background-size:16px; padding-right:32px; }
.modal-foot { display:flex; gap:8px; margin-top:16px; }
.btn-ghost { flex:1; padding:10px; border-radius:8px; border:1.5px solid var(--bd); background:transparent; color:var(--txs); font-size:13px; font-weight:600; font-family:'Plus Jakarta Sans',sans-serif; cursor:pointer; transition:all .18s; }
.btn-ghost:hover { border-color:var(--bdh); color:var(--tx); background:var(--sf2); }
.btn-primary { flex:1.4; padding:10px; border-radius:8px; border:none; color:#fff; font-size:13px; font-weight:700; font-family:'Plus Jakarta Sans',sans-serif; cursor:pointer; transition:opacity .18s, transform .12s; display:flex; align-items:center; justify-content:center; gap:6px; }
.btn-primary:hover { opacity:.9; transform:translateY(-1px); }
.btn-primary.green  { background:linear-gradient(135deg,#22c55e,#16a34a); }
.btn-primary.blue   { background:linear-gradient(135deg,#3b82f6,#2563eb); }
.btn-primary.purple { background:linear-gradient(135deg,#a78bfa,#7c3aed); }
.btn-primary.red    { background:linear-gradient(135deg,#f87171,#dc2626); }

/* ── CUSTOM CONFIRM DIALOG ── */
.confirm-modal {
  width: 380px;
  max-width: 94vw;
  text-align: center;
  padding: 28px 24px 22px;
}

.confirm-icon {
  font-size: 38px;
  margin-bottom: 10px;
  line-height: 1;
}

.confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--tx);
  margin-bottom: 6px;
}

.confirm-message {
  font-size: 13px;
  color: var(--txs);
  margin-bottom: 0;
  line-height: 1.5;
}

.confirm-modal .modal-foot {
  margin-top: 20px;
  justify-content: center;
}

.confirm-modal .btn-ghost { flex: 0 0 auto; min-width: 90px; }
.confirm-modal .btn-primary { flex: 0 0 auto; min-width: 120px; }

/* ── MAP LABELS ── */
.label-tooltip, .label-tooltip-line, .label-tooltip-polygon {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--bd);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  box-shadow: var(--sh-sm);
  white-space: nowrap;
  pointer-events: none;
}

/* ── TOAST ── */
#toasts { position:fixed; bottom:18px; right:18px; z-index:9999; display:flex; flex-direction:column; gap:6px; }
.toast { background:var(--sf); border:1px solid var(--bd); border-radius:9px; padding:9px 14px; font-size:12px; font-weight:600; display:flex; align-items:center; gap:8px; min-width:220px; box-shadow:var(--sh); animation:tslide .22s ease; }
.toast.ok { border-color:var(--greenr); color:var(--green); }
.toast.er { border-color:var(--redr); color:var(--red); }
@keyframes tslide { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width:640px) {
  .modal { width:92vw; padding:16px; }
  .pcard-detail { min-width:200px; max-width:260px; }
  #search-wrap { max-width:160px; }
}