/* ============================================================
   FINANCEL — CONFIGS V3 PREMIUM
   Estilos específicos da tela de Configurações
   Mantém o mesmo padrão premium do dashboard, cartões e lançamentos
   ============================================================ */

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

:root {
  --configs-header-radius: 22px;
  --configs-card-radius: 1.6rem;
  --configs-border-soft: rgba(148, 163, 184, 0.32);
  --configs-border-strong: rgba(15, 23, 42, 0.95);
  --configs-pill-bg: rgba(15, 23, 42, 0.96);
  --configs-pill-border: rgba(148, 163, 184, 0.55);
  --configs-pill-muted: rgba(148, 163, 184, 0.85);
  --configs-gold-soft: rgba(250, 204, 21, 0.16);
  --configs-gold-strong: rgba(250, 204, 21, 0.85);
  --configs-danger-soft: rgba(239, 68, 68, 0.16);
  --configs-success-soft: rgba(34, 197, 94, 0.18);
  --configs-warning-soft: rgba(250, 204, 21, 0.1);
  --configs-info-soft: rgba(56, 189, 248, 0.12);
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.header {
  /* mesmo layout, apenas ajustes sutis para contexto "Configurações" */
  border-radius: var(--configs-header-radius);
}

.header .brand-tagline.faith {
  /* garante uma linha única e elegante no subtítulo */
  max-width: 280px;
  color: var(--gold);
  font-weight: 500;
}

/* botão "Voltar ao dashboard" no header direito */
.header-right .btn-header-ghost {
  border-color: rgba(148, 163, 184, 0.8);
}

/* botão "Ver A Receber" no header direito */
.header-right .btn-header-primary {
  background: linear-gradient(135deg, var(--gold), #fb923c);
  color: #111827;
  border: none;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.configs-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: flex-start;
  justify-content: stretch;
}

/* garante consistência visual dos cartões nesta página */
.dash-card {
  border-radius: var(--configs-card-radius);
  padding: 1rem 1.05rem 1.15rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.06), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(251, 191, 36, 0.10), transparent 55%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.99), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--configs-border-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}

/* header dos cards */
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--gold);
}

.dash-card-title-icon {
  width: 16px;
  height: 16px;
}

.dash-card-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-pill-soft {
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--configs-pill-border);
  background: var(--configs-pill-bg);
  color: var(--configs-pill-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.form-grid-two {
  margin-top: 0.4rem;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.form-group label {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.input-field,
.select-field {
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.8);
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    transform 0.06s ease;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.96),
    0 8px 18px rgba(0, 0, 0, 0.75);
  appearance: none;
}

.input-field::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.input-field:focus,
.select-field:focus {
  border-color: rgba(250, 204, 21, 0.85);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.96),
    0 0 0 1px rgba(250, 204, 21, 0.5),
    0 10px 26px rgba(0, 0, 0, 0.9);
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.98));
  transform: translateY(-0.5px);
}

.input-field[type="password"] {
  text-align: left;
}

/* select com ícone imaginário de seta */
.select-field {
  padding-right: 2.1rem;
  background-image: linear-gradient(135deg, rgba(148, 163, 184, 0.65), rgba(148, 163, 184, 0.1));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.select-field option,
.select-field optgroup {
  background-color: #0f172a;
  color: #e5e7eb;
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.btn-main {
  min-width: 180px;
  margin-top: 1rem;
}

.btn-secondary {
  margin-top: 0.8rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--muted);
  padding: 0.6rem 1.2rem;
  border-radius: 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(250, 204, 21, 0.5);
  color: var(--gold);
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.note-small {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.note-small span {
  color: var(--gold);
  font-weight: 500;
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

.configs-full-width {
  margin-top: 1.6rem;
}

/* ------------------------------------------------------------

   ------------------------------------------------------------ */

@media (max-width: 1024px) {
  .configs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 840px) {
  .form-grid-two,
  .grid-form-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .configs-grid {
    justify-items: center;
  }

  .configs-grid > .dash-card {
    width: min(100%, 720px);
  }
}

@media (max-width: 640px) {
  .dash-card {
    padding: 0.95rem 0.9rem 1rem;
    border-radius: 1.4rem;
  }

  .btn-main {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .configs-grid {
    gap: 1.2rem;
  }

  .note-small {
    padding-inline: 0.1rem;
  }
}

/* ------------------------------------------------------------
   Lista de usuários (premium)
   ------------------------------------------------------------ */

.usuarios-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.usuarios-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 1.05rem;
  border: 1px solid var(--configs-border-soft);
  background: radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.05), transparent 55%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.85));
}

.usuarios-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.usuarios-item-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuarios-item-email {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuarios-item-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.usuarios-pill {
  margin-left: 0;
}

.btn-mini {
  margin-top: 0;
  padding: 0.48rem 0.9rem;
  border-radius: 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ─── Input com botão de ação ─────────────────────────────── */
.input-with-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-with-action .input-field {
  flex: 1;
}

.btn-icon-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.95));
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.btn-icon-action:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.95), rgba(59, 130, 246, 1));
}

.btn-icon-action:active {
  transform: scale(0.96);
}

.btn-icon-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status mensagem WhatsApp */
.status-msg {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  padding: 0.25rem 0;
}

.status-msg.success {
  color: #22c55e;
}

.status-msg.error {
  color: #f97316;
}

/* ═══════════════════════════════════════════════════════════
   WHATSAPP CONFIG CARD — Notificações e Alertas
   ═══════════════════════════════════════════════════════════ */

.wa-config-card {
  border-left: 4px solid #25D366;
}

/* Status banner */
.wa-status-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border, #e5e7eb);
}
.wa-status-ok    { background: #f0fdf4; border-color: #86efac; color: #166534; }
.wa-status-warn  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.wa-status-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

/* Master toggle row */
.wa-toggle-master {
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

/* Toggle row genérico */
.wa-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  gap: 1rem;
  cursor: pointer;
}
.wa-toggle-row + .wa-toggle-row {
  border-top: 1px solid var(--border-light, #f3f4f6);
}
.wa-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.wa-toggle-label strong {
  font-size: 0.88rem;
  font-weight: 600;
}
.wa-toggle-label small {
  font-size: 0.75rem;
  color: var(--muted, #9ca3af);
}

/* iOS-style switch */
.wa-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.wa-switch input { opacity: 0; width: 0; height: 0; }
.wa-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.25s ease;
}
.wa-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wa-switch input:checked + .wa-slider {
  background: #25D366;
}
.wa-switch input:checked + .wa-slider::before {
  transform: translateX(20px);
}
.wa-switch input:disabled + .wa-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Config group */
.wa-config-group {
  padding: 0.75rem 0;
  transition: opacity 0.3s ease;
}
.wa-config-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Actions */
.wa-config-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .wa-status-ok    { background: #052e16; border-color: #166534; color: #86efac; }
  .wa-status-warn  { background: #451a03; border-color: #92400e; color: #fde68a; }
  .wa-status-error { background: #450a0a; border-color: #991b1b; color: #fca5a5; }
  .wa-slider       { background: #4b5563; }
}