/* =========================================================
   DASHBOARD PAGE
========================================================= */

.dashboard-page {
  background: #f7f9fc;
  min-height: 100vh;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}


/* =========================================================
   HERO / GLOBAL FILTER
========================================================= */

.dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #eef1f6;
  border-radius: 22px;
  padding: 1.35rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.dashboard-hero.compact {
  background: #ffffff;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.hero-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e9f8f0, #d9f3e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b7a3b;
  font-size: 2rem;
  flex: 0 0 auto;
}

.hero-icon.compact {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.5rem;
}

.filter-panel {
  background: #ffffff;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.filter-panel.compact {
  background: #f8fafc;
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: none;
}

.filter-panel.compact .form-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.filter-panel.compact .form-select,
.filter-panel.compact .form-control,
.filter-panel.compact .btn {
  min-height: 34px;
}


/* =========================================================
   KPI CARD
========================================================= */

.kpi-card {
  background: #ffffff;
  border: 1px solid #edf1f7;
  border-radius: 22px;
  padding: 1.25rem;
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}

.kpi-card.compact {
  border-radius: 16px;
  padding: 0.9rem;
  min-height: 92px;
  gap: 0.8rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -35px;
  top: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.16;
}

.kpi-card.compact::after {
  right: -32px;
  top: -32px;
  width: 82px;
  height: 82px;
  opacity: 0.12;
}

.kpi-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  flex: 0 0 auto;
}

.kpi-icon.compact {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.45rem;
}

.kpi-label {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.kpi-card.compact .kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-value {
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.kpi-card.compact .kpi-value {
  font-size: 1.55rem;
}

.kpi-value small {
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
}

.kpi-card.compact .kpi-value small {
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 2px;
}

.kpi-desc {
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 0.5rem;
}

.kpi-card.compact .kpi-desc {
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 0.35rem;
  white-space: nowrap;
}


/* KPI COLORS */

.kpi-blue .kpi-icon {
  background: #e8f1ff;
  color: #2563eb;
}

.kpi-blue::after {
  background: #2563eb;
}

.kpi-green .kpi-icon {
  background: #e8f8ef;
  color: #16a34a;
}

.kpi-green::after {
  background: #16a34a;
}

.kpi-indigo .kpi-icon {
  background: #eef2ff;
  color: #3b82f6;
}

.kpi-indigo::after {
  background: #3b82f6;
}

.kpi-orange .kpi-icon {
  background: #fff4e5;
  color: #f97316;
}

.kpi-orange::after {
  background: #f97316;
}

.kpi-purple .kpi-icon {
  background: #f3e8ff;
  color: #9333ea;
}

.kpi-purple::after {
  background: #9333ea;
}


/* =========================================================
   DASHBOARD CARD
========================================================= */

.dashboard-card {
  background: #ffffff;
  border: 1px solid #edf1f7;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.dashboard-card.compact {
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.dashboard-card-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #eef1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-card-header.compact {
  padding: 0.85rem 1rem;
  gap: 0.75rem;
}

.dashboard-card-header h5 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.dashboard-card-header.compact h6 {
  font-size: 0.86rem;
  line-height: 1.25;
}

.dashboard-card-header.compact p {
  font-size: 0.72rem;
}

.dashboard-card-body {
  padding: 1.25rem;
}

.dashboard-card-body.compact {
  padding: 0.85rem;
}


/* =========================================================
   CARD ACTION BUTTONS
========================================================= */

.dashboard-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.btn-icon-card {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #ffffff;
}

.btn-icon-card i {
  font-size: 1.15rem;
  line-height: 1;
}

.btn-icon-card:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1 !important;
}


/* =========================================================
   SELECT / FILTER INSIDE CARD
========================================================= */

.dashboard-select {
  min-width: 120px;
}

.dashboard-select.compact {
  width: 110px;
  min-height: 32px;
  font-size: 0.75rem;
  border-radius: 10px;
}


/* =========================================================
   MAP & CHART WRAPPER
========================================================= */

.map-wrapper {
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  background: #e8eef6;
}

.map-wrapper.compact {
  height: 300px;
  border-radius: 14px;
}

#map-dashboard {
  width: 100%;
  height: 100%;
}

