.mapa-producao-bar {
  box-sizing: border-box;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  min-height: 38px !important;
  padding: 4px;
  overflow: visible;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.mapa-producao-viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.mapa-producao-viewport::-webkit-scrollbar { display: none; }

.mapa-producao-track {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  width: max-content;
  min-width: 100%;
}

.mapa-producao-nav {
  display: none;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.mapa-producao-nav.is-visible { display: inline-flex; }
.mapa-producao-nav:last-child { margin-right: 2px; }
.mapa-producao-nav:hover { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }

.mapa-producao-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  max-width: 310px;
  padding: 3px 7px 3px 9px;
  border: 1px solid var(--mapa-producao-borda, #cbd5e1);
  border-radius: 15px;
  background: var(--mapa-producao-fundo, #fff);
  color: #172033;
  cursor: pointer;
  white-space: nowrap;
}

.mapa-producao-chip:hover,
.mapa-producao-chip.is-open {
  border-color: var(--mapa-producao-cor, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .10);
}

.mapa-producao-chip-cor {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--mapa-producao-cor, #64748b);
}

.mapa-producao-chip-nome {
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.mapa-producao-chip-valor { color: #334155; }
.mapa-producao-chip-seta { color: #64748b; font-size: 13px; }

.mapa-producao-m {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.mapa-producao-m:hover { border-color: #1f57d8; color: #1f57d8; }
.mapa-producao-m.is-active { border-color: #1f57d8; background: #e8efff; color: #1f57d8; }

.mapa-producao-panel {
  position: fixed;
  z-index: 1300;
  display: none;
  width: min(370px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
}

.mapa-producao-panel.is-open { display: flex; flex-direction: column; }

.mapa-producao-panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 9px 10px 9px 13px;
  border-bottom: 1px solid #dbe3ea;
  background: var(--mapa-producao-fundo, #f8fafc);
  cursor: move;
  user-select: none;
  touch-action: none;
}

.mapa-producao-panel-ident { min-width: 0; flex: 1 1 auto; }
.mapa-producao-panel-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #172033; font-size: 14px; font-weight: 800; }
.mapa-producao-panel-total { margin-top: 3px; color: #475569; font-size: 11px; }
.mapa-producao-panel-actions { display: flex; align-items: center; gap: 5px; }

.mapa-producao-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.68);
  color: #334155;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.mapa-producao-panel-icon:hover { background: #fff; color: #0f172a; }

.mapa-producao-panel-body {
  min-height: 0;
  padding: 12px 14px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mapa-producao-panel-label {
  margin-bottom: 7px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.mapa-producao-sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid #edf1f5;
}

.mapa-producao-sub:first-of-type { border-top: 0; }
.mapa-producao-sub-main { min-width: 0; }
.mapa-producao-sub-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mapa-producao-sub-cor { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 2px; }
.mapa-producao-sub-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #172033; font-size: 12px; }
.mapa-producao-sub-valor { color: #172033; font-size: 11px; font-weight: 800; white-space: nowrap; }
.mapa-producao-sub-pct { color: #64748b; font-size: 10px; }
.mapa-producao-progress { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: #e2e8f0; }
.mapa-producao-progress > span { display: block; height: 100%; border-radius: inherit; }
.mapa-producao-empty { padding: 18px 4px; color: #64748b; font-size: 12px; text-align: center; }
.mapa-producao-panel.is-minimized .mapa-producao-panel-body { display: none; }
.mapa-producao-panel.is-minimized { width: min(310px, calc(100vw - 24px)); }

@media (max-width: 700px) {
  .mapa-producao-chip { max-width: 260px; }
  .mapa-producao-panel,
  .mapa-producao-panel.is-minimized {
    top: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto;
    max-height: min(62vh, 520px);
    border-radius: 14px;
  }
  .mapa-producao-panel-head { cursor: default; touch-action: auto; }
}
