/* Peta Wilayah Kerja OTBAN VIII — modern premium */
.wilayah-map-page {
  --w-ink: #08233f;
  --w-blue: #0d5aa6;
  --w-sky: #1896cf;
  --w-mist: #f0f6fb;
  --w-line: rgba(8, 35, 63, 0.09);
  --w-soft: rgba(255, 255, 255, 0.88);
  --w-shadow: 0 18px 42px rgba(8, 35, 63, 0.1);
}

.wilayah-map-page .wilayah-hero {
  margin: 0 0 1.25rem;
  padding: clamp(1.4rem, 3.2vw, 2rem);
  border-radius: 28px;
  color: #fff;
  background:
    linear-gradient(128deg, rgba(6, 34, 72, .96) 0%, rgba(13, 90, 166, .84) 54%, rgba(24, 150, 207, .48) 100%),
    var(--hero-photo, none) center/cover;
  box-shadow: var(--w-shadow);
}
.wilayah-hero h1 {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  color: #fff;
  line-height: 1.15;
  max-width: 16ch;
  letter-spacing: -.02em;
}
.wilayah-hero p {
  margin: 0;
  max-width: 38rem;
  color: rgba(255,255,255,.9);
  line-height: 1.55;
  font-size: .95rem;
}
.wilayah-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.15rem;
}
.wilayah-hero-meta span {
  display: inline-flex;
  align-items: center;
  padding: .42rem .78rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .76rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}
.wilayah-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
}
.wilayah-hero-actions .btn-ghost {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.26) !important;
}

.wilayah-card {
  padding: 0;
  border-radius: 28px;
  border: 1px solid var(--w-line);
  background: #fff;
  box-shadow: var(--w-shadow);
  overflow: hidden;
}
.wilayah-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-end;
  padding: 1.2rem 1.35rem 1.05rem;
  border-bottom: 1px solid var(--w-line);
  background: linear-gradient(180deg, #f7fbfe, #fff);
}
.wilayah-card-head h2 {
  margin: .12rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.3vw, 1.38rem);
  color: var(--w-ink);
  letter-spacing: -.015em;
}
.wilayah-kicker {
  margin: 0;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--w-blue);
}
.wilayah-pill {
  display: inline-flex;
  align-items: center;
  padding: .42rem .8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(13,90,166,.1), rgba(24,150,207,.12));
  color: var(--w-ink);
  font-size: .74rem;
  font-weight: 800;
  border: 1px solid rgba(13, 90, 166, .14);
}

