/* ── NES — Estabelecimentos de Atendimento ── */

/* ── Banner no topbar ── */
.nes-estab-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2, rgba(0,0,0,.04));
  border-radius: 8px;
  font-size: 0.8rem;
  flex-shrink: 0;
  max-width: 320px;
  overflow: hidden;
  border: 1px solid var(--gray-200, #e2e8f0);
}

.estab-label {
  color: var(--gray-500, #64748b);
  white-space: nowrap;
}

.estab-nome {
  font-weight: 600;
  color: var(--primary, #00b4a6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.estab-nenhum {
  color: #b45309;
  font-weight: 600;
  white-space: nowrap;
}

.estab-btn-trocar {
  background: none;
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray-600, #475569);
  white-space: nowrap;
  flex-shrink: 0;
}

.estab-btn-trocar:hover {
  background: var(--gray-100, #f1f5f9);
}

/* ── Modais compartilhados ── */
.nes-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.nes-modal {
  background: var(--surface-1, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nes-estab-modal-inner { max-width: 640px; }
.nes-estab-form-inner  { max-width: 780px; }

.nes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200, #e2e8f0);
  flex-shrink: 0;
}

.nes-modal-header h3 { margin: 0; font-size: 1rem; }

.nes-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-400, #94a3b8);
  line-height: 1;
  padding: 0 4px;
}

.nes-modal-close:hover { color: var(--gray-700, #334155); }

.nes-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.nes-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200, #e2e8f0);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Itens no modal seletor ── */
.estab-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: border-color .15s;
}

.estab-item--ativo {
  border-color: var(--primary, #00b4a6);
  background: rgba(0,180,166,.04);
}

.estab-item-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.estab-logo-mini {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--gray-200, #e2e8f0);
  flex-shrink: 0;
}

.estab-item-cidade { color: var(--gray-500, #64748b); font-size: .85rem; }
.estab-item-meta   { font-size: .8rem; color: var(--gray-500, #64748b); margin-top: 2px; }

.estab-item-acoes {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.estab-badge-padrao {
  display: inline-block;
  font-size: .7rem;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  margin-left: 4px;
}

.estab-badge-sel {
  font-size: .8rem;
  color: var(--primary, #00b4a6);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Seção em Configurações ── */
.config-card {
  background: var(--surface-1, #fff);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.estab-config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
}

.estab-config-item:last-child { border-bottom: none; }

.estab-config-info { font-size: .9rem; min-width: 0; }

.estab-config-acoes {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Formulário grid ── */
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-1 { grid-template-columns: 1fr; }

@media (max-width: 600px) {
  .nes-estab-banner { max-width: 160px; }
  .estab-nome { max-width: 80px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