.chart-wrapper {
  width: 100%;
  position: relative;
}

.chart-sm {
  min-height: 240px;
}

.chart-sm.compact {
  min-height: 210px;
}

.chart-md {
  min-height: 340px;
}

.chart-md.compact {
  min-height: 300px;
}

.chart-lg {
  min-height: 360px;
}

.chart-lg.compact {
  min-height: 300px;
}


/* =========================================================
   FOOTER
========================================================= */

.dashboard-footer {
  color: #64748b;
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

.dashboard-footer.compact {
  font-size: 0.78rem;
  padding: 0.25rem 0 0.75rem;
}

.dashboard-footer.compact i {
  color: #0f9f5f;
  font-size: 0.95rem;
}



.chart-provinsi-wrapper {
  min-height: 360px;
}

@media (max-width: 1199.98px) {
  .chart-provinsi-wrapper {
    min-height: 340px;
  }
}

@media (max-width: 575.98px) {
  .chart-provinsi-wrapper {
    min-height: 320px;
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1199.98px) {
  .map-wrapper.compact {
    height: 280px;
  }

  .chart-md.compact,
  .chart-lg.compact {
    min-height: 280px;
  }

  .chart-sm.compact {
    min-height: 220px;
  }
}

@media (max-width: 991.98px) {
  .dashboard-hero.compact {
    padding: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .dashboard-hero,
  .filter-panel,
  .dashboard-card,
  .kpi-card {
    border-radius: 18px;
  }

  .kpi-card {
    min-height: auto;
  }

  .map-wrapper {
    height: 300px;
  }

  .dashboard-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .kpi-card.compact {
    padding: 0.8rem;
    gap: 0.65rem;
  }

  .kpi-icon.compact {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1.25rem;
  }

  .kpi-card.compact .kpi-value {
    font-size: 1.35rem;
  }

  .kpi-card.compact .kpi-desc {
    white-space: normal;
  }

  .dashboard-card-header.compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-card-actions {
    flex-wrap: wrap;
  }

  .dashboard-select.compact {
    width: 100%;
  }

  .map-wrapper.compact {
    height: 360px;
  }

  .chart-sm.compact {
    min-height: 210px;
  }

  .chart-md.compact,
  .chart-lg.compact {
    min-height: 260px;
  }
}

.chart-unit-kerja-wrapper {
  min-height: 360px;
  overflow: hidden;
}


@media (max-width: 1199.98px) {
  .chart-unit-kerja-wrapper {
    min-height: 300px;
  }
}

@media (max-width: 575.98px) {
  .chart-unit-kerja-wrapper {
    min-height: 280px;
  }
}

/* =========================================================
   MINI CHART GROUP CARD
========================================================= */

.mini-chart-card {
  background: #f8fafc;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  padding: 0.75rem;
  min-height: 265px;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}
.mini-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.mini-chart-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.mini-chart-title i {
  font-size: 1.05rem;
  line-height: 1;
}

.mini-chart-wrapper {
  flex: 1;
  min-height: 220px;
}



@media (max-width: 1199.98px) {
  .mini-chart-card {
    min-height: 270px;
  }

  .mini-chart-wrapper {
    min-height: 225px;
  }
}

@media (max-width: 575.98px) {
  .mini-chart-card {
    min-height: 250px;
  }

  .mini-chart-wrapper {
    min-height: 210px;
  }
}

.map-wrapper.compact {
  height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef6;
}

#map-dashboard {
  width: 100%;
  height: 100%;
}

@media (max-width: 1199.98px) {
  .map-wrapper.compact {
    height: 280px;
  }
}

@media (max-width: 575.98px) {
  .map-wrapper.compact {
    height: 260px;
  }
}


/* =========================================================
   TOP LIST QUICK SUMMARY
========================================================= */

.top-list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.top-list-box {
  background: #f8fafc;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  padding: 0.85rem;
}

.top-list-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.top-list-title i {
  font-size: 1.05rem;
}

.top-list-content {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.top-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.top-list-rank {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #e8f1ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.top-list-info {
  min-width: 0;
  flex: 1;
}

.top-list-name {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-list-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.top-list-progress-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

.top-list-value {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 38px;
  text-align: right;
}

.top-list-empty {
  color: #94a3b8;
  font-size: 0.78rem;
  padding: 0.4rem 0;
}

[data-bs-theme="dark"] .top-list-box {
  background: #0f172a;
  border-color: #243247;
}

[data-bs-theme="dark"] .top-list-title,
[data-bs-theme="dark"] .top-list-name,
[data-bs-theme="dark"] .top-list-value {
  color: #f8fafc;
}

[data-bs-theme="dark"] .top-list-progress {
  background: #1e293b;
}

[data-bs-theme="dark"] .top-list-rank {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
}

/* =========================================================
   MAP + RESUME BALANCE
========================================================= */

.dashboard-map-summary-row {
  align-items: stretch;
}

.dashboard-map-summary-row .dashboard-card {
  min-height: 520px;
}

.map-card-body {
  height: calc(100% - 78px);
  display: flex;
  flex-direction: column;
}

.map-dashboard-wrapper {
  flex: 1;
  height: auto;
  min-height: 390px;
}

.dashboard-resume-card .dashboard-card-body {
  height: calc(100% - 78px);
}

.dashboard-resume-card .top-list-stack {
  height: 100%;
}

.dashboard-resume-card .top-list-box {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-resume-card .top-list-content {
  flex: 1;
}

@media (max-width: 1199.98px) {
  .dashboard-map-summary-row .dashboard-card {
    min-height: auto;
  }

  .map-card-body {
    height: auto;
  }

  .map-dashboard-wrapper {
    height: 360px;
    min-height: 360px;
  }

  .dashboard-resume-card .dashboard-card-body {
    height: auto;
  }
}

@media (max-width: 575.98px) {
  .map-dashboard-wrapper {
    height: 300px;
    min-height: 300px;
  }
}
.map-card-body {
  height: calc(100% - 78px);
  display: flex;
  flex-direction: column;
}

.map-dashboard-wrapper {
  flex: 1;
  height: auto;
  min-height: 390px;
}

/* =========================================================
   DASHBOARD MAP ENHANCEMENT
========================================================= */

.map-dashboard-wrapper {
  position: relative;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.leaflet-popup-content {
  margin: 0;
  min-width: 220px;
}

.map-popup-card {
  padding: 0.85rem;
}

.map-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #e8f1ff;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
}

.map-popup-title {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.map-popup-meta {
  display: grid;
  gap: 0.35rem;
  color: #475569;
  font-size: 0.76rem;
}

.map-popup-meta div {
  display: flex;
  gap: 0.4rem;
}

.map-popup-meta i {
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 1px;
}

.map-legend-dashboard {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  min-width: 180px;
}

.map-legend-title {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.map-legend-item:last-child {
  margin-bottom: 0;
}

.map-legend-color {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  flex: 0 0 auto;
}

[data-bs-theme="dark"] .leaflet-popup-content-wrapper {
  background: #111c2f;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .map-popup-title {
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-popup-meta {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .map-legend-dashboard {
  background: rgba(15, 23, 42, 0.94);
  border-color: #243247;
}

[data-bs-theme="dark"] .map-legend-title {
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-legend-item {
  color: #cbd5e1;
}
/* =========================================================
   MAP POPUP MODERN
========================================================= */

.leaflet-popup-content-wrapper {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
}

.leaflet-popup-content {
  margin: 0;
  min-width: 280px;
  max-width: 320px;
}

.leaflet-popup-tip {
  box-shadow: none;
}

.map-popup-card.modern {
  background: #ffffff;
  color: #0f172a;
}

.map-popup-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef6ff 100%);
  border-bottom: 1px solid #e5edf7;
}

.map-popup-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #e8f1ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.map-popup-heading {
  min-width: 0;
  flex: 1;
}

.map-popup-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.map-popup-title {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1rem 0;
}

.map-popup-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.map-popup-tag.primary {
  background: #e8f1ff;
  color: #2563eb;
}

.map-popup-tag.success {
  background: #e8f8ef;
  color: #16a34a;
}

.map-popup-tag i {
  font-size: 0.85rem;
}

.map-popup-info {
  padding: 0.8rem 1rem 1rem;
  display: grid;
  gap: 0.6rem;
}

.map-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.map-popup-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.95rem;
}

.map-popup-row-label {
  color: #94a3b8;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.18rem;
}

.map-popup-row-value {
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
}

/* Leaflet close button */
.leaflet-container a.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: #ffffff;
  color: #0f172a;
}

/* Dark mode */
[data-bs-theme="dark"] .map-popup-card.modern {
  background: #111c2f;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .map-popup-top {
  background: linear-gradient(135deg, #111c2f 0%, #0f172a 100%);
  border-bottom-color: #243247;
}

[data-bs-theme="dark"] .map-popup-label {
  color: #94a3b8;
}

[data-bs-theme="dark"] .map-popup-title {
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-popup-row-icon {
  background: #0f172a;
  color: #94a3b8;
}

[data-bs-theme="dark"] .map-popup-row-label {
  color: #64748b;
}

[data-bs-theme="dark"] .map-popup-row-value {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .leaflet-container a.leaflet-popup-close-button {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
}

[data-bs-theme="dark"] .leaflet-container a.leaflet-popup-close-button:hover {
  background: #1e293b;
  color: #ffffff;
}

/* =========================================================
   NEW DASHBOARD MAP MARKER
========================================================= */

.dashboard-map-marker {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--marker-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.28),
    0 0 0 4px rgba(255, 255, 255, 0.9);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-map-marker::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #ffffff;
}

.dashboard-map-marker span {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--marker-fill);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.dashboard-map-marker::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 2px solid var(--marker-border);
  opacity: 0.22;
  animation: dashboardMarkerPulse 1.6s ease-out infinite;
}

.leaflet-marker-icon:hover .dashboard-map-marker {
  transform: scale(1.18);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.36),
    0 0 0 5px rgba(255, 255, 255, 0.96);
}

@keyframes dashboardMarkerPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.34;
  }

  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

[data-bs-theme="dark"] .dashboard-map-marker {
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.42),
    0 0 0 4px rgba(15, 23, 42, 0.92);
}

[data-bs-theme="dark"] .dashboard-map-marker::before {
  background: #0f172a;
}

[data-bs-theme="dark"] .leaflet-marker-icon:hover .dashboard-map-marker {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.52),
    0 0 0 5px rgba(15, 23, 42, 0.96);
}

/* =========================================================
   MAP POPUP V2
========================================================= */

.leaflet-popup-content-wrapper {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.32);
}

.leaflet-popup-content {
  margin: 0;
  min-width: 310px;
  max-width: 360px;
}

.leaflet-popup-tip {
  box-shadow: none;
}

.map-popup-card-v2 {
  display: flex;
  background: #ffffff;
  color: #0f172a;
  overflow: hidden;
}

.map-popup-accent {
  width: 6px;
  flex: 0 0 6px;
}

.map-popup-main {
  flex: 1;
  min-width: 0;
  padding: 0.95rem;
}

.map-popup-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.map-popup-marker-preview {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background: var(--marker-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.map-popup-marker-preview::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 12px;
  background: #ffffff;
}

.map-popup-marker-preview span {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--marker-fill);
}

.map-popup-head-text {
  min-width: 0;
  flex: 1;
}

.map-popup-eyebrow {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.map-popup-title-v2 {
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-popup-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.map-popup-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.map-popup-chip.category {
  background: #f1f5f9;
  color: #334155;
}

.map-popup-chip i {
  font-size: 0.86rem;
}

.map-popup-detail {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.map-popup-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.map-popup-detail-item > i {
  width: 27px;
  height: 27px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.map-popup-detail-item small {
  display: block;
  color: #94a3b8;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.16rem;
}

.map-popup-detail-item strong {
  display: block;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

/* Close button */
.leaflet-container a.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  padding: 0;
  z-index: 5;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: #ffffff;
  color: #0f172a;
}

/* Dark mode */
[data-bs-theme="dark"] .map-popup-card-v2 {
  background: #111c2f;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .map-popup-marker-preview::before {
  background: #0f172a;
}

[data-bs-theme="dark"] .map-popup-eyebrow {
  color: #94a3b8;
}

[data-bs-theme="dark"] .map-popup-title-v2 {
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-popup-chip.category {
  background: #0f172a;
  color: #cbd5e1;
}

[data-bs-theme="dark"] .map-popup-detail {
  border-top-color: #243247;
}

[data-bs-theme="dark"] .map-popup-detail-item > i {
  background: #0f172a;
  color: #94a3b8;
}

[data-bs-theme="dark"] .map-popup-detail-item small {
  color: #64748b;
}

[data-bs-theme="dark"] .map-popup-detail-item strong {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .leaflet-container a.leaflet-popup-close-button {
  background: rgba(15, 23, 42, 0.92);
  color: #cbd5e1;
}

[data-bs-theme="dark"] .leaflet-container a.leaflet-popup-close-button:hover {
  background: #1e293b;
  color: #ffffff;
}

/* =========================================================
   MARKER CLUSTER MODERN
========================================================= */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(37, 99, 235, 0.18);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: #2563eb;
  color: #ffffff;
  font-weight: 900;
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.35),
    0 0 0 4px rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] .marker-cluster-small,
[data-bs-theme="dark"] .marker-cluster-medium,
[data-bs-theme="dark"] .marker-cluster-large {
  background: rgba(96, 165, 250, 0.18);
}

[data-bs-theme="dark"] .marker-cluster-small div,
[data-bs-theme="dark"] .marker-cluster-medium div,
[data-bs-theme="dark"] .marker-cluster-large div {
  background: #3b82f6;
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.28),
    0 0 0 4px rgba(15, 23, 42, 0.85);
}

.btn-reset-dashboard {
  width: 36px;
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
}

/* =========================================================
   MAP LEGEND TOGGLE CONTROL
========================================================= */

.map-legend-toggle-control {
  min-width: 180px;
  font-family: inherit;
}

.map-legend-toggle-btn {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
}

.map-legend-toggle-btn i {
  font-size: 1rem;
  line-height: 1;
}

.map-legend-toggle-btn span {
  flex: 1;
  text-align: left;
}

.map-legend-floating {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  max-width: 260px;
  max-height: 260px;
  overflow-y: auto;
}

.map-legend-heading {
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.45rem;
}

.map-legend-body {
  display: grid;
  gap: 0.38rem;
}

.map-legend-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.map-legend-row span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.map-legend-border {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #ffffff;
  flex: 0 0 auto;
}

.map-legend-border.status-selesai {
  border: 4px solid #16a34a;
}

.map-legend-border.status-proses {
  border: 4px solid #2563eb;
}

.map-legend-border.status-belum {
  border: 4px solid #f97316;
}

.map-legend-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.65rem 0;
}

/* Dark mode */
[data-bs-theme="dark"] .map-legend-toggle-btn,
[data-bs-theme="dark"] .map-legend-floating {
  background: rgba(15, 23, 42, 0.94);
  border-color: #243247;
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-legend-heading {
  color: #f8fafc;
}

[data-bs-theme="dark"] .map-legend-row {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .map-legend-border {
  background: #0f172a;
}

[data-bs-theme="dark"] .map-legend-divider {
  background: #243247;
}
/* =========================================================
   DASHBOARD DARK MODE
========================================================= */

[data-bs-theme="dark"] .dashboard-page {
  background: #0f172a;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .dashboard-hero,
[data-bs-theme="dark"] .dashboard-hero.compact,
[data-bs-theme="dark"] .filter-panel,
[data-bs-theme="dark"] .filter-panel.compact,
[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .kpi-card.compact,
[data-bs-theme="dark"] .dashboard-card,
[data-bs-theme="dark"] .dashboard-card.compact {
  background: #111c2f;
  border-color: #243247;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-bs-theme="dark"] .dashboard-hero.compact {
  background: linear-gradient(135deg, #111c2f 0%, #0f172a 100%);
}

[data-bs-theme="dark"] .filter-panel.compact {
  background: #0f172a;
}

[data-bs-theme="dark"] .hero-icon,
[data-bs-theme="dark"] .hero-icon.compact {
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
}

[data-bs-theme="dark"] .dashboard-card-header,
[data-bs-theme="dark"] .dashboard-card-header.compact {
  border-bottom-color: #243247;
}

[data-bs-theme="dark"] .dashboard-card-header h5,
[data-bs-theme="dark"] .dashboard-card-header h6,
[data-bs-theme="dark"] .dashboard-hero h3,
[data-bs-theme="dark"] .dashboard-hero h4,
[data-bs-theme="dark"] .kpi-value,
[data-bs-theme="dark"] .text-dark {
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .dashboard-card-header p,
[data-bs-theme="dark"] .dashboard-hero p,
[data-bs-theme="dark"] .kpi-label,
[data-bs-theme="dark"] .kpi-desc,
[data-bs-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
  background-color: #0b1220;
  border-color: #334155;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
  background-color: #0b1220;
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 0 0.15rem rgba(34, 197, 94, 0.18);
}

[data-bs-theme="dark"] .form-label {
  color: #94a3b8 !important;
}

[data-bs-theme="dark"] .btn-light {
  background-color: #111827;
  border-color: #334155 !important;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .btn-light:hover {
  background-color: #1e293b;
  color: #ffffff;
}

[data-bs-theme="dark"] .btn-icon-card {
  background: #0b1220;
  border-color: #334155 !important;
  color: #94a3b8;
}

[data-bs-theme="dark"] .btn-icon-card:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #475569 !important;
}

[data-bs-theme="dark"] .map-wrapper,
[data-bs-theme="dark"] .map-wrapper.compact {
  background: #0b1220;
}

[data-bs-theme="dark"] .dashboard-footer,
[data-bs-theme="dark"] .dashboard-footer.compact {
  color: #94a3b8;
}

[data-bs-theme="dark"] .dashboard-footer strong {
  color: #f8fafc !important;
}

/* KPI DARK SOFT COLORS */

[data-bs-theme="dark"] .kpi-blue .kpi-icon {
  background: rgba(37, 99, 235, 0.16);
  color: #60a5fa;
}

[data-bs-theme="dark"] .kpi-green .kpi-icon {
  background: rgba(22, 163, 74, 0.16);
  color: #4ade80;
}

[data-bs-theme="dark"] .kpi-indigo .kpi-icon {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

[data-bs-theme="dark"] .kpi-orange .kpi-icon {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

[data-bs-theme="dark"] .kpi-purple .kpi-icon {
  background: rgba(147, 51, 234, 0.16);
  color: #c084fc;
}

[data-bs-theme="dark"] .mini-chart-card {
  background: #0f172a;
  border-color: #243247;
  box-shadow: none;
}

[data-bs-theme="dark"] .mini-chart-title {
  color: #f8fafc;
}