/* Formulários e botões reutilizáveis em todo o sistema */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--nb-muted);
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--nb-border);
  border-radius: 10px;
  background: var(--nb-surface);
  color: var(--nb-text);
  font: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--nb-blue);
  box-shadow: 0 0 0 3px rgba(92, 133, 214, 0.2);
}

.input::placeholder {
  color: var(--nb-muted);
  opacity: 0.75;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.925rem;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--nb-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--nb-blue-hover);
}

.btn-secondary {
  background: var(--nb-soft);
  color: var(--nb-text);
  border-color: var(--nb-border);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--nb-soft) 70%, var(--nb-border));
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
}

.form-card .field span {
  font-weight: 600;
  color: var(--nb-text);
}

/* Switch de status */
.nb-status-field {
  justify-content: flex-end;
}

.nb-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--nb-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nb-switch:hover {
  border-color: rgba(79, 127, 212, 0.45);
}

.nb-switch.is-on {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.35);
}

.nb-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.nb-switch-ui {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #c5cad3;
  flex-shrink: 0;
  transition: background 0.18s ease;
}

.nb-switch.is-on .nb-switch-ui {
  background: #059669;
}

.nb-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.nb-switch.is-on .nb-switch-knob {
  transform: translateX(20px);
}

.nb-switch-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 7.5rem;
}

.nb-switch-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--nb-text);
}

.nb-switch-hint {
  font-size: 0.78rem;
  color: var(--nb-muted);
  font-weight: 500;
}

/* Vínculos empresa + perfil */
.vinculo-section {
  margin-top: 1.35rem;
}

.vinculo-section-head {
  margin-bottom: 0.85rem;
}

.vinculo-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vinculo-card {
  display: grid;
  grid-template-columns: auto 1fr minmax(180px, 240px);
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--nb-border);
  border-radius: 12px;
  background: var(--nb-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.vinculo-card.is-selected {
  border-color: rgba(79, 127, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 127, 212, 0.08);
  background: rgba(79, 127, 212, 0.03);
}

.vinculo-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.vinculo-check-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.nb-check-ui {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--nb-border);
  background: var(--nb-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vinculo-card.is-selected .nb-check-ui {
  background: var(--nb-blue);
  border-color: var(--nb-blue);
  color: #fff;
}

.vinculo-empresa {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  min-width: 0;
}

.vinculo-empresa strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--nb-text);
}

.vinculo-empresa small {
  font-size: 0.8rem;
  color: var(--nb-muted);
  font-weight: 500;
}

.vinculo-perfil {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.vinculo-perfil-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nb-muted);
}

.vinculo-perfil-select {
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2.1rem;
  font-weight: 600;
}

.vinculo-perfil-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background-color: rgba(0, 0, 0, 0.03);
}

@media (max-width: 720px) {
  .vinculo-card {
    grid-template-columns: auto 1fr;
  }

  .vinculo-perfil {
    grid-column: 1 / -1;
  }
}
