/* RouterBox - Customer Geospatial Map Styles */

#view-customers-map {
  background-color: #0b1120;
  color: #f1f5f9;
}

#view-customers-map.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 65px);
  min-height: calc(100vh - 65px);
  overflow: hidden;
  position: relative;
}

.customer-map-toolbar {
  padding: 10px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.customer-map-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-search-box {
  position: relative;
  flex: 1;
}

.customer-search-box i.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

.customer-search-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  padding: 8px 32px 8px 34px;
  outline: none;
  transition: all 0.2s;
}

.customer-search-input:focus {
  border-color: #38bdf8;
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.customer-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px;
  display: none;
  font-size: 12px;
}

.customer-map-filters-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-area-select {
  flex: 1.4;
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
}

.customer-status-pills {
  display: flex;
  gap: 4px;
  flex: 1;
}

.status-pill {
  flex: 1;
  text-align: center;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}

.status-pill.active {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.status-pill.pill-isolir.active {
  background: #dc2626;
  color: #fff;
  border-color: #ef4444;
}

/* Map Canvas Container */
.customer-map-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

#customerLeafletMap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  background: #090d16;
}

/* Floating HUD on top of map */
.map-floating-stats {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-badge-count {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.map-badge-count span.highlight {
  color: #38bdf8;
}

/* Mode Map Switcher (Jalan vs Google Satelit) */
.map-layer-pill-group {
  display: flex;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.map-layer-pill {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.map-layer-pill.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.map-layer-pill:active {
  transform: scale(0.95);
}

.btn-map-float.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.map-floating-actions {
  position: absolute;
  right: 12px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.btn-map-float {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.btn-map-float:active {
  transform: scale(0.92);
  background: #1e293b;
}

/* Custom Marker Pins */
.custom-customer-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  color: #ffffff;
  font-size: 12px;
  transition: transform 0.15s ease-out;
}

.custom-customer-pin.pin-isolir {
  background: #ef4444;
}

.custom-customer-pin:hover {
  transform: scale(1.25);
  z-index: 1000 !important;
}

/* Technician GPS Location Pulse Pin */
.user-gps-pulse-pin {
  width: 18px;
  height: 18px;
  background: #0284c7;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 16px #38bdf8;
  position: relative;
}

.user-gps-pulse-pin::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: pulseRadar 2s infinite ease-out;
}

@keyframes pulseRadar {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Customer Details Bottom Sheet Modal */
.customer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  border-top: 2px solid #38bdf8;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 16px 18px 72px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.85);
  z-index: 1100;
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.customer-sheet.visible {
  transform: translateY(0);
}

.customer-sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: #475569;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.customer-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.customer-sheet-name {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 2px;
}

.customer-sheet-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-sheet-close {
  background: #1e293b;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #1e293b;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.customer-sheet-field {
  display: flex;
  flex-direction: column;
}

.customer-sheet-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.customer-sheet-val {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.customer-sheet-val.highlight {
  color: #38bdf8;
}

.customer-sheet-actions {
  display: flex;
  gap: 8px;
}

.btn-customer-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-customer-gmaps {
  background: #0284c7;
  color: #ffffff;
}

.btn-customer-gmaps:active {
  background: #0369a1;
}

.btn-customer-wa {
  background: #16a34a;
  color: #ffffff;
}

.btn-customer-wa:active {
  background: #15803d;
}

.btn-customer-gps-edit {
  background: #334155;
  color: #f1f5f9;
  flex: 0 0 44px;
}

/* Cluster styling override for dark mode */
.marker-cluster-small {
  background-color: rgba(16, 185, 129, 0.4) !important;
}
.marker-cluster-small div {
  background-color: rgba(16, 185, 129, 0.85) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.marker-cluster-medium {
  background-color: rgba(2, 132, 199, 0.4) !important;
}
.marker-cluster-medium div {
  background-color: rgba(2, 132, 199, 0.85) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.marker-cluster-large {
  background-color: rgba(139, 92, 246, 0.4) !important;
}
.marker-cluster-large div {
  background-color: rgba(139, 92, 246, 0.85) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   DESKTOP WEB WINBOX – PETA PELANGGAN WINDOW
   ========================================================================== */
.cmap-desk-root { display:flex; flex-direction:column; height:100%; min-height:0; background:#070d18; color:#f1f5f9; }
.cmap-desk-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 14px; background:linear-gradient(135deg, rgba(8,47,73,0.55) 0%, rgba(15,23,42,0.95) 100%); border-bottom:1px solid rgba(56,189,248,0.25); flex-shrink:0; }
.cmap-desk-title { display:flex; align-items:center; gap:10px; min-width:220px; }
.cmap-desk-orb { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:17px; background:linear-gradient(135deg,#0284c7 0%,#38bdf8 100%); box-shadow:0 0 14px rgba(56,189,248,0.45); }
.cmap-desk-search { position:relative; flex:1; min-width:220px; }
.cmap-desk-search > i { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:#38bdf8; font-size:12px; pointer-events:none; }
.cmap-desk-search input { width:100%; box-sizing:border-box; background:#0b1120; border:1px solid #334155; color:#f8fafc; font-size:12.5px; border-radius:8px; padding:8px 30px 8px 32px; outline:none; }
.cmap-desk-search input:focus { border-color:#38bdf8; box-shadow:0 0 0 2px rgba(56,189,248,0.2); }
.cmap-desk-search button { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:none; color:#64748b; cursor:pointer; display:none; }
.cmap-desk-select { background:#0b1120; border:1px solid #334155; color:#38bdf8; font-weight:700; font-size:12px; border-radius:8px; padding:8px 10px; min-width:170px; outline:none; cursor:pointer; }
.cmap-desk-pills { display:flex; gap:4px; }
.cmap-desk-pills .status-pill { flex:none; padding:7px 11px; font-size:11.5px; }
.cmap-desk-actions { display:flex; gap:6px; }
.cmap-desk-body { flex:1; display:flex; min-height:0; }
.cmap-desk-side { width:290px; flex-shrink:0; display:flex; flex-direction:column; background:#0b1120; border-right:1px solid rgba(255,255,255,0.08); min-height:0; }
.cmap-desk-kpis { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:12px; border-bottom:1px solid rgba(255,255,255,0.06); }
.cmap-desk-kpi { background:#111a2e; border:1px solid rgba(255,255,255,0.07); border-radius:10px; padding:8px 10px; display:flex; flex-direction:column; gap:2px; }
.cmap-desk-kpi span { font-size:10px; font-weight:700; color:#94a3b8; text-transform:uppercase; letter-spacing:0.04em; }
.cmap-desk-kpi strong { font-size:18px; font-weight:800; font-family:'JetBrains Mono', monospace; }
.cmap-desk-list-head { display:flex; justify-content:space-between; align-items:center; padding:9px 12px; font-size:11px; font-weight:700; color:#cbd5e1; text-transform:uppercase; border-bottom:1px solid rgba(255,255,255,0.06); }
.cmap-desk-list { flex:1; overflow-y:auto; min-height:0; }
.cmap-desk-item { display:flex; align-items:center; gap:9px; padding:8px 12px; border-bottom:1px solid rgba(255,255,255,0.04); cursor:pointer; transition:background 0.15s; }
.cmap-desk-item:hover { background:rgba(56,189,248,0.08); }
.cmap-desk-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.cmap-desk-name { font-size:12.5px; font-weight:700; color:#f8fafc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cmap-desk-meta { font-size:10.5px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:'JetBrains Mono', monospace; }
.cmap-desk-badge { font-size:9.5px; font-weight:800; letter-spacing:0.03em; }
.cmap-desk-mapwrap { flex:1; min-width:0; }
.cmap-desk-mapwrap .leaflet-top.leaflet-right { top:44px; }
/* Detail card: floating panel on the right instead of a mobile bottom sheet */
.customer-sheet.cmap-desk-sheet { left:auto; right:14px; bottom:14px; width:370px; max-width:calc(100% - 28px); padding:14px 16px 16px; border:1px solid rgba(56,189,248,0.35); border-radius:14px; transform:translateX(120%); }
.customer-sheet.cmap-desk-sheet.visible { transform:translateX(0); }
.customer-sheet.cmap-desk-sheet .customer-sheet-drag-handle { display:none; }
