:root {
  --bg: #0F172A;
  --surface: #16213D;
  --surface-2: #1C2A4A;
  --surface-3: #223256;
  --text: #F4F1E9;
  --text-dim: #8F97A3;
  --line: rgba(255,255,255,0.07);

  --red: #E6484F;
  --yellow: #FFC145;
  --green: #22C55E;
  --pix: #4DA8DA;
  --tip: #FF8FA3;
  --brand: #22C55E;
  --brand-light: #4ADE80;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100dvh;
}

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

button {
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 18px 10px;
  background: var(--bg);
}

.topbar-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-bottom: 14px;
}
.brand-icon { flex-shrink: 0; border-radius: 8px; display: block; }
.brand-name {
  font-family: "Syne", var(--font-display), sans-serif;
  font-weight: 800;
  font-size: 25px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar-date {
  font-size: 12.5px;
  color: var(--text-dim);
  text-transform: capitalize;
}

.session-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13px;
  background: var(--green);
  color: #0C1410;
  box-shadow: 0 3px 0 rgba(0,0,0,0.25);
  transition: transform .08s ease, background .15s ease;
  user-select: none;
}
.session-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.session-btn[data-state="running"] {
  background: var(--yellow);
  color: #2B1E00;
}
.session-btn[data-state="paused"] {
  background: var(--tip);
  color: #350012;
}

.session-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px 0;
  gap: 10px;
}
#sessionTimer {
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.idle-card {
  border-left-color: var(--tip);
}
.stock-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.stock-card-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.stock-fill {
  background: linear-gradient(90deg, var(--pix), var(--green));
}
.pix-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}
.pix-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pix-fill-confirmado { background: var(--green); }
.pix-fill-pendente { background: var(--yellow); }
.compact-row {
  display: flex;
  gap: 10px;
}
.compact-col {
  flex: 1;
  min-width: 0;
}
.compact-col .section-title {
  font-size: 12.5px;
  margin-bottom: 6px;
}
.compact-col .best-hour-card {
  font-size: 12.5px;
  padding: 12px;
}
.pix-toggle-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--yellow);
  flex-shrink: 0;
}
.pix-toggle-btn.confirmado {
  color: var(--green);
}

/* ---------- MAIN / TABS ---------- */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 190px;
  position: relative;
}

.tab-panel { will-change: transform, opacity; }
.tab-panel.enter-right { animation: slideInRight .32s cubic-bezier(.22,.61,.36,1); }
.tab-panel.enter-left { animation: slideInLeft .32s cubic-bezier(.22,.61,.36,1); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* ---------- HERO ---------- */
/* ---------- DESAFIO DE HOJE (gamificação) ---------- */
.desafio-card {
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  margin: 10px 0 14px;
}
.desafio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.desafio-titulo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.desafio-nivel-badge {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}
.desafio-meta-principal { margin-bottom: 16px; }
.desafio-meta-secundaria {
  background: var(--surface-3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.desafio-meta-label { font-size: 13px; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }
.desafio-meta-numero {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 10px;
}
.desafio-meta-numero-media {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}
.desafio-meta-de { font-size: 20px; color: var(--text-dim); margin-left: 4px; }
.desafio-meta-numero-media .desafio-meta-de { font-size: 14px; }
.desafio-bar-grande { height: 16px; }
.desafio-falta { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }

.desafio-meta-hora {
  background: var(--surface-3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.desafio-meta-hora-destaque {
  background: linear-gradient(160deg, rgba(34,197,94,0.16), var(--surface-3));
  border: 1px solid rgba(34,197,94,0.35);
  padding: 18px 18px 16px;
}
.desafio-meta-hora-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}
.desafio-meta-hora-numero {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
}
.desafio-meta-hora-numero-grande {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  color: var(--green);
  line-height: 1.1;
  margin-bottom: 10px;
}

.desafio-footer {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.desafio-footer-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.desafio-footer-btn { border: none; }
.desafio-footer-emoji { font-size: 15px; }

.desafio-xp-bar-wrap { margin-top: 4px; }
.desafio-xp-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 5px;
}
.desafio-bar-small { height: 7px; }

.metas-bubble-celebra .metas-bubble-pct { font-size: 56px; }
.recordes-lista { text-align: left; margin: 6px 0 16px; }
.recorde-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.recorde-item:last-child { border-bottom: none; }
.recorde-item .recorde-valor { font-family: var(--font-display); font-weight: 700; color: var(--green); }

.hero-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  margin: 10px 0 14px;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,204,113,0.18), transparent 70%);
}
.hero-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.hero-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.1;
  margin-top: 4px;
  color: var(--green);
}
.hero-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-dim);
}
.hero-real {
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
}
.link-btn {
  display: block;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
}
.registro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.registro-label { font-size: 13.5px; font-weight: 600; }
.registro-hora { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.registro-del {
  background: rgba(230,72,79,0.12);
  border: none;
  color: var(--red);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.registro-edit {
  background: rgba(77,168,218,0.12);
  border: none;
  color: var(--pix);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 15px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- GOAL STRIP ---------- */
.goal-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.goal-strip-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dim);
}
.goal-bar {
  height: 10px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.goal-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  border-radius: 999px;
  transition: width .3s ease;
}
.goal-value {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- METRIC GRID ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.grid-cards-2 { grid-template-columns: 1fr 1fr; }

.metric-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.metric-icon { font-size: 16px; margin-bottom: 5px; opacity: 0.9; }
.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.15;
}
.metric-label {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.metric-card.signal-yellow .metric-value { color: var(--yellow); }
.metric-card.signal-green .metric-value { color: var(--green); }
.metric-card.accent-pix .metric-value { color: var(--pix); }
.metric-card.accent-tip .metric-value { color: var(--tip); }

/* ---------- SECTIONS ---------- */
.section-block { margin-bottom: 22px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--text);
}
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 220px;
  position: relative;
}
.chart-wrap-small { height: 160px; }
.pix-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}
.pix-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF !important;
}
.pix-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.best-hour-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
}

