/* Fontes carregadas via <link> nos layouts (app.php / auth.php):
   Source Sans em todo o sistema (corpo e títulos) — sem fonte display. */

/* ============================================================
   VARIÁVEIS — Paleta oficial Zelô (plano_cores.jpg)
   ============================================================
   Brand Blue   #143A9A  → primário, CTAs, nav, header
   Brand Gold   #FBCA0F  → acento, destaques, alertas
   Off-White    #FBFBF8  → background de página
   Light Grey   #EDEFF3  → painéis secundários, cabeçalhos de tabela
   Medium Grey  #A8B1C2  → bordas, ícones passivos, disabled
   Dark Grey    #333333  → texto principal
   Hover Blue   #1A4EB1  → hover state em botões primários
   ============================================================ */
:root {
  /* Marca */
  --azul:       #143A9A;
  --azul-dk:    #0E2B75;   /* hover mais escuro da nav/header */
  --azul-lt:    #1A4EB1;   /* hover state padrão conforme guia */
  --gold:       #FBCA0F;
  --gold-dk:    #D9AB00;   /* hover do gold */

  /* Superfície */
  --bg:         #FBFBF8;   /* Off-White — fundo de página */
  --bg-panel:   #EDEFF3;   /* Light Grey — painéis/th */
  --borda:      #A8B1C2;   /* Medium Grey — divisores, bordas */
  --borda-lt:   #D6DAE3;   /* borda leve para cards */
  --texto:      #333333;   /* Dark Grey — corpo de texto */
  --muted:      #6B7280;   /* subtexto/labels */
  --branco:     #ffffff;

  /* Feedback (mantidos — sem alteração no guia) */
  --verde:      #2ECC71;
  --vermelho:   #E74C3C;

  /* Patentes */
  --bronze:     #CD7F32;
  --prata:      #9EA8B3;   /* ajustado para harmonizar com paleta */
  --ouro:       #FBCA0F;   /* usa Brand Gold */
  --diamante:   #60B8E8;
  --master:     #FBCA0F;   /* Gold para master também */

  /* Tipografia — Source Sans em todo o sistema (corpo e títulos), sem fonte display */
  --ft:         'Source Sans 3', 'Source Sans Pro', sans-serif;
  --ftt:        'Source Sans 3', 'Source Sans Pro', sans-serif;

  /* Sombras — base azul da marca em vez de preto */
  --sh-sm:      0 2px 8px  rgba(20, 58, 154, .07);
  --sh-md:      0 6px 24px rgba(20, 58, 154, .12);
  --sh-lg:      0 12px 40px rgba(20, 58, 154, .16);

  --tr:         .2s cubic-bezier(.4,0,.2,1);
  --sidebar-w:  260px;
  --header-h:   60px;
  --radius:     12px;
}

/* ============================================================
   RESET
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--ft);
  background:  var(--bg);
  color:       var(--texto);
  font-size:   15px;
  line-height: 1.6;
}

/* Layout de 2 colunas (conteúdo + aside) usado nas páginas de perfil,
   ranking e indicação — colapsa para 1 coluna no tablet/mobile.
   A largura da coluna lateral é definida inline por página via
   grid-template-columns; aqui só garantimos o colapso responsivo. */
.zp-2col {
  display: grid;
  gap: 20px;
  align-items: start;
}
.zp-2col > * { min-width: 0; }
@media (max-width: 992px) {
  .zp-2col { grid-template-columns: 1fr !important; }
}
h1,h2,h3,h4,h5,h6 {
  font-family: var(--ftt);
  font-weight: 700;
  line-height: 1.2;
  color:       var(--azul);
}
a { color: var(--azul-lt); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--azul); }
img { max-width: 100%; height: auto; }

/* ============================================================
   LOGO SVG INLINE — substituição completa da logo antiga
   Usado via classe .logo-zelô nas views
   ============================================================ */
