/* ===========================================================================
   OdontoCare — folha dos 12 módulos novos.

   Diferente do protótipo original (todo com style inline), estes módulos usam
   classes. Isso deixa a responsividade nativa: os grids nascem com auto-fit e
   minmax, então não é preciso nenhum seletor [style*="..."] para adaptá-los.
   Tudo herda as variáveis de tema (--bg, --card-bg, --primary, ...) que a raiz
   do app já publica, então o modo claro/escuro continua funcionando sozinho.
   =========================================================================== */

.v2 { display: flex; flex-direction: column; gap: 14px; }
.v2 * { box-sizing: border-box; }

/* ------------------------------------------------------------ tipografia -- */
.v2-h { font-weight: 700; font-size: 13.5px; }
.v2-sub { font-size: 11.5px; color: var(--text-muted); }
.v2-muted { color: var(--text-muted); }
.v2-mono { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.v2-strong { font-weight: 700; }
.v2-pre { white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; margin: 0; font-family: inherit; }
.v2-num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ grid -- */
.v2-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.v2-cols { display: grid; gap: 14px; align-items: start; }
.v2-cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.v2-cols-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.v2-cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.v2-split { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.v2-split-esq { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
@media (max-width: 900px) {
  .v2-split, .v2-split-esq { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ card -- */
.v2-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.v2-card-h { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v2-card-h .v2-sub { width: 100%; }
.v2-card-b { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.v2-card-b.tight { padding: 0; }

/* ------------------------------------------------------------------- kpi -- */
.v2-kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.v2-kpi-l { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.v2-kpi-v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-kpi-d { font-size: 11.5px; color: var(--text-muted); }
.v2-kpi-d.ok { color: var(--success); }
.v2-kpi-d.warn { color: var(--warning); }
.v2-kpi-d.dan { color: var(--danger); }

/* ----------------------------------------------------------------- table -- */
.v2-tw { overflow-x: auto; }
.v2-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.v2-t th { text-align: left; font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--card-bg); }
.v2-t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.v2-t tr:last-child td { border-bottom: none; }
.v2-t tbody tr.clic { cursor: pointer; }
.v2-t tbody tr.clic:hover { background: var(--bg); }
.v2-t tbody tr.sel { background: var(--primary-soft); }
.v2-t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v2-t .c { text-align: center; }
.v2-t .nw { white-space: nowrap; }
.v2-t .w { min-width: 190px; }

/* ------------------------------------------------------------------ tags -- */
.v2-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--text-muted); }
.v2-tag.ok { background: var(--success-soft); color: var(--success); }
.v2-tag.warn { background: var(--warning-soft); color: var(--warning); }
.v2-tag.dan { background: var(--danger-soft); color: var(--danger); }
.v2-tag.info { background: var(--primary-soft); color: var(--primary); }
.v2-tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------------------------------------------------------------- botões -- */
.v2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-size: 12px; font-weight: 700; padding: 8px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; white-space: nowrap; line-height: 1.2; }
.v2-btn:hover { border-color: var(--primary); color: var(--primary); }
.v2-btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.v2-btn.pri:hover { opacity: .9; color: #fff; }
.v2-btn.dan { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.v2-btn.dan:hover { border-color: var(--danger); color: var(--danger); }
.v2-btn.sm { font-size: 11px; padding: 5px 9px; border-radius: 7px; }
.v2-btn:disabled { opacity: .45; cursor: not-allowed; }
.v2-btn:disabled:hover { border-color: var(--border); color: var(--text); }
.v2-acoes { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- chips -- */
.v2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-chip { font-family: inherit; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-muted); white-space: nowrap; }
.v2-chip.on { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ----------------------------------------------------------------- forms -- */
.v2-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.v2-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.v2-f.full { grid-column: 1 / -1; }
.v2-l { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.v2-i, .v2-s, .v2-ta {
  font-family: inherit; font-size: 12.5px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; width: 100%; outline: none;
}
.v2-i:focus, .v2-s:focus, .v2-ta:focus { border-color: var(--primary); }
.v2-ta { resize: vertical; min-height: 84px; line-height: 1.5; }
.v2-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.v2-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.v2-busca { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 0 11px; background: var(--bg); flex: 1; min-width: 160px; }
.v2-busca input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 12.5px; color: var(--text); padding: 9px 0; width: 100%; }
.v2-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ abas -- */
.v2-abas { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.v2-aba { font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 10px 14px; cursor: pointer; white-space: nowrap; border: none; background: transparent; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.v2-aba.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ----------------------------------------------------------------- lista -- */
.v2-lista { display: flex; flex-direction: column; }
.v2-li { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.v2-li:last-child { border-bottom: none; }
.v2-li:hover { background: var(--bg); }
.v2-li.on { background: var(--primary-soft); }
.v2-li-txt { flex: 1; min-width: 0; }
.v2-li-t { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-li-s { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; background: var(--primary-soft); color: var(--primary); }

/* ---------------------------------------------------------------- barras -- */
.v2-bar { height: 7px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.v2-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.v2-bar > i.ok { background: var(--success); }
.v2-bar > i.warn { background: var(--warning); }
.v2-bar > i.dan { background: var(--danger); }
.v2-linha-meta { display: flex; flex-direction: column; gap: 6px; }
.v2-linha-meta .topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }

/* --------------------------------------------------------------- colunas -- */
.v2-def { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 12.5px; align-items: baseline; }
.v2-def dt { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.v2-def dd { margin: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- modal -- */
.v2-modal { position: fixed; inset: 0; background: var(--overlay); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.v2-modal-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.v2-modal-box.g { max-width: 900px; }
.v2-modal-h { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.v2-modal-b { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.v2-modal-f { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.v2-x { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px; font-family: inherit; }

/* ---------------------------------------------------------------- vazios -- */
.v2-vazio { padding: 44px 20px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* ------------------------------------------------------- construtor form -- */
.v2-secao { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.v2-secao-h { padding: 10px 13px; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v2-campo { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; padding: 9px 13px; border-top: 1px solid var(--border); align-items: center; }
@media (max-width: 700px) { .v2-campo { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------- papel/documento -- */
.v2-papel { background: #fff; color: #1c1917; border-radius: 8px; border: 1px solid var(--border); padding: 22px; font-size: 12px; line-height: 1.6; overflow: auto; }
.v2-papel .cab { border-bottom: 2px solid currentColor; padding-bottom: 10px; margin-bottom: 14px; white-space: pre-wrap; font-size: 11.5px; }
.v2-papel .rod { border-top: 1px solid #d6d3d1; margin-top: 18px; padding-top: 8px; font-size: 10px; color: #57534e; white-space: pre-wrap; }
.v2-papel .logo { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.v2-qr { width: 68px; height: 68px; flex: none; border-radius: 6px; background-size: 8px 8px; background-color: #fff; border: 1px solid #d6d3d1;
  background-image:
    linear-gradient(45deg, #1c1917 25%, transparent 25%, transparent 75%, #1c1917 75%),
    linear-gradient(45deg, #1c1917 25%, transparent 25%, transparent 75%, #1c1917 75%);
  background-position: 0 0, 4px 4px; }

/* ----------------------------------------------------------------- vídeo -- */
.v2-palco { background: #0c0a09; border-radius: 12px; aspect-ratio: 16 / 9; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.v2-palco .eu { position: absolute; right: 12px; bottom: 12px; width: 26%; min-width: 96px; aspect-ratio: 4 / 3; background: #1c1917; border: 1px solid #44403c; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #a8a29e; font-size: 11px; font-weight: 700; }
.v2-palco .av { width: 84px; height: 84px; border-radius: 999px; background: #292524; color: #e7e5e4; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.v2-palco .nome { position: absolute; left: 12px; bottom: 12px; color: #e7e5e4; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 7px; }
.v2-controles { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ e-mail lab -- */
.v2-email { background: #f5f5f4; border-radius: 10px; padding: 16px; }
.v2-email-box { background: #fff; border-radius: 8px; overflow: hidden; max-width: 460px; margin: 0 auto; color: #1c1917; }
.v2-email-topo { height: 6px; }
.v2-email-b { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.v2-email-b h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.v2-email-b p { margin: 0; font-size: 12.5px; line-height: 1.6; color: #44403c; }
.v2-email-cta { align-self: flex-start; color: #fff; font-size: 12px; font-weight: 700; padding: 10px 18px; border-radius: 8px; }
.v2-email-img { height: 110px; border-radius: 8px; background: #e7e5e4; display: flex; align-items: center; justify-content: center; color: #78716c; font-size: 11.5px; font-weight: 700; }
.v2-email-rod { border-top: 1px solid #e7e5e4; padding: 12px 20px; font-size: 10px; color: #78716c; line-height: 1.5; }

/* ------------------------------------------------------------------- sms -- */
.v2-sms { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; font-size: 12.5px; line-height: 1.5; }
.v2-sms-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 11px; color: var(--text-muted); }

/* --------------------------------------------------------------- etapas --- */
.v2-etapas { display: flex; gap: 0; flex-wrap: wrap; }
.v2-etapa { display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 12px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.v2-etapa .n { width: 21px; height: 21px; border-radius: 999px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.v2-etapa.on { color: var(--primary); }
.v2-etapa.on .n { background: var(--primary); color: #fff; }
.v2-etapa.feito { color: var(--success); }
.v2-etapa.feito .n { background: var(--success-soft); color: var(--success); }

/* ------------------------------------------------------------- galeria --- */
.v2-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 12px; }
.v2-arq { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--card-bg); }
.v2-arq:hover { border-color: var(--primary); }
.v2-arq .capa { height: 92px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--bg); }
.v2-arq .meta { padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; }
.v2-arq .nome { font-size: 11.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-arq .sub { font-size: 10.5px; color: var(--text-muted); }

/* ------------------------------------------------------------- gráficos -- */
.v2-graf { display: flex; align-items: flex-end; gap: 8px; height: 148px; padding-top: 8px; }
.v2-graf .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.v2-graf .pilha { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; flex: 1; }
.v2-graf .b { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.v2-graf .rot { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.v2-legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.v2-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.v2-legenda i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------ TISS ------- */
/* Lista de pendências da auditoria pré-envio: erro trava o lote, alerta não. */
.v2-lista-pend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.v2-lista-pend li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.45; padding: 9px 11px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); }
.v2-lista-pend li .marca { flex: none; width: 18px; height: 18px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.v2-lista-pend li.erro { border-color: var(--danger); }
.v2-lista-pend li.erro .marca { background: var(--danger-soft, var(--bg)); color: var(--danger); }
.v2-lista-pend li.alerta .marca { background: var(--warning-soft, var(--bg)); color: var(--warning); }

/* Seletor de código na tabela do contrato — o preço nasce daqui, não da digitação. */
.v2-picker { display: flex; flex-direction: column; gap: 8px; }
.v2-picker-lista { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; }
.v2-picker-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font-family: inherit; font-size: 12.5px; text-align: left; cursor: pointer; width: 100%; }
.v2-picker-item:last-child { border-bottom: none; }
.v2-picker-item:hover { background: var(--bg); }
.v2-picker-item.on { background: var(--primary-soft); color: var(--primary); }
.v2-picker-item .desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-picker-item .v2-mono { flex: none; min-width: 74px; }

/* ------------------------------------------------- acessos & módulos ------ */
/* Grade de módulos por grupo (tela Acessos e o resumo do plano). auto-fit +
   minmax, como o resto do v2: a responsividade não depende de breakpoint. */
.v2-grid-mod { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.v2-grid-mod .v2-check { padding: 3px 0; }
.v2-grid-mod .v2-card { box-shadow: none; }
.v2-aviso { background: var(--primary-soft); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 12.5px; }
.v2-aviso .v2-check { font-weight: 700; }

/* --------------------------------------------------------------- ajustes -- */
@media (max-width: 600px) {
  .v2-card-h { flex-direction: column; align-items: stretch; }
  .v2-card-h .v2-acoes { justify-content: flex-start; }
  .v2-modal { padding: 0; align-items: flex-end; }
  .v2-modal-box { max-width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .v2-picker-item { flex-wrap: wrap; }
  .v2-picker-item .desc { white-space: normal; flex-basis: 100%; }
}

/* ---------------------------------------------------- escalas & atendimentos */
/* A grade da semana é uma tabela de verdade (7 colunas fixas), e não um grid:
   `grid-column: span` colapsa no celular e cria coluna implícita — já mordeu
   este projeto. Aqui o que rola é a tabela dentro do `.v2-tw`, que é o mesmo
   comportamento das outras telas largas. */
.v2-t.esc-grade th { text-align: center; }
.v2-t.esc-grade th:first-child { text-align: left; }
.v2-t.esc-grade th.sel { background: var(--primary-soft); color: var(--primary); }
.v2-t.esc-grade td { vertical-align: top; min-width: 96px; }
.v2-t.esc-grade td.clic { cursor: pointer; }
.v2-t.esc-grade td.clic:hover { background: var(--bg); }
.esc-cel { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; }
.esc-cel .v2-sub { font-size: 10.5px; text-align: center; }

.esc-li { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--border); }
.esc-li:last-child { border-bottom: none; }

.esc-tl { display: flex; flex-direction: column; }
.esc-tl-i { display: flex; gap: 13px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.esc-tl-i:last-child { border-bottom: none; }
.esc-tl-h { flex: none; width: 52px; font-size: 11.5px; color: var(--text-muted); padding-top: 1px; }

.esc-aviso { background: var(--warning-soft, var(--bg)); border: 1px solid var(--warning); border-radius: 9px; padding: 10px 12px; font-size: 12.5px; }

/* ------------------------------------------------- whatsapp · atendimento -- */
/* Duas colunas que viram uma no celular. `minmax(0,1fr)` e não `1fr`: sem o
   mínimo zero, uma mensagem longa empurra a coluna e a tela ganha rolagem
   horizontal — o mesmo defeito que o grid da grade da semana teve. */
.wa-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .wa-split { grid-template-columns: minmax(0, 1fr); } }

.wa-bolhas { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px; background: var(--bg); border-radius: 10px; }
.wa-linha { display: flex; }
.wa-linha.eu { justify-content: flex-end; }
.wa-bolha { max-width: 76%; padding: 9px 12px; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.wa-bolha.eu { background: var(--success-soft, var(--primary-soft)); border-color: transparent; }
.wa-hora { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; text-align: right; }

/* O "Abrir no WhatsApp" e um <a> de verdade, porque precisa navegar para o
   wa.me — um <button> com onClick nao abre aba nem funciona no celular. Ele
   veste o mesmo botao do resto do sistema. */
a.v2-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ------------------------------------------------------ início (home) ---- */
/* Cartões de módulo: grid com auto-fit, então vira uma coluna no celular
   sem seletor de largura. O cartão é um <button> de verdade — foco pelo
   teclado e Enter funcionam de graça. */
.v2-home-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.v2-home-oi { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.v2-home-busca { flex: 1 1 260px; max-width: 360px; }
.v2-home-kpi { cursor: pointer; transition: border-color .15s ease; }
.v2-home-kpi:hover { border-color: var(--primary); }
.v2-home-grupo { display: flex; flex-direction: column; gap: 8px; }
.v2-home-grupo-t { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 2px 0; }
.v2-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.v2-home-card { display: flex; align-items: center; gap: 12px; text-align: left; font-family: inherit; color: var(--text); background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.v2-home-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.v2-home-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.v2-home-ico { width: 40px; height: 40px; border-radius: 11px; }
.v2-home-card-txt { min-width: 0; flex: 1; }
.v2-home-card-t { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-home-card-s { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------- frente de caixa (PDV) -- */
.v2-pdv-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; max-height: 520px; overflow-y: auto; padding: 2px; }
.v2-pdv-item { display: flex; flex-direction: column; gap: 3px; text-align: left; font-family: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; cursor: pointer; min-width: 0; }
.v2-pdv-item:hover { border-color: var(--primary); background: var(--card-bg); }
.v2-pdv-item-n { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.v2-pdv-item-s { font-size: 10.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-pdv-item-v { font-size: 12.5px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.v2-pdv-linhas { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.v2-pdv-linha { padding: 9px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.v2-pdv-linha:last-child { border-bottom: none; }
.v2-pdv-linha-t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12.5px; }
.v2-pdv-tot { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.v2-pdv-tot .v2-def dd { text-align: right; }
.v2-pdv-tot .v2-btn { width: 100%; font-size: 14px; padding: 12px; }
.v2-pdv-pg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .v2-pdv-cat { max-height: none; } }

/* ---------------------------------------------- frente de caixa · loja --- */
/* Pedido de 10/09/2026: o balcão com a cara do PDV do Retail OS — ladrilhos
   à esquerda, a venda à direita, pagamento em botões. */
.v2-pdv-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.v2-pdv-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.v2-pdv-pill.v2-aba { border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; margin: 0; background: var(--card-bg); }
.v2-pdv-pill.v2-aba.on { background: var(--text); color: var(--card-bg); border-color: var(--text); }
.v2-pdv-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .v2-pdv-split { grid-template-columns: minmax(0, 1fr); } }
.v2-pdv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; max-height: 620px; overflow-y: auto; padding: 2px; }
.v2-pdv-tile { display: flex; flex-direction: column; text-align: left; font-family: inherit; color: var(--text); background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 0; cursor: pointer; overflow: hidden; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.v2-pdv-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.v2-pdv-tile-top { height: 64px; display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 10px; color: #fff; position: relative; }
.v2-pdv-tile-ini { font-size: 26px; font-weight: 800; line-height: 1; opacity: .85; }
.v2-pdv-tile-badge { font-size: 10px; font-weight: 700; background: rgba(255,255,255,.9); color: #241c20; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.v2-pdv-tile-b { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.v2-pdv-side { position: sticky; top: 8px; }
.v2-pdv-cli { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.v2-pdv-cli-novo { display: block; background: var(--bg); }
.v2-link { background: none; border: none; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer; padding: 2px 4px; }
.v2-link.dan { color: var(--danger); }
.v2-pdv-linha-c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v2-pdv-linha-c .v2-i { padding: 5px 8px; font-size: 12px; }
.v2-pdv-linha-c .v2-link { margin-left: auto; }
.v2-pdv-qtd { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-weight: 800; cursor: pointer; font-family: inherit; }
.v2-pdv-qtd:hover { border-color: var(--primary); color: var(--primary); }
.v2-pdv-vazio { text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 34px 10px; line-height: 1.6; }
.v2-pdv-desc { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; }
.v2-pdv-desc .v2-i, .v2-pdv-desc .v2-s { padding: 6px 8px; font-size: 12.5px; }
.v2-pdv-tot2 { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.v2-pdv-tot2 .l { display: flex; justify-content: space-between; gap: 10px; }
.v2-pdv-tot2 .l.tot { font-size: 16px; font-weight: 800; margin-top: 4px; }
.v2-pdv-pgtitulo { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.v2-pdv-meios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.v2-pdv-meio { font-family: inherit; font-size: 12px; font-weight: 700; padding: 9px 6px; border-radius: 9px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-pdv-meio.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.v2-pdv-lancar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.v2-pdv-lancar .v2-i { flex: 1; min-width: 0; }
.v2-pdv-pags { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; margin-bottom: 6px; }
.v2-pdv-pags .l { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.v2-pdv-falta { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; margin: 6px 0 8px; }
.v2-pdv-fim.v2-btn { width: 100%; font-size: 14.5px; padding: 13px; border-radius: 11px; }
.v2-pdv-fim.v2-btn:disabled { background: var(--border); border-color: var(--border); color: var(--text-muted); opacity: 1; }

/* ------------------------------------------------- início · visão geral -- */
.v2-home-visao { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; align-items: stretch; }
@media (max-width: 980px) { .v2-home-visao { grid-template-columns: minmax(0, 1fr); } }
.v2-home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.v2-home-tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--card-bg); cursor: pointer; min-width: 0; text-align: left; font-family: inherit; color: var(--text); }
.v2-home-tile:hover { border-color: var(--primary); }
.v2-home-tile .n { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.v2-home-tile .l { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.3; }
.v2-home-kpis2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.v2-home-kpi2 { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--card-bg); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-home-kpi2 .l { font-size: 12px; color: var(--text-muted); }
.v2-home-kpi2 .v { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.v2-home-kpi2 .v small { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.v2-home-kpi2 .v2-link { align-self: flex-start; padding: 0; margin-top: 2px; font-size: 11.5px; }
.v2-home-fila { display: flex; flex-direction: column; gap: 8px; }
.v2-home-fila-i { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--card-bg); flex-wrap: wrap; }
.v2-home-fila-i .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.v2-home-fila-i .t { font-size: 13px; font-weight: 700; }
.v2-home-fila-i .s { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.v2-home-fila-i .txt { flex: 1; min-width: 200px; }
/* <button> não estica os filhos como um flex normal: a faixa colorida do
   ladrilho ficava só na largura do texto. */
.v2-pdv-tile { align-items: stretch; width: 100%; }
.v2-pdv-tile-top, .v2-pdv-tile-b { width: 100%; }