/* ---------- HISTÓRICO ---------- */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 14px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.filter-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #0C1410;
}

.compare-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  gap: 14px;
}
.compare-col { flex: 1; }
.compare-label { font-size: 12px; color: var(--text-dim); }
.compare-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-top: 2px; }
.compare-diff {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-3);
}
.compare-diff.up { color: var(--green); }
.compare-diff.down { color: var(--red); }

.historico-lista { display: flex; flex-direction: column; gap: 10px; }
.historico-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.historico-item-date {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: capitalize;
}
.historico-item-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.historico-item-value { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--green); }
.historico-empty { text-align: center; color: var(--text-dim); padding: 40px 10px; font-size: 14px; }

/* ---------- FORM ---------- */
.form-field { margin-bottom: 14px; }
.meta-hora-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.meta-hora-preview strong { color: var(--green); font-family: var(--font-display); font-size: 15px; }
.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-field input, .form-field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  color: var(--text);
}
.form-field input:focus, .form-field select:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.btn-primary {
  width: 100%;
  border: none;
  background: var(--green);
  color: #0C1410;
  font-weight: 700;
  font-size: 15px;
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.btn-primary:active { filter: brightness(0.92); }

.btn-secondary {
  width: 100%;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 14px;
  padding: 13px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.backup-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 360px; text-align: center; }
.auth-logo { border-radius: 16px; margin-bottom: 16px; }
.auth-title {
  font-family: "Syne", var(--font-display), sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.auth-sub { font-size: 13px; color: var(--text-dim); margin: 4px 0 28px; }
.auth-error {
  color: var(--red);
  font-size: 12.5px;
  margin: -6px 0 14px;
  text-align: left;
}
.auth-loading { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.auth-debug { margin-top: 10px; font-size: 11px; color: var(--pix); text-align: left; word-break: break-word; white-space: pre-wrap; }
.auth-versao { margin-top: 24px; font-size: 10px; color: var(--surface-3); }

.btn-danger {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  margin-top: 6px;
}
.btn-danger-solid {
  width: 100%;
  border: none;
  background: var(--red);
  color: #2A0B0D;
  font-weight: 700;
  font-size: 15px;
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ---------- PROGRESS (metas) ---------- */
.progress-item { margin-bottom: 16px; }

.modal-overlay-center {
  align-items: center !important;
}
.metas-bubble {
  width: 86%;
  max-width: 340px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 22px 24px;
  text-align: center;
  position: relative;
  animation: bubblePop .32s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
@keyframes bubblePop {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: scale(1); }
}
.metas-bubble-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
}
.metas-bubble-emoji { font-size: 42px; line-height: 1; margin-bottom: 4px; }
.metas-bubble-title {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metas-bubble-pct {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--green);
  margin: 4px 0 2px;
  line-height: 1;
}
.metas-bubble-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.metas-bubble-bar { height: 13px; border-radius: 999px; }
.metas-bubble-values { font-size: 12.5px; color: var(--text-dim); margin-top: 7px; }
.metas-bubble-divider { height: 1px; background: var(--line); margin: 18px 0 12px; }
.metas-bubble-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}
.metas-bubble-bar-small { height: 8px; border-radius: 999px; }
.metas-bubble-msg {
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-3);
  padding: 11px 14px;
  border-radius: 14px;
}

.progress-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ---------- PRODUTOS ---------- */
.produtos-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.produto-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.produto-nome { font-weight: 700; font-size: 14px; }
.produto-info { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.produto-lucro { font-family: var(--font-display); font-weight: 700; color: var(--green); font-size: 15px; }

.oferta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.oferta-nome { font-size: 13px; font-weight: 600; }
.oferta-preco { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.oferta-del {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
}
.oferta-add-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 6px;
  align-items: center;
}
.oferta-add-row input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}
.oferta-add-btn {
  background: var(--green);
  color: #0C1410;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  padding: 10px 0;
  width: 40px;
}
.oferta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.oferta-chip {
  border: 1px solid var(--pix);
  background: rgba(77,168,218,0.1);
  color: var(--pix);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
}
.oferta-chip.active {
  background: var(--pix);
  color: #062230;
}

/* ---------- QUICK ACTIONS ---------- */
.quick-actions {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  bottom: calc(78px + var(--safe-bottom));
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 8px;
  padding: 0 14px;
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity .22s ease, transform .22s ease;
}
.quick-actions.qa-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}
.quick-actions.qa-hidden .quick-btn {
  pointer-events: none;
}
.quick-btn {
  pointer-events: auto;
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform .08s ease;
}
.quick-btn:active { transform: scale(0.95); }
.quick-icon { font-size: 20px; display: flex; align-items: center; justify-content: center; }
.quick-carro { background: var(--yellow); color: #2B1E00; }
.quick-venda { background: var(--green); color: #0C1410; }
.quick-gorjeta { background: var(--tip); color: #350012; }

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + var(--safe-bottom));
  z-index: 15;
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 4px 0;
  border-radius: 10px;
  transition: color .2s ease;
}
.nav-item.active { color: var(--green); }
.nav-icon { font-size: 19px; display: flex; align-items: center; justify-content: center; transition: transform .2s ease; }
.nav-item.active .nav-icon { transform: scale(1.1); }

/* ---------- QTY STEPPER ---------- */
.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--surface-3);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:active { background: var(--green); color: #0C1410; }
.qty-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}
#qtyValor { font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.qty-suffix { font-size: 12px; color: var(--text-dim); }

