.customers-view-tabs {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: .875rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.customers-view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 7rem;
  padding: .65rem 1rem;
  border: 0;
  border-radius: .65rem;
  color: var(--color-muted);
  background: transparent;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.customers-view-tab:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

.customers-view-tab.is-active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 .35rem .8rem color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.customers-view-count {
  min-width: 1.5rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  color: var(--color-text-soft);
  background: var(--color-bg);
  font-size: .7rem;
  line-height: 1.35;
}

.customers-view-tab.is-active .customers-view-count {
  color: var(--color-primary);
  background: #fff;
}

.customers-view-tab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  outline-offset: 2px;
}

.customers-map-card {
  position: relative;
  overflow: hidden;
  min-height: 34rem;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.customers-map-canvas {
  width: 100%;
  height: min(68vh, 48rem);
  min-height: 34rem;
  z-index: 1;
}

.customers-map-status {
  position: absolute;
  top: 1rem;
  left: 50%;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: calc(100% - 2rem);
  padding: .7rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  color: var(--color-text-soft);
  box-shadow: var(--shadow-lg);
  font-size: .8rem;
  font-weight: 700;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.customers-map-summary {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
  pointer-events: none;
}

.customers-map-summary span {
  padding: .55rem .8rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  color: var(--color-text-soft);
  box-shadow: var(--shadow-md);
  font-size: .75rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.customer-cluster-icon,
.customer-map-marker {
  border: 0;
  background: transparent;
}

.customer-cluster-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 4px solid color-mix(in srgb, #fff 75%, transparent);
  border-radius: 50%;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 .3rem .9rem rgba(var(--color-primary-rgb), .38);
  font-size: .9rem;
  font-weight: 800;
}

.customer-marker-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 12%;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 .3rem .8rem rgba(var(--color-primary-rgb), .35);
  transform: rotate(-45deg);
}

.customer-marker-dot i {
  font-size: .7rem;
  transform: rotate(45deg);
}

.customer-map-popup {
  min-width: 14rem;
  color: var(--color-text);
}

.customer-map-popup h3 {
  margin: 0 0 .25rem;
  font-size: .95rem;
  line-height: 1.25;
}

.customer-map-popup p {
  margin: .15rem 0;
  color: var(--color-muted);
  font-size: .76rem;
  line-height: 1.4;
}

.customer-map-popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .8rem;
}

.customer-map-popup-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: .55rem;
  color: var(--color-text-soft);
  background: var(--color-surface);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.customer-map-popup-actions button:last-child {
  border-color: transparent;
  color: #fff;
  background: var(--color-primary);
}

[data-theme="dark"] .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip {
  color: var(--color-text);
  background: var(--color-surface);
}

[data-theme="dark"] .leaflet-container a.leaflet-popup-close-button {
  color: var(--color-muted);
}

@media (max-width: 767px) {
  .customers-view-tabs { width: 100%; }
  .customers-view-tab { flex: 1; min-width: 0; }
  .customers-map-card,
  .customers-map-canvas { min-height: 28rem; }
  .customers-map-summary { right: .75rem; bottom: .75rem; left: .75rem; }
}