.wilayah-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 400px);
  align-items: stretch;
  min-height: min(74vh, 740px);
}
.wilayah-map-pane {
  min-width: 0;
  background: #d7e6f3;
  border-right: 1px solid var(--w-line);
}
.wilayah-stage {
  position: relative;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
}
.wilayah-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  z-index: 1;
}
.wilayah-map-tools {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 500;
  display: flex;
  gap: .4rem;
}
.wilayah-tool-btn {
  border: 1px solid rgba(8,35,63,.08);
  background: var(--w-soft);
  color: var(--w-ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: .78rem;
  border-radius: 999px;
  padding: .55rem .95rem;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(8, 35, 63, .12);
  transition: transform .15s ease, background .15s ease;
}
.wilayah-tool-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}
.wilayah-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-width: min(90%, 440px);
  padding: .5rem .6rem;
  border-radius: 999px;
  background: var(--w-soft);
  border: 1px solid rgba(8,35,63,.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(8, 35, 63, .1);
}
.wilayah-legend span {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  font-size: .66rem;
  font-weight: 700;
  color: #45617a;
  padding: .18rem .42rem;
}
.wilayah-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.wilayah-legend i.hq { background: linear-gradient(145deg, #0B4F9C, #29B6F6); }
.wilayah-legend i.intl { background: #0F8A4B; }
.wilayah-legend i.dom { background: #1565C0; }
.wilayah-legend i.per { background: #C47B16; }
.wilayah-legend i.kh { background: #5B4DB8; }

/* Sidebar */
.wilayah-side {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr);
  min-width: 0;
  background: linear-gradient(180deg, #f5f9fd 0%, #fff 40%);
  max-height: min(74vh, 740px);
  overflow: hidden;
}
.wilayah-side-top {
  border-bottom: 1px solid var(--w-line);
  background: #fff;
  max-height: min(48vh, 420px);
  overflow: auto;
  overscroll-behavior: contain;
}
.wilayah-filter {
  display: grid;
  gap: .4rem;
  padding: 1rem 1.05rem .85rem;
}
.wilayah-filter label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6d849a;
}
.wilayah-select-wrap {
  position: relative;
}
.wilayah-select-wrap::after {
  content: '';
  position: absolute;
  right: .95rem;
  top: 50%;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid #6d849a;
  border-bottom: 2px solid #6d849a;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}
.wilayah-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--w-line);
  border-radius: 14px;
  background: var(--w-mist);
  color: var(--w-ink);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  padding: .78rem 2.2rem .78rem 1rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.wilayah-select:focus {
  border-color: rgba(13, 90, 166, .35);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(24, 150, 207, .12);
}

.wilayah-detail {
  padding: 0 .85rem 1rem;
}
.wilayah-detail-placeholder {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: var(--w-mist);
  border: 1px dashed rgba(13, 90, 166, .2);
}
.wilayah-detail-placeholder strong {
  display: block;
  font-family: var(--display);
  color: var(--w-ink);
  font-size: .95rem;
  margin-bottom: .25rem;
}
.wilayah-detail-placeholder p {
  margin: 0;
  color: #6d849a;
  font-size: .82rem;
  line-height: 1.45;
}
.wilayah-detail-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--w-line);
  background: #fff;
  box-shadow: 0 14px 32px rgba(8, 35, 63, .08);
  animation: wilayahDetailIn .35s ease;
}
@keyframes wilayahDetailIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.wilayah-detail-hero {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: .75rem;
  padding: .75rem;
  align-items: start;
  background: linear-gradient(135deg, #f3f8fd, #fff);
  border-bottom: 1px solid var(--w-line);
}
.wilayah-detail-media {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0B4F9C, #1896cf);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(8, 35, 63, .16);
}
.wilayah-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wilayah-detail-intro {
  min-width: 0;
  padding-top: .1rem;
}
.wilayah-detail-intro .wilayah-badge {
  margin-bottom: .4rem;
}
.wilayah-detail-intro h3 {
  margin: 0 0 .12rem;
  font-family: var(--display);
  font-size: 1.08rem;
  color: var(--w-ink);
  letter-spacing: -.015em;
  line-height: 1.2;
}
.wilayah-detail-official {
  margin: 0 0 .35rem;
  font-size: .7rem;
  font-weight: 700;
  color: var(--w-blue);
}
.wilayah-detail-desc {
  margin: 0;
  color: #3d556e;
  font-size: .78rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wilayah-detail-body {
  padding: .75rem .85rem .9rem;
}
.wilayah-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-bottom: .65rem;
}
.wilayah-meta-grid > div {
  padding: .5rem .55rem;
  border-radius: 12px;
  background: var(--w-mist);
}
.wilayah-meta-grid span {
  display: block;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6d849a;
}
.wilayah-meta-grid strong {
  display: block;
  margin-top: .15rem;
  font-size: .78rem;
  color: var(--w-ink);
  line-height: 1.3;
  font-weight: 700;
}
.wilayah-detail-addr {
  margin: 0 0 .35rem;
  font-size: .78rem;
  color: #3d556e;
  line-height: 1.4;
}
.wilayah-detail-addr span {
  display: block;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6d849a;
  margin-bottom: .1rem;
}
.wilayah-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
}

.wilayah-side-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.wilayah-side-list-head {
  padding: .7rem 1.05rem .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6d849a;
}
.wilayah-list {
  overflow: auto;
  display: grid;
  gap: .4rem;
  padding: .35rem .85rem 1rem;
  align-content: start;
}
.wilayah-empty {
  margin: .4rem 0;
  color: #6d849a;
  font-size: .84rem;
}
.wilayah-group-label {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: .15rem 0 0;
  padding: .38rem .55rem;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--w-blue);
  background: rgba(245, 249, 253, .94);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
.wilayah-item {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(255,255,255,.75);
  border-radius: 16px;
  padding: .38rem;
  cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
}
.wilayah-item:hover {
  border-color: rgba(24, 150, 207, .25);
  background: #fff;
  box-shadow: 0 8px 20px rgba(8, 35, 63, .07);
  transform: translateY(-1px);
}
.wilayah-item.is-active {
  border-color: rgba(13, 90, 166, .32);
  background: #fff;
  box-shadow: 0 12px 28px rgba(13, 90, 166, .12);
}
.wilayah-item-thumb {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(145deg, #0B4F9C, #1896cf);
}
.wilayah-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wilayah-item-copy { min-width: 0; }
.wilayah-item strong {
  display: block;
  color: var(--w-ink);
  font-size: .88rem;
  line-height: 1.25;
  font-family: var(--display);
  letter-spacing: -.01em;
}
.wilayah-item span {
  display: block;
  margin-top: .12rem;
  color: #6d849a;
  font-size: .72rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wilayah-item em {
  display: inline-block;
  margin-top: .28rem;
  font-style: normal;
  font-size: .62rem;
  font-weight: 800;
  color: #fff;
  background: #1565C0;
  padding: .14rem .45rem;
  border-radius: 999px;
}
.wilayah-item em.is-hq { background: linear-gradient(135deg, #0B4F9C, #29B6F6); }
.wilayah-item em.is-intl { background: #0F8A4B; }
.wilayah-item em.is-perintis { background: #C47B16; }
.wilayah-item em.is-khusus { background: #5B4DB8; }

.wilayah-badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .55rem;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 800;
  color: #fff;
  background: #1565C0;
  box-shadow: 0 6px 16px rgba(8, 36, 58, .25);
}
.wilayah-badge.is-hq { background: linear-gradient(135deg, #0B4F9C, #29B6F6); }
.wilayah-badge.is-intl { background: #0F8A4B; }
.wilayah-badge.is-domestik { background: #1565C0; }
.wilayah-badge.is-perintis { background: #C47B16; }
.wilayah-badge.is-khusus { background: #5B4DB8; }

.wilayah-office {
  margin-top: 1.2rem;
  padding: 1.2rem 1.3rem;
  border-radius: 22px;
  border: 1px solid var(--w-line);
  background:
    linear-gradient(135deg, rgba(13,90,166,.06), transparent 48%),
    #fff;
  box-shadow: 0 12px 28px rgba(8, 35, 63, .05);
}
.wilayah-office h2 {
  margin: 0 0 .4rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--w-ink);
}
.wilayah-office p {
  margin: 0 0 .85rem;
  color: #3d556e;
  line-height: 1.55;
  font-size: .9rem;
}
.wilayah-office-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

/* Markers */
.leaflet-div-icon.wilayah-pin { background: transparent; border: 0; }
.wilayah-pin-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: #1565C0;
  border: 2.5px solid #fff;
  box-shadow: 0 10px 20px rgba(8, 36, 58, .32);
}
.wilayah-pin-core svg {
  width: 15px;
  height: 15px;
  position: relative;
  z-index: 1;
}
.wilayah-pin-core.is-hq {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #0B4F9C, #29B6F6);
}
.wilayah-pin-core.is-hq svg { width: 18px; height: 18px; }
.wilayah-pin-core.is-intl { background: #0F8A4B; }
.wilayah-pin-core.is-perintis { background: #C47B16; }
.wilayah-pin-core.is-khusus { background: #5B4DB8; }
.wilayah-pin-pulse {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(24, 150, 207, .5);
  animation: wilayahPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes wilayahPulse {
  0% { transform: scale(.7); opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.wilayah-map-page .leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 10px 24px rgba(8, 35, 63, .14) !important;
  border-radius: 14px !important;
  overflow: hidden;
  margin-right: 1rem !important;
  margin-bottom: 1rem !important;
}
.wilayah-map-page .leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--w-ink) !important;
  border-bottom-color: var(--w-line) !important;
}

.wilayah-leaflet-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(8, 36, 58, .24);
}
.wilayah-leaflet-popup .leaflet-popup-content {
  margin: 0;
  min-width: 240px;
}
.wilayah-popup-media {
  aspect-ratio: 16 / 9;
  background: #0B4F9C;
  overflow: hidden;
}
.wilayah-popup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wilayah-popup-body { padding: .75rem .85rem .9rem; }
.wilayah-popup h4 {
  margin: .4rem 0 .2rem;
  font-family: var(--display);
  font-size: .98rem;
  color: var(--w-ink);
}
.wilayah-popup p {
  margin: 0;
  font-size: .78rem;
  color: #5C738C;
  line-height: 1.4;
}
.wilayah-popup-code {
  margin-top: .3rem !important;
  font-weight: 800;
  color: var(--w-blue) !important;
}

@media (max-width: 980px) {
  .wilayah-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .wilayah-map-pane { border-right: 0; border-bottom: 1px solid var(--w-line); }
  .wilayah-stage,
  .wilayah-map { min-height: 400px; height: 420px; }
  .wilayah-side {
    max-height: none;
    grid-template-rows: auto auto;
    overflow: visible;
  }
  .wilayah-side-top {
    max-height: none;
    overflow: visible;
  }
  .wilayah-list { max-height: 280px; }
  .wilayah-legend { display: none; }
  .wilayah-detail-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .wilayah-detail-media {
    width: 96px;
    height: 96px;
  }
}
