:root {
  /* DFPet — identidade "Noturno Dourado" */
  --ink: #0A1130;
  --gold: #E8B33C;
  --gold-hover: #F0BE4C;
  --gold-active: #D9A32F;
  --slate: #4A5170;
  --cream: #F7F3EA;
  --ink-soft: #9BA0B8;
  --ink-muted: #55503F;
  --line-light: #DCD5C6;
  --surface-dark-2: rgba(247, 243, 234, 0.06);

  --primary: var(--gold);
  --primary-dark: var(--gold-active);
  --primary-light: #F7E7C4;
  --success: #3C6B45;
  --success-bg: #E7EFE4;
  --danger: #9C4A3C;
  --danger-bg: #F3E6E1;
  --warning: #8A6A1F;
  --warning-bg: #FBF0D9;
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --border: var(--line-light);
  --surface: #ffffff;
  --bg: var(--cream);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 14px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: var(--bg-image, none);
  background-size: var(--bg-size, auto);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 { font-family: var(--font-serif); font-weight: 400; font-size: 2rem; margin: 0 0 1.25rem; letter-spacing: -0.01em; line-height: 1.1; }
h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; margin: 2rem 0 0.9rem; letter-spacing: -0.01em; line-height: 1.1; }
.rotulo-mono {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500;
}

.container { max-width: none; margin: 0; padding: 1.75rem 2rem 4rem; }

.site-footer {
  padding: 1.1rem 2rem 1.5rem; margin-top: -2.25rem; text-align: center; font-size: 0.78rem;
  color: var(--text-muted); border-top: 1px solid var(--border); line-height: 1.6;
}
.site-footer-coracao { color: var(--danger); }

a { color: var(--primary); }
.tabela-carrinho td a:not(.btn-link), .tabela-pedidos td a:not(.btn-link), .tabela-atencao td a:not(.btn-link) {
  text-decoration: none;
}
.tabela-carrinho td a:not(.btn-link):hover, .tabela-pedidos td a:not(.btn-link):hover, .tabela-atencao td a:not(.btn-link):hover {
  text-decoration: underline;
}

/* ---------- App shell / sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.main-area { min-width: 0; flex: 1; }

.sidebar {
  --sidebar-w: 240px;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .18s ease-out;
  z-index: 60;
}
html.sidebar-collapsed .sidebar { --sidebar-w: 68px; }
html.sidebar-collapsed .sidebar .label { display: none; }
html.sidebar-collapsed .sidebar-top { padding: 1rem 0.4rem; }
html.sidebar-collapsed .sidebar-toggle { left: 68px; }
html.sidebar-collapsed .sidebar-nav a, html.sidebar-collapsed .sidebar-footer a, html.sidebar-collapsed .perfil-menu-toggle { justify-content: center; }
html.sidebar-collapsed .sidebar-brand-logo-full { display: none; }
html.sidebar-collapsed .sidebar-brand-logo-compact { display: block; }

.sidebar-top { display: flex; align-items: center; justify-content: center; position: relative; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(247,243,234,0.1); }
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; white-space: nowrap; min-width: 0; }
.sidebar-brand-logo { height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.sidebar-brand-logo-compact { display: none; height: 26px; width: auto; }

/* botãozinho redondo de encolher/expandir, "pendurado" fora da barra,
   bem em cima da linha de divisa com o conteúdo, na altura da logo —
   position:fixed (não relativo à .sidebar, que tem overflow-x:hidden e
   cortaria ele) pra poder ficar meio pra fora sem ser cortado.
   O círculo visível é pequeno (26px, mantém o visual discreto), mas a
   área clicável de verdade é bem maior (44px, o mínimo recomendado pra
   toque em celular) via um ::before transparente por cima — sem isso o
   botão era impreciso de acertar no dedo (só 26px de alvo real). */
.sidebar-toggle {
  position: fixed; top: 1.75rem; left: 240px; transform: translate(-50%, -50%);
  background: var(--ink); color: var(--cream); border: 3px solid var(--bg); width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer; box-shadow: var(--shadow-sm); padding: 0; font-size: 0.8rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 61; transition: left .18s ease-out;
}
.sidebar-toggle::before {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px;
}
.sidebar-toggle:hover { background: var(--ink-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0.65rem; flex: 1; }
.sidebar-footer { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.65rem; border-top: 1px solid rgba(247, 243, 234, .1); margin-top: auto; }
.sidebar-nav a, .sidebar-footer a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.85rem; font-weight: 600;
  padding: 0.6rem 0.7rem; border-radius: 6px; display: flex; align-items: center; gap: 0.75rem;
  transition: background .15s ease-out, color .15s ease-out, border-color .15s ease-out; white-space: nowrap;
  border-left: 2px solid transparent;
}
.sidebar-nav a .icon, .sidebar-footer a .icon, .perfil-menu-toggle .icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.sidebar-nav a .icon svg, .sidebar-footer a .icon svg, .perfil-menu-toggle .icon svg { width: 20px; height: 20px; display: block; }
.sidebar-nav a:hover, .sidebar-footer a:hover { background: var(--surface-dark-2); color: var(--cream); }
.sidebar-nav a.active { background: var(--surface-dark-2); color: var(--gold); border-left-color: var(--gold); }

.perfil-menu-wrap { position: relative; }
.perfil-menu-toggle {
  width: 100%; background: none; border: none; cursor: pointer; box-shadow: none; font-family: inherit;
  color: var(--ink-soft); text-decoration: none; font-size: 0.85rem; font-weight: 600;
  padding: 0.6rem 0.7rem; border-radius: 6px; display: flex; align-items: center; gap: 0.75rem;
  transition: background .15s ease-out, color .15s ease-out; white-space: nowrap; border-left: 2px solid transparent;
}
.perfil-menu-toggle:hover { background: var(--surface-dark-2); color: var(--cream); }
.perfil-menu-toggle .label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.perfil-menu-seta { flex-shrink: 0; font-size: 0.65rem; transition: transform .15s ease-out; }
.perfil-menu-wrap.aberto .perfil-menu-seta { transform: rotate(180deg); }
.perfil-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0.65rem; right: 0.65rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 10;
  opacity: 0; transform: scale(0.96); visibility: hidden; pointer-events: none;
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s linear .15s;
}
.perfil-menu-wrap.aberto .perfil-menu {
  opacity: 1; transform: scale(1); visibility: visible; pointer-events: auto;
  transition: opacity .15s ease-out, transform .15s ease-out;
}
.perfil-menu.perfil-menu-flutuante { position: fixed; left: auto; right: auto; bottom: auto; width: 180px; }
.perfil-menu a {
  display: block; padding: 0.65rem 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--text); text-decoration: none;
}
.perfil-menu a:hover { background: var(--bg); color: var(--text); }
.perfil-menu-sair { color: var(--danger) !important; }
html.sidebar-collapsed .perfil-menu-seta { display: none; }

.banner-pedido-para {
  background: var(--warning-bg); color: var(--warning); padding: 0.65rem 1.25rem; font-size: 0.88rem;
  display: flex; gap: 0.6rem; align-items: center; font-weight: 600; border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm); margin: 1.5rem 2rem 0;
}