.logo-zelô {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
/* Logo embutida no PHP via <img src="/assets/img/logo-zelo.png"> */
.logo-zelô img {
  height: 36px;
  width:  auto;
  display: block;
  /* mantém nitidez em retina */
  image-rendering: -webkit-optimize-contrast;
}
/* Variante compacta: só ícone (sidebar collapse) */
.logo-zelô--icon img { height: 32px; }
/* Variante branca (header dark) */
.logo-zelô--white img { filter: brightness(0) invert(1); }
/* Versão texto quando não há SVG */
.logo-zelô-text {
  font-family: var(--ftt);
  font-size:   19px;
  font-weight: 800;
  color:       #fff;
  letter-spacing: -0.5px;
}
.logo-zelô-text .acento { color: var(--gold); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows:    var(--header-h) 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  grid-column: 1 / -1;
  grid-row: 1;
  background: var(--azul);             /* Brand Blue */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  box-shadow: 0 2px 16px rgba(20,58,154,.25);
  overflow: hidden;
  /* Linha de acento dourado na base do header — assinatura visual */
  border-bottom: 2px solid var(--gold);
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo-area img {
  height: 34px;
  width: auto;
  max-width: none;
  flex-shrink: 0;
}
/* Ícone de logo no header (fallback se imagem não carregar) */
.logo-icon {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  color: var(--azul);
}
.logo-text {
  font-family: var(--ftt);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo-text .acento { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px; cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--tr), border-color var(--tr);
  position: relative; text-decoration: none;
}
.header-btn:hover {
  background: rgba(251,202,15,.18);
  border-color: rgba(251,202,15,.4);
  color: var(--gold);
}
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  width: 16px; height: 16px;
  background: var(--gold); color: var(--azul);
  border-radius: 50%; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  padding: 5px 12px 5px 5px;
  border-radius: 24px; cursor: pointer;
  transition: background var(--tr); text-decoration: none;
}
.user-pill:hover {
  background: rgba(251,202,15,.18);
  border-color: rgba(251,202,15,.4);
}
.user-avatar {
  width: 26px; height: 26px;
  background: var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--azul); flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; }
.hamburger-btn {
  display: none;
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 4px;
  line-height: 1; flex-shrink: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.app-sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--azul-dk);          /* azul mais escuro para contraste */
  padding: 16px 0 24px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto; overflow-x: hidden;
  transition: transform var(--tr);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
  /* Linha dourada decorativa no topo da sidebar */
  border-top: 1px solid rgba(251,202,15,.2);
}
.app-sidebar::-webkit-scrollbar { width: 5px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2); border-radius: 3px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(251,202,15,.4); }

.sidebar-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 16px 20px 5px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 10px;
  color: rgba(255,255,255,.6); font-size: 14px; font-weight: 500;
  transition: all var(--tr); margin: 0 8px 2px;
  cursor: pointer; text-decoration: none;
  border: none; background: none;
  width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
/* Item ativo: Gold como destaque (conforme "Active Menu Item" do guia) */
.nav-item.active {
  background: rgba(251,202,15,.15);
  color: var(--gold);
  font-weight: 600;
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}
.nav-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: rgba(255,255,255,.07); flex-shrink: 0;
}
.nav-item.active .nav-icon {
  background: rgba(251,202,15,.2);
  color: var(--gold);
}
.sidebar-patente {
  margin: 6px 12px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(251,202,15,.15);
  border-radius: 12px; padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.pt-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.pt-bronze   { background: rgba(205,127,50,.2);  color: var(--bronze); }
.pt-prata    { background: rgba(158,168,179,.2);  color: var(--prata); }
.pt-ouro     { background: rgba(251,202,15,.2);   color: var(--gold); }
.pt-diamante { background: rgba(96,184,232,.2);   color: var(--diamante); }
.pt-master   { background: rgba(251,202,15,.25);  color: var(--gold); }
.pt-info small { font-size: 10px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; display: block; }
.pt-info strong { font-family: var(--ftt); font-size: 14px; color: #fff; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.app-main {
  grid-column: 2; grid-row: 2;
  min-width: 0;
  padding: 24px 28px;
  background: var(--bg);
  animation: fadeIn .3s ease;
  overflow-x: hidden;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.page-title   { font-size: 24px; font-weight: 800; color: var(--azul); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  grid-column: 1/-1;
  background: var(--azul-dk);
  color: rgba(255,255,255,.4);
  text-align: center; padding: 12px; font-size: 12px;
  border-top: 1px solid rgba(251,202,15,.15);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--branco);
  border: 1px solid var(--borda-lt);
  border-radius: 16px; padding: 22px;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--tr);
  overflow: hidden; min-width: 0;
}
.card:hover { box-shadow: var(--sh-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 8px; flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bg-panel);
}
.card-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--azul);
}
/* Acento dourado sutil no topo de cards em destaque */
.card--destaque {
  border-top: 3px solid var(--gold);
}

