/* Sistema VetVix — mesma identidade do site: azul-noite, amarelo da marca, Nunito.
   Casca: menu lateral fixo no computador, gaveta no celular. Superfícies claras com sombra curta e macia.
   Gráficos: entradas = azul, saídas = laranja (validado para daltonismo e contraste, claro e escuro). */
:root {
  --bg: #F3F6F9; --surface: #FFFFFF; --ink: #182736; --muted: #5A6B7D; --line: #E1E8EF; --line-2: #CFD9E3; --soft: #EEF3F8; --hover: #F6F9FB;
  --night: #12263A; --night-2: #1C3550; --night-3: #26425F; --on-night: #EEF4FA; --on-night-muted: #A9BDD1;
  --brand: #3F6782; --brand-2: #335671; --brand-soft: #E3EDF5; --on-brand: #FFFFFF; --sun: #E6B440; --sun-2: #D9A42C; --sun-soft: #FFF5DC;
  --ring: rgba(63, 103, 130, .22);
  --entra: #2a78d6; --sai: #eb6834; --grade: #E3E8EE; --eixo: #C3CDD8;
  --ok: #1E7A3E; --ok-soft: #DDF3E5; --alerta: #8A5300; --alerta-soft: #FFF1D6; --ruim: #B3261E; --ruim-soft: #FDECEA;
  --sombra: 0 1px 2px rgba(18, 38, 58, .05), 0 6px 16px -10px rgba(18, 38, 58, .14);
  --sombra-alta: 0 2px 6px rgba(18, 38, 58, .08), 0 18px 40px -16px rgba(18, 38, 58, .28);
  --f-head: "Nunito", "Segoe UI", system-ui, sans-serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --r: 14px; --r-sm: 10px;
  --lateral: 244px; --topo-h: 0px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D151E; --surface: #16212D; --ink: #E6EDF4; --muted: #A3B4C5; --line: #243445; --line-2: #31445A; --soft: #1A2836; --hover: #1C2A39;
  --night: #0A121B; --night-2: #15243A; --night-3: #1F3350; --brand: #8DB5D9; --brand-2: #A6C6E3; --brand-soft: #1B2D40; --on-brand: #0E1620; --sun: #E2B84C; --sun-2: #EBC566; --sun-soft: #2A2312;
  --ring: rgba(141, 181, 217, .28);
  --entra: #3987e5; --sai: #d95926; --grade: #223142; --eixo: #33465A;
  --ok: #5FD08A; --ok-soft: #13301F; --alerta: #E8B45C; --alerta-soft: #2E2410; --ruim: #FF8A80; --ruim-soft: #3A1715;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -10px rgba(0, 0, 0, .5); --sombra-alta: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px -16px rgba(0, 0, 0, .7); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0D151E; --surface: #16212D; --ink: #E6EDF4; --muted: #A3B4C5; --line: #243445; --line-2: #31445A; --soft: #1A2836; --hover: #1C2A39;
  --night: #0A121B; --night-2: #15243A; --night-3: #1F3350; --brand: #8DB5D9; --brand-2: #A6C6E3; --brand-soft: #1B2D40; --on-brand: #0E1620; --sun: #E2B84C; --sun-2: #EBC566; --sun-soft: #2A2312;
  --ring: rgba(141, 181, 217, .28);
  --entra: #3987e5; --sai: #d95926; --grade: #223142; --eixo: #33465A;
  --ok: #5FD08A; --ok-soft: #13301F; --alerta: #E8B45C; --alerta-soft: #2E2410; --ruim: #FF8A80; --ruim-soft: #3A1715;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -10px rgba(0, 0, 0, .5); --sombra-alta: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px -16px rgba(0, 0, 0, .7); color-scheme: dark }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; caret-color: var(--brand); }
::selection { background: var(--sun-soft); color: var(--ink); }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 900; } h2 { font-size: 1.125rem; font-weight: 900; } h3 { font-size: 1rem; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--ruim); }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* casca: menu lateral */
.lateral { position: fixed; inset: 0 auto 0 0; width: var(--lateral); background: linear-gradient(180deg, #15304A 0%, var(--night) 38%, #0F2033 100%); color: var(--on-night); display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 14px; z-index: 30; overflow-y: auto; scrollbar-color: var(--night-3) transparent; }
.marca { display: grid; grid-template-columns: 132px; justify-items: center; gap: 8px; text-decoration: none; color: var(--on-night-muted); padding: 8px 10px 20px; margin-bottom: 4px; border-bottom: 1px solid rgba(169, 189, 209, .14); }
.marca img { width: 132px; height: auto; display: block; }
.marca span { font-family: var(--f-head); font-weight: 800; font-size: .75rem; letter-spacing: .02em; text-align: center; white-space: nowrap; }
#menu { display: grid; gap: 14px; flex: 1; align-content: start; }
.grupo-menu { display: grid; gap: 2px; }
.grupo-menu p { font-family: var(--f-head); font-weight: 800; font-size: .75rem; color: var(--on-night-muted); padding: 0 10px 4px; }
.grupo-menu a { display: flex; align-items: center; gap: 11px; color: var(--on-night-muted); text-decoration: none; font-family: var(--f-head); font-weight: 700; font-size: .9375rem; padding: 8px 10px; border-radius: var(--r-sm); transition: background-color .15s var(--ease), color .15s var(--ease); }
.grupo-menu a svg, .sair svg, .abre-menu svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.grupo-menu a:hover { background: var(--night-2); color: var(--on-night); }
.grupo-menu a[aria-current="page"] { background: var(--night-3); color: #fff; }
.grupo-menu a[aria-current="page"] svg { color: var(--sun); }
.conta { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--night-3); padding: 12px 6px 0; margin-top: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sun); color: #12263A; display: grid; place-items: center; font-family: var(--f-head); font-weight: 900; flex: none; }
.quem { flex: 1; min-width: 0; font-weight: 700; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sair { background: none; border: 0; color: var(--on-night-muted); padding: 7px; border-radius: 8px; cursor: pointer; display: grid; }
.sair:hover { background: var(--night-2); color: var(--on-night); }
body.com-menu { padding-left: var(--lateral); }
.barra-movel { display: none; }
.veu { position: fixed; inset: 0; background: rgba(10, 18, 27, .45); z-index: 25; }
@media (max-width: 1023px) {
  :root { --topo-h: 56px; }
  body.com-menu { padding-left: 0; }
  .barra-movel:not([hidden]) { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; min-height: var(--topo-h); padding: env(safe-area-inset-top, 0px) 12px 0; background: var(--night); color: var(--on-night); }
  .barra-movel img { height: 28px; width: auto; display: block; }
  .titulo-movel { font-family: var(--f-head); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .abre-menu { background: none; border: 0; color: var(--on-night); padding: 8px; margin-left: -4px; border-radius: 10px; cursor: pointer; display: grid; }
  .abre-menu:hover { background: var(--night-2); }
  .lateral { width: min(84vw, 290px); transform: translateX(-100%); visibility: hidden; transition: transform .25s var(--ease), visibility 0s .25s; }
  body.menu-aberto .lateral { transform: none; visibility: visible; box-shadow: var(--sombra-alta); transition: transform .25s var(--ease); }
}

main { padding-inline: 24px; }
.aba, .carregando { max-width: 76rem; margin-inline: auto; padding-block: 28px 64px; display: grid; gap: 20px; }
.cab { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.cab > div:not(.acoes) { display: grid; gap: 4px; }
.cab p { color: var(--muted); }

.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 12px; align-content: start; min-width: 0; box-shadow: var(--sombra); }
.grade-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 4px; align-content: start; box-shadow: var(--sombra); }
.kpi span { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.kpi b { font-family: var(--f-head); font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi small { color: var(--muted); font-size: .8125rem; }
.kpi.atencao { border-color: var(--sun); background: var(--sun-soft); }
.kpi a { font-weight: 800; font-size: .8125rem; }
.previsao { background: var(--night); border: 1px solid var(--night-2); color: var(--on-night); border-radius: var(--r); padding: 18px 20px; display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: baseline; box-shadow: var(--sombra); }
.previsao b { font-family: var(--f-head); font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.previsao span { color: var(--on-night-muted); font-size: .875rem; }

/* formulários */
label { font-family: var(--f-head); font-weight: 800; font-size: .8125rem; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; width: 100%; min-width: 0; min-height: 42px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); box-shadow: none; flex: none; }
input[type="file"] { padding: 5px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-family: var(--f-head); font-weight: 800; font-size: .875rem; border: 0; border-radius: 8px; padding: 6px 14px; margin-right: 10px; background: var(--brand-soft); color: var(--brand); cursor: pointer; }
select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6B7D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 14px; align-items: end; }
.campo { display: grid; gap: 6px; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.btn { font-family: var(--f-head); font-weight: 800; font-size: .9rem; border: 1px solid transparent; border-radius: 99px; padding: 8px 18px; min-height: 40px; cursor: pointer; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; transition: background-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.btn:hover { background: color-mix(in srgb, var(--brand-soft) 72%, var(--brand) 28%); }
.btn:active { transform: translateY(1px); }
.btn.principal { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.btn.principal:hover { background: var(--brand-2); }
a.btn { text-decoration: none; }
.btn.mini { padding: 3px 12px; min-height: 30px; font-size: .8125rem; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.erro { color: var(--ruim); font-weight: 700; }
.ok { color: var(--ok); font-weight: 700; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filtros .campo { width: auto; min-width: 150px; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-block: 40px; background: radial-gradient(120% 80% at 50% 0%, var(--brand-soft), var(--bg) 60%); }
.form-login { width: min(400px, 100%); padding: 28px; gap: 10px; border: 0; box-shadow: var(--sombra-alta); }
.form-login .logo-login { height: 44px; width: auto; justify-self: start; margin-bottom: 6px; }
.form-login .btn { margin-top: 8px; }

/* tabelas */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--hover); color: var(--muted); font-family: var(--f-head); font-weight: 800; font-size: .78rem; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background-color .12s var(--ease); }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.desc { min-width: 220px; }
td.desc small { display: block; color: var(--muted); }
td select { min-width: 190px; padding: 5px 8px; }
tr.anulado td { color: var(--muted); text-decoration: line-through; }
.chip { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 99px; white-space: nowrap; line-height: 1.5; }
.chip.aberta { background: var(--soft); color: var(--brand); }
.chip.vencida { background: var(--ruim-soft); color: var(--ruim); }
.chip.hoje { background: var(--alerta-soft); color: var(--alerta); }
.chip.paga { background: var(--ok-soft); color: var(--ok); }
.chip.manual { background: var(--sun-soft); color: var(--alerta); }
.vazio { color: var(--muted); text-align: center; padding: 24px; }

/* gráficos */
.legenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.grafico text { fill: var(--muted); font-family: var(--f-body); font-size: 11px; }
.grafico .gl { stroke: var(--grade); stroke-width: 1; }
.grafico .base { stroke: var(--eixo); stroke-width: 1; }
.grafico .e { fill: var(--entra); } .grafico .s { fill: var(--sai); }
.grafico .alvo { fill: transparent; cursor: default; }
.grafico .alvo:hover + g path, .grafico g.foco path { opacity: 1; }
.grafico g.esmaecido path { opacity: .35; }
.barras-h { display: grid; gap: 8px; }
.barra-h { display: grid; grid-template-columns: minmax(110px, 11rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .875rem; }
.barra-h .trilho { height: 12px; border-radius: 0 4px 4px 0; }
.barra-h .trilho i { display: block; height: 100%; background: var(--sai); border-radius: 0 4px 4px 0; min-width: 2px; }
.barra-h span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dica { position: fixed; z-index: 50; background: var(--night); color: var(--on-night); border-radius: 10px; padding: 8px 12px; font-size: .8125rem; pointer-events: none; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.dica b { font-family: var(--f-head); }

/* importar */
.drop { border: 3px dashed var(--line); border-radius: var(--r); padding: 28px 16px; display: grid; gap: 6px; justify-items: center; text-align: center; background: var(--surface); cursor: pointer; }
.drop:hover, .drop.sobre { border-color: var(--brand); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop b { font-family: var(--f-head); font-size: 1.05rem; }
.previa-arq { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--soft); }

/* regras */
.regras td input, .regras td select { padding: 5px 8px; }
.regras td.mover { white-space: nowrap; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .barra-h { grid-template-columns: minmax(0, 1fr) auto; }
  .barra-h .trilho { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* cadastros */
.grade-cad { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.lista-cad { display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; }
.item-cad { display: grid; gap: 2px; text-align: left; background: var(--soft); border: 2px solid transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.item-cad:hover, .item-cad:focus-visible { border-color: var(--brand); }
.item-cad .pets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.form-cad { display: grid; gap: 12px; }
.form-cad.sub { background: var(--soft); border-radius: 12px; padding: 14px; }
.campo.largo { grid-column: 1 / -1; }
.pets-cad { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.pet-cad { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.pet-cad.inativo { opacity: .6; }
.pet-topo { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: start; }
.pet-topo small { display: block; }
.alerta-cad { background: var(--ruim-soft); color: var(--ruim); font-weight: 700; border-radius: 8px; padding: 4px 10px; font-size: .875rem; }
.pesos { font-size: .8125rem; }
.peso-novo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.peso-novo input { width: 8rem; }
td small.muted { display: block; }
@media (max-width: 900px) { .grade-cad { grid-template-columns: minmax(0, 1fr); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Atendimento: orçamento e venda */
.grade-orc, .grade-venda { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.coluna { display: grid; gap: 16px; min-width: 0; }
.grade-orc #o-resumo { position: sticky; top: calc(var(--topo-h) + 20px); }
.cab-form { display: flex; justify-content: space-between; align-items: start; gap: 10px; flex-wrap: wrap; }
.linha-ativo { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, .9fr) minmax(0, .8fr) auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.previa-orc { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.total-formula { font-family: var(--f-head); font-weight: 900; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.alertas-orc { margin: 0; padding: 10px 12px 10px 28px; background: var(--alerta-soft); color: var(--alerta); border-radius: 12px; font-weight: 700; font-size: .875rem; display: grid; gap: 4px; }
div.alertas-orc { padding-left: 12px; }
.itens-orc summary, details > summary { cursor: pointer; font-weight: 700; color: var(--brand); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lista-formulas { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.lista-formulas li { display: grid; gap: 6px; }
.f-topo { display: flex; justify-content: space-between; gap: 12px; }
.f-topo b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.linha-total { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.linha-total b { font-variant-numeric: tabular-nums; }
.linha-total.grande { font-family: var(--f-head); font-size: 1.35rem; font-weight: 900; }
.parceiro-desc { background: var(--ok-soft); color: var(--ok); font-weight: 700; border-radius: 12px; padding: 8px 12px; font-size: .875rem; }
.btn.sol { background: var(--sun); color: #12263A; }
.escolhido { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--soft); border-radius: 12px; padding: 10px 12px; flex-wrap: wrap; }
.mini-cad { background: var(--soft); border-radius: 12px; padding: 12px; }
.sem-cad { font-size: .875rem; }
.sem-cad .campos { margin-top: 8px; }
textarea { font: inherit; resize: vertical; }
.passos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; counter-reset: p; }
.passos li { counter-increment: p; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: .8125rem; color: var(--muted); }
.passos li::before { content: counter(p) " "; font-family: var(--f-head); font-weight: 900; }
.passos li.feito { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.passos li.feito::before { content: "✓ "; }
.lista-pag, .lista-mov { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lista-pag li, .lista-mov li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.riscado, tr.riscado td { color: var(--muted); text-decoration: line-through; }
.perigo summary { color: var(--ruim); }
.filtros-lista { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filtros-lista input[type="search"] { flex: 1 1 240px; width: auto; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg .btn.ativo { background: var(--brand); color: var(--on-brand); }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td, tr.clicavel:focus-visible td { background: var(--soft); }
.formulas-col { max-width: 26rem; }
.link-nome { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.saldo-grande { font-family: var(--f-head); font-weight: 900; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.linha-compra { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; align-items: end; }
.linha-compra .item { grid-column: 1 / -1; }
/* Receitas por mês na ficha do prescritor (uma série: barras simples, sem legenda) */
.barras-mes { display: flex; align-items: end; gap: 6px; height: 140px; padding-top: 18px; }
.bm { flex: 1; display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; height: 100%; min-width: 0; }
.bm i { display: block; width: 100%; max-width: 28px; background: var(--entra); border-radius: 4px 4px 0 0; min-height: 2px; align-self: end; }
.bm-n { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bm-m { font-size: .6875rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) {
  .grade-orc, .grade-venda { grid-template-columns: minmax(0, 1fr); }
  .grade-orc #o-resumo { position: static; }
  .passos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .linha-ativo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .linha-ativo .campo:first-child { grid-column: 1 / -1; }
  .itens-orc th:nth-child(2), .itens-orc td:nth-child(2) { display: none; }
}
.lista-mov li > :nth-child(2) { flex: 1 1 14rem; text-align: left; }
.alts { display: grid; gap: 6px; background: var(--soft); border-radius: 12px; padding: 8px 10px; font-size: .875rem; }
.alt { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.alt small { display: block; }
.grade-ia { display: grid; gap: 4px; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.link-pag { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
#aba-estoque .grade-cad > .cartao:first-child .tabela-wrap { max-height: 70vh; overflow: auto; }
#aba-estoque td.num small { display: block; white-space: normal; }
.check.conferir { background: var(--sun-soft); border-radius: 10px; padding: 8px 10px; }
/* WhatsApp */
.grade-wa { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
.lista-wa { max-height: 75vh; overflow-y: auto; gap: 6px; }
.item-wa { display: grid; gap: 3px; text-align: left; background: var(--soft); border: 2px solid transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.item-wa.ativo, .item-wa:hover { border-color: var(--brand); }
.wa-topo { display: flex; justify-content: space-between; gap: 8px; }
.badge { background: var(--ok); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .75rem; font-weight: 800; }
.wa-previa { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs-wa { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; background: var(--soft); border-radius: 12px; padding: 12px; }
.msg { max-width: 80%; padding: 8px 10px; border-radius: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.msg small, .msg-nota small { display: block; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.msg-in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.msg-out { align-self: flex-end; background: var(--ok-soft); }
.msg-nota { align-self: center; max-width: 92%; font-size: .8rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
.envio-wa { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.campos-wa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 10px; }
.campos-wa code { background: var(--soft); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .grade-wa, .campos-wa { grid-template-columns: minmax(0, 1fr); } }
.sim-wa .msgs-wa { min-height: 320px; max-height: 62vh; }
.envio-sim { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: end; }
.msg.digitando { color: var(--muted); font-style: italic; }
#aba-whatsapp > .seg { margin-top: -6px; }
@media (max-width: 560px) { .envio-sim { grid-template-columns: 1fr 1fr; } .envio-sim textarea { grid-column: 1 / -1; grid-row: 1; } }
.barra-prog { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.barra-prog i { display: block; height: 100%; background: var(--brand); }
/* Relatórios */
#r-corpo { display: grid; gap: 16px; }
.filtros-lista input[type="date"] { width: auto; }
.barra-h.venda .trilho i { background: var(--entra); }
/* Listas de orçamentos e vendas no celular: cada linha vira um bloco (nº, cliente, valor e situação sem rolar de lado). */
@media (max-width: 640px) {
  .lista-atd thead { display: none; }
  .lista-atd, .lista-atd tbody { display: block; }
  .lista-atd tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .lista-atd tr:last-child { border-bottom: 0; }
  .lista-atd td { display: block; padding: 0; border: 0; min-width: 0; background: none !important; }
  .lista-atd td:nth-child(1) { grid-row: 1; grid-column: 1; }
  .lista-atd td:nth-child(2) { grid-row: 1; grid-column: 2; color: var(--muted); font-size: .8125rem; align-self: center; }
  .lista-atd td:nth-child(5) { grid-row: 1; grid-column: 3; font-weight: 800; }
  .lista-atd td:nth-child(3) { grid-column: 1 / -1; }
  .lista-atd td:nth-child(4) { grid-column: 1 / -1; color: var(--muted); font-size: .8125rem; max-width: none; }
  .lista-atd td:nth-child(6) { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
  .lista-atd td.vazio, .lista-atd td.erro { grid-column: 1 / -1; }
  .lista-atd tr.clicavel:hover { background: var(--hover); }
}
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Equipe e acessos */
.perfis-escolha { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.perfis-escolha legend { font-family: var(--f-head); font-weight: 800; font-size: .8125rem; padding: 0; margin-bottom: 6px; }
.opcao-perfil { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; font-family: var(--f-body); font-weight: 400; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.opcao-perfil:hover { border-color: var(--muted); }
.opcao-perfil:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opcao-perfil input { margin-top: 2px; }
.opcao-perfil span { display: grid; gap: 2px; }
.opcao-perfil b { font-family: var(--f-head); font-weight: 800; font-size: .9rem; }
.opcao-perfil small { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.perfis-escolha:disabled .opcao-perfil { opacity: .6; cursor: not-allowed; }