/* ---------- Flash messages ---------- */
.flashes { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.flash { padding: 0.7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 0.6rem; font-size: 0.9rem; font-weight: 600; }
.flash-message, .flash-None { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Auth ---------- */
.auth-box {
  max-width: 380px; margin: 4rem auto; background: var(--surface); padding: 2.25rem;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.auth-box h1 { margin-top: 0; }
.auth-box label { display: block; margin-bottom: 1.1rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.auth-box input, .auth-box select, .auth-box textarea {
  width: 100%; padding: 0.65rem 0.75rem; margin-top: 0.4rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; transition: border-color .15s;
}
.auth-box textarea { resize: vertical; }
.auth-box input:focus, .auth-box select:focus, .auth-box textarea:focus { outline: none; border-color: var(--primary); }
.auth-box .hint { color: var(--text-muted); font-size: 0.85rem; }
.auth-box p { font-size: 0.88rem; }
.checkbox-inline {
  display: flex !important; align-items: flex-start; gap: 0.55rem; font-weight: 400 !important;
  color: var(--text) !important; cursor: pointer;
}
.checkbox-inline input[type=checkbox] { width: auto; margin: 0.15rem 0 0; flex-shrink: 0; }
.checkbox-inline a { color: var(--primary); }
.chips-parcelas { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.chips-parcelas .chip { font-size: 0.78rem; padding: 0.4rem 0.75rem; }

.caixa-perigo { border: 1px solid var(--danger); }
.btn-perigo, .btn-perigo:hover { background: var(--danger); color: #fff; }
.btn-perigo:active { background: #7C3C31; }

/* ---------- Buttons ---------- */
button, .btn-primario {
  background: var(--gold); color: var(--ink); border: none; padding: 0.62rem 1.3rem;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; font-weight: 600;
  text-decoration: none; display: inline-block; font-family: var(--font-sans); transition: background .15s ease-out, transform .1s;
  box-shadow: none;
}
button:hover, .btn-primario:hover { background: var(--gold-hover); }
button:active, .btn-primario:active { background: var(--gold-active); transform: translateY(1px); }
button:disabled { background: #3A4160; color: #7C819A; cursor: not-allowed; }

/* ---------- Boas-vindas (marquee, visitante) ---------- */
.boas-vindas-marquee {
  overflow: hidden; flex: 1; min-width: 0; margin: 0 1.25rem;
}
.boas-vindas-marquee-track {
  display: flex; width: max-content; will-change: transform;
  animation: boas-vindas-scroll 26s linear infinite;
}
.boas-vindas-marquee-texto {
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700; color: var(--gold);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); white-space: nowrap; padding: 0 1.5rem; flex-shrink: 0;
}
@keyframes boas-vindas-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .boas-vindas-marquee-track { animation: none; }
}

/* ---------- Filters / chips ---------- */
.catalogo-filtros { display: flex; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; align-items: center; }
.catalogo-filtros .dropdown-filtro { margin-bottom: 0; }
.catalogo-filtros-chips { display: contents; }
.catalogo-filtros input[type=search], .catalogo-filtros input[type=text] {
  padding: 0.6rem 0.9rem; border: 1.5px solid var(--border); border-radius: 999px; width: 100%;
  font-size: 0.9rem; font-family: inherit; background: var(--surface);
}
.catalogo-filtros input[type=search]:focus, .catalogo-filtros input[type=text]:focus { outline: none; border-color: var(--primary); }
.busca-wrap { position: relative; flex: 1; min-width: 200px; }
.busca-wrap:has(.btn-microfone) input[type=search], .busca-wrap:has(.btn-microfone) input[type=text] { padding-right: 2.5rem; }
.busca-wrap:has(.busca-icones) input[type=search], .busca-wrap:has(.busca-icones) input[type=text] { padding-right: 4.6rem; }
.busca-icones { position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 0.05rem; }
.btn-microfone {
  position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border-radius: 50%; border: none; background: transparent; color: var(--text-muted); font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: none;
}
.btn-microfone:hover { background: var(--primary-light); color: var(--primary); }
.btn-microfone.gravando { background: var(--danger); color: #fff; animation: pulso-microfone 1s ease-in-out infinite; }
@keyframes pulso-microfone { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.busca-icones .btn-microfone, .btn-icone-busca {
  position: static; transform: none; top: auto; right: auto; flex-basis: auto;
  width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
  color: var(--text-muted); font-size: 1rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; padding: 0; box-shadow: none; flex-shrink: 0;
}
.btn-icone-busca:hover { background: var(--primary-light); color: var(--primary); }
.busca-sugestoes {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  z-index: 40; overflow: hidden; max-height: 380px; overflow-y: auto;
}
.busca-sugestao {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.8rem; cursor: pointer;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
}
button.busca-sugestao { width: 100%; border: none; border-bottom: 1px solid var(--border); background: none; font: inherit; text-align: left; }
.busca-sugestao:last-child { border-bottom: none; }
.busca-sugestao:hover, .busca-sugestao.selecionada { background: var(--primary-light); }
.busca-sugestao-foto { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--bg); flex-shrink: 0; }
.busca-sugestao-foto-placeholder { width: 36px; height: 36px; border-radius: 6px; background: var(--bg); flex-shrink: 0; }
.busca-sugestao-nome { font-size: 0.85rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busca-sugestao-preco { font-size: 0.82rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.busca-sugestao-vazio { padding: 0.8rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.catalogo-filtros select {
  padding: 0.6rem 0.9rem; border-radius: 999px; border: 1.5px solid var(--border);
  font-family: inherit; font-size: 0.9rem; background: var(--surface); color: var(--text);
}
.catalogo-filtros select:has(option[value=""]:checked) { color: var(--text-muted); }
.catalogo-filtros select option { color: var(--text); }
.chip {
  padding: 0.5rem 1rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-ativo, .chip-ativo:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ---------- Marcas ---------- */
/* cada logo fica numa caixa do mesmo tamanho (largura x altura fixas) e
   a imagem escala dentro dela sem distorcer (object-fit: contain) — assim
   logos com proporção bem diferente (ex: Lança Bicho, mais "quadrado",
   contra as outras, mais "banner largo") ocupam um espaço visualmente
   equivalente, sem sobrar vão desigual entre elas */
.marcas-destaque { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.75rem; margin: 0 0 0.9rem; }
.marca-logo-link {
  display: flex; align-items: center; justify-content: center; width: 112px; height: 44px;
  padding: 0.25rem; transition: transform .12s ease-out; opacity: 0.92;
}
.marca-logo-link:hover, .marca-logo-link-ativa { opacity: 1; transform: scale(1.05); }
.marca-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Catálogo por fileiras de categoria ---------- */
.categorias-linhas { display: flex; flex-direction: column; gap: 1.75rem; }
.categoria-bloco { min-width: 0; }
.categoria-cabecalho { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.categoria-titulo { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text); margin: 0; }
.categoria-badge {
  font-size: 0.68rem; font-weight: 700; color: var(--gold-dark, #8a5a00); background: #FCEFD2;
  border-radius: 999px; padding: 0.15rem 0.55rem; flex-shrink: 0;
}
.linha-scroll-wrap { position: relative; }
.linha-scroll {
  display: flex; gap: 0.85rem; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.linha-scroll::-webkit-scrollbar { height: 4px; }
.linha-scroll::-webkit-scrollbar-track { background: transparent; }
.linha-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.linha-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.linha-scroll .produto-card { flex: 0 0 170px; }
.seta-scroll {
  position: absolute; top: 35%; right: -6px; transform: translateY(-50%); width: 34px; height: 34px;
  border-radius: 50%; border: none; background: var(--ink); color: #fff; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .linha-scroll .produto-card { flex-basis: 140px; }
  .seta-scroll { display: none; }
}

/* ---------- Product grid ---------- */
.produto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.1rem; }
.produto-card {
  background: var(--surface); border-radius: var(--radius-md); padding: 0.9rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--border); transition: border-color .15s ease-out; position: relative;
}
.produto-card:hover { border-color: var(--gold); }
.produto-foto-wrap { position: relative; }
.produto-foto {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm);
  background: #f0f1f5; display: block;
}
.produto-foto-placeholder {
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  font-size: 0.75rem; text-align: center; padding: 0.5rem;
}
.badge-promo {
  position: absolute; top: 0.4rem; left: 0.4rem; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 800; padding: 0.2rem 0.5rem; border-radius: 999px; letter-spacing: 0.02em;
  z-index: 2;
}
.btn-info {
  position: absolute; top: 0.4rem; right: 0.4rem; z-index: 2; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; background: rgba(26, 29, 41, .55); color: #fff; box-shadow: none;
  font-size: 0.78rem; font-weight: 700; font-style: italic; font-family: Georgia, serif; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.btn-info:hover { background: var(--primary); }
.badge-login-ok {
  display: inline-block; background: var(--success-bg); color: var(--success); font-size: 0.78rem; font-weight: 700;
  padding: 0.25rem 0.6rem; border-radius: 999px; margin-right: 0.5rem;
}
.badge-no-carrinho {
  position: absolute; bottom: 0.4rem; left: 0.4rem; right: 0.4rem; z-index: 2;
  background: var(--success); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 0.25rem 0.5rem; border-radius: 999px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.badge-no-carrinho[hidden] { display: none; }
.produto-nome {
  font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.3em; line-height: 1.15;
}
.produto-preco { font-size: 0.95rem; }
.preco-riscado { text-decoration: line-through; color: var(--text-muted); margin-right: 0.4rem; font-size: 0.78rem; }
.preco-atual { font-weight: 600; color: var(--primary); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.produto-form { display: flex; gap: 0.4rem; align-items: center; margin-top: auto; }
.qtd-stepper { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qtd-stepper button {
  background: var(--bg); color: var(--text); box-shadow: none; border-radius: 0; padding: 0.35rem 0.6rem;
  font-weight: 800; font-size: 1rem; line-height: 1;
}
.qtd-stepper button:hover { background: var(--primary-light); color: var(--primary); }
.qtd-input {
  width: 2.4rem; padding: 0.35rem 0; border: none; text-align: center; font-family: inherit;
  font-weight: 700; font-size: 0.9rem; -moz-appearance: textfield;
}
.qtd-input::-webkit-outer-spin-button, .qtd-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.produto-form button[type=submit] { flex: 1; padding: 0.55rem 0.5rem; font-size: 0.82rem; }

/* ---------- Tables ---------- */
.tabela-carrinho, .tabela-pedidos, .tabela-atencao {
  width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.tabela-carrinho th, .tabela-carrinho td,
.tabela-pedidos th, .tabela-pedidos td,
.tabela-atencao th, .tabela-atencao td { padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.tabela-carrinho th, .tabela-pedidos th, .tabela-atencao th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  background: var(--bg); font-weight: 700; position: sticky; top: 0; z-index: 5;
}
.celula-truncada {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tabela-contas th, .tabela-contas td { padding: 0.6rem 0.9rem; font-size: 0.85rem; }
.pix-box {
  display: flex; gap: 1.5rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.25rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.pix-qrcode { width: 180px; height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; padding: 0.5rem; }
.pix-copia-cola { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 0.5rem; }
.pix-copia-cola label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.pix-copia-cola textarea { resize: vertical; font-family: monospace; font-size: 0.8rem; padding: 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); }
.pix-copiado-msg { color: var(--success, #2e7d32); font-size: 0.85rem; font-weight: 600; margin: 0; }
.tabela-carrinho tr:last-child td, .tabela-pedidos tr:last-child td, .tabela-atencao tr:last-child td { border-bottom: none; }
.tabela-carrinho tr:hover td, .tabela-pedidos tr:hover td { background: var(--primary-light); }
.total { font-size: 1.3rem; font-weight: 600; margin: 1.25rem 0; font-variant-numeric: tabular-nums; }
.resumo-pedido { background: var(--surface); padding: 1.25rem 1.6rem; border-radius: var(--radius-md); list-style: none; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.resumo-pedido li { padding: 0.4rem 0; border-bottom: 1px dashed var(--border); }
.resumo-pedido li:last-child { border-bottom: none; }
.hint { color: var(--text-muted); font-size: 0.88rem; }

.carrinho-foto-col { width: 56px; }
.carrinho-foto { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg); display: block; }
.carrinho-foto-placeholder { display: flex; align-items: center; justify-content: center; font-size: 0.6rem; color: var(--text-muted); text-align: center; }
.btn-info-inline { position: static; display: inline-flex; vertical-align: middle; margin-left: 0.35rem; background: var(--bg); color: var(--text-muted); }
.btn-info-inline:hover { background: var(--gold); color: var(--ink); }
.carrinho-acoes { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.orcamento-box {
  margin-top: 2rem; padding: 1.25rem 1.6rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); border-left: 3px solid var(--gold);
}
.orcamento-box h2 { margin: 0 0 0.3rem; }
.orcamento-box .hint { margin: 0 0 1rem; }
.orcamento-box-form { display: flex; gap: 0.9rem; align-items: flex-end; flex-wrap: wrap; }
.orcamento-box-form label {
  display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); flex: 1; min-width: 200px;
}
.orcamento-box-form input {
  font-family: var(--font-sans); font-size: 0.95rem; padding: 0.55rem 0.8rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
#orcamento-status { margin: 0.75rem 0 0; }

.inline-form { display: inline; }
.btn-link { background: none; border: none; color: var(--primary); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; box-shadow: none; font-weight: 600; }

.atraso-grave td { background: var(--danger-bg) !important; }
.atraso-medio td { background: var(--warning-bg) !important; }
.atraso-hoje td { background: var(--success-bg) !important; }

.form-inline-grid { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.75rem; }
.form-inline-grid input, .form-inline-grid select {
  padding: 0.6rem 0.8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem;
}

/* ---------- Por perto (mapa) ---------- */
.mapa-perto-secao { margin-bottom: 2rem; max-width: 720px; }
.mapa-perto-status { color: var(--text-muted); font-size: 0.88rem; }
.mapa-perto { width: 100%; height: 320px; border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 0.9rem; }
.mapa-perto-lista { display: flex; flex-direction: column; gap: 0.6rem; }
.mapa-perto-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); transition: border-color .15s ease-out;
}
.mapa-perto-item:hover { border-color: var(--gold); }
.mapa-perto-item-nome { font-weight: 700; flex: 1; min-width: 0; }
.mapa-perto-item-endereco { color: var(--text-muted); font-size: 0.82rem; flex: 2; min-width: 0; }
.mapa-perto-item-distancia { color: var(--primary); font-weight: 700; font-size: 0.82rem; flex-shrink: 0; white-space: nowrap; }

/* ---------- Rotas ---------- */
.rotas-layout { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1.75rem; flex-wrap: wrap; }
.rotas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 620px; flex: 1; }
.rota-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 1.4rem 1rem;
  text-align: center; text-decoration: none; color: var(--text); font-weight: 600;
  transition: border-color .15s ease-out;
}
.rota-card:hover { border-color: var(--gold); }
.rota-card-ativa { border-color: var(--gold); background: var(--primary-light); color: var(--ink); }
.rota-contagem { font-weight: 500; font-size: 0.82rem; color: var(--text-muted); display: block; margin-top: 0.3rem; }

.rotas-menu-wrap { position: relative; }
.rotas-menu-toggle {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; box-shadow: none; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s ease-out;
}
.rotas-menu-toggle:hover { border-color: var(--gold); }
.rotas-menu-seta { font-size: 0.9rem; color: var(--text); transition: transform .2s ease-out; }
.rotas-menu-wrap.aberto .rotas-menu-seta { transform: rotate(180deg); }
.rotas-menu-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 50;
  opacity: 0; transform: scale(0.96); visibility: hidden; pointer-events: none;
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s linear .15s;
}
.rotas-menu-wrap.aberto .rotas-menu-dropdown {
  opacity: 1; transform: scale(1); visibility: visible; pointer-events: auto;
  transition: opacity .15s ease-out, transform .15s ease-out;
}
.rotas-menu-dropdown a {
  display: block; padding: 0.65rem 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--text); text-decoration: none;
}
.rotas-menu-dropdown a:hover { background: var(--bg); }

/* ---------- Criar nova rota ---------- */
.rota-nova-topo { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.rota-nova-select-rota { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.rota-nova-select-rota select {
  padding: 0.6rem 0.8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem;
}
.rota-nova-lista-clientes { list-style: none; margin: 0 0 1.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; max-width: 720px; }
.rota-nova-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s ease-out;
}
.rota-nova-item:has(.rota-nova-checkbox:checked) { border-color: var(--gold); background: var(--primary-light); }
.rota-nova-item label { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.7rem 1rem; cursor: pointer; }
.rota-nova-item label input[type=checkbox] { flex-shrink: 0; margin-top: 0.2rem; }
.rota-nova-item-desabilitado { opacity: 0.55; }
.rota-nova-item-desabilitado label { cursor: not-allowed; }
.rota-nova-item-texto { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.rota-nova-item-nome { font-weight: 700; }
.rota-nova-item-endereco { color: var(--text-muted); font-size: 0.82rem; }
.rota-nova-resultado { max-width: 720px; }
.rota-nova-ordem-lista { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rota-nova-ordem-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.rota-nova-ordem-numero {
  display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%; background: var(--ink); color: var(--gold); font-weight: 700; font-size: 0.78rem;
}
.rota-nova-ordem-nome { font-weight: 700; flex: 1; min-width: 0; }
.rota-nova-ordem-distancia { color: var(--primary); font-weight: 700; font-size: 0.82rem; flex-shrink: 0; white-space: nowrap; }
.rota-cliente-item-texto { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
.rota-cliente-item-texto .rota-nova-ordem-nome { flex: none; }
.rota-cliente-item-endereco { color: var(--text-muted); font-size: 0.8rem; }

/* ---------- Botão de ícone com tooltip (ex: baixar PDF na lista de orçamentos) ---------- */
.orcamento-acoes { width: 1%; white-space: nowrap; text-align: right; }
.btn-icone-tooltip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border); text-decoration: none;
  transition: background .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.btn-icone-tooltip svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-icone-tooltip:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.orcamento-acoes .inline-form { margin-left: 0.4rem; }
.btn-icone-tooltip-perigo:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* a caixinha em si NÃO fica dentro do botão — .tabela-scroll tem
   overflow-x:auto, que corta qualquer ::after posicionado ali dentro. Em
   vez disso, tooltip-flutuante.js desenha ela como position:fixed direto
   no <body>, igual o "portal" do menu de perfil no mobile. */
.tooltip-flutuante {
  position: fixed; transform: translate(-50%, -100%); background: var(--ink); color: var(--cream);
  font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  padding: 0.35rem 0.6rem; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease; z-index: 200;
}
.tooltip-flutuante.visivel { opacity: 1; }

/* ---------- Chat widget ---------- */
.chat-widget { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 100; }
.chat-fab {
  position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: var(--ink);
  border: none; cursor: pointer; font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
  box-shadow: 0 4px 12px rgba(10, 17, 48, 0.35);
  transition: transform .15s ease-out, background .15s ease-out, box-shadow .15s ease-out;
}
.chat-fab:hover { background: var(--gold-hover); box-shadow: 0 6px 16px rgba(10, 17, 48, 0.45); transform: scale(1.08); }
.chat-fab[hidden] { display: none; }
.chat-fab::after, .cart-fab::after {
  content: attr(data-tooltip);
  position: absolute; top: 50%; right: calc(100% + 0.6rem); transform: translateY(-50%) translateX(4px);
  background: var(--ink); color: var(--cream); font-family: var(--font-sans); font-size: 0.78rem; font-weight: 600;
  white-space: nowrap; padding: 0.4rem 0.7rem; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.chat-fab:hover::after, .cart-fab:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.chat-panel {
  width: 320px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); display: flex; flex-direction: column; position: absolute; bottom: 0; right: 0;
}
.chat-panel[hidden] { display: none; }
.chat-panel-header {
  background: var(--ink); color: var(--cream); padding: 0.75rem 1.1rem;
  font-weight: 600; font-family: var(--font-serif); font-size: 1.1rem; display: flex; align-items: center; justify-content: space-between;
}
.chat-fechar { background: none; border: none; color: var(--ink-soft); cursor: pointer; padding: 0; font-size: 1.1rem; box-shadow: none; line-height: 1; }
.dafne-letra { color: var(--gold); font-weight: 800; }
.chat-fechar:hover { color: var(--cream); background: none; }
.chat-panel .chat-mensagens { height: 300px; }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 0.9rem; font-size: 0.85rem; background: var(--bg); }
.chat-msg { margin-bottom: 0.7rem; max-width: 85%; padding: 0.5rem 0.75rem; border-radius: var(--radius-md); line-height: 1.4; }
.chat-msg-user { margin-left: auto; background: var(--gold); color: var(--ink); border-bottom-right-radius: 4px; }
.chat-msg-bot { margin-right: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-input-row { display: flex; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-row input { flex: 1; border: none; padding: 0.75rem; font-size: 0.85rem; font-family: inherit; }
.chat-input-row input:focus { outline: none; }
.chat-input-row button { border: none; background: var(--gold); color: var(--ink); padding: 0 1.1rem; cursor: pointer; border-radius: 0; box-shadow: none; }

/* ---------- Guest header (visitante, sem login) ---------- */
.guest-header {
  background: var(--ink); position: sticky; top: 0; z-index: 50;
  box-shadow: none; margin: 0 0 1.75rem;
}
.guest-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: none; margin: 0; padding: 0.9rem 2rem;
}
.guest-brand { text-decoration: none; display: flex; align-items: center; gap: 0.65rem; }
.guest-brand-logo { height: 40px; width: auto; object-fit: contain; }
.guest-nav { display: flex; align-items: center; gap: 0.75rem; }
.guest-nav .cart-link { color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.guest-nav .cart-link svg { width: 18px; height: 18px; vertical-align: middle; }
.guest-header .btn-outline { border-color: rgba(247,243,234,0.3); color: var(--cream); }
.guest-header .btn-outline:hover { background: var(--surface-dark-2); }
.guest-header .btn-primario-outline { border-color: var(--gold); color: var(--gold); }
.guest-header .btn-primario-outline:hover { background: var(--surface-dark-2); }

.cart-fab {
  position: fixed; bottom: 5rem; right: 1.25rem; z-index: 55; width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--gold); display: flex; align-items: center; justify-content: center;
  text-decoration: none; border: 1.5px solid var(--gold);
  box-shadow: 0 4px 12px rgba(10, 17, 48, 0.35);
  transition: transform .15s ease-out, background .15s ease-out, box-shadow .15s ease-out;
}
.cart-fab:hover { background: #141b3c; box-shadow: 0 6px 16px rgba(10, 17, 48, 0.45); transform: scale(1.08); }
.cart-fab svg { width: 22px; height: 22px; }
.cart-fab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-size: 0.68rem; font-weight: 700; font-family: var(--font-sans);
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--cream);
}
.cart-fab-badge[hidden] { display: none; }
.botoes-boleto { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.boleto-link-fallback {
  width: 100%; margin-top: 0.5rem; padding: 0.5rem 0.7rem; font-size: 0.8rem;
  border: 1.5px solid var(--primary); border-radius: var(--radius-sm); color: var(--text); background: var(--surface);
}
.acoes-conta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: nowrap; position: relative; }
.form-baixar-compacto { display: flex; align-items: center; gap: 0.3rem; margin: 0; flex-wrap: nowrap; }
.form-baixar-compacto input {
  width: 4.4rem; padding: 0.3rem 0.4rem; font-size: 0.78rem; margin: 0;
}
.btn-icone {
  width: 1.9rem; height: 1.9rem; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 0.85rem; box-shadow: none; flex-shrink: 0; line-height: 1;
}
.btn-icone:hover { border-color: var(--primary); background: var(--primary-light); }
.btn-icone-baixar { border-color: var(--success); color: var(--success); }
.btn-icone-baixar:hover { background: var(--success-bg); }
.compartilhar-wrap { position: relative; }
.compartilhar-painel {
  position: absolute; top: 115%; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 0.3rem; min-width: 170px;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.compartilhar-painel button {
  background: transparent; box-shadow: none; color: var(--text); text-align: left; padding: 0.5rem 0.6rem;
  font-size: 0.82rem; font-weight: 600; border-radius: var(--radius-sm); white-space: nowrap; border: none;
}
.compartilhar-painel button:hover { background: var(--primary-light); }
.compartilhar-painel[hidden] { display: none; }
.compartilhar-status {
  position: absolute; top: 115%; right: 0; z-index: 30; background: var(--ink); color: var(--cream);
  font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.55rem; border-radius: var(--radius-sm); white-space: nowrap;
}
.btn-outline, .btn-primario-outline {
  border: 1.5px solid var(--border); color: var(--text); background: transparent; padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; font-size: 0.85rem; box-shadow: none;
}
.btn-primario-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover, .btn-primario-outline:hover { background: var(--primary-light); }

/* ---------- Checkout ---------- */
.checkout-box {
  max-width: 860px; margin: 0 auto 3rem; background: var(--surface); padding: 2.25rem;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.checkout-box h1 { margin-top: 0; }
.checkout-box label { display: block; margin-bottom: 1.1rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.checkout-box input, .checkout-box select, .checkout-box textarea {
  width: 100%; padding: 0.65rem 0.75rem; margin-top: 0.4rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; transition: border-color .15s;
}
.checkout-box textarea { resize: vertical; }
.checkout-box input:focus, .checkout-box select:focus, .checkout-box textarea:focus { outline: none; border-color: var(--primary); }
.checkout-box .hint { color: var(--text-muted); font-size: 0.85rem; }
.checkout-box p { font-size: 0.88rem; }

.checkout-itens-wrap { margin-bottom: 1.75rem; }
.tabela-scroll {
  overflow-x: auto; overflow-y: auto; max-height: 70vh; scrollbar-width: thin; scrollbar-color: var(--slate) var(--bg);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y;
  position: relative;
}
.tabela-scroll::-webkit-scrollbar { height: 9px; }
.tabela-scroll::-webkit-scrollbar-track { background: var(--bg); }
.tabela-scroll::-webkit-scrollbar-thumb { background: var(--slate); border-radius: 999px; }
.tabela-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
.tabela-scroll .tabela-carrinho, .tabela-scroll .tabela-pedidos, .tabela-scroll .tabela-atencao { border: none; border-radius: 0; }
.tabela-checkout-itens .carrinho-foto-col { width: 3.5rem; }
.celula-desconto-item { white-space: nowrap; }
.campo-desconto-item { width: 4.5rem !important; display: inline-block; margin: 0 !important; padding: 0.4rem 0.5rem !important; }

.checkout-totais { margin-top: 0.9rem; max-width: 320px; margin-left: auto; }
.linha-total { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9rem; margin: 0.4rem 0; }
.linha-total input { width: 8rem; margin: 0; }
.linha-total.total { font-size: 1.15rem; font-weight: 600; border-top: 1px solid var(--border); padding-top: 0.6rem; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.campo-desconto-pedido-linha label { margin: 0; font-weight: 600; }

.parcelas-preview-wrap { margin-top: 1rem; }
.parcelas-preview-titulo { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.5rem; }
.parcelas-preview-titulo .hint { font-weight: 400; }
.tabela-parcelas-preview input { margin: 0; padding: 0.4rem 0.5rem; font-size: 0.85rem; }
.parcelas-preview-diff { color: var(--danger, #c0392b); font-weight: 600; margin: 0.6rem 0; }
.parcelas-recalcular { margin-top: 0.5rem; font-size: 0.82rem; }

.cliente-detalhe-abas { display: flex; justify-content: center; gap: 0.6rem; margin: 1.25rem 0; }
.cliente-detalhe-abas .chip { font-size: 0.88rem; padding: 0.55rem 1.25rem; }
.aba-cliente-painel { margin-bottom: 1.75rem; }

.filtro-cliente-ativo {
  display: flex; align-items: center; gap: 0.6rem; background: var(--primary-light); color: var(--primary);
  border-radius: var(--radius-sm); padding: 0.6rem 1rem; font-size: 0.88rem; font-weight: 600; margin-top: 0.9rem;
}
.filtro-cliente-ativo .btn-link { font-weight: 700; }
.filtro-periodo-linha { display: flex; align-items: center; gap: 0.6rem; margin: 0.9rem 0; min-width: 0; }
.filtro-periodo { display: flex; flex-wrap: nowrap; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.2rem; min-width: 0; }
.filtro-periodo .chip { padding: 0.35rem 0.7rem; font-size: 0.78rem; flex-shrink: 0; }
.filtro-periodo-linha .chip-limpar { flex-shrink: 0; padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.filtro-periodo-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1.1rem; }
.filtro-periodo-custom[hidden] { display: none; }
.filtro-periodo-custom label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.filtro-periodo-custom input {
  margin-top: 0.3rem; padding: 0.55rem 0.8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: inherit; background: var(--surface); width: 9rem;
}
.filtro-periodo-custom input:focus { outline: none; border-color: var(--primary); }
.chip-limpar { color: var(--text-muted); border-style: dashed; }
.chip-limpar:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

.filtro-meses { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.1rem; }
.filtro-meses[hidden] { display: none; }
.chip-mes { min-width: 3.2rem; text-align: center; }
.filtro-meses-ano { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }

.tabs-situacao {
  display: flex; flex-wrap: nowrap; gap: 0.3rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem; overflow-x: auto;
}
.tab-situacao {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; color: var(--text-muted); text-decoration: none; background: var(--bg);
  border: 1.5px solid transparent; flex-shrink: 0; white-space: nowrap;
}
.tab-situacao:hover { background: var(--primary-light); }
.tab-situacao-ativa { background: var(--surface); border-color: var(--primary); color: var(--text); }
.dot-situacao { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
.tab-situacao-contagem { font-size: 0.7rem; color: var(--text-muted); }

.dropdown-filtro { position: relative; display: inline-block; margin-bottom: 0.9rem; }
.dropdown-filtro-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.dropdown-filtro-painel {
  position: absolute; top: 115%; left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 0.9rem; min-width: 280px;
}
.dropdown-filtro-painel[hidden] { display: none; }
.dropdown-filtro-painel .filtro-periodo { flex-wrap: wrap; overflow-x: visible; }
.dropdown-filtro-painel .filtro-periodo-custom { margin-bottom: 0; }
.dropdown-filtro-painel .filtro-meses { margin-top: 0.75rem; margin-bottom: 0; }
.dropdown-filtro-painel .lista-opcoes { display: flex; flex-direction: column; gap: 0.15rem; min-width: 190px; }
.dropdown-filtro-painel .lista-opcoes button, .dropdown-filtro-painel .lista-opcoes a {
  background: transparent; box-shadow: none; color: var(--text); text-align: left; padding: 0.5rem 0.6rem;
  font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-sm); white-space: nowrap; border: none;
  text-decoration: none; display: block;
}
.dropdown-filtro-painel .lista-opcoes button:hover, .dropdown-filtro-painel .lista-opcoes a:hover { background: var(--primary-light); }
.dropdown-filtro-painel .lista-opcoes a.opcao-ativa { background: var(--primary-light); color: var(--primary); }
.acoes-checkout { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.acoes-checkout .dropdown-filtro { margin-bottom: 0; }
.tabs-situacao-dropdown {
  display: flex; flex-direction: column; gap: 0.2rem; border-bottom: none; padding-bottom: 0; overflow-x: visible;
  min-width: 220px;
}
.tabs-situacao-dropdown .tab-situacao { border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; }
.clientes-acoes-topo { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 1.2rem 0 0.9rem; }
.clientes-acoes-topo .col-filter-wrap { margin-bottom: 0; }
.btn-novo-cliente {
  width: 42px; height: 42px; border-radius: var(--radius-sm); border: none; background: var(--ink); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: none; flex-shrink: 0;
}
.btn-novo-cliente:hover { background: var(--slate); }
.btn-novo-cliente .btn-icon { margin-right: 0; }
.btn-novo-cliente .btn-icon svg { width: 20px; height: 20px; }
.clientes-acoes-topo .col-filter-btn {
  width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.clientes-acoes-topo .col-filter-btn .btn-icon { margin-right: 0; }
.clientes-acoes-topo .col-filter-btn .btn-icon svg { width: 20px; height: 20px; }
.col-filter-wrap { position: relative; display: inline-block; margin-bottom: 0.9rem; }
.col-filter-painel {
  position: absolute; top: 115%; left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 0.75rem 1rem; min-width: 200px;
}
.col-filter-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; padding: 0.3rem 0; cursor: pointer; white-space: nowrap; }
.col-filter-item input { width: auto; margin: 0; }
.celula-acoes { white-space: nowrap; }
.celula-acoes .btn-link { margin-right: 0.75rem; }
.select-rota {
  width: auto; display: inline-block; appearance: auto; -webkit-appearance: auto;
  background: #6d28d9; color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem; font-size: 0.78rem; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: var(--shadow-sm); margin-left: 0.5rem;
}
.select-rota:hover { background: #5b21b6; }

tr[data-href] { cursor: pointer; }

.filtros-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.filtros-toolbar .col-filter-wrap, .filtros-toolbar .dropdown-filtro { margin-bottom: 0; }
.filtros-toolbar form { margin: 0; }
.filtros-toolbar select {
  padding: 0.5rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.85rem; font-weight: 700; background: var(--surface); color: var(--text);
}
.filtros-contador { font-size: 0.82rem; color: var(--text-muted); }
.filtros-painel { display: flex; flex-direction: column; gap: 0.9rem; min-width: 240px; }
.filtros-painel[hidden] { display: none; }
.filtros-painel label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin: 0; }
.filtros-painel select, .filtros-painel input {
  width: 100%; margin-top: 0.35rem; padding: 0.5rem 0.7rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.88rem; font-family: inherit; background: var(--surface);
}
.filtros-painel select:focus, .filtros-painel input:focus { outline: none; border-color: var(--primary); }
.filtros-limpar { align-self: flex-start; font-size: 0.82rem; }

.col-dot-situacao { width: 1.6rem; text-align: center; padding-right: 0 !important; }
.col-dot-situacao .dot-situacao { width: 0.8rem; height: 0.8rem; display: inline-block; }
.col-check { width: 2.2rem; text-align: center; }
.col-check input { width: auto; margin: 0; cursor: pointer; }
.barra-somatorio {
  display: flex; gap: 1.75rem; flex-wrap: wrap; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem 1.2rem; margin-top: 0.85rem;
  font-size: 0.88rem; box-shadow: var(--shadow-sm);
}
.barra-somatorio strong { color: var(--primary); }

.barra-acoes-clientes {
  display: flex; align-items: center; gap: 0.75rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 1rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.barra-acoes-clientes[hidden] { display: none; }
.barra-acoes-contador { font-size: 0.85rem; color: var(--text-muted); }
.barra-acoes-contador strong { color: var(--ink); }
.lista-selecao-card { max-width: 460px; }
.lista-selecao { list-style: none; margin: 1rem 0 0; padding: 0; }
.lista-selecao li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; line-height: 1.5; }
.lista-selecao li:last-child { border-bottom: none; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); background: var(--surface); border-radius: var(--radius-md); border: 1px dashed var(--border); }

/* estado-erro/estado-vazio (partials/_estados.html) — estilo base, vale
   em qualquer largura; o mobile (style-mobile-2.css) só ajusta espaçamento
   pro toque. Sem isso, essas telas ficam sem estilo nenhum no desktop. */
.estado-erro, .estado-vazio {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem; margin: 0.5rem 0 1rem;
  display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start;
}
.estado-erro { border-left: 4px solid var(--danger); }
.estado-erro h3, .estado-vazio h3 { margin: 0; font-size: 1.05rem; font-family: var(--font-serif); font-weight: 400; }
.estado-erro p, .estado-vazio p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }
.estado-erro .acao, .estado-vazio .acao {
  display: inline-flex; align-items: center; margin-top: 0.2rem; padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm); background: var(--gold); color: var(--ink);
  font-weight: 700; font-size: 0.9rem; text-decoration: none;
}
.estado-erro .detalhe-tecnico { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); word-break: break-word; }
.estado-erro .detalhe-tecnico summary { cursor: pointer; }

@media (max-width: 780px) {
  .sidebar { --sidebar-w: 64px !important; }
  .sidebar .label { display: none; }
  .sidebar-top { justify-content: center; padding: 1rem 0.4rem; }
  .sidebar-brand-logo-full { display: none; }
  .sidebar-brand-logo-compact { display: block; }
  .sidebar-toggle { left: 64px; }
  .sidebar-nav a, .sidebar-footer a, .perfil-menu-toggle { justify-content: center; padding: 0.65rem 0.4rem; }
  .perfil-menu-seta { display: none; }

  /* "Gaveta" mobile: a barra fica travada em 64px (só ícones) por falta
     de espaço, mas o botão abre ela por cima do conteúdo (position:fixed,
     com fundo escurecido atrás) em vez de tentar encolher/expandir inline
     como no desktop — não cabe as duas coisas numa tela de celular. */
  html.sidebar-mobile-aberta .sidebar {
    position: fixed; top: 0; left: 0; z-index: 200;
    --sidebar-w: 240px !important;
    box-shadow: 6px 0 28px rgba(0,0,0,0.35);
  }
  html.sidebar-mobile-aberta .sidebar .label { display: inline; }
  html.sidebar-mobile-aberta .sidebar-top { justify-content: flex-start; padding: 1.1rem 1.1rem 1rem; }
  html.sidebar-mobile-aberta .sidebar-brand-logo-full { display: block; }
  html.sidebar-mobile-aberta .sidebar-brand-logo-compact { display: none; }
  html.sidebar-mobile-aberta .sidebar-nav a, html.sidebar-mobile-aberta .sidebar-footer a,
  html.sidebar-mobile-aberta .perfil-menu-toggle { justify-content: flex-start; padding: 0.6rem 0.7rem; }
  html.sidebar-mobile-aberta .perfil-menu-seta { display: inline; }
  html.sidebar-mobile-aberta .sidebar-toggle { left: 240px; }
  .sidebar-backdrop { display: none; }
  html.sidebar-mobile-aberta .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(20,16,10,0.45); z-index: 150;
  }
}

@media (max-width: 640px) {
  .container { padding: 1.1rem 1rem 3rem; }
  /* "Buscar" fica sozinho na própria linha, e os chips encolhem um
     pouco pra caber mais na mesma linha (Mais vendidos + Outras marcas
     + Promoções, idealmente) */
  .catalogo-filtros { gap: 0.3rem; }
  .catalogo-filtros > button[type=submit] { flex-basis: 100%; }
  .catalogo-filtros .chip, .catalogo-filtros .dropdown-filtro-btn { font-size: 0.68rem; padding: 0.35rem 0.45rem; }
  .marcas-destaque { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; justify-items: center; }
  .marca-logo-link { width: 100%; height: 34px; padding: 0; }
  .boas-vindas-marquee { flex-basis: 100%; margin: 0.4rem 0 0; order: 3; }
  .boas-vindas-marquee-texto { font-size: 0.85rem; padding: 0 1rem; }
  .rotas-grid { grid-template-columns: repeat(2, 1fr); }
  .rotas-menu-wrap { width: 100%; display: flex; justify-content: flex-end; }
  /* table { display: block; ... } removido de propósito — quebrava o layout
     das tabelas-cartão abaixo (ver .tabela-carrinho/.tabela-pedidos/.tabela-atencao) */
  .tabela-scroll { padding-top: 1.5rem; }
  .tabela-scroll::before {
    content: "⇄ arraste pro lado pra ver tudo"; position: absolute; top: 0.3rem; right: 0.7rem;
    font-size: 0.68rem; color: var(--text-muted); pointer-events: none;
  }
  .tabela-contas th, .tabela-contas td { padding: 0.5rem 0.6rem; font-size: 0.76rem; }
  .celula-truncada { max-width: 110px; }
  .mapa-perto-item { flex-wrap: wrap; }
  .mapa-perto-item-endereco { flex-basis: 100%; }

  .produto-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .produto-card { padding: 0.6rem; gap: 0.4rem; }
  .produto-nome { font-size: 0.78rem; min-height: 2.1em; }
  .produto-preco { font-size: 0.85rem; }
  .preco-atual { font-size: 0.92rem; }
  .produto-form { flex-direction: column; align-items: stretch; }
  .qtd-stepper { justify-content: center; }
  .produto-form button[type=submit] { flex: none; }

  .guest-header { margin: 0 0 1.1rem; }
  .guest-header-inner {
    padding: 0.75rem 1rem;
    flex-wrap: wrap; row-gap: 0.6rem;
  }
  .guest-brand { font-size: 1rem; }
  .guest-nav { flex-wrap: wrap; gap: 0.5rem; width: 100%; justify-content: flex-end; }
  .btn-outline, .btn-primario-outline { padding: 0.45rem 0.8rem; font-size: 0.8rem; }

  /* tabelas continuam tabela de verdade no mobile (cabeçalho fixo em
     cima, arrasta pro lado pra ver o resto) — ver .tabela-scroll e o
     cabeçalho sticky em ~L402 */
  .tabela-carrinho, .tabela-pedidos, .tabela-atencao { font-size: 0.82rem; }
  .tabela-carrinho th, .tabela-carrinho td,
  .tabela-pedidos th, .tabela-pedidos td,
  .tabela-atencao th, .tabela-atencao td { padding: 0.55rem 0.7rem; }
}

/* ---------- Modal de informações do produto ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17, 19, 28, .6); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; padding: 1.5rem;
}
.modal-fechar {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  background: var(--bg); color: var(--text); box-shadow: none; font-size: 1.3rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.modal-fechar:hover { background: var(--danger-bg); color: var(--danger); }
.modal-imagem-wrap { background: var(--bg); border-radius: var(--radius-md); overflow: hidden; }
.modal-imagem-wrap img { width: 100%; max-height: 340px; object-fit: contain; display: block; }
.modal-thumbs { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.modal-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer;
  border: 2px solid transparent; opacity: 0.7; transition: all .15s;
}
.modal-thumb:hover { opacity: 1; }
.modal-thumb.ativa { border-color: var(--primary); opacity: 1; }
.modal-info { margin-top: 1.25rem; }
.modal-info h2 { margin: 0 0 0.4rem; font-size: 1.2rem; padding-right: 2rem; }
.modal-detalhes { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 1rem 0; font-size: 0.88rem; }
.modal-detalhes dt { color: var(--text-muted); font-weight: 600; }
.modal-detalhes dd { margin: 0; }
.modal-descricao { white-space: pre-line; font-size: 0.9rem; color: var(--text); line-height: 1.6; }
.modal-estoque { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0.6rem 0; }
.modal-estoque-total { font-size: 0.88rem; font-weight: 600; }
.modal-estoque-total strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--primary); }
.modal-estoque-lista { list-style: none; margin: 0.4rem 0 0; padding: 0.4rem 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 0.2rem; }
.modal-estoque-lista li { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }
.modal-estoque-saldo { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- lista de produtos (admin) ---------- */
.produto-foto-mini { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; display: block; }
.produto-foto-mini-vazia { background: var(--bg); border: 1px solid var(--border); }
.estoque-numero {
  background: none; border: none; padding: 0; box-shadow: none; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--primary); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; font-size: inherit;
}
.estoque-numero:hover { color: var(--gold-active); }
.estoque-popover {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 0.6rem 0.8rem; min-width: 180px;
}

@media (max-width: 640px) {
  .modal-card { padding: 1.1rem; max-height: 92vh; }
  .modal-imagem-wrap img { max-height: 220px; }
}

/* ---------- Configurações (admin) ---------- */
.tabs-config { display: flex; gap: 0.5rem; margin: 0.5rem 0 1.25rem; }
.config-whatsapp-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: start; }
.config-whatsapp-campos label { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.config-whatsapp-campos textarea {
  width: 100%; padding: 0.65rem 0.75rem; margin-top: 0.4rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; resize: vertical;
}
.config-whatsapp-campos textarea:focus { outline: none; border-color: var(--primary); }
.config-whatsapp-campos input[type=text], .config-whatsapp-campos input[type=password] {
  width: 100%; padding: 0.6rem 0.75rem; margin-top: 0.4rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
}
.config-whatsapp-campos h2 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.hint-finalidade { margin: -0.5rem 0 1rem; font-size: 0.78rem; }
.radio-inline {
  display: flex !important; align-items: flex-start; gap: 0.55rem; font-weight: 400 !important;
  color: var(--text) !important; cursor: pointer; margin-bottom: 0.6rem;
}
.radio-inline input[type=radio] { width: auto; margin: 0.2rem 0 0; flex-shrink: 0; }
.config-api-avancado {
  margin-top: 0.75rem; padding: 1rem; background: var(--bg); border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.config-whatsapp-preview { position: sticky; top: 1rem; }
.zap-preview-bloco { margin-bottom: 1.1rem; }
.zap-preview-titulo { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin: 0 0 0.35rem; }
.zap-bolha {
  background: #DCF8C6; border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 2px;
  padding: 0.55rem 0.7rem; max-width: 90%; box-shadow: var(--shadow-sm); position: relative;
}
.zap-bolha-texto { margin: 0; font-size: 0.88rem; color: #111; white-space: pre-wrap; word-break: break-word; }
.zap-bolha-hora { display: block; text-align: right; font-size: 0.7rem; color: #667781; margin-top: 0.25rem; }

@media (max-width: 860px) {
  .config-whatsapp-grid { grid-template-columns: 1fr; }
  .config-whatsapp-preview { position: static; }
}

/* ---------- Botão de envio de WhatsApp por finalidade (cobrança, rota...) ---------- */
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

/* ---------- Trocar tipo de cadastro (cliente <-> vendedor) ---------- */
.mudar-tipo-wrap { display: inline-block; }
.mudar-tipo-wrap summary { list-style: none; cursor: pointer; }
.mudar-tipo-wrap summary::-webkit-details-marker { display: none; }
.mudar-tipo-wrap[open] summary { margin-bottom: 0.4rem; }

/* ---------- Formulários de edição (admin): orçamento, produto, cliente, pedido ---------- */
.form-padrao { max-width: 780px; }
.form-padrao label { display: block; margin-bottom: 1.1rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-padrao input, .form-padrao select, .form-padrao textarea {
  width: 100%; padding: 0.65rem 0.75rem; margin-top: 0.4rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; transition: border-color .15s;
}
.form-padrao textarea { resize: vertical; }
.form-padrao input:focus, .form-padrao select:focus, .form-padrao textarea:focus { outline: none; border-color: var(--primary); }
.form-padrao .hint { color: var(--text-muted); font-size: 0.85rem; }
.produto-editar-fotos { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.5rem 0 1.25rem; }
.produto-editar-foto-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem; width: 110px;
  margin: 0; font-weight: 400; font-size: 0.78rem;
}
.produto-editar-foto-item img {
  width: 110px; height: 110px; object-fit: contain; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* ---------- Objetivos (metas do vendedor / dashboard admin) ---------- */
.texto-alerta { color: var(--danger); font-weight: 600; }

.objetivos-cabecalho { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.4rem; }
.objetivos-mes-nav { display: flex; align-items: center; gap: 0.6rem; }
.objetivos-mes-atual { font-weight: 700; min-width: 11rem; text-align: center; }
.btn-desabilitado { opacity: 0.35; pointer-events: none; }

.objetivo-secao {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1.4rem; margin-bottom: 1.5rem;
}
.objetivo-secao h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.objetivo-subtitulo { font-size: 1rem; margin: 1.4rem 0 0.3rem; }
.objetivo-sem-meta { color: var(--text-muted); font-size: 0.8rem; display: block; margin-top: 0.35rem; }
.objetivo-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0.35rem 0 0; }
.objetivo-hint-ok { color: var(--success); font-weight: 600; }
.objetivo-vazio { color: var(--text-muted); }

.objetivo-stats-linha { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin: 1rem 0 0; padding-top: 0.85rem; border-top: 1px dashed var(--border); font-size: 0.85rem; }
.objetivo-stats-linha span { display: flex; flex-direction: column-reverse; gap: 0.1rem; }
.objetivo-stats-linha strong { font-size: 1.05rem; color: var(--ink); }

.meta-status { display: flex; align-items: center; gap: 1.5rem; }
.meta-status-barra { flex: 1; min-width: 0; }
.barra-progresso { height: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.barra-progresso-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.meta-status-linha { margin: 0.6rem 0 0; font-size: 0.95rem; }
.meta-status-linha strong { font-size: 1.1rem; }
.meta-status-pct { float: right; font-weight: 700; }

.meta-status-donut { flex-shrink: 0; text-align: center; }
.meta-status-donut-legenda { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.35rem; white-space: nowrap; }
.meta-status-donut-ok { color: var(--success); font-weight: 700; }

.donut-wrap { position: relative; margin: 0 auto; }
.donut-svg circle { transition: stroke-dashoffset .4s ease; }
.donut-centro {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; font-size: 1.1rem; font-weight: 700;
}
.donut-sem-meta { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-align: center; line-height: 1.2; }

.objetivos-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; margin-top: 1.25rem; }
.objetivo-admin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1.25rem;
}
.objetivo-admin-card h2 { font-size: 1.05rem; margin: 0 0 0.9rem; }
.objetivo-admin-donuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem 0.6rem; margin-bottom: 0.75rem; }
.objetivo-admin-donut-item { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--text-muted); text-align: center; }
.objetivo-admin-donut-item strong { color: var(--ink); font-size: 0.85rem; }
.objetivo-admin-form { margin-top: 1rem; display: grid; gap: 0.65rem; }
.objetivo-admin-form label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); display: block; }
.objetivo-admin-form input {
  width: 100%; margin-top: 0.3rem; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
}

@media (max-width: 640px) {
  .meta-status { flex-direction: column; }
  .meta-status-pct { float: none; margin-left: 0.5rem; }
}

/* ---------- Encomendas (cidades por vendedor + fila) ---------- */
.cidades-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; min-height: 1.6rem; }
.cidade-chip-form { display: inline-block; }
.cidade-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
.cidade-chip button {
  background: none; border: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  padding: 0; opacity: 0.6;
}
.cidade-chip button:hover { opacity: 1; color: var(--danger); }
.cidade-add-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.cidade-add-form input {
  flex: 1; padding: 0.45rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; font-family: inherit;
}

/* ---------- Personalizar visual (/admin/personalizar) ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.preset-card {
  display: block; border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.1rem;
  cursor: pointer; background: var(--surface); transition: border-color .15s;
}
.preset-card:hover { border-color: var(--gold); }
.preset-card-ativo { border-color: var(--gold); box-shadow: 0 0 0 2px var(--primary-light); }
.preset-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.preset-card strong { display: block; font-family: var(--font-sans); font-size: 0.95rem; margin-bottom: 0.35rem; }
.preset-card span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

.cor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; }
.cor-input-wrap { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.cor-input-wrap input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.cor-input-wrap input[type="text"] { flex: 1; margin-top: 0; font-family: var(--font-mono); text-transform: uppercase; }

.radio-grupo { display: flex; gap: 1.2rem; margin-top: 0.4rem; }
.radio-grupo .radio-inline { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; font-size: 0.9rem; margin: 0; }
.radio-grupo .radio-inline input { width: auto; margin: 0; }

.logo-upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1rem; max-width: 780px; }
.logo-upload-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem; background: var(--surface); text-align: center; }
.logo-upload-card .lbl-logo { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.8rem; }
.logo-preview { max-width: 100%; max-height: 60px; margin: 0 auto 1rem; object-fit: contain; }
.logo-upload-card form { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.logo-upload-card input[type="file"] { width: 100%; font-size: 0.78rem; }

/* ---------- ícone de verdade dentro de botão/chip (troca dos emojis) ---------- */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }
.btn-icon svg { width: 15px; height: 15px; display: block; }
.btn-icone-busca .btn-icon svg, .btn-microfone .btn-icon svg { width: 16px; height: 16px; }
button .btn-icon, a.chip .btn-icon, .chip .btn-icon { margin-right: 0.35rem; }

/* ---------- pontuação/fidelidade (cliente/pontuacao.html, admin/pontuacao.html, selo no cadastro do cliente) ---------- */
.pontos-hero { display: flex; align-items: center; gap: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.gauge { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-center .num { font-family: var(--font-serif); font-size: 2.1rem; line-height: 1; }
.gauge-center .max { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.pontos-info h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.pontos-info p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; max-width: 40ch; margin: 0; }
.badge-nivel { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--success-bg); color: var(--success); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 999px; margin-top: 0.6rem; }

.secao-titulo { font-size: 1.05rem; margin: 1.6rem 0 0.9rem; }
.historico { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.historico-linha { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.1rem; font-size: 0.85rem; border-top: 1px solid var(--border); }
.historico-linha:first-child { border-top: none; }
.historico-linha .desc { display: flex; flex-direction: column; gap: 0.15rem; }
.historico-linha .desc small { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem; }
.pts { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.pts.pos { color: var(--success); }
.pts.neg { color: var(--danger); }

.premios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 0.9rem; }
.premio-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; text-align: center; }
.premio-card .foto { height: 70px; border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 0.7rem; background-position: center; }
.premio-card b { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.premio-card .custo { font-family: var(--font-mono); color: var(--gold-active); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.7rem; }
.btn-resgatar { width: 100%; border: none; background: var(--ink); color: var(--gold); font-weight: 600; padding: 0.5rem; border-radius: 999px; font-size: 0.8rem; }
.btn-resgatar:disabled { background: var(--border); color: var(--text-muted); }

.regra-bloco { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem 1.4rem; margin-bottom: 1rem; background: var(--surface); }
.regra-linha { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; font-size: 0.85rem; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.regra-linha:first-child { border-top: none; }
.regra-linha input[type="number"] { width: 60px; padding: 0.35rem 0.4rem; border: 1.5px solid var(--border); border-radius: 6px; font-family: var(--font-mono); text-align: center; font-size: 0.85rem; flex-shrink: 0; margin: 0; }
.regra-linha select { margin: 0; padding: 0.35rem 0.5rem; font-size: 0.82rem; }
.regra-linha .unidade { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.regra-linha .remover { margin-left: auto; background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 0.2rem 0.4rem; flex-shrink: 0; box-shadow: none; }
.regra-linha .remover:hover { color: var(--danger); background: none; }
.regra-linha-nova { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; margin-top: 0.6rem; border: 1.5px dashed var(--gold); border-radius: var(--radius-sm); background: var(--bg); flex-wrap: wrap; }
.regra-linha-nova input, .regra-linha-nova select { margin: 0; }
.regra-linha-nova input[type="number"] { width: 60px; padding: 0.4rem; border: 1.5px solid var(--border); border-radius: 6px; font-family: var(--font-mono); text-align: center; font-size: 0.85rem; }
.regra-linha-nova-mix span[data-campo-mix] { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; }
.btn-add-regra, .btn-add { display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 1.5px dashed var(--gold-active); color: var(--gold-active); font-weight: 600; font-size: 0.78rem; padding: 0.4rem 0.8rem; border-radius: 999px; margin-top: 0; cursor: pointer; box-shadow: none; }
.btn-add-regra:hover, .btn-add:hover { background: var(--primary-light); }

.premios-admin-lista { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 1rem; }
.premio-admin-linha { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); font-size: 0.85rem; flex-wrap: wrap; }
.premio-admin-linha:first-child { border-top: none; }
.premio-admin-linha .foto-sm { width: 36px; height: 36px; border-radius: 6px; background: var(--bg); flex-shrink: 0; background-position: center; }
.premio-admin-linha b { flex: 1; }

.pontos-badge-linha { margin: 0.6rem 0 1.2rem; }
.score-badge-mini { display: inline-flex; align-items: center; gap: 0.7rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.5rem 1rem 0.5rem 0.6rem; }
.score-badge-mini .ring { position: relative; width: 38px; height: 38px; flex-shrink: 0; }
.score-badge-mini .ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700; }
.score-badge-mini .txt { display: flex; flex-direction: column; line-height: 1.25; }
.score-badge-mini .txt b { font-size: 0.85rem; }
.score-badge-mini .txt small { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.68rem; }

@media (max-width: 640px) {
  .premios-grid { grid-template-columns: 1fr 1fr; }
  .pontos-hero { gap: 1.2rem; }
}
@media (max-width: 420px) {
  .premios-grid { grid-template-columns: 1fr; }
}
.perfil-menu-toggle .btn-icon svg, .sidebar-footer .btn-icon svg { width: 18px; height: 18px; }

/* ---------- mobile: sem zoom automático ao tocar num campo ---------- */
/* iOS/Android dão zoom sozinhos quando o campo focado tem menos de 16px
   de fonte — como o app usa fontes menores que isso em vários formulários
   (0.78rem–0.9rem), sem isso o teclado abre e a tela pula de tamanho
   sozinha. O !important é necessário pra vencer as regras mais
   específicas de cada formulário (ex.: .form-padrao input) só nessa
   largura de tela. O zoom "de verdade" (tamanho da fonte do app inteiro)
   continua só em Configurações → Personalizar visual → Tamanho do texto. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ---------- convite de acesso do cliente (Clientes admin/vendedor) ---------- */
.status-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.status-chip.sem-convite { background: var(--bg); color: var(--text-muted); }
.status-chip.pendente { background: var(--warning-bg); color: var(--warning); }
.status-chip.ativo { background: var(--success-bg); color: var(--success); }
.btn-convite { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--ink); color: var(--gold); border: none; padding: 0.4rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.76rem; cursor: pointer; white-space: nowrap; margin-top: 0.4rem; }
.btn-convite.reenviar { background: none; border: 1.5px solid var(--border); color: var(--text-muted); }

/* ---------- Conferência de estoque (admin/estoque_bp.py) ---------- */
.card-estoque {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap;
}
.campo-estoque { display: flex; flex-direction: column; gap: 0.35rem; }
.campo-estoque-inline { flex-direction: row; align-items: center; gap: 0.6rem; margin: -0.5rem 0 1.25rem; }
.campo-estoque-inline label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.campo-estoque-inline select { padding: 0.4rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.88rem; }
.campo-estoque-inline select:disabled { background: var(--bg); color: var(--text-muted); }
.campo-estoque label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.campo-estoque input { padding: 0.55rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; min-width: 260px; }
.campo-estoque input:focus { outline: none; border-color: var(--primary); }

.scan-dock {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1.4rem; margin-bottom: 1.4rem;
}
.scan-input-row { display: flex; gap: 0.5rem; align-items: stretch; }
.scan-input-row #scanInput { flex: 1; min-width: 0; }
.scan-input-col { flex: 1 1 320px; display: flex; flex-direction: column; gap: 0.4rem; }
.scan-row { display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap; }
.scan-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
#scanInput {
  font-family: var(--font-mono); font-size: 1.4rem; font-weight: 500; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--bg); color: var(--text); width: 100%;
}
#scanInput:focus { outline: none; border-color: var(--gold); }
#scanInput:disabled { background: #eee; color: var(--text-muted); }
.qty-col { display: flex; flex-direction: column; gap: 0.4rem; }
.qty-stepper { display: flex; align-items: stretch; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); height: 52px; }
.qty-stepper button { width: 38px; border: none; background: var(--surface); color: var(--text); font-size: 1.1rem; font-weight: 700; cursor: pointer; padding: 0; }
.qty-stepper button:hover { background: var(--border); }
.qty-stepper input { width: 52px; border: none; background: transparent; text-align: center; font-family: var(--font-mono); font-size: 1.15rem; color: var(--text); }
.qty-stepper input:focus { outline: none; }
.keep-qty { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
.last-scan {
  margin-top: 1rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem; font-size: 0.86rem; min-height: 20px;
}
.last-scan .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.last-scan .code { font-family: var(--font-mono); font-weight: 600; }
.last-scan .muted { color: var(--text-muted); }
.last-scan.empty { color: var(--text-muted); font-style: italic; }
.last-scan.erro { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); font-style: normal; }

.stats-estoque { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.stat-estoque { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.stat-estoque .n { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-estoque .l { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.stat-estoque.accent .n { color: var(--gold-active); }
.stat-estoque.ok .n { color: var(--success); }
.stat-estoque.falta .n { color: var(--danger); }
.stat-estoque.nc .n { color: #6B4FA0; }
.progress-bar-estoque { height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-top: 2px; }
.progress-bar-estoque > div { height: 100%; background: var(--gold); border-radius: 3px; transition: width .25s ease; }

.table-controls-estoque { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
#searchInput { padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.85rem; min-width: 200px; }
#searchInput:focus { outline: none; border-color: var(--primary); }

.tabela-carrinho td.stripe-cell { padding: 0; width: 4px; }
.stripe { width: 4px; height: 100%; min-height: 36px; display: block; }
.stripe.ok { background: var(--success); }
.stripe.falta { background: var(--danger); }
.stripe.sobra { background: #3163AD; }
.stripe.pendente { background: var(--warning); opacity: .5; }
.stripe.naoCadastrado { background: #6B4FA0; }
.tabela-carrinho td.codigo, .busca-resultado-estoque-item .codigo-interno { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.tabela-carrinho td.num, .tabela-carrinho th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.status-chip.ok { background: var(--success-bg); color: var(--success); }
.status-chip.falta { background: var(--danger-bg); color: var(--danger); }
.status-chip.sobra { background: #E4EDF9; color: #3163AD; }
.status-chip.naoCadastrado { background: #ECE5F7; color: #6B4FA0; }
.editable { cursor: text; border-bottom: 1px dashed var(--border); }
.editable:hover { border-color: var(--gold); }
.edit-input { width: 64px; font-family: var(--font-mono); font-size: 0.85rem; text-align: right; border: 1px solid var(--gold); border-radius: 5px; background: var(--bg); color: var(--text); padding: 2px 6px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); width: 26px; height: 26px; border-radius: 6px; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.row-acoes { display: flex; gap: 0.4rem; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 28px 12px; font-style: italic; }

.banner-info { background: #E4EDF9; color: #3163AD; border: 1px solid #3163AD; border-radius: var(--radius-sm); padding: 0.65rem 1rem; font-size: 0.88rem; }

.campo-estoque .busca-wrap { display: block; margin-top: 0.4rem; }
.campo-estoque .busca-wrap input[type=text] { width: 100%; padding: 0.55rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; }
.campo-estoque .busca-wrap input[type=text]:focus { outline: none; border-color: var(--primary); }
.atalho-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; }
.busca-resultados-estoque { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); max-height: 300px; overflow-y: auto; margin-top: 0.6rem; }
.busca-resultado-estoque-item { padding: 0.65rem 0.9rem; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.busca-resultado-estoque-item:last-child { border-bottom: none; }
.busca-resultado-estoque-item:hover, .busca-resultado-estoque-item.selecionada { background: var(--primary-light); }
.busca-resultado-estoque-item .meta { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.busca-resultado-estoque-item .ja-tem-gtin { font-size: 0.68rem; color: var(--warning); font-weight: 700; }

.btn-camera {
  flex-shrink: 0; width: 52px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-camera:hover { border-color: var(--gold); color: var(--text); }
.btn-camera svg { width: 20px; height: 20px; }

.camera-overlay {
  position: fixed; inset: 0; background: rgba(10, 17, 48, 0.92); z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem;
}
.camera-box { position: relative; width: min(92vw, 480px); border-radius: var(--radius-md); overflow: hidden; background: #000; }
.camera-video { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.camera-guia {
  position: absolute; left: 8%; right: 8%; top: 32%; bottom: 32%; border: 2px solid var(--gold); border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.camera-status { color: var(--cream); font-size: 0.88rem; text-align: center; }
.camera-status-erro { color: #F0A08F; max-width: 320px; }
.camera-fechar { border: none; background: var(--surface); color: var(--ink); padding: 0.6rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.camera-fechar:hover { background: var(--gold); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--cream); padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.erro { background: var(--danger); }

/* ---------- Modo offline: botão de sincronizar ---------- */
.sync-offline-block {
  padding: 0.65rem 0.65rem 0.7rem; margin-top: 0.2rem; border-top: 1px solid rgba(247, 243, 234, 0.12);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.sync-offline-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: rgba(247, 243, 234, 0.06); color: var(--cream); border: 1.5px solid rgba(247, 243, 234, 0.3);
  border-radius: 8px; padding: 0.6rem 0.7rem; font-family: inherit; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.sync-offline-btn:hover:not(:disabled) { background: rgba(232, 179, 60, 0.12); border-color: var(--gold); color: var(--gold); }
.sync-offline-btn:disabled { cursor: default; opacity: 0.7; }
.sync-offline-btn .icon { display: flex; flex-shrink: 0; }
.sync-offline-btn .icon svg { width: 15px; height: 15px; display: block; }
.sync-offline-btn.sincronizando .icon svg { animation: sync-girar 0.9s linear infinite; }
@keyframes sync-girar { to { transform: rotate(360deg); } }
html.sidebar-collapsed .sync-offline-btn .label { display: none; }
.sync-offline-status {
  margin: 0; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.03em; text-align: center;
  color: var(--ink-soft); line-height: 1.4;
}
html.sidebar-collapsed .sync-offline-status { display: none; }

.sync-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--cream); padding: 0.75rem 1.25rem; border-radius: var(--radius-md);
  font-size: 0.86rem; font-weight: 600; max-width: min(92vw, 440px); text-align: left; line-height: 1.4;
  display: flex; align-items: flex-start; gap: 0.6rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; box-shadow: var(--shadow-lg);
}
.sync-toast.mostrar { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- Pedido offline ---------- */
.status-chip.enviando { background: #EFEAF7; color: #5B4B8A; }
.pedido-offline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; margin-top: 1rem; }
@media (max-width: 900px) { .pedido-offline-grid { grid-template-columns: 1fr; } }
.pedido-offline-col input[type="search"] {
  width: 100%; padding: 0.6rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: inherit; margin-bottom: 0.5rem;
}
.po-lista { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.po-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem; font-size: 0.85rem; text-align: left; width: 100%; cursor: pointer;
  font-family: inherit; color: var(--text);
}
button.po-item:hover { border-color: var(--primary); }
.po-item span { color: var(--text-muted); font-size: 0.8rem; flex-shrink: 0; }
.po-item-carrinho { cursor: default; }
.po-qty { display: flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); }
.po-selecionado {
  background: var(--success-bg); color: var(--success); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; margin-bottom: 1rem; font-size: 0.88rem; display: flex; justify-content: space-between; gap: 0.5rem;
}
.po-total { font-weight: 700; font-size: 1.05rem; margin: 0.5rem 0; }
#po-forma-pagamento { width: 100%; padding: 0.5rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-top: 0.3rem; }
.qty-btn {
  width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface);
  font-size: 0.85rem; line-height: 1; cursor: pointer; font-family: inherit;
}
.qty-btn:hover { border-color: var(--primary); }

.push-convite {
  display: flex; align-items: center; gap: 0.85rem; max-width: min(92vw, 460px);
  padding: 0.75rem 1rem; text-align: left; flex-wrap: wrap;
}
.push-convite-icone {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: rgba(232, 179, 60, 0.18);
  color: var(--gold); display: flex; align-items: center; justify-content: center;
}
.push-convite-icone svg { width: 16px; height: 16px; }
.push-convite-texto { flex: 1; min-width: 160px; font-weight: 600; font-size: 0.85rem; line-height: 1.4; }
.push-convite-acoes { display: flex; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }
.push-convite-btn {
  font-family: inherit; font-size: 0.8rem; font-weight: 700; padding: 0.4rem 0.8rem; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.push-convite-btn.ativar { background: var(--gold); color: var(--ink); border: none; }
.push-convite-btn.ativar:hover { background: var(--gold-hover); }
.push-convite-btn.dispensar { background: none; color: rgba(247, 243, 234, 0.75); border: none; }
.push-convite-btn.dispensar:hover { color: var(--cream); }

.lembrete-push-card { display: flex; flex-direction: column; gap: 0.85rem; }
.lembrete-push-status {
  display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.85rem; color: var(--text-muted);
}
.lembrete-push-status .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--primary); }
.lembrete-push-status .icon svg { width: 18px; height: 18px; display: block; }
#perfil-ativar-push { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; }
#perfil-ativar-push .icon svg { width: 16px; height: 16px; display: block; }
.btn-perigo-link { color: var(--danger) !important; }
