/* ============================================================
   KINSTOCK — LISTA DA FAMÍLIA — estilos
   Tema claro/escuro via [data-theme] no <html>
   ============================================================ */

:root {
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-500: #6366f1;
  --violet-500: #8b5cf6;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --red-600: #dc2626;
  --red-500: #ef4444;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* ----- tema claro (padrão) ----- */
  --bg: #f4f5fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e6e8f2;
  --text: #14162b;
  --text-muted: #6b7093;
  --text-faint: #9ca0c0;
  --shadow-sm: 0 1px 2px rgba(20, 22, 43, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 22, 43, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 22, 43, 0.14);
  --sidebar-bg: #14162b;
  --sidebar-text: #c7c9e6;
  --sidebar-text-active: #ffffff;
}

html[data-theme="escuro"] {
  --bg: #0e0f1e;
  --bg-elevated: #171933;
  --surface: #171933;
  --surface-2: #1e2140;
  --border: #2b2e54;
  --text: #f1f2fb;
  --text-muted: #a3a6ce;
  --text-faint: #6a6d99;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --sidebar-bg: #090a17;
  --sidebar-text: #9296c4;
  --sidebar-text-active: #ffffff;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; color: inherit; }

/* Troca de tema (claro/escuro) suave em todo o app — sem isso, cartões,
   barra lateral e modais mudavam de cor de golpe enquanto o <body> já
   estava fazendo a transição, o que parecia quebrado. */
.sidebar, .item-card, .modal-card, .stat-card, .bottom-nav, .bnav-mais-sheet,
.topheader, input, select, textarea, .btn, .avatar, .toast {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.hidden { display: none !important; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: #0e0f1e;
}

.login-bg { position: absolute; inset: 0; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 14s ease-in-out infinite;
}
.blob-a { width: 420px; height: 420px; background: #6366f1; top: -120px; left: -100px; }
.blob-b { width: 380px; height: 380px; background: #8b5cf6; bottom: -140px; right: -80px; animation-delay: -4s; }
.blob-c { width: 300px; height: 300px; background: #10b981; bottom: 10%; left: 30%; opacity: 0.25; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.08); }
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(23, 25, 51, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  color: #f1f2fb;
  animation: cardIn .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-mark {
  background: linear-gradient(135deg, var(--indigo-500), var(--violet-500));
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(99,102,241,.4);
}
.logo-mark svg { stroke: #ffffff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-mark-img {
  width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99,102,241,.4);
}
.login-logo h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login-logo p { margin: 0; font-size: 14px; color: #a3a6ce; }

.login-title { font-size: 19px; font-weight: 700; margin: 0 0 14px; color: #f1f2fb; }
.login-sub { font-size: 14.5px; color: #a3a6ce; margin: 2px 0 0; line-height: 1.45; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.avatar-pick {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 88px;
  justify-content: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.avatar-pick:hover { transform: translateY(-3px); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.avatar-pick .avatar { width: 60px; height: 60px; font-size: 26px; }
.avatar-pick span.avatar-name { font-size: 14.5px; font-weight: 600; color: #e3e4f6; text-align: center; }
.avatar-pick { position: relative; }
.avatar-biometria {
  position: absolute; top: 4px; right: 6px;
  font-size: 13px; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* Banner de oferta pra ativar Face ID / digital (passo 3 do login) */
.biometria-dispensar-link { display: block; width: 100%; text-align: center; margin-top: 4px; }

.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.avatar-sm { width: 34px; height: 34px; font-size: 16px; }
.avatar-lg { width: 56px; height: 56px; font-size: 26px; }

.login-step { animation: fadeIn .25s ease; }

/* ---------- tour rápido (onboarding) ---------- */
.onboarding-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 20px; background: #0e0f1e; }
.onboarding-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  background: rgba(23, 25, 51, 0.65); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg);
  padding: 36px 28px; box-shadow: var(--shadow-lg); color: #f1f2fb;
  animation: cardIn .5s cubic-bezier(.2,.8,.2,1); text-align: center;
}
.onboarding-slide { animation: fadeIn .3s ease; }
.onboarding-icon {
  margin-bottom: 14px; width: 64px; height: 64px; border-radius: 16px;
  background: rgba(99,102,241,.14); display: flex; align-items: center; justify-content: center;
  margin-left: auto; margin-right: auto;
}
.onboarding-icon svg { width: 30px; height: 30px; stroke: #a5a7ef; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onboarding-slide h2 { font-size: 19px; margin: 0 0 10px; font-weight: 800; }
.onboarding-slide p { font-size: 13.5px; color: #c3c5e6; line-height: 1.6; margin: 0; }
.onboarding-dots { display: flex; gap: 8px; justify-content: center; margin: 26px 0 22px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: all .2s ease; }
.onboarding-dot.active { background: var(--indigo-500); width: 22px; border-radius: 999px; }
.onboarding-actions { display: flex; align-items: center; justify-content: space-between; }
.onboarding-actions .btn-primary { padding: 11px 24px; }

.link-back {
  background: none; border: none; color: #a3a6ce; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0 0 14px; display: inline-block;
}
.link-back:hover { color: white; }

.login-pin-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 20px 0 10px; }
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all .15s ease;
}
.pin-dot.filled { background: var(--indigo-500); border-color: var(--indigo-500); }
.pin-dots.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.login-error {
  text-align: center;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  margin: 6px 0 0;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.key {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f1f2fb;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  padding: 14px 0;
  cursor: pointer;
  transition: background .12s ease, transform .06s ease;
}
.key:hover { background: rgba(255,255,255,0.12); }
.key:active { transform: scale(.94); }
.key-ghost { color: #a3a6ce; font-size: 15px; }

/* Teclado travado durante o bloqueio de tentativas de PIN */
.keypad.locked { opacity: .35; pointer-events: none; }

.forgot-note {
  text-align: center;
  font-size: 12px;
  color: #a3a6ce;
  margin-top: 14px;
  line-height: 1.5;
}
.forgot-note strong { color: #e3e4f6; }

.pin-confirm-btn { width: 100%; margin-top: 14px; justify-content: center; opacity: .4; pointer-events: none; padding: 14px 18px; font-size: 15.5px; min-height: 52px; }
.pin-confirm-btn:not(:disabled) { opacity: 1; pointer-events: auto; }

.familia-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.familia-form input {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #f1f2fb; font-size: 16px; padding: 15px 14px; border-radius: 12px;
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.familia-form input::placeholder { color: #7d80a6; }
.familia-form input:focus { outline: none; border-color: var(--indigo-500); }
.familia-form input#redefinirCodigo { text-align: center; letter-spacing: 0.4em; font-size: 20px; font-weight: 700; }

.email-recuperacao-status { font-size: 13.5px; color: var(--text-muted); margin: 4px 0 12px; line-height: 1.5; }

.familia-tipo-conta { margin-top: 14px; }
.familia-tipo-conta .hint { color: #a3a6ce; margin: 0 0 8px; }
.tipo-conta-opcoes { display: flex; gap: 8px; }
.tipo-conta-opcao {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #d5d7f2; font-size: 13px; font-weight: 600; padding: 11px 8px;
  border-radius: 12px; cursor: pointer; text-align: center;
}
.tipo-conta-opcao input { display: none; }
.tipo-conta-opcao:has(input:checked) { border-color: var(--indigo-500); background: rgba(99,102,241,0.18); color: #fff; }
#familiaCnpj { margin-top: 10px; }

/* Passo -1 do login: 4 botões (Entrar/Criar conta × Família/Empresa) */
.escolha-conta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.escolha-conta-btn {
  width: 100%; flex-direction: column; justify-content: center; align-items: center;
  gap: 6px; padding: 16px 8px; font-size: 14px; text-align: center; line-height: 1.3;
  min-height: 78px;
}
.login-card .escolha-conta-btn { white-space: normal; }
.escolha-conta-icon { display: flex; }
.escolha-conta-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- relatório de gastos (painel) ---------- */
.relatorio-gastos-total { font-size: 26px; font-weight: 900; color: var(--emerald-600); margin: 4px 0 14px; }
.relatorio-gastos-centros { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.relatorio-centro-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.relatorio-centro-row strong { font-weight: 700; }
.estoque-baixo-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sugestao-padrao-row { gap: 10px; }
.sugestao-padrao-row span { flex: 1; }

/* ---------- comparativo de gasto entre meses/anos (painel) ---------- */
.comparativo-gastos-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.comparativo-gastos-titulo { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.comparativo-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px;
}
.comparativo-label { font-weight: 700; }
.comparativo-valor { font-weight: 600; }
.comparativo-up { color: var(--red-600); font-weight: 700; }
.comparativo-down { color: var(--emerald-600); font-weight: 700; }

/* ---------- ranking de produtos (painel) ---------- */
.ranking-produtos-subtitulo { font-size: 13px; font-weight: 700; margin: 14px 0 8px; color: var(--text-muted); }
.ranking-produtos-subtitulo:first-child { margin-top: 0; }

/* ---------- gráfico de gasto por semana (painel) ---------- */
.gasto-semana-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 120px;
  padding: 10px 4px 0; border-bottom: 1px solid var(--border);
}
.gasto-semana-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.gasto-semana-bar { width: 100%; max-width: 26px; min-height: 2px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--indigo-500), var(--indigo-600)); }
.gasto-semana-label { font-size: 10px; color: var(--text-faint); }

/* ---------- offline / manutenção ---------- */
.offline-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0e0f1e; padding: 20px;
}
.offline-card {
  background: rgba(23,25,51,.7); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); padding: 40px 32px;
  text-align: center; max-width: 380px; color: #f1f2fb;
  box-shadow: var(--shadow-lg);
}
.offline-icon { margin-bottom: 10px; display: flex; justify-content: center; }
.offline-icon svg { width: 42px; height: 42px; stroke: #a5a7ef; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.offline-card h1 { font-size: 20px; margin: 0 0 8px; }
.offline-card p { color: #a3a6ce; font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.offline-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------- conexão (sidebar) ---------- */
.conn-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--sidebar-text);
  padding: 2px 4px;
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.conn-status.offline .conn-dot { background: var(--red-500); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.conn-status.offline { color: #fca5a5; }

/* ---------- operador ---------- */
.operator-card { border: 1px solid rgba(245,158,11,.35); background: linear-gradient(180deg, rgba(245,158,11,.06), transparent); }
.operator-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* Dentro de um card do Operador, cada bloco direto (parágrafo, input,
   botão, form, grid) ganha um respiro mínimo do anterior — sem isso,
   vários cards (Plano, Admin geral, Relatório por e-mail etc.) ficavam
   com tudo grudado verticalmente. Margens colapsam, então isso só
   garante um mínimo — não soma com o que já existia. */
.operator-card > * + *,
#view-configuracoes .card > * + * { margin-top: 12px; }
.operator-card .btn + .btn,
#view-configuracoes .card .btn + .btn { margin-top: 10px; }
.operator-hint { margin: 2px 0 0; }

.switch {
  width: 46px; height: 26px; border-radius: 999px;
  background: var(--border); border: none; cursor: pointer;
  position: relative; flex-shrink: 0; transition: background .15s ease;
}
.switch[aria-checked="true"] { background: var(--emerald-500); }
.switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: white;
  transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }

.login-footnote {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 360px;
}

.login-copyright {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.28);
  text-align: center;
  max-width: 340px;
}

.login-legal-links {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  font-size: 10.5px;
  text-align: center;
}
.login-legal-links a {
  color: rgba(255,255,255,0.45);
  text-decoration: underline;
}
.login-legal-links a:hover { color: rgba(255,255,255,0.7); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-screen {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 24px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand-text strong { color: white; font-size: 15px; font-weight: 800; }
.sidebar-brand-text span { font-size: 11px; color: var(--sidebar-text); }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none;
  color: var(--sidebar-text);
  font-size: 14px; font-weight: 600;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: linear-gradient(135deg, var(--indigo-600), var(--violet-500)); color: white; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.nav-item .badge { margin-left: auto; }

.badge {
  background: var(--red-500); color: white;
  font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 7px; min-width: 18px; text-align: center;
}
.badge.hidden { display: none; }

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--sidebar-text);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  align-self: flex-start;
  width: 100%;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.icon-moon { display: none; }
html[data-theme="escuro"] .icon-sun { display: none; }
html[data-theme="escuro"] .icon-moon { display: block; }

.me-card { display: flex; align-items: center; gap: 8px; }
.me-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.me-info strong { color: white; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-info span { font-size: 11px; color: var(--sidebar-text); }
.icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--sidebar-text);
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }
.icon-btn .icon { width: 15px; height: 15px; }

/* ---------- main content ---------- */
.main { flex: 1; min-width: 0; }

.topheader {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px 16px;
  border-bottom: 1px solid transparent;
}
.topheader h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.topheader-actions { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 220px;
}
.search-box .icon { color: var(--text-faint); }
.search-box input {
  border: none; outline: none; background: transparent;
  font-size: 14px; width: 100%; color: var(--text);
}

.content { padding: 8px 32px 100px; max-width: 900px; }

.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.muted { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.card { transition: box-shadow .2s ease, border-color .2s ease; }
.card:hover { box-shadow: var(--shadow-md); }

/* ---------- add item form ---------- */
.add-item-card { margin-bottom: 24px; }
.add-item-row { display: grid; grid-template-columns: 2fr auto 1fr 1.2fr auto; gap: 10px; }
#scanBarcodeBtn { padding: 11px 14px; }
.add-item-row input, .add-item-row select {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  width: 100%;
}
.add-item-row input:focus, .add-item-row select:focus { outline: 2px solid var(--indigo-500); outline-offset: -1px; }
.add-item-row-money { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.add-item-row-money input {
  padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13px; width: 100%;
}
.add-item-row-money input:focus { outline: 2px solid var(--indigo-500); outline-offset: -1px; }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }

/* ---------- assistente de IA (chat) ---------- */
.assistente-card { display: flex; flex-direction: column; }
.assistente-aviso {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.assistente-receita-btn { align-self: flex-start; margin-bottom: 14px; }
.assistente-mensagens {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px 12px;
  margin-bottom: 12px;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.minha {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--indigo-600), var(--violet-500));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.ia {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble-digitando { opacity: 0.7; font-style: italic; }
.assistente-form { grid-template-columns: 1fr auto auto; }
.assistente-mic-btn {
  font-size: 16px;
  padding: 0 14px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.assistente-mic-btn.gravando {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  border-color: transparent;
  animation: micPulso 1.1s ease-in-out infinite;
}
@keyframes micPulso {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.chat-item-adicionado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 12px;
}
@media (max-width: 640px) {
  .assistente-mensagens { max-height: 60vh; }
}

/* ---------- visão geral do Operador (painel de controle) ---------- */
.visao-geral-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.visao-geral-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.visao-geral-emoji { font-size: 18px; }
.visao-geral-valor { font-size: 20px; font-weight: 700; }
.visao-geral-label { font-size: 12px; color: var(--text-muted); }

/* ---------- permissões granulares por membro ---------- */
.member-permissoes {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.permissao-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}
.permissao-chip.on {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--text);
}
.permissao-chip.off {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--text);
}

/* ---------- comparador de preços / lojas ---------- */
.comparador-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.comparador-list { display: flex; flex-direction: column; gap: 12px; }
.comparador-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.comparador-item-nome { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comparador-economia { font-size: 12px; font-weight: 500; color: #22c55e; }
.comparador-lojas { display: flex; flex-direction: column; gap: 4px; }
.comparador-loja-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}
.comparador-loja-row.melhor { background: rgba(34, 197, 94, 0.12); font-weight: 600; }
.lojas-list { display: flex; flex-direction: column; gap: 8px; }
.loja-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.loja-nome { flex: 1; min-width: 120px; font-size: 14px; }

/* ---------- plano (grátis/pro) ---------- */
.plano-status { font-size: 15px; margin-bottom: 10px; }
.plano-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  margin-right: 4px;
}
.plano-pill-pro { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.plano-pill-gratis { background: var(--surface-2); border: 1px solid var(--border); }
.plano-uso-box { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.plano-nota { margin-bottom: 12px; }
.plano-pix-box {
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 12px; font-size: 13px;
}
.plano-pix-box p { margin: 0 0 6px; }
.plano-pix-box p:last-child { margin-bottom: 0; }
.pix-key-row {
  background: var(--surface); border: 1px dashed var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; word-break: break-all;
}
.admin-conta-pendente {
  font-size: 11px; font-weight: 700; color: var(--amber-600);
  background: rgba(245,158,11,.14); border-radius: 999px; padding: 3px 9px; margin-left: 6px;
}
#tornarContaMasterBtn { margin-top: 10px; }

/* ---------- painel admin "de emergência" (senha, fora do login normal) --- */
.painel-admin-canto {
  position: fixed; bottom: 10px; right: 10px; z-index: 500;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); opacity: .35; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .15s ease;
}
.painel-admin-canto:hover { opacity: 1; }
.painel-admin-card { max-width: 640px; width: 92vw; max-height: 80vh; overflow-y: auto; }
.painel-admin-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.painel-admin-topo h3 { margin: 0; }

/* ---------- admin geral (conta master) ---------- */
.admin-preco-pro { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.admin-preco-pro label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.admin-preco-pro-row { display: flex; gap: 8px; margin-top: 6px; }
.admin-preco-pro-row input { width: 110px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.admin-geral-botoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-resumo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
.admin-resumo-item {
  background: var(--surface-2); border-radius: 12px; padding: 10px 8px;
  text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.admin-resumo-item strong { font-size: 20px; font-weight: 900; color: var(--indigo-600); }
.admin-resumo-item span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.admin-nova-conta-form { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.admin-nova-conta-form h3 { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 0 0 6px; }
.admin-nova-conta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nova-conta-row input, .admin-nova-conta-row select {
  flex: 1 1 140px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.admin-conta-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.admin-conta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.admin-conta-meta { font-size: 12px; }
.admin-conta-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-membros-lista {
  width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.admin-membro-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px;
}
.admin-membros-loading { font-size: 12.5px; margin: 0; }

/* ---------- feedback ---------- */
.feedback-label { font-size: 13px; font-weight: 700; margin: 18px 0 8px; }
.feedback-notas { display: flex; gap: 8px; }
.feedback-nota {
  font-size: 15px; font-weight: 800; line-height: 1; width: 42px; height: 42px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  transition: all .12s ease;
}
.feedback-nota:hover { transform: translateY(-2px); }
.feedback-nota.selecionada { border-color: var(--indigo-500); background: rgba(99,102,241,.12); }
.feedback-categorias { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-chip {
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
  transition: all .12s ease;
}
.feedback-chip.selecionada { border-color: var(--indigo-500); background: rgba(99,102,241,.12); color: var(--indigo-600); }
#feedbackTexto {
  width: 100%; margin-top: 4px; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical;
  background: var(--surface-2); color: var(--text); box-sizing: border-box;
}
.feedback-confirmacao { margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--emerald-600); }
.feedback-admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.feedback-admin-row {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.feedback-admin-row-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feedback-admin-nota { font-size: 20px; line-height: 1; }
.feedback-admin-quando { font-size: 11.5px; margin-left: auto; }
.feedback-admin-texto { font-size: 13.5px; margin: 8px 0 6px; line-height: 1.5; }
.feedback-admin-meta { font-size: 11.5px; }

/* ---------- fornecedores e pedidos de compra (empresa) ---------- */
.stack-form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.stack-form input, .stack-form select, .stack-form textarea {
  font-size: 14px; font-weight: 400; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: inherit; width: 100%; box-sizing: border-box; resize: vertical;
}
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus {
  outline: 2px solid var(--indigo-500); outline-offset: -1px;
}
.stack-form button { align-self: flex-start; }

.fornecedores-list, .ordens-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.fornecedor-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.fornecedor-info strong { font-size: 14px; }
.fornecedor-info p { margin: 4px 0 0; }
.fornecedor-obs { font-style: italic; }

.ordem-row {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ordem-row-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ordem-row-topo strong { font-size: 14px; }
.ordem-status {
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.ordem-status-rascunho { background: rgba(148,150,190,.16); color: var(--text-muted); }
.ordem-status-enviado { background: rgba(245,158,11,.14); color: var(--amber-600); }
.ordem-status-recebido { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.ordem-itens { margin: 8px 0 0; }
.ordem-notas { font-style: italic; }
.ordem-meta { font-size: 11.5px; margin-top: 6px; }
.ordem-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- dinheiro: total da lista, orçamento, preço por item ---------- */
.lista-money-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.money-pill {
  font-size: 12.5px; font-weight: 800; padding: 6px 13px; border-radius: 999px;
  background: rgba(16,185,129,.12); color: var(--emerald-600);
}
.money-pill-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.money-pill.over-budget { background: rgba(239,68,68,.14); color: var(--red-600); }
.money-pill.warning { background: rgba(245,158,11,.14); color: var(--amber-600); }
.item-preco { font-size: 11.5px; font-weight: 700; color: var(--emerald-600); background: rgba(16,185,129,.1); padding: 2px 9px; border-radius: 999px; }
.catalog-precos { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.catalog-preco-melhor { color: var(--emerald-600); font-weight: 700; }

.btn {
  border: none; border-radius: 10px;
  padding: 11px 18px;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .05s ease, opacity .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(135deg, var(--indigo-600), var(--violet-500)); color: white; box-shadow: 0 4px 14px rgba(99,102,241,.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,.42); }
.btn-secondary { background: var(--text); color: var(--bg); }
.btn-secondary:hover { opacity: .85; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--red-600); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--text-faint); color: var(--text); }
.btn-danger-outline { background: transparent; border: 1px solid var(--red-600); color: var(--red-600); }
.btn-danger-outline:hover { background: var(--red-600); color: white; }

.login-demo-btn { width: 100%; justify-content: center; margin-top: 12px; font-size: 13px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 8px; }

/* ---------- list toolbar / chips ---------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.filter-chips { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: all .12s ease;
}
.chip.active { background: var(--indigo-600); color: white; border-color: var(--indigo-600); }
.sort-box { display: flex; align-items: center; gap: 10px; }
.sort-box select {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.count-label { font-size: 13px; color: var(--text-faint); }

/* ---------- items grid ---------- */
.items-grid { display: flex; flex-direction: column; gap: 10px; }
.category-header {
  font-size: 13px; font-weight: 800; color: var(--text-muted);
  margin: 10px 2px 0; padding-top: 6px; text-transform: uppercase; letter-spacing: .03em;
}
.category-header:first-child { margin-top: 0; padding-top: 0; }

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease, opacity .3s ease;
  animation: itemIn .25s ease;
}
@keyframes itemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.item-card:hover { box-shadow: var(--shadow-md); }
.item-card.bought { opacity: 0.55; }
.item-card.removing { opacity: 0; transform: scale(.96) translateX(10px); }

.item-check {
  width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; background: var(--surface);
  position: relative;
  transition: all .15s ease;
}
.item-check .icon { width: 14px; height: 14px; opacity: 0; transition: opacity .1s ease; }
.item-check.checked { background: var(--emerald-500); border-color: var(--emerald-500); }
.item-check.checked .icon { opacity: 1; }
/* A caixinha visual continua pequena (fica melhor no layout da lista), mas
   a área que realmente responde ao toque cresce pra ~36px — abaixo do
   ideal de 44px pra não sobrepor o item vizinho numa lista densa, mas bem
   mais fácil de acertar no celular do que os 24px originais. */
.item-check::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px; transform: translate(-50%, -50%);
}

.pendente-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber-500); flex-shrink: 0; margin: 0 7px;
}

.sugestoes-card { margin-bottom: 24px; }
.sugestoes-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.sugestoes-header select { padding: 8px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.sugestoes-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sugestao-chip {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .12s ease; color: var(--text);
}
.sugestao-chip:hover { background: var(--indigo-500); color: white; border-color: var(--indigo-500); }
.sugestao-chip .sugestao-count { opacity: .6; font-weight: 500; margin-left: 4px; }

#novaListaNome {
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 14px; width: 100%; box-sizing: border-box;
  margin: 6px 0 10px;
}
.participantes-checklist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.participante-opcao {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--surface-2); border-radius: 999px; padding: 6px 13px 6px 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
}
.participante-opcao input { margin: 0; }
.participante-opcao.checked { border-color: var(--indigo-500); background: rgba(99,102,241,.1); }
.nova-lista-btn { width: auto; }

.escolher-lista-opcoes { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; max-height: 300px; overflow-y: auto; }
.escolher-lista-opcao {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text);
}
.escolher-lista-opcao:hover { border-color: var(--indigo-500); }
.escolher-lista-opcao .muted { margin: 2px 0 0; font-weight: 500; }

.pedido-mensagem-input {
  margin-top: 8px; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13px;
}
.pedido-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pedido-row .pedido-info strong { display: block; }
.pedido-row .pedido-info p { margin: 2px 0 0; }

/* ---------- confete (bônus de indicação) ---------- */
.confete-palco {
  position: fixed; inset: 0; z-index: 999; pointer-events: none; overflow: hidden;
}
.confete-peca {
  position: absolute; top: -12px; width: 9px; height: 14px; opacity: .9;
  animation-name: confeteCair; animation-timing-function: ease-in; animation-fill-mode: forwards;
}
@keyframes confeteCair {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0; }
}

/* ---------- landing (página inicial de quem ainda não é cliente) ---------- */
.landing-screen {
  position: fixed; inset: 0; z-index: 500; overflow-y: auto;
  background: #0e0f1e; color: #f1f2fb;
  font-feature-settings: normal;
}
.landing-screen a { color: inherit; }

.landing-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: rgba(14, 15, 30, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.landing-logo { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; letter-spacing: 0.2px; }
.landing-logo img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.landing-nav { display: flex; align-items: center; gap: 26px; }
.landing-nav a { font-size: 14px; color: #b7b9d6; text-decoration: none; transition: color .15s ease; }
.landing-nav a:hover { color: #ffffff; }
.landing-cta-topo { font-size: 13px; padding: 9px 18px; }
@media (max-width: 720px) { .landing-nav { display: none; } }

/* hero */
.landing-hero { position: relative; overflow: hidden; padding: 76px 24px 60px; }
.landing-hero-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.landing-hero-bg .blob { opacity: 0.35; }
.landing-hero-grid {
  position: relative; z-index: 1; max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 56px;
}
.landing-kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px;
  color: #c7c9ff; background: rgba(99, 102, 241, 0.16); border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}
.landing-hero-copy h1 { font-size: 42px; font-weight: 900; line-height: 1.18; margin: 0 0 18px; letter-spacing: -0.5px; }
.landing-sub { font-size: 16.5px; color: #b7b9d6; line-height: 1.65; margin: 0 0 30px; max-width: 480px; }
.landing-hero-ctas { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.landing-cta-principal { font-size: 15.5px; padding: 14px 28px; }
.landing-cta-secundaria { font-size: 14.5px; color: #d6d7ee; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.25); padding-bottom: 2px; }
.landing-cta-secundaria:hover { color: #ffffff; }
.landing-sub-nota { font-size: 12.5px; color: #7d80a8; margin: 20px 0 0; }

/* mockup */
.landing-mockup { display: flex; justify-content: center; }
.mockup-window {
  width: 100%; max-width: 400px; background: #171933; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6); overflow: hidden;
}
.mockup-topbar { display: flex; gap: 6px; padding: 12px 14px; background: #12132a; border-bottom: 1px solid rgba(255,255,255,0.06); }
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; background: #3a3d63; }
.mockup-dot:nth-child(1) { background: #f97066; }
.mockup-dot:nth-child(2) { background: #f5b955; }
.mockup-dot:nth-child(3) { background: #4ade80; }
.mockup-body { padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; }
.mockup-row { display: flex; align-items: center; gap: 10px; }
.mockup-check { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #4b4e78; flex-shrink: 0; }
.mockup-check-on { background: #6366f1; border-color: #6366f1; position: relative; }
.mockup-check-on::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mockup-line { display: block; height: 8px; border-radius: 4px; background: #2c2f52; flex: 1 1 auto; }
.mockup-tag { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; white-space: nowrap; }
.mockup-tag-green { background: rgba(74, 222, 128, 0.15); color: #6ee7a0; }
.mockup-tag-amber { background: rgba(245, 185, 85, 0.15); color: #f5c169; }
.mockup-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 2px 0; }
.mockup-ai { display: flex; align-items: center; gap: 10px; }
.mockup-ai-dot { width: 17px; height: 17px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); flex-shrink: 0; }

/* sections */
.landing-section { padding: 76px 24px; max-width: 1080px; margin: 0 auto; }
.landing-section-alt { max-width: none; background: #12132a; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }
.landing-section-alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.landing-h2 { font-size: 28px; font-weight: 900; text-align: center; margin: 0 0 10px; letter-spacing: -0.3px; }
.landing-h2-sub { font-size: 15px; color: #9294bd; text-align: center; margin: 0 auto 44px; max-width: 520px; line-height: 1.6; }

.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.landing-feature {
  background: #171933; border: 1px solid rgba(255,255,255,0.07); border-radius: 14px;
  padding: 26px 22px; text-align: left; transition: border-color .2s ease, transform .2s ease;
}
.landing-feature:hover { border-color: rgba(99, 102, 241, 0.4); transform: translateY(-2px); }
.landing-feature-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, 0.15); margin-bottom: 16px;
}
.landing-feature-icon svg { width: 20px; height: 20px; stroke: #a5a7ef; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.landing-feature h3 { font-size: 15.5px; font-weight: 800; margin: 0 0 7px; }
.landing-feature p { font-size: 13.5px; color: #9294bd; line-height: 1.55; margin: 0; }

/* comparison table */
.landing-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); }
.landing-table { width: 100%; border-collapse: collapse; min-width: 520px; background: #171933; }
.landing-table th, .landing-table td { padding: 14px 16px; font-size: 13.5px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.06); }
.landing-table th:first-child, .landing-table td:first-child { text-align: left; color: #d6d7ee; font-weight: 600; }
.landing-table thead th { font-size: 12.5px; color: #9294bd; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding-top: 18px; }
.landing-table tbody tr:last-child td { border-bottom: none; }
.landing-table-destaque { background: rgba(99, 102, 241, 0.1); color: #c7c9ff !important; }
.landing-table td.landing-table-destaque { background: rgba(99, 102, 241, 0.07); }
.ico-yes svg { width: 17px; height: 17px; stroke: #6ee7a0; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-no svg { width: 17px; height: 17px; stroke: #6a6d94; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-parcial { color: #f5c169; font-weight: 800; }

/* como funciona */
.landing-steps { display: flex; align-items: flex-start; justify-content: center; gap: 8px; flex-wrap: wrap; }
.landing-step { flex: 1 1 220px; max-width: 260px; text-align: center; padding: 0 10px; }
.landing-step-num {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 auto 16px;
  border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); font-weight: 800; font-size: 16px;
}
.landing-step h3 { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.landing-step p { font-size: 13.5px; color: #9294bd; line-height: 1.55; margin: 0; }
.landing-step-linha { flex: 0 0 auto; width: 60px; height: 1px; background: rgba(255,255,255,0.12); margin-top: 20px; }
@media (max-width: 720px) { .landing-step-linha { display: none; } }

/* cta final */
.landing-cta-final {
  text-align: center; padding: 70px 24px; max-width: 640px; margin: 0 auto;
}
.landing-cta-final h2 { font-size: 26px; font-weight: 900; margin: 0 0 14px; }
.landing-cta-final p { font-size: 15px; color: #9294bd; margin: 0 0 28px; }

.landing-footer {
  text-align: center; padding: 30px 24px 50px; border-top: 1px solid rgba(255,255,255,0.06);
}
.landing-footer-nota { font-size: 12px; color: #6f7196; margin: 0; }
.landing-footer-nota a { color: #9294bd; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .landing-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .landing-hero-copy { text-align: center; }
  .landing-sub { margin-left: auto; margin-right: auto; }
  .landing-hero-ctas { justify-content: center; }
}
@media (max-width: 600px) {
  .landing-hero-copy h1 { font-size: 30px; }
  .landing-hero { padding: 56px 20px 40px; }
  .landing-section { padding: 56px 20px; }
  .landing-topbar { padding: 14px 18px; }
  .landing-topbar .landing-cta-topo { font-size: 12px; padding: 8px 14px; }
}

/* ---------- tour guiado ---------- */
.tour-overlay { position: fixed; inset: 0; z-index: 998; }
.tour-highlight {
  position: absolute; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 17, 38, 0.72);
  pointer-events: none;
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.tour-tooltip {
  position: absolute; z-index: 999; width: 300px; max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  transition: top .25s ease, bottom .25s ease, left .25s ease;
}
.tour-tooltip-contador { font-size: 11px; font-weight: 800; color: var(--indigo-600); letter-spacing: .04em; margin-bottom: 4px; }
.tour-tooltip-titulo { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.tour-tooltip-texto { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 14px; }
.tour-tooltip-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.item-main { flex: 1; min-width: 0; cursor: pointer; }
.item-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-name { font-weight: 700; font-size: 15px; }
.item-name.strike { text-decoration: line-through; color: var(--text-faint); }
.item-qty { font-size: 11.5px; font-weight: 700; color: var(--indigo-600); background: rgba(99,102,241,.1); padding: 2px 9px; border-radius: 999px; }
.item-meta { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

.status-pill { font-size: 10.5px; font-weight: 800; padding: 4px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0; }
.status-aprovado { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.status-pendente { background: rgba(245,158,11,.14); color: var(--amber-600); }
.status-recusado { background: rgba(239,68,68,.12); color: var(--red-600); }
.status-comprado { background: var(--surface-2); color: var(--text-faint); }

.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- approvals ---------- */
.approval-card { border-left: 4px solid var(--amber-500); }
.approval-actions { display: flex; gap: 8px; }
.gate-card { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.gate-card .empty-icon { margin: 0 auto 12px; }

/* ---------- dashboard ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.stat-card.accent-indigo .stat-value { color: var(--indigo-600); }
.stat-card.accent-emerald .stat-value { color: var(--emerald-600); }
.stat-card.accent-amber .stat-value { color: var(--amber-600); }
.stat-card.accent-red .stat-value { color: var(--red-600); }

.ranking-list { display: flex; flex-direction: column; gap: 10px; }
.ranking-row { display: flex; align-items: center; gap: 12px; }
.ranking-row .avatar { width: 34px; height: 34px; font-size: 15px; }
.ranking-name { font-size: 13px; font-weight: 700; flex-shrink: 0; width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-bar-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.ranking-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo-500), var(--violet-500)); transition: width .4s ease; }
.ranking-count { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 26px; text-align: right; }
#rankingList .ranking-count { width: auto; min-width: 54px; white-space: nowrap; }

.conquistas-list { display: flex; flex-wrap: wrap; gap: 10px; }
.conquista-badge {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 96px; padding: 10px 8px; border-radius: 14px; text-align: center;
  background: var(--surface-2); opacity: .5; filter: grayscale(.6);
}
.conquista-badge.earned {
  opacity: 1; filter: none;
  background: rgba(245,158,11,.12);
  box-shadow: 0 0 0 1px var(--amber-500) inset;
}
.conquista-emoji { display: flex; align-items: center; justify-content: center; color: var(--amber-500); }
.conquista-emoji svg { width: 24px; height: 24px; }
.conquista-titulo { font-size: 11px; font-weight: 800; }
.conquista-hint { font-size: 9.5px; color: var(--text-muted); }

.category-bars { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 12px; }
.cat-label { font-size: 13px; width: 110px; flex-shrink: 0; }
.cat-bar-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--emerald-500), var(--indigo-500)); }
.cat-count { font-size: 12px; color: var(--text-muted); width: 20px; text-align: right; }

/* ---------- history ---------- */
.history-list { display: flex; flex-direction: column; }
.history-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--indigo-500); margin-top: 6px; flex-shrink: 0; }
.history-text { font-size: 13.5px; }
.history-text strong { font-weight: 700; }
.history-time { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* ---------- members ---------- */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.member-card { border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.member-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-info { flex: 1 1 130px; min-width: 130px; }
.member-name { font-weight: 700; font-size: 14px; overflow-wrap: break-word; }
.member-role { font-size: 11.5px; color: var(--text-muted); }
.member-actions { display: flex; gap: 4px; flex-shrink: 0; }
.member-remove, .member-pin {
  border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.member-remove:hover { color: var(--red-600); background: rgba(239,68,68,.1); }
.member-pin:hover { color: var(--indigo-600); background: rgba(99,102,241,.1); }
.member-pin .icon, .member-remove .icon { width: 15px; height: 15px; }

.add-member-row { display: grid; grid-template-columns: 2fr 1fr 1.5fr auto; gap: 8px; }
.add-member-row input, .add-member-row select {
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 14px;
}

/* ---------- empty states ---------- */
.empty-state { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 14px; line-height: 1.6; }
.empty-icon { width: 46px; height: 46px; stroke: var(--text-faint); fill: none; stroke-width: 1.6; margin-bottom: 14px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(14,15,30,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 65; padding: 20px; }
.modal.hidden { display: none; }
.modal-card { background: var(--surface); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); animation: cardIn .2s ease; border: 1px solid var(--border); }
.modal-card h3 { margin: 0 0 4px; font-size: 16px; }
.modal-card textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  font-family: inherit; font-size: 14px; resize: vertical; margin-top: 8px; background: var(--surface-2); color: var(--text);
}
.modal-card input[type="text"] {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 15px; letter-spacing: 2px; margin-top: 10px;
  background: var(--surface-2); color: var(--text); box-sizing: border-box;
}
.modal-card input[type="text"].hidden { display: none; }
.modal-field { margin-bottom: 10px; }
.modal-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }
.modal-field input, .modal-field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 14px; color: var(--text);
}
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 12px 14px 12px 18px;
  border-radius: 12px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-lg); z-index: 75;
  display: flex; align-items: center; gap: 12px;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 10px); }
.toast-action { background: rgba(255,255,255,.15); border: none; color: inherit; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.toast-action:hover { background: rgba(255,255,255,.25); }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- aviso banner ---------- */
.aviso-banner {
  margin: 0 32px 4px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  animation: fadeIn .2s ease;
}
.aviso-icon { display: flex; flex-shrink: 0; }
.aviso-icon svg { stroke: var(--indigo-600); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aviso-texto { flex: 1; font-size: 13.5px; font-weight: 600; }
.aviso-fechar {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.aviso-fechar:hover { color: var(--text); }

.admin-modo-banner {
  margin: 0 32px 4px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(239,68,68,.1));
  border: 1px solid rgba(245,158,11,.4);
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  animation: fadeIn .2s ease;
}
.admin-modo-banner .aviso-icon svg { stroke: var(--amber-600); }

/* ---------- operador: avisos / templates / snapshots / acessos ---------- */
.aviso-form, .template-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.aviso-form input, .template-form input {
  flex: 1; min-width: 180px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 14px;
}
.aviso-ativo-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
}

.templates-list, .snapshots-list, .access-list { display: flex; flex-direction: column; gap: 8px; }
.template-row, .snapshot-row, .access-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.template-row strong, .snapshot-row strong { font-size: 13.5px; }
.template-row .muted, .snapshot-row .muted { margin: 0; font-size: 11.5px; }
.template-row .spacer, .snapshot-row .spacer, .access-row .spacer { flex: 1; }

.access-row .avatar { width: 30px; height: 30px; font-size: 14px; }
.access-name { font-size: 13.5px; font-weight: 700; }

/* ---------- OCR de nota fiscal (experimental) ---------- */
#ocrModal .modal-card { max-width: 460px; }
.access-time { font-size: 12px; color: var(--text-muted); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); flex-shrink: 0; }
.online-dot.away { background: var(--text-faint); }

.audit-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.audit-toolbar select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px;
}
.history-row .history-restore { margin-left: auto; flex-shrink: 0; }
.history-row { align-items: center; }

/* ---------- barra de contexto da lista (quando é uma lista privada) ---------- */
.lista-context-bar {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.08));
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 22px;
}
.lista-voltar { padding: 0; font-size: 13px; }
.lista-context-info { display: flex; flex-direction: column; line-height: 1.3; }
.lista-context-info strong { font-size: 14px; }
.lista-context-info span { font-size: 12px; color: var(--text-muted); }

/* ---------- minhas listas ---------- */
.modelos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.modelo-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 8px;
}
.modelo-card h3 { margin: 0; font-size: 16px; }
.modelo-card p { margin: 0; font-size: 13px; }
.modelo-card .btn { align-self: flex-start; margin-top: 4px; }
.modelo-card-destaque { border-color: var(--indigo-600); background: var(--surface); }
.listas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lista-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  background: var(--surface-2); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column; gap: 6px;
}
.lista-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lista-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lista-card-nome { font-weight: 800; font-size: 14.5px; }
.lista-card-meta { font-size: 12px; color: var(--text-muted); }
.lista-card-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.lista-card-count { font-size: 11.5px; font-weight: 700; color: var(--indigo-600); background: rgba(99,102,241,.1); padding: 2px 9px; border-radius: 999px; }
.lista-excluir { margin-left: auto; background: none; border: none; color: var(--text-faint); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.lista-excluir:hover { color: var(--red-600); background: rgba(239,68,68,.1); }
.lista-excluir .icon { width: 14px; height: 14px; }

/* ---------- catálogo de produtos ---------- */
.catalog-toolbar { margin-bottom: 12px; }
.catalog-toolbar input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 14px;
}
.catalog-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.catalog-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.catalog-nome { font-weight: 700; font-size: 13.5px; }
.catalog-meta { font-size: 11.5px; color: var(--text-faint); }
.catalog-cat-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); flex-shrink: 0; }

/* ---------- estoque (conta empresa) ---------- */
.catalog-row.estoque-baixo { border-color: rgba(239,68,68,.4); }
.catalog-estoque {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-muted); font-weight: 600;
}
.catalog-estoque input {
  width: 70px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12px; color: var(--text);
}
.catalog-historico {
  flex-basis: 100%; display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface);
  font-size: 11px; color: var(--text-faint); max-height: 140px; overflow-y: auto;
}
.catalog-historico-linha { display: flex; justify-content: space-between; gap: 10px; }
.catalog-preco-hist-btn { margin-top: 8px; }
.preco-subiu { color: var(--red-600); font-weight: 700; }
.preco-desceu { color: var(--emerald-600); font-weight: 700; }
.preco-igual { color: var(--text-faint); font-weight: 700; }

/* ---------- meta de gasto mensal (Painel) ---------- */
.meta-mensal-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.meta-mensal-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-mensal-track { height: 10px; }
.ranking-bar-fill.warning { background: linear-gradient(90deg, var(--amber-500), var(--amber-600)); }
.ranking-bar-fill.danger { background: linear-gradient(90deg, var(--red-500), var(--red-600)); }

/* ---------- blocked screen ---------- */
.offline-screen.hidden { display: none; }

/* ---------- tela de formulário obrigatório ---------- */
.form-desc { margin-bottom: 18px !important; }
.form-open-btn { width: 100%; justify-content: center; text-decoration: none; margin-bottom: 10px; }
.form-confirm-btn { width: 100%; justify-content: center; margin-bottom: 14px; }
.form-back-link { display: block; text-align: center; width: 100%; padding: 0; }

/* ---------- urgente / nota / favoritos ---------- */
.add-item-flag {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; user-select: none;
}
.add-item-flag input { margin: 0; accent-color: var(--red-600); width: 16px; height: 16px; }

.item-card.urgente { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.04); }
.badge-urgente {
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: rgba(239,68,68,.14); color: var(--red-600); flex-shrink: 0; white-space: nowrap;
}
.badge-frequente {
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: rgba(245,158,11,.14); color: var(--amber-600); flex-shrink: 0; white-space: nowrap;
}
.badge-validade {
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  flex-shrink: 0; white-space: nowrap;
}
.badge-validade-vence-breve { background: rgba(245,158,11,.14); color: var(--amber-600); }
.badge-validade-vence-hoje, .badge-validade-vencido { background: rgba(239,68,68,.14); color: var(--red-600); }
.validade-texto-breve { color: var(--amber-600); }
.validade-texto-vencido { color: var(--red-600); }

/* ---------- Painel de vencimento ---------- */
.validade-resumo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.validade-tile { border: 1px solid var(--border); border-radius: 14px; padding: 12px 8px; text-align: center; background: var(--surface); }
.validade-tile strong { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.validade-tile span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-top: 3px; }
.validade-tile.vt-vencido strong { color: var(--red-600); }
.validade-tile.vt-hoje strong { color: #f97316; }
.validade-tile.vt-7 strong { color: var(--amber-600); }
.validade-tile.vt-30 strong { color: var(--emerald-600); }
.validade-filtros { flex-wrap: wrap; margin-bottom: 12px; }
.validade-lista { gap: 8px; }
.validade-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-left: 4px solid var(--emerald-500);
  border-radius: 12px; padding: 10px 12px; background: var(--surface);
}
.validade-row.vr-breve { border-left-color: var(--amber-500); }
.validade-row.vr-vencido { border-left-color: var(--red-600); }
.validade-info { display: flex; flex-direction: column; flex: 1 1 140px; min-width: 0; }
.validade-nome { font-weight: 800; overflow-wrap: anywhere; }
.validade-data { font-size: 12px; color: var(--text-muted); }
.validade-acoes { display: flex; gap: 6px; }
.validade-sem-data { font-size: 12.5px; margin-top: 10px; }
@media (max-width: 520px) { .validade-resumo { grid-template-columns: repeat(2, 1fr); } .validade-acoes { width: 100%; } .validade-acoes .btn { flex: 1; } }
.item-nota { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-style: italic; }

.favoritos-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.favorito-chip {
  border: 1px solid var(--amber-500); background: rgba(245,158,11,.1); border-radius: 999px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: all .12s ease; color: var(--amber-600);
}
.favorito-chip:hover { background: var(--amber-500); color: white; }
.favorito-star {
  border: none; background: transparent; cursor: pointer; color: var(--text-faint);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; flex-shrink: 0; position: relative;
}
.favorito-star.ativo { color: var(--amber-500); }
.favorito-star:hover { background: rgba(245,158,11,.12); }
.favorito-star .icon { width: 16px; height: 16px; }
/* Mantém o botão visualmente compacto (fica melhor ao lado do texto do
   item), mas estende a área que responde ao toque pra ~38px. */
.favorito-star::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 38px; height: 38px; transform: translate(-50%, -50%);
}

/* ---------- aprovação em lote / decidir depois ---------- */
.aprovar-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.aprovar-categoria-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aprovar-categoria-chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text);
}
.aprovar-categoria-chip:hover { background: var(--emerald-500); color: white; border-color: var(--emerald-500); }

.decidir-depois-btn {
  border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.decidir-depois-btn:hover { color: var(--indigo-600); background: rgba(99,102,241,.1); }
.decidir-depois-btn .icon { width: 15px; height: 15px; }
.decidir-depois-btn.ativo { color: var(--indigo-600); }

/* ---------- confirmação de aprovação/recusa ---------- */
.reacao-toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 80; pointer-events: none;
  animation: reacaoFade .6s ease forwards;
}
.reacao-toast.reacao-aprovado { background: rgba(34,197,94,.12); color: #16a34a; }
.reacao-toast.reacao-recusado { background: rgba(148,163,184,.14); color: var(--text-muted); }
@keyframes reacaoFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- limite de auto-aprovação (membro) ---------- */
.member-limite {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-muted); font-weight: 600;
}
.member-limite input {
  width: 80px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12px; color: var(--text);
}

/* ---------- streak do aprovador ---------- */
.streak-card { display: flex; align-items: center; gap: 10px; }
.streak-flame { font-size: 22px; }

/* ---------- modo simples (criança) ---------- */
.modo-crianca .add-item-row-money,
.modo-crianca .item-preco,
.modo-crianca .item-mercado { display: none !important; }
.modo-crianca .add-item-row input,
.modo-crianca .item-card { font-size: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .sidebar { display: none; }
  .app-screen { flex-direction: column; }
  .topheader { padding: 18px 18px 12px; }
  .content { padding: 8px 18px 90px; }
  .add-item-row, .add-member-row, .add-item-row-money { grid-template-columns: 1fr; }
  .modal-row { grid-template-columns: 1fr; }
  .search-box { min-width: 0; flex: 1; }
  .topheader-actions { flex: 1; }

  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 30;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  }
  .bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; color: var(--text-faint);
    font-size: 10.5px; font-weight: 700; padding: 6px 2px; border-radius: 10px;
    position: relative;
  }
  .bnav-item.active { color: var(--indigo-600); }
  .bnav-item .badge-mobile { position: absolute; top: 2px; right: 18%; }

  /* ---------- painel "Mais" (resto das seções, fora das 4 abas fixas) ---------- */
  .bnav-mais-overlay {
    position: fixed; inset: 0; background: rgba(15,15,20,.4);
    z-index: 39; opacity: 0; transition: opacity .2s ease;
  }
  .bnav-mais-overlay.hidden { display: none; }
  .bnav-mais-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(0,0,0,.18);
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .22s cubic-bezier(.16,1,.3,1);
    max-height: 70vh; overflow-y: auto;
  }
  .bnav-mais-sheet.hidden { display: none; }
  .bnav-mais-sheet.aberto { transform: translateY(0); }
  .bnav-mais-handle {
    width: 36px; height: 4px; border-radius: 999px; background: var(--border);
    margin: 4px auto 14px;
  }
  .bnav-mais-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px;
  }
  .bnav-mais-grid .bnav-item {
    flex: none; padding: 14px 4px; border-radius: 14px; gap: 8px;
    font-size: 11px;
  }
  .bnav-mais-grid .bnav-item:active { background: var(--surface-2); }
  .bnav-mais-grid .bnav-item .icon { width: 22px; height: 22px; }
  .bnav-mais-grid .bnav-item.active { color: var(--indigo-600); background: rgba(99,102,241,.1); }
}

@media (max-width: 480px) {
  .avatar-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 26px 20px; }
}

/* ============================================================
   POLIMENTO VISUAL — microinterações e acabamento, sem mexer em
   nenhuma estrutura/funcionalidade. Só transições, sombras e
   pequenos toques que deixam o app mais "vivo" ao usar.
   ============================================================ */

/* rolagem mais fina e combinando com o tema, em vez da barra padrão do navegador */
* { scrollbar-color: var(--border) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* anel de foco consistente pra quem navega por teclado, em vez do azul padrão do navegador */
:focus-visible { outline: 2px solid var(--indigo-500); outline-offset: 2px; border-radius: 4px; }

/* botões: um leve "levantar" ao passar o mouse, sem exagerar */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }

/* itens de navegação: leve deslocamento lateral no hover, mais tátil */
.nav-item { transition: background .15s ease, color .15s ease, transform .15s ease; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active { transform: none; }

.icon-btn { transition: background .15s ease, color .15s ease, transform .15s ease; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.93); }

/* badge de pendências pulsa bem sutilmente pra chamar atenção sem incomodar */
.badge:not(.hidden) { animation: badgePulse 2.4s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* cartões de estatística (Painel): leve elevação ao passar o mouse */
.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* troca de tela um pouco mais suave (mesma duração, curva mais macia) */
.view.active { animation: fadeIn .28s cubic-bezier(.16,1,.3,1); }

/* reforça a transição de cor/fundo/sombra nessas linhas e cartões pra ficar
   suave ao atualizar (o .item-card da lista já tinha a sua própria, mais
   completa, e não foi tocado aqui). */
.template-row, .snapshot-row, .access-row, .loja-row,
.fornecedor-row, .ordem-row, .feedback-admin-row, .admin-membro-row {
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* ---------- seletor de idioma (PT/EN) ---------- */
.lang-switch {
  position: fixed; top: 16px; right: 16px; z-index: 90;
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow-md);
}
.lang-btn {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--indigo-600); color: #fff; }

/* ---------- programa de indicação ---------- */
.referral-codigo-box { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.referral-codigo {
  font-family: 'Courier New', monospace; font-size: 20px; font-weight: 800; letter-spacing: .12em;
  padding: 8px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border);
  color: var(--indigo-600);
}

/* ---------- Modo Compra: tela cheia, alvos de toque grandes,
   pra ser usada andando pelo mercado com uma mão só ---------- */
.modo-compra-overlay {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column;
}
.modo-compra-overlay.hidden { display: none; }
.modo-compra-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.modo-compra-fechar {
  border: none; background: var(--surface-2); color: var(--text); width: 40px; height: 40px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.modo-compra-fechar:active { transform: scale(0.92); }
.modo-compra-fechar .icon { width: 18px; height: 18px; }
.modo-compra-header-info { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.modo-compra-header-info strong { font-size: 15px; }
.modo-compra-header-info span { font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
.modo-compra-progresso { height: 6px; background: var(--surface-2); flex-shrink: 0; }
.modo-compra-progresso-barra {
  height: 100%; background: linear-gradient(90deg, var(--indigo-600), var(--emerald-600));
  transition: width .25s ease;
}
.modo-compra-lista { flex: 1; overflow-y: auto; padding: 10px 14px 90px; }
.modo-compra-categoria {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); padding: 16px 4px 8px;
}
.modo-compra-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 14px; margin-bottom: 8px; cursor: pointer; text-align: left;
  font-family: inherit; transition: background .15s ease, opacity .15s ease;
}
.modo-compra-item:active { transform: scale(0.98); }
.modo-compra-check {
  width: 32px; height: 32px; border-radius: 999px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent;
}
.modo-compra-check .icon { width: 18px; height: 18px; }
.modo-compra-item.checked { background: rgba(16,185,129,.08); opacity: .72; }
.modo-compra-item.checked .modo-compra-check {
  background: var(--emerald-600); border-color: var(--emerald-600); color: white;
}
.modo-compra-item-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.modo-compra-item-nome { font-size: 15.5px; font-weight: 700; }
.modo-compra-item-nome.strike { text-decoration: line-through; color: var(--text-muted); }
.modo-compra-item-meta { font-size: 12.5px; color: var(--text-muted); }
.modo-compra-footer {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.modo-compra-footer .btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }
.modo-compra-resumo-card { text-align: center; }
.modo-compra-resumo-linha { font-size: 14.5px; margin: 6px 0; }
.modo-compra-resumo-linha strong { color: var(--emerald-600); }

/* ============================================================
   VISUAL 2.0 — mesmo design do Painel Admin (kinstock.web.app/admin)
   ------------------------------------------------------------
   Camada final: só redefine cores, tipografia e acabamento dos
   componentes que já existem. Nenhuma estrutura/HTML mudou — se
   precisar voltar ao visual antigo, basta apagar daqui pra baixo.
   ============================================================ */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --pink-500: #ec4899;
  --cyan-500: #06b6d4;
  --grad-pri: linear-gradient(135deg, #6366f1, #8b5cf6);
  --grad-brand: linear-gradient(135deg, #6366f1, #ec4899);

  /* claro — mesma linguagem, versão diurna */
  --bg: #f5f6fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --border: #e7e9f3;
  --border-2: #d9dcea;
  --text: #12142a;
  --text-muted: #666c8f;
  --text-faint: #9ca1bf;
  --pri-soft: rgba(99, 102, 241, 0.10);
  --pri-text: #4f46e5;
  --glass: rgba(245, 246, 251, 0.82);
  --shadow-sm: 0 1px 2px rgba(18, 20, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(18, 20, 42, 0.07);
  --shadow-lg: 0 20px 50px rgba(18, 20, 42, 0.14);
  --sidebar-bg: #0f1120;
  --sidebar-text: #8c93b3;
  --sidebar-text-active: #ffffff;
}
html[data-theme="escuro"] {
  --bg: #0b0d17;
  --bg-elevated: #151a2b;
  --surface: #151a2b;
  --surface-2: #1b2135;
  --border: #262d45;
  --border-2: #323a58;
  --text: #e8eaf6;
  --text-muted: #8c93b3;
  --text-faint: #5d6484;
  --pri-soft: rgba(99, 102, 241, 0.14);
  --pri-text: #c7caff;
  --glass: rgba(11, 13, 23, 0.82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --sidebar-bg: #10131f;
  --sidebar-text: #8c93b3;
  --sidebar-text-active: #ffffff;
  color-scheme: dark;
}
body { font-size: 14px; letter-spacing: -0.005em; }

/* ---------- barra lateral ---------- */
.sidebar { border-right: 1px solid rgba(255, 255, 255, 0.06); padding: 18px 12px; }
.sidebar-brand { padding: 4px 8px 22px; }
.sidebar-brand .logo-mark, .login-logo .logo-mark { background: var(--grad-brand); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45); }
.sidebar-brand-text strong { font-size: 15.5px; letter-spacing: -0.2px; }
.nav-item { color: var(--sidebar-text); font-weight: 600; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; }
.nav-item:hover { background: #151a2b; color: #e8eaf6; }
.nav-item.active {
  background: rgba(99, 102, 241, 0.16); color: #d6d8ff; box-shadow: none;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad-brand);
}
.nav-item.active .icon { color: #a5a8ff; }
.sidebar-footer { border-top-color: rgba(255, 255, 255, 0.06); }
.theme-toggle, .icon-btn { background: #151a2b; border-color: #262d45; color: #8c93b3; }
.theme-toggle:hover { background: #1b2135; color: #e8eaf6; }

/* ---------- topo ---------- */
.topheader {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px 14px;
}
.topheader h1 { font-size: 20px; font-weight: 750; letter-spacing: -0.4px; }
.content { padding-top: 22px; max-width: 1080px; }
.search-box { background: var(--surface); border-color: var(--border); border-radius: 10px; }
.search-box:focus-within { border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--pri-soft); }

/* ---------- cartões ---------- */
.card {
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 18px;
}
html[data-theme="escuro"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)) , var(--surface);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }
.card h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.1px; }
.muted { font-size: 12.5px; line-height: 1.5; }

/* estatísticas: brilho no canto igual aos KPIs do painel */
.stat-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 16px 18px; }
.stat-card::after {
  content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--indigo-500); opacity: 0.13; pointer-events: none;
}
.stat-card.accent-emerald::after { background: var(--emerald-500); }
.stat-card.accent-amber::after { background: var(--amber-500); }
.stat-card.accent-red::after { background: var(--pink-500); }
.stat-card .stat-value { font-weight: 750; letter-spacing: -0.8px; font-size: 27px; }
.stat-card .stat-label { font-size: 12px; }
html[data-theme="escuro"] .stat-card.accent-indigo .stat-value { color: #a5a8ff; }
html[data-theme="escuro"] .stat-card.accent-emerald .stat-value { color: #6ee7b7; }
html[data-theme="escuro"] .stat-card.accent-amber .stat-value { color: #fcd34d; }
html[data-theme="escuro"] .stat-card.accent-red .stat-value { color: #fda4af; }
.visao-geral-card { border-radius: 12px; }
.visao-geral-valor { font-weight: 750; letter-spacing: -0.4px; }

/* ---------- botões ---------- */
.btn { border-radius: 10px; font-weight: 650; font-size: 13.5px; padding: 10px 16px; gap: 7px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-primary { background: var(--grad-pri); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border); border-color: var(--border-2); }
.btn-outline { border-color: var(--border-2); color: var(--text); }
.btn-outline:hover { border-color: var(--indigo-500); color: var(--text); background: var(--pri-soft); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); }
.btn-secondary:hover { opacity: 1; background: var(--border); }
html[data-theme="escuro"] .btn-danger { background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(244, 63, 94, 0.35); color: #fda4af; }
html[data-theme="escuro"] .btn-danger:hover { background: rgba(244, 63, 94, 0.24); }
html[data-theme="escuro"] .btn-danger-outline { border-color: rgba(244, 63, 94, 0.45); color: #fda4af; }
html[data-theme="escuro"] .btn-danger-outline:hover { background: rgba(244, 63, 94, 0.18); color: #fecdd3; }

/* ---------- campos ---------- */
.add-item-row input, .add-item-row select, .add-item-row-money input,
.modal-field input, .modal-field select, .modal-card textarea, .modal-card input[type="text"],
.card input[type="text"], .card input[type="email"], .card input[type="number"], .card input[type="password"],
.card input[type="tel"], .card input[type="url"], .card input[type="date"], .card select, .card textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
html[data-theme="escuro"] .add-item-row input, html[data-theme="escuro"] .add-item-row select,
html[data-theme="escuro"] .add-item-row-money input, html[data-theme="escuro"] .modal-field input,
html[data-theme="escuro"] .modal-field select, html[data-theme="escuro"] .modal-card textarea,
html[data-theme="escuro"] .modal-card input[type="text"], html[data-theme="escuro"] .card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="escuro"] .card select, html[data-theme="escuro"] .card textarea { background: #10131f; }
.add-item-row input:focus, .add-item-row select:focus, .add-item-row-money input:focus,
.modal-field input:focus, .modal-field select:focus, .modal-card textarea:focus, .modal-card input[type="text"]:focus,
.card input:focus, .card select:focus, .card textarea:focus {
  outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--pri-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ---------- chips / filtros (estilo "segmento" do painel) ---------- */
.chip { background: var(--surface); border-color: var(--border); font-weight: 650; font-size: 12.5px; padding: 6px 13px; }
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { background: var(--pri-soft); color: var(--pri-text); border-color: rgba(99, 102, 241, 0.45); }
.sort-box select { background: var(--surface); border-color: var(--border); }
.category-header { font-size: 11px; letter-spacing: 0.9px; color: var(--text-faint); font-weight: 700; }

/* ---------- itens da lista ---------- */
.item-card { border-radius: 13px; padding: 13px 15px; box-shadow: none; }
.item-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
html[data-theme="escuro"] .item-card:hover { background: #181e31; }
.approval-card { border-left: 3px solid var(--amber-500); }

/* selos de status — mais suaves, sem caixa alta gritando */
.status-pill { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 700; padding: 3px 10px; border: 1px solid transparent; }
html[data-theme="escuro"] .status-aprovado { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
html[data-theme="escuro"] .status-pendente { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
html[data-theme="escuro"] .status-recusado { background: rgba(244, 63, 94, 0.14); color: #fda4af; }
html[data-theme="escuro"] .status-comprado { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
html[data-theme="escuro"] .item-preco { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); }
html[data-theme="escuro"] .money-pill.over-budget { color: #fda4af; }
html[data-theme="escuro"] .money-pill.warning { color: #fcd34d; }
html[data-theme="escuro"] .catalog-preco-melhor, html[data-theme="escuro"] .modo-compra-resumo-linha strong { color: #6ee7b7; }
html[data-theme="escuro"] .referral-codigo { color: #a5a8ff; }
.plano-pill-pro { background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(236, 72, 153, 0.85)); }

/* ---------- avatares ---------- */
.avatar { border-radius: 12px; }

/* ---------- modais ---------- */
.modal { background: rgba(5, 6, 12, 0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.modal-card { border-radius: 18px; border: 1px solid var(--border-2); padding: 22px; animation: v2Pop .18s ease; }
.modal-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.modal-field label { font-weight: 600; letter-spacing: 0.2px; }
@keyframes v2Pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- aviso rápido (toast) ---------- */
.toast {
  background: #1e2440; color: #e8eaf6; border: 1px solid #323a58; border-left: 3px solid var(--indigo-500);
  font-weight: 600; border-radius: 11px;
}
.toast-action { background: rgba(99, 102, 241, 0.2); color: #d6d8ff; }
.toast-action:hover { background: rgba(99, 102, 241, 0.32); }

/* ---------- idioma ---------- */
.lang-btn.active { background: var(--grad-pri); }

/* ---------- login / onboarding: mesmo brilho do painel ---------- */
.login-screen, .onboarding-screen { background: #0b0d17; }
.blob-a { background: #6366f1; opacity: 0.5; }
.blob-b { background: #ec4899; opacity: 0.32; }
.blob-c { background: #06b6d4; opacity: 0.16; }
.login-card { background: rgba(21, 26, 43, 0.78); border-color: #262d45; border-radius: 22px; }

/* ---------- chat da IA ---------- */
.chat-bubble { border-radius: 16px; line-height: 1.55; box-shadow: none; }
.chat-bubble.minha { background: var(--grad-pri); border-bottom-right-radius: 5px; }
.chat-bubble.ia { background: var(--surface); border-bottom-left-radius: 5px; }

/* ---------- Modo Compra ---------- */
.modo-compra-header { background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.modo-compra-progresso-barra { background: linear-gradient(90deg, #6366f1, #ec4899); }
.modo-compra-item { border-radius: 13px; }

/* ---------- celular: barra de baixo em vidro fosco ---------- */
@media (max-width: 880px) {
  .topheader { padding: 14px 18px 12px; }
  .content { padding-top: 16px; }
  .bottom-nav {
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid var(--border);
    box-shadow: none;
  }
  .bnav-item { color: var(--text-faint); font-weight: 650; }
  .bnav-item.active { color: var(--pri-text); }
  .bottom-nav > .bnav-item.active::before {
    content: ""; position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
    width: 54px; height: 28px; border-radius: 999px; background: var(--pri-soft); z-index: -1;
  }
  .bnav-mais-sheet { background: var(--surface); border: 1px solid var(--border); border-bottom: 0; }
  .bnav-mais-grid .bnav-item.active { color: var(--pri-text); background: var(--pri-soft); }
  .bnav-mais-overlay { background: rgba(5, 6, 12, 0.55); }
}

/* ============================================================
   APP DA LOJA (iOS/Android) — Guideline 3.1.1 da Apple
   Dentro do app nativo não existe plano: tudo é grátis e nada fala de
   Pro, preço, assinatura, bônus ou indicação. No site continua normal.
   ============================================================ */
html.app-sem-planos #planoCard,
html.app-sem-planos .plano-pill,
html.app-nativo #referralCard,
html.app-nativo #adminGeralCard,
html.app-nativo #tornarContaMasterBtn,
html.app-nativo #familiaCodigoIndicacao,
html.app-nativo #familiaIndicacaoErro,
html.app-nativo #painelAdminAbrirBtn,
html.app-nativo #painelAdminModal,
html.app-nativo #referralBonusAtivo { display: none !important; }

/* Guideline 3.1.1/3.1.3(c): no app da loja não existe cadastro/entrada de
   "empresa" — só o fluxo normal (contas de empresa antigas entram pelo
   mesmo botão "Entrar"). */
html.app-nativo .escolha-conta-btn[data-modo="login-empresa"],
html.app-nativo .escolha-conta-btn[data-modo="criar-empresa"],
html.app-nativo #familiaCnpj { display: none !important; }
html.app-nativo .escolha-conta-grid { grid-template-columns: 1fr !important; }


/* ---------- Faixa de conexão ---------- */
.aviso-conexao {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  text-align: center; font-size: 13px; font-weight: 700; color: #fff;
}
.aviso-conexao[hidden] { display: none; }
.aviso-conexao.aviso-offline { background: #b45309; }
.aviso-conexao.aviso-cota { background: #4f46e5; }


/* ---------- Receitas salvas ---------- */
.receita-salvar-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.receita-salvar input[type="text"] { margin-top: 8px; }
.receitas-salvas { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.receitas-salvas h4 { margin: 0 0 4px; font-size: 15px; }
.receita-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.receita-nome { flex: 1; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Gráfico de desperdício ---------- */
.desperdicio-chart { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 10px 4px 0; border-bottom: 1px solid var(--border); }
.desperdicio-pilha { width: 100%; max-width: 34px; min-height: 2px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.desp-usado { background: var(--emerald-500); min-height: 0; }
.desp-jogado { background: var(--red-600); min-height: 0; }

/* ---------- Faixa de progresso (tela principal) ---------- */
.progresso-strip {
  display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; width: 100%;
  margin-bottom: 14px; padding: 12px 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; font: inherit;
}
.progresso-strip.hidden { display: none; }
.prog-bloco { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 130px; }
.prog-bloco.prog-mini { flex: 0 0 auto; min-width: 90px; }
.prog-bloco strong { font-size: 22px; font-weight: 900; line-height: 1; }
.prog-rotulo { font-size: 12.5px; font-weight: 800; }
.prog-dica { font-size: 11.5px; color: var(--text-muted); }
.prog-barra { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.prog-barra-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo-500), var(--emerald-500)); transition: width .4s ease; }
.prog-barra-fill.warning { background: var(--amber-500); }
.prog-barra-fill.danger { background: var(--red-600); }

/* ---------- Landing: azul claro suave no lugar do roxo ----------
   Só a página inicial (#screen-landing). App interno e /admin não mudam.
   Para voltar ao roxo: apague este bloco. */
#screen-landing .blob-a { background: #7cc4fa; }
#screen-landing .blob-b { background: #93c5fd; }
#screen-landing .blob-c { background: #67e8f9; }
#screen-landing .btn-primary {
  background: linear-gradient(135deg, #7cc4fa, #a5d8fd); color: #0b1b33;
  box-shadow: 0 6px 18px rgba(124, 196, 250, 0.35);
}
#screen-landing .btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(124, 196, 250, 0.5); }
#screen-landing .landing-kicker { color: #d4ecff; background: rgba(124, 196, 250, 0.16); border-color: rgba(124, 196, 250, 0.38); }
#screen-landing .landing-feature:hover { border-color: rgba(124, 196, 250, 0.45); }
#screen-landing .landing-feature-icon { background: rgba(124, 196, 250, 0.15); }
#screen-landing .landing-feature-icon svg { stroke: #9fd3fb; }
#screen-landing .landing-step-num { background: linear-gradient(135deg, #7cc4fa, #a5d8fd); color: #0b1b33; }
#screen-landing .landing-table-destaque { background: rgba(124, 196, 250, 0.10); color: #d4ecff !important; }
#screen-landing .landing-table td.landing-table-destaque { background: rgba(124, 196, 250, 0.07); }
#screen-landing .mockup-check-on { background: #7cc4fa; border-color: #7cc4fa; }
#screen-landing .mockup-ai-dot { background: linear-gradient(135deg, #7cc4fa, #a5d8fd); }

/* ---------- v26: alerta de meta, comentários, QR, gráfico de preço ---------- */
.meta-alerta { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.meta-alerta.hidden { display: none; }
.meta-alerta-amarelo { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.45); color: #fbbf24; }
.meta-alerta-vermelho { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.5); color: #f87171; }
.btn-comentarios { padding: 4px 8px; min-width: 0; font-size: 13px; }
.comentarios-lista { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.comentario { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.comentario-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-muted); }
.comentario-texto { font-size: 14px; margin-top: 3px; word-break: break-word; }
.qr-imagem { width: 240px; max-width: 80%; margin: 14px auto; padding: 12px; background: #fff; border-radius: 14px; }
.qr-imagem svg { width: 100%; height: auto; display: block; }
.preco-resumo { padding: 6px 0 10px; color: var(--indigo-500); }
.preco-spark { width: 100%; max-width: 260px; height: 48px; display: block; }
.preco-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.preco-stats b { color: var(--text); }

/* v28 — alvos de toque maiores no celular (recomendação Apple: ~44px).
   Só aumenta a área clicável (padding/::after), sem mudar o visual. */
@media (pointer: coarse) {
  .lang-btn { min-height: 36px; min-width: 40px; }
  .login-legal-links a, .landing-footer a, #screen-landing footer a { display: inline-block; padding: 12px 6px; }
  #painelAdminAbrirBtn { position: relative; }
  #painelAdminAbrirBtn::after { content: ''; position: absolute; inset: -9px; }
}

/* v28 — correções vistas no iPhone (375px) */
#scanBarcodeBtn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#scanBarcodeBtn { color: var(--text); }
.topheader { gap: 12px; }
.topheader h1 { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 880px) {
  /* o ⚙ do painel ficava em cima da aba "Mais" da barra de baixo */
  .painel-admin-canto { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
