/* Metas por Vendedor — reaproveita os cards da Meta da Loja (sg-*) */

.panel-seller-goal .mv-empty {
  margin: 8px 0;
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
}

/* Cards de vendedor */
.mv-sellers-cards {
  display: grid;
  gap: 10px;
}

.mv-seller-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #FFFFFF;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

#mv-stage-table.is-seller-mode th:nth-child(2),
#mv-stage-table.is-seller-mode td:nth-child(2),
#mv-stage-table.is-seller-mode th:nth-child(3),
#mv-stage-table.is-seller-mode td:nth-child(3),
#mv-stage-table.is-seller-mode th:nth-child(4),
#mv-stage-table.is-seller-mode td:nth-child(4) {
  display: none;
}

.mv-seller-card.is-inactive {
  opacity: 0.6;
}

.mv-seller-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1.8fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(70px, 0.6fr) 52px 72px;
  gap: 10px;
  align-items: end;
}

.mv-history-source {
  display: block;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--muted, #94a3b8);
}

.mv-dist-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mv-dist-mode-label {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  font-weight: 600;
}

.mv-mode-btn {
  height: 36px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #D6DEE8;
  border-radius: 10px;
  background: #FFFFFF;
  color: #64748B;
  cursor: pointer;
}

.mv-mode-btn.is-active {
  background: #EAF2FF;
  border-color: #93C5FD;
  color: #1E3A5F;
}

.mv-distribution-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.mv-dist-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #FCFDFE;
}

.mv-dist-card.is-warn {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}

.mv-dist-card.is-ok {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.mv-dist-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted, #94a3b8);
}

.mv-dist-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mv-name-field {
  min-width: 0;
}

.mv-linked-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  vertical-align: middle;
}

.mv-active-field {
  align-items: center;
  justify-items: center;
  text-align: center;
}

.mv-active-field span {
  width: 100%;
  text-align: center;
}

.mv-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3b82f6;
  cursor: pointer;
}

.mv-remove-field {
  align-items: center;
  justify-items: center;
  text-align: center;
}

.mv-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mv-remove-btn:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

.mv-remove-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Grupos de acao (Vendedores / Distribuicao) reorganizados em dropdown */
.mv-action-groups {
  position: relative;
  align-items: center;
}

.mv-action-group {
  position: relative;
  display: inline-block;
}

.mv-group-toggle.is-active {
  background: #EAF2FF;
  border-color: #93C5FD;
  color: #1E3A5F;
}

.mv-action-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: var(--shadow);
}

.mv-action-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.mv-action-menu-item:hover {
  background: #F1F5F9;
}

.mv-action-menu-item--danger {
  color: #dc2626;
}

.mv-action-menu-item--danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* Abas de etapa */
.mv-stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.mv-tab {
  height: 36px;
  padding: 2px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #D6DEE8;
  border-radius: 10px;
  background: #FFFFFF;
  color: #64748B;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mv-tab:hover {
  color: var(--text);
  background: #F8FAFC;
}

.mv-tab.is-active {
  background: #EAF2FF;
  border-color: #93C5FD;
  color: #1E3A5F;
}

.sg-diff-ok {
  color: #4ade80;
  font-weight: 600;
}

.sg-diff-warn {
  color: #f87171;
  font-weight: 600;
}

.mv-row-inactive {
  opacity: 0.55;
}

.mv-row-inactive small {
  color: var(--muted, #94a3b8);
}

/* Resumo por vendedor */
.mv-summary-levels {
  display: grid;
  gap: 4px;
}

.mv-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.mv-summary-row span {
  color: var(--muted, #94a3b8);
  font-weight: 600;
}

.mv-summary-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.mv-summary-row.sg-lv-bronze { background: rgba(var(--bronze-rgb), 0.12); }
.mv-summary-row.sg-lv-prata { background: rgba(var(--prata-rgb), 0.12); }
.mv-summary-row.sg-lv-ouro { background: rgba(var(--ouro-rgb), 0.12); }
.mv-summary-row.sg-lv-diamante { background: rgba(var(--diam-rgb), 0.12); }

/* Responsividade */
@media (max-width: 768px) {
  .mv-seller-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mv-name-field,
  .mv-notes-field {
    grid-column: 1 / -1;
  }

  .mv-dist-mode {
    flex-direction: column;
    align-items: stretch;
  }

  .mv-mode-btn {
    width: 100%;
  }

  .mv-stage-tabs .mv-tab {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .mv-seller-grid {
    grid-template-columns: 1fr;
  }
}