.toggle-group { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
}
.toggle-btn.active {
  background: var(--pix);
  border-color: var(--pix);
  color: #062230;
}
.toggle-btn.active[data-pay="dinheiro"] {
  background: var(--green);
  border-color: var(--green);
  color: #0C1410;
}

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fadeInOverlay .2s ease;
}
.modal-overlay[hidden] {
  display: none;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  max-height: 88dvh;
  overflow-y: auto;
  animation: slideUp .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.modal-close {
  background: var(--surface-2);
  border: none;
  color: var(--text-dim);
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  font-size: 18px;
  flex-shrink: 0;
}
.modal-body { padding: 6px 18px 26px; }

.resumo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.resumo-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.resumo-item .v { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.resumo-item .l { font-size: 11.5px; color: #B7BFCC; font-weight: 500; margin-top: 2px; }
.resumo-celebra {
  text-align: center;
  padding: 10px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(46,204,113,0.18), rgba(255,193,69,0.18));
  font-weight: 700;
  color: var(--green);
}

.detalhe-linha {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.detalhe-linha:last-child { border-bottom: none; }
.detalhe-linha .l { color: var(--text-dim); }
.detalhe-linha .v { font-weight: 700; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(160px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 481px) {
  body { background: #0B0D10; }
  #app { box-shadow: 0 0 60px rgba(0,0,0,0.5); }
}