/* ============================================================
   KPI GRID
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 14px; margin-bottom: 22px;
}
.kpi-card {
  background: var(--branco);
  border: 1px solid var(--borda-lt);
  border-radius: 16px; padding: 18px;
  box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
  animation: slideUp .4s ease backwards; min-width: 0;
  container-type: inline-size; /* permite escalar o valor pela largura do card */
}
@keyframes slideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.kpi-card:nth-child(1){animation-delay:.05s} .kpi-card:nth-child(2){animation-delay:.1s}
.kpi-card:nth-child(3){animation-delay:.15s} .kpi-card:nth-child(4){animation-delay:.2s}

/* Linha de acento no topo de cada KPI */
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--bg-panel);
  border-radius: 16px 16px 0 0;
  transition: background var(--tr);
}
.kpi-card.verde::before  { background: var(--verde); }
.kpi-card.azul::before   { background: var(--azul); }
.kpi-card.gold::before   { background: var(--gold); }
.kpi-card.laranja::before { background: #F59E0B; }  /* amber — sem laranja no brand, usar amber */

.kpi-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 12px;
}
.kpi-card.verde  .kpi-icon { background: rgba(46,204,113,.1);  color: var(--verde); }
.kpi-card.azul   .kpi-icon { background: rgba(20,58,154,.1);   color: var(--azul); }
.kpi-card.gold   .kpi-icon { background: rgba(251,202,15,.15); color: var(--gold-dk); }
.kpi-card.laranja .kpi-icon { background: rgba(245,158,11,.1); color: #D97706; }

.kpi-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px;
}
.kpi-value {
  font-family: var(--ft); font-weight: 700;
  font-size: clamp(16px, 11cqi, 26px);
  color: var(--azul); line-height: 1.1;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.kpi-value.green { color: var(--verde); }

/* ============================================================
   BOTÕES — baseados no UI Element Mappings do guia
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px;
  font-family: var(--ft); font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--tr);
  text-decoration: none; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
/* Primary → Brand Blue, hover #1A4EB1 (conforme guia) */
.btn-primary {
  background: var(--azul);
  color: #fff;
}
.btn-primary:hover {
  background: var(--azul-lt);   /* #1A4EB1 exato do guia */
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(20,58,154,.3);
  color: #fff;
}
/* Gold — para CTA de destaque / alerta importante */
.btn-gold {
  background: var(--gold);
  color:      var(--azul);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--gold-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(251,202,15,.4);
  color: var(--azul);
}
/* Secondary mantém azul escuro */
.btn-secondary {
  background: var(--azul-dk);
  color: #fff;
}
.btn-secondary:hover { background: var(--azul); color: #fff; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--azul);
  border: 1.5px solid var(--borda);
}
.btn-outline:hover {
  border-color: var(--azul);
  background: rgba(20,58,154,.06);
  color: var(--azul);
}
.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { filter: brightness(.92); }
.btn-danger  { background: var(--vermelho); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm  { padding: 6px 13px; font-size: 12px; border-radius: 8px; }
.btn-lg  { padding: 13px 26px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group   { margin-bottom: 18px; }
.form-label   {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--azul); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 10px 13px;
  background: var(--branco);
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-family: var(--ft); font-size: 14px; color: var(--texto);
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none; min-width: 0; box-sizing: border-box;
}
.form-control:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(20,58,154,.12);
  background: #fff;
}
.form-control.is-invalid {
  border-color: var(--vermelho);
  box-shadow: 0 0 0 3px rgba(231,76,60,.1);
}
.invalid-feedback { font-size: 12px; color: var(--vermelho); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23143A9A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-pendente   { background: rgba(245,158,11,.12); color: #D97706; }
.badge-aprovada,
.badge-aprovado   { background: rgba(46,204,113,.12);  color: #16A34A; }
.badge-paga       { background: rgba(20,58,154,.1);    color: var(--azul); }
.badge-cancelada,
.badge-rejeitado  { background: rgba(231,76,60,.1);    color: var(--vermelho); }
.badge-ativo      { background: rgba(46,204,113,.12);  color: #16A34A; }
.badge-inativo,
.badge-bloqueado  { background: rgba(168,177,194,.15); color: #6B7280; }
.badge-processando { background: rgba(20,58,154,.1);   color: var(--azul); }
/* Novos status v3 */
.badge-venda_confirmada  { background: rgba(20,58,154,.1);    color: var(--azul); }
.badge-comissao_recebida { background: rgba(251,202,15,.18);  color: var(--azul-dk); font-weight: 700; }
.badge-encerrado         { background: rgba(46,204,113,.12);  color: #16A34A; }
.badge-pendente_ativacao { background: rgba(168,177,194,.15); color: #6B7280; }

/* Patentes */
.pt-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  font-family: var(--ftt); white-space: nowrap;
}
.pt-badge.sem_patente { background: rgba(168,177,194,.12); color: var(--muted); border: 1px solid var(--borda-lt); }
.pt-badge.madeira  { background: rgba(150,106,68,.14); color: #7A4B2A; border: 1px solid rgba(150,106,68,.35); }
.pt-badge.bronze   { background: rgba(205,127,50,.12); color: var(--bronze); border: 1px solid rgba(205,127,50,.3); }
.pt-badge.prata    { background: rgba(158,168,179,.15); color: #6B7280; border: 1px solid rgba(158,168,179,.4); }
.pt-badge.ouro     { background: rgba(251,202,15,.15);  color: var(--azul-dk); border: 1px solid rgba(251,202,15,.5); }
.pt-badge.diamante { background: rgba(96,184,232,.15);  color: #1D6FA0; border: 1px solid rgba(96,184,232,.4); }
.pt-badge.master   { background: rgba(251,202,15,.2);   color: var(--azul-dk); border: 1px solid rgba(251,202,15,.6); }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--borda-lt); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.table th {
  background: var(--bg-panel);          /* Light Grey do guia */
  padding: 11px 14px; text-align: left;
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1px solid var(--borda-lt); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--borda-lt); color: var(--texto); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(20,58,154,.025); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: var(--azul);             /* Brand Blue */
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
/* Padrão de fundo sutil — chave em watermark */
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 25% 40%, rgba(251,202,15,.08) 0%, transparent 50%),
                    radial-gradient(circle at 75% 70%, rgba(26,78,177,.3) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  background: #fff; border-radius: 22px;
  width: 100%; max-width: 440px; padding: 40px;
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
  position: relative; z-index: 1;
  animation: authIn .5s cubic-bezier(.175,.885,.32,1.275);
  /* Linha dourada no topo do card de auth */
  border-top: 4px solid var(--gold);
}
@keyframes authIn { from{opacity:0;transform:scale(.92) translateY(16px)} to{opacity:1;transform:scale(1) translateY(0)} }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img {
  height: 56px; width: auto;
  margin-bottom: 14px;
}
/* Fallback sem logo SVG */
.auth-logo-icon {
  width: 64px; height: 64px;
  background: var(--gold); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(251,202,15,.4);
  color: var(--azul);
}
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--azul); }
.auth-logo p  { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   ALERTAS — Accent Detail conforme guia usa Gold
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: 12px; font-size: 14px;
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
}
.alert-success { background: rgba(46,204,113,.08);  color: #16A34A; border: 1px solid rgba(46,204,113,.2); }
.alert-error   { background: rgba(231,76,60,.08);   color: var(--vermelho); border: 1px solid rgba(231,76,60,.2); }
/* warning usa Gold — "important alerts" do guia */
.alert-warning { background: rgba(251,202,15,.12);  color: var(--azul-dk); border: 1px solid rgba(251,202,15,.4); }
.alert-info    { background: rgba(20,58,154,.07);   color: var(--azul); border: 1px solid rgba(20,58,154,.15); }
.disabled-field { background: var(--bg-panel); opacity: .6; cursor: not-allowed; }

/* ============================================================
   QR CODE
   ============================================================ */
.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-wrapper {
  width: 150px; height: 150px;
  border: 3px solid var(--azul); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 14px 0; background: #fff; padding: 8px;
  transition: transform var(--tr), box-shadow var(--tr);
  /* Halo dourado ao hover */
}
.qr-wrapper:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 4px rgba(251,202,15,.35), var(--sh-md);
}
.qr-wrapper img { width: 100%; height: 100%; object-fit: contain; }
.codigo-indicacao {
  font-family: 'Courier New', monospace; font-size: 16px; font-weight: 700;
  color: var(--azul); background: var(--bg-panel);
  border: 1.5px dashed var(--borda);
  padding: 7px 18px; border-radius: 8px; letter-spacing: 2px; word-break: break-all;
}

/* ============================================================
   SALDO / CARTEIRA
   ============================================================ */
.saldo-card {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-lt) 100%);
  color: #fff; padding: 24px; border-radius: 16px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
/* Detalhe dourado no saldo card */
.saldo-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: var(--gold);
}
.saldo-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .7; margin-bottom: 5px; }
.saldo-valor {
  font-family: var(--ft); font-weight: 700;
  font-size: clamp(24px, 5vw, 36px);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.saldo-card > div { min-width: 0; } /* permite os valores encolherem no flex */
.saldo-verde { color: var(--verde); }

/* ============================================================
   MODAL
   ============================================================ */
.zp-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(14,43,117,.6); z-index: 999;
  align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(4px);
}
.zp-modal.open { display: flex; }
.zp-modal-box {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 500px; max-height: 92vh;
  overflow-y: auto; padding: 28px;
  box-shadow: 0 24px 80px rgba(14,43,117,.3);
  animation: modalIn .3s cubic-bezier(.175,.885,.32,1.275);
  border-top: 4px solid var(--gold);
}
@keyframes modalIn { from{opacity:0;transform:scale(.92) translateY(16px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 8px; }
.modal-title { font-family: var(--ftt); font-size: 18px; font-weight: 700; color: var(--azul); }
.modal-close { background: none; border: none; font-size: 18px; color: #999; cursor: pointer; padding: 4px; line-height: 1; transition: color .2s; }
.modal-close:hover { color: var(--vermelho); }

/* ============================================================
   IMÓVEIS
   ============================================================ */
.imovel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 18px;
}
.imovel-card {
  background: #fff; border: 1px solid var(--borda-lt); border-radius: 14px;
  overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform var(--tr), box-shadow var(--tr); min-width: 0;
}
.imovel-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.imovel-thumb {
  height: 170px;
  background: linear-gradient(135deg, var(--bg-panel), #D6DAE3);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: var(--azul); opacity: .4;
  position: relative; overflow: hidden;
}
.imovel-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.imovel-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--azul); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; text-transform: uppercase;
}
.imovel-body { padding: 14px; }
.imovel-valor { font-family: var(--ftt); font-size: 19px; font-weight: 800; color: var(--azul); margin-bottom: 5px; }
.imovel-titulo { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 9px; }
.imovel-features { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }

/* ============================================================
   REDE
   ============================================================ */
.rede-node {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: #fff; border: 1px solid var(--borda-lt); border-radius: 12px;
  margin-bottom: 7px; transition: box-shadow var(--tr);
}
.rede-node:hover { box-shadow: var(--sh-sm); border-color: rgba(20,58,154,.2); }
.rede-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  background: rgba(20,58,154,.08); color: var(--azul);
}
.rede-nivel-block { margin-left: 22px; padding-left: 18px; border-left: 2px dashed var(--borda-lt); margin-bottom: 10px; }
.rede-nivel-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 7px;
  display: flex; align-items: center; gap: 5px;
}

/* ============================================================
   COMISSÃO CARD
   ============================================================ */
.com-card {
  border-left: 4px solid var(--verde); padding: 14px 18px;
  background: #fff; border-radius: 0 12px 12px 0;
  margin-bottom: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
  box-shadow: var(--sh-sm); flex-wrap: wrap; min-width: 0;
}
.com-card.pendente    { border-left-color: #F59E0B; }
.com-card.paga        { border-left-color: var(--azul); }
.com-card.cancelado   { border-left-color: var(--vermelho); }
.com-card.rede        { border-left-color: var(--gold); }
.com-valor {
  font-family: var(--ftt); font-size: 20px; font-weight: 800;
  color: var(--verde); white-space: nowrap;
}
.com-card.pendente .com-valor { color: #D97706; }
.com-card.rede .com-valor     { color: var(--azul-dk); }

/* ============================================================
   STEP / FLUXO (usado nas pages de captação admin)
   ============================================================ */
.step-flow {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px; flex-wrap: wrap;
}
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); position: relative;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-panel); border: 2px solid var(--borda);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.step.done .step-num  { background: var(--verde);   border-color: var(--verde);  color: #fff; }
.step.active .step-num { background: var(--azul);   border-color: var(--azul);   color: #fff; }
.step.active { color: var(--azul); }
.step-line {
  flex: 1; height: 2px; background: var(--borda-lt); min-width: 24px; max-width: 48px;
}
.step.done + .step-line { background: var(--verde); }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.text-verde   { color: var(--verde)   !important; }
.text-vermelho { color: var(--vermelho) !important; }
.text-gold    { color: var(--gold-dk) !important; }
.text-azul    { color: var(--azul)    !important; }
.text-muted   { color: var(--muted)   !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.d-flex{display:flex}.align-center{align-items:center}.justify-between{justify-content:space-between}
.gap-1{gap:8px}.gap-2{gap:16px}.flex-1{flex:1;min-width:0}.fw-bold{font-weight:700}
.separator{border:none;border-top:1px solid var(--borda-lt);margin:18px 0}
.bg-panel{background:var(--bg-panel)!important}
.spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}
/* Spinner para fundo claro */
.spinner-dark{border-color:rgba(20,58,154,.2);border-top-color:var(--azul)}

/* ============================================================
   SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(14,43,117,.45); z-index: 89;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   RESPONSIVO — Tablet (≤ 992px)
   ============================================================ */
@media (max-width: 992px) {
  .app-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) 1fr;
  }
  .app-sidebar {
    position: fixed; top: var(--header-h); left: 0;
    width: var(--sidebar-w); height: calc(100vh - var(--header-h));
    transform: translateX(-100%); z-index: 90;
    box-shadow: 4px 0 24px rgba(14,43,117,.25);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { grid-column: 1; padding: 18px 14px; width: 100%; max-width: 100%; }
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .app-footer { grid-column: 1; }
  .step-flow { gap: 4px; }
}

/* ============================================================
   RESPONSIVO — Mobile (≤ 576px)
   ============================================================ */
@media (max-width: 576px) {
  :root { --header-h: 56px; }
  .app-main { padding: 14px 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* .kpi-value usa clamp(...cqi...) — escala sozinho pela largura do card */
  .kpi-card { padding: 14px; }
  .imovel-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title { font-size: 20px; }
  .auth-card { padding: 24px 18px; }
  /* .saldo-valor usa clamp() responsivo — sem tamanho fixo aqui */
  .btn { font-size: 13px; padding: 8px 14px; }
  .btn-sm { font-size: 11px; padding: 5px 11px; }
  .zp-modal-box { padding: 20px; border-radius: 14px; }
  .zp-modal { padding: 8px; }
  .logo-text { font-size: 15px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 12px; }
  .user-name { display: none; }
  .user-pill { padding: 5px; }
  .com-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .com-valor { font-size: 18px; }
  .step-flow { flex-direction: column; align-items: flex-start; }
  .step-line { display: none; }
}

/* ============================================================
   RESPONSIVO — Mobile pequeno (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
