:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ccfbf1;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.hidden { display: none !important; }

/* AUTH SCREEN */
.auth-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(145deg, #0f766e 0%, #134e4a 100%);
}

.auth-card {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.28);
}

.auth-brand {
  text-align: center;
  margin-bottom: 16px;
}
.auth-brand h1 {
  margin: 8px 0 4px;
  font-size: 1.35rem;
  color: var(--text);
}
.auth-brand p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.btn-google:hover { background: #f8fafc; }
.g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 12px;
}
.auth-tab {
  border: none;
  background: transparent;
  padding: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.auth-erro {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 9px;
}

.divider-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 12px 0;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.divider-or span { padding: 0 10px; }

.auth-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.link-suporte {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

/* HEADER APP */
.app-header {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
  color: #fff;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.header-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.title-version-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.app-header h1 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-linha {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  opacity: 0.94;
  margin-top: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: #4ade80; }
.status-dot.offline { background: #fbbf24; }

.plan-pill {
  background: rgba(255, 255, 255, 0.18);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}
.plan-pill.pro {
  background: #f59e0b;
  color: #fff;
}

.header-acoes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.install-banner {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}
.btn-install-mini {
  background: #ffffff;
  color: var(--primary-dark);
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.fin-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.fin-pill {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.fin-pill span { font-size: 0.68rem; opacity: 0.85; }
.fin-pill strong { font-size: 0.86rem; font-weight: 700; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 106px;
  z-index: 15;
}

.tab {
  border: none;
  background: transparent;
  padding: 12px 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 14px 96px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.coach-tip {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.btn-tip-ok {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font-size: 0.92rem;
}

.cat-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.stack-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.card.status-critico { border-left-color: var(--danger); }
.card.status-baixo { border-left-color: var(--warn); }
.card.status-ok { border-left-color: var(--success); }
.card.item-pausado {
  opacity: 0.68;
  border-left-color: #94a3b8;
  background: #f8fafc;
}
.card.no-carrinho {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
}

.card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #e2e8f0; color: #475569; }

.pro-tag {
  background: #f59e0b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 3px;
}

.qrcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.membros-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.membro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.btn-remover-membro {
  background: var(--danger-soft);
  color: var(--danger);
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.card-estoque-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  gap: 8px;
}

.estoque-num {
  font-size: 1.05rem;
  font-weight: 800;
}
.estoque-num small {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

.card-acoes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-step {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary, .btn-secondary, .btn-success, .btn-chip, .btn-fechar {
  border: none;
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-chip { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-chip.ativo { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary); }
.btn-pausado-ativo { background: #475569 !important; color: #fff !important; border-color: #475569 !important; }
.btn-fechar { background: transparent; color: var(--muted); font-size: 1.1rem; padding: 4px 8px; }

.lista-controles { margin-bottom: 12px; border-left-width: 1px; }
.lista-topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.lbl-mini { display: block; font-size: 0.74rem; color: var(--muted); margin-bottom: 3px; }
.lista-auto-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.add-avulso-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.add-avulso-row input[type="text"] {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.input-qtd-mini {
  width: 68px;
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.lista-acoes-rodape {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.grupo-corredor {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  padding: 6px 4px 2px;
}

.mercado-topo { margin-bottom: 10px; border-left-width: 1px; }
.mercado-selects { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mercado-selects select {
  flex: 1;
  min-width: 140px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.mercado-lista-pad { padding-bottom: 84px; }
.market-inputs { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.market-row { display: flex; align-items: center; gap: 6px; }
.market-inputs input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
}

.money-wrap {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 8px;
}
.money-wrap span { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-right: 4px; }
.money-wrap input { border: none !important; background: transparent !important; padding: 8px 2px !important; font-weight: 700; }

.qtd-progresso {
  min-width: 46px;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 5px 7px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text);
}
.qtd-progresso.meta-atingida { background: var(--success-soft); color: var(--success); }
.qtd-progresso.acima-meta { background: var(--info-soft); color: var(--info); }

.mercado-barra-fixa {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 25;
}

.totais-mercado { display: flex; gap: 16px; }
.totais-mercado small { display: block; font-size: 0.7rem; color: var(--muted); }
.totais-mercado strong { font-size: 0.96rem; }
.text-right { text-align: right; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 50;
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.onboarding-box {
  text-align: center;
  padding: 22px 18px;
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ob-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: all 0.2s ease;
}
.ob-dot.active {
  width: 24px;
  background: var(--primary);
}
.ob-slide { display: none; }
.ob-slide.active { display: block; }
.ob-icon { font-size: 2.6rem; margin-bottom: 8px; }
.ob-slide h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--text); }
.ob-slide p { margin: 0 0 18px; font-size: 0.92rem; color: #334155; line-height: 1.5; }
.onboarding-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.onboarding-footer button { flex: 1; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-header h2 { margin: 0; font-size: 1.05rem; }

.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: #334155; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.check-row { flex-direction: row !important; align-items: center; gap: 8px !important; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.hint { font-size: 0.82rem; color: var(--muted); }
