/* ═══════════════════════════════════════════════════════════
   VARIÁVEIS & RESET
═══════════════════════════════════════════════════════════ */
:root {
  /* AmorSaúde */
  --as-teal:      #61c1d0;
  --as-teal-dark: #4aa8b8;
  --as-red:       #d53e36;

  /* Cartão de TODOS */
  --ct-green:     #a5ff01;
  --ct-teal:      #00a988;
  --ct-teal-dark: #007a63;

  /* Superfícies */
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;

  /* Texto */
  --text:         #1a202c;
  --text-muted:   #718096;
  --text-light:   #a0aec0;

  /* Bordas */
  --border:       #e2e8f0;
  --border-focus: var(--as-teal);

  /* Status */
  --success:      var(--ct-teal);
  --warning:      #f59e0b;
  --danger:       var(--as-red);

  /* Espaçamento */
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:    0 4px 20px rgba(0,0,0,.12);

  --navbar-h:     60px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Modo Escuro ─────────────────────────────────────────── */
:root.dark {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #283548;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-light:   #64748b;
  --border:       #334155;
  --border-focus: var(--as-teal);
  --shadow:       0 1px 4px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-md:    0 4px 20px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Garante que o atributo hidden não seja sobrescrito por regras de display */
[hidden] { display: none !important; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ═══════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  box-shadow: 0 1px 0 var(--border);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-right: 1.5rem;
}

.navbar__logo { height: 28px; width: auto; }

.navbar__title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--as-teal-dark);
  letter-spacing: -.3px;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
}

.nav-link {
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.nav-link:hover  { background: var(--bg); color: var(--text); }
.nav-link.active { background: #e6f7f9; color: var(--as-teal-dark); }

.navbar__user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.navbar__username {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.main-content--centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.5px;
}

/* ═══════════════════════════════════════════════════════════
   CARD
═══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   BOTÕES
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; pointer-events: none; }

.btn--primary {
  background: var(--ct-teal);
  color: #fff;
  border-color: var(--ct-teal);
}
.btn--primary:hover { background: var(--ct-teal-dark); border-color: var(--ct-teal-dark); }

.btn--outline {
  background: transparent;
  color: var(--ct-teal);
  border-color: var(--ct-teal);
}
.btn--outline:hover { background: #e6f7f5; }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn--ghost:hover { background: var(--bg); }

.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--danger:hover { background: #b83028; }

.btn--sm  { padding: .35rem .85rem; font-size: .8rem; }
.btn--full { width: 100%; }

/* ═══════════════════════════════════════════════════════════
   FORMULÁRIOS
═══════════════════════════════════════════════════════════ */
.form { display: flex; flex-direction: column; gap: 1rem; }

.form__section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}

.form__section-optional {
  font-weight: 400;
  font-size: .8rem;
  text-transform: none;
  letter-spacing: 0;
}

.form__group { display: flex; flex-direction: column; gap: .35rem; }

.form__label {
  font-size: .825rem;
  font-weight: 600;
  color: var(--text);
}

.form__input {
  padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form__input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(97,193,208,.2);
}
.form__input--sm { padding: .4rem .7rem; font-size: .825rem; }

.form__row { display: flex; flex-direction: column; gap: 1rem; }
.form__row--2col { flex-direction: row; }
.form__row--2col .form__group { flex: 1; }

.form__actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .5rem;
}

.form__error {
  color: var(--danger);
  font-size: .825rem;
  font-weight: 500;
  padding: .5rem .75rem;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
}

.required { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge--live    { background: #d1fae5; color: #065f46; }
.badge--warning { background: #fef3c7; color: #92400e; }
.badge--success { background: #d1fae5; color: #065f46; }
.badge--pending { background: #f0f9ff; color: #0369a1; }

.badge--live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ═══════════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th, .table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--surface-2);
}
.table tbody tr:hover { background: var(--surface-2); }
.table__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem !important;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal__title { font-size: 1.1rem; font-weight: 700; }

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  padding: .25rem;
}
.modal__close:hover { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   LOGIN CARD
═══════════════════════════════════════════════════════════ */
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

.login-card__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.login-card__logos img { height: 40px; width: auto; }

.login-card__title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.login-card__subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 1.75rem;
}

/* ═══════════════════════════════════════════════════════════
   FILTERS
═══════════════════════════════════════════════════════════ */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filters__group { min-width: 160px; }

/* ═══════════════════════════════════════════════════════════
   FORM CARD
═══════════════════════════════════════════════════════════ */
.form-card { max-width: 720px; }

/* ═══════════════════════════════════════════════════════════
   INDICAÇÕES
═══════════════════════════════════════════════════════════ */
.indicacao-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  position: relative;
  background: var(--surface-2);
}

.indicacao-block__title {
  font-size: .825rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.indicacao-block__remove {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--danger);
  font-size: .8rem;
  font-weight: 600;
}

#indicacoes-container { display: flex; flex-direction: column; gap: .75rem; }

/* ── Caixa PIX do cliente (nova venda) ───────────────────── */
.pix-key-box {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #f0fdf9;
  border: 1.5px solid var(--ct-teal);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
}
:root.dark .pix-key-box {
  background: #0d2b24;
}
.pix-key-box__icon { font-size: 1.4rem; line-height: 1.6; flex-shrink: 0; }

/* ── Dark mode toggle ────────────────────────────────────── */
.dark-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.dark-toggle:hover { background: var(--bg); }
