/* ==========================================================================
   Controle de Orçamentos: estilos da interface com a identidade Hertz.
   Cores, fontes, raios e sombras vêm de tokens.css (carregado antes).
   ========================================================================== */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 400 16px/1.5 var(--hz-font-text); background: var(--hz-bg); color: var(--hz-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--hz-orange); color: var(--hz-navy); }
a { color: var(--hz-slate); text-decoration: underline; text-decoration-color: rgba(65, 83, 100, .35); text-underline-offset: 3px; }
a:hover { color: var(--hz-navy); text-decoration-color: currentColor; }
strong, b { font-weight: 600; }

h1, h2, h3, legend { font-family: var(--hz-font-title); font-weight: 700; color: var(--hz-navy); letter-spacing: -.01em; }
h1 { font-size: 1.85rem; line-height: 1.15; margin: .25rem 0 1.25rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.2rem; line-height: 1.25; margin: 0 0 .9rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h3 { font-size: 1.02rem; margin: 0 0 .5rem; }
h1 .selo, h2 .selo { font-size: .8rem; letter-spacing: 0; }
h2 small { font-family: var(--hz-font-label); font-style: italic; font-weight: 500; color: var(--hz-text-muted); font-size: .8rem; letter-spacing: 0; }

small, .dica, .migalha { color: var(--hz-text-muted); }
.dica { font-size: .9rem; margin: .25rem 0 .75rem; }
.migalha { margin: 0 0 .15rem; font: italic 500 .8rem/1.4 var(--hz-font-label); }
.migalha a { text-decoration: none; }
.migalha a:hover { text-decoration: underline; }

/* ---------- Foco visível (anel laranja com contorno escuro para contraste) ---------- */
:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--hz-surface), 0 0 0 4px var(--hz-navy), 0 0 0 7px rgba(240, 159, 84, .75); border-radius: 4px; }
.botao:focus-visible, .aba:focus-within, button:focus-visible { border-radius: var(--hz-radius-sm); }
.aba:focus-within { box-shadow: 0 0 0 2px var(--hz-surface), 0 0 0 4px var(--hz-navy), 0 0 0 7px rgba(240, 159, 84, .75); border-radius: var(--hz-radius-pill); }

/* ---------- Barra superior ---------- */
.topo {
  background: var(--hz-navy); color: var(--hz-on-dark);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; min-height: var(--hz-topbar-h);
  position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 20px rgba(16, 24, 32, .18);
}
.marca { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--hz-on-dark); flex-shrink: 0; }
.marca img { height: 34px; width: auto; display: block; }
.marca .produto {
  font: italic 500 .78rem/1 var(--hz-font-label); color: var(--hz-on-dark-muted);
  padding-left: .75rem; border-left: 1px solid rgba(229, 225, 230, .25);
}
.marca:hover { color: var(--hz-on-dark); }
.amb { font: italic 500 .68rem/1 var(--hz-font-label); text-transform: uppercase; background: var(--hz-orange); color: var(--hz-navy); padding: .25rem .45rem; border-radius: 4px; }
.menu { display: flex; gap: .15rem; align-items: stretch; flex: 1; align-self: stretch; }
.menu a {
  position: relative; display: inline-flex; align-items: center; padding: 0 .85rem;
  color: var(--hz-on-dark-muted); text-decoration: none; font-weight: 500; transition: color .15s;
}
.menu a::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background .15s; }
.menu a:hover { color: var(--hz-on-dark); }
.menu a:hover::after { background: rgba(229, 225, 230, .3); }
.menu a.ativo { color: var(--hz-orange); font-weight: 600; }
.menu a.ativo::after { background: var(--hz-orange); }
.sair { margin-left: auto; display: flex; align-items: center; }
.topo button.link {
  color: var(--hz-on-dark-muted); border: 1px solid rgba(229, 225, 230, .25); border-radius: var(--hz-radius-pill);
  padding: .35rem .9rem; font-size: .9rem; transition: color .15s, border-color .15s, background .15s;
}
.topo button.link:hover { color: var(--hz-navy); background: var(--hz-light); border-color: var(--hz-light); }
.topo :focus-visible { box-shadow: 0 0 0 3px var(--hz-orange); }

/* ---------- Estrutura ---------- */
.conteudo { width: 100%; max-width: var(--hz-content-max); margin: 0 auto; padding: 2rem 1.5rem 1rem; flex: 1; }
.rodape { text-align: center; color: var(--hz-text-muted); font: italic 500 .75rem/1.4 var(--hz-font-label); padding: 2rem 1rem; }

.cabecalho { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.cabecalho h1 { margin-bottom: .5rem; }
.cartao, .bloco {
  background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: var(--hz-radius);
  padding: 1.4rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--hz-shadow);
}
.zona-perigo { border-color: #F2C9CE; }

/* ---------- Painel: indicadores ---------- */
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.cartoes-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.indicador {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .2rem;
  background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: var(--hz-radius);
  padding: 1.1rem 1.25rem 1rem; text-decoration: none; color: var(--hz-text); box-shadow: var(--hz-shadow);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.indicador::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hz-orange); }
a.indicador:hover { box-shadow: var(--hz-shadow-hover); transform: translateY(-1px); border-color: var(--hz-border-strong); color: var(--hz-text); }
.indicador .rotulo { font: italic 500 .78rem/1.35 var(--hz-font-label); color: var(--hz-text-muted); }
.indicador strong { font: 700 1.75rem/1.15 var(--hz-font-title); color: var(--hz-navy); font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: .15rem 0; }
.indicador small { font-size: .85rem; }
.ind-ok::before { background: var(--hz-ok); }
.ind-alerta { background: var(--hz-danger-row); border-color: #F2C9CE; }
.ind-alerta::before { background: var(--hz-danger); }
.ind-alerta strong { color: var(--hz-danger); }

/* ---------- Botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 42px; padding: .5rem 1.05rem;
  border-radius: var(--hz-radius-sm); border: 1.5px solid var(--hz-slate); background: var(--hz-surface); color: var(--hz-slate);
  font: 500 .95rem/1.2 var(--hz-font-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.botao:hover { background: var(--hz-slate); color: #fff; border-color: var(--hz-slate); }
.botao-primario { background: var(--hz-orange); color: var(--hz-navy); border-color: var(--hz-orange); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 32, .12); }
.botao-primario:hover { background: var(--hz-orange-hover); border-color: var(--hz-orange-hover); color: var(--hz-navy); }
.botao-perigo { color: var(--hz-danger); border-color: var(--hz-danger); background: var(--hz-surface); }
.botao-perigo:hover { background: var(--hz-danger); border-color: var(--hz-danger); color: #fff; }
.botao-pequeno { min-height: 34px; padding: .3rem .75rem; font-size: .875rem; }
.botao:disabled, .botao[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--hz-slate); font: inherit; cursor: pointer; padding: .45rem .6rem; }
.acoes, .acoes-status { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }

details.acao { display: inline-block; }
details.acao > summary { list-style: none; }
details.acao > summary::-webkit-details-marker { display: none; }
details.acao[open] { display: block; width: 100%; }
details.acao[open] > summary { margin-bottom: .5rem; }
details.acao > form { background: var(--hz-surface-2); border: 1px solid var(--hz-border); border-radius: var(--hz-radius-sm); padding: .9rem; margin-bottom: .5rem; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form > .botao { align-self: flex-start; }
.form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: .35rem; font: italic 500 .8rem/1.35 var(--hz-font-label); color: var(--hz-text-muted); }
label.check { flex-direction: row; align-items: center; gap: .55rem; font: 400 .95rem/1.4 var(--hz-font-text); color: var(--hz-text); }
input, select, textarea {
  font: 400 16px/1.4 var(--hz-font-text); color: var(--hz-text); background: var(--hz-surface);
  border: 1px solid var(--hz-border-strong); border-radius: var(--hz-radius-sm); padding: .55rem .7rem; min-height: 42px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--hz-gray); }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--hz-slate); box-shadow: var(--hz-focus); }
input::placeholder, textarea::placeholder { color: #8A8F97; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; min-height: auto; accent-color: var(--hz-slate); margin: 0; }
input[type=checkbox]:focus, input[type=radio]:focus { box-shadow: var(--hz-focus); }
input[type=file] { min-height: auto; padding: .4rem; font-size: .9rem; }
input[type=file]::file-selector-button { font: 500 .85rem var(--hz-font-text); border: 1.5px solid var(--hz-slate); color: var(--hz-slate); background: var(--hz-surface); border-radius: 6px; padding: .3rem .7rem; margin-right: .6rem; cursor: pointer; }
input[readonly] { background: var(--hz-surface-2); }
textarea { min-height: 96px; resize: vertical; }
fieldset { border: 1px solid var(--hz-border); border-radius: var(--hz-radius-sm); padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: .75rem; background: var(--hz-surface-2); }
legend { padding: 0 .4rem; font-size: .98rem; }
.linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
[hidden] { display: none !important; }
output { font-variant-numeric: tabular-nums; padding: .5rem 0; color: var(--hz-text); font-weight: 600; }

/* ---------- Filtros e abas ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; align-items: flex-end; }
.filtros input[type=search] { flex: 2 1 220px; width: auto; }
.filtros select { flex: 1 1 160px; width: auto; }
.filtros .mes input { width: auto; }
.abas { display: flex; flex-wrap: wrap; gap: .35rem; }
.aba {
  position: relative; flex-direction: row; align-items: center; border: 1px solid var(--hz-border-strong); border-radius: var(--hz-radius-pill);
  padding: .4rem .95rem; cursor: pointer; background: var(--hz-surface); color: var(--hz-slate); text-transform: capitalize;
  font: 500 .9rem/1.2 var(--hz-font-text); transition: background .15s, color .15s, border-color .15s;
}
.aba:hover { border-color: var(--hz-slate); }
.aba.ativa { background: var(--hz-navy); color: var(--hz-light); border-color: var(--hz-navy); }
.aba input { position: absolute; opacity: 0; pointer-events: none; }
.resumo-filtro { color: var(--hz-text-muted); margin: .25rem 0 1rem; font-size: .92rem; }
.abas-links { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 1.5rem; }
.abas-links a {
  text-decoration: none; color: var(--hz-slate); background: var(--hz-surface); border: 1px solid var(--hz-border-strong);
  border-radius: var(--hz-radius-pill); padding: .4rem .95rem; font-weight: 500; font-size: .9rem; transition: background .15s, color .15s, border-color .15s;
}
.abas-links a:hover { background: var(--hz-navy); color: var(--hz-light); border-color: var(--hz-navy); }
section[id] { scroll-margin-top: calc(var(--hz-topbar-h) + 1rem); }

/* ---------- Tabelas ---------- */
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: var(--hz-radius); overflow: hidden; box-shadow: var(--hz-shadow); }
.cartao .tabela, .bloco .tabela, details .tabela { box-shadow: none; }
.tabela th, .tabela td { padding: .75rem .9rem; border-bottom: 1px solid var(--hz-border); text-align: left; vertical-align: top; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela th { font: italic 500 .78rem/1.3 var(--hz-font-label); color: var(--hz-text-muted); background: var(--hz-surface-2); white-space: nowrap; }
.tabela tbody tr { transition: background .12s; }
.tabela tbody tr:hover { background: #FBFAFC; }
.tabela td a { font-weight: 500; }
.tabela td[data-rotulo="Número"] { white-space: nowrap; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.linha-atraso, .tabela tbody tr.linha-atraso:hover { background: var(--hz-danger-row); }
.linha-atraso td:first-child { box-shadow: inset 3px 0 0 var(--hz-danger); }
.acoes-celula { min-width: 160px; }
.acoes-celula details.acao { margin: 0 .25rem .25rem 0; }

/* ---------- Selos de status ---------- */
.selo {
  display: inline-flex; align-items: center; gap: .3rem; font: italic 500 .76rem/1.2 var(--hz-font-label);
  padding: .22rem .6rem; border-radius: var(--hz-radius-pill); background: var(--hz-surface-2); color: var(--hz-text-muted);
  border: 1px solid var(--hz-border-strong); white-space: nowrap; vertical-align: middle;
}
.selo::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; opacity: .85; flex-shrink: 0; }
.st-enviado, .sit-parcialmente-recebido, .sit-a-receber, .par-pendente { background: var(--hz-info-bg); color: var(--hz-info); border-color: transparent; }
.st-aprovado, .st-em_execucao { background: var(--hz-warn-bg); color: var(--hz-warn); border-color: transparent; }
.st-realizado, .sit-quitado, .par-recebida { background: var(--hz-ok-bg); color: var(--hz-ok); border-color: transparent; }
.st-recusado { text-decoration: line-through; }
.sit-com-atraso, .par-atrasada { background: var(--hz-danger-bg); color: var(--hz-danger); border-color: transparent; }
.st-rascunho { background: var(--hz-surface); color: var(--hz-text-muted); border-style: dashed; }

/* ---------- Avisos ---------- */
.aviso { padding: .8rem 1rem .8rem 1.1rem; border-radius: var(--hz-radius-sm); margin-bottom: 1rem; border: 1px solid transparent; border-left-width: 4px; font-size: .95rem; }
.aviso-ok { background: var(--hz-ok-bg); color: var(--hz-ok); border-left-color: var(--hz-ok); }
.aviso-erro, .aviso-alerta { background: var(--hz-danger-bg); color: var(--hz-danger); border-left-color: var(--hz-danger); }
.aviso-info { background: var(--hz-info-bg); color: var(--hz-info); border-left-color: var(--hz-slate); }

/* ---------- Listas do painel ---------- */
.itens { list-style: none; margin: 0 -.5rem; padding: 0; }
.itens li + li { border-top: 1px solid var(--hz-border); }
.itens a { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .75rem .5rem; text-decoration: none; color: var(--hz-text); border-radius: var(--hz-radius-sm); transition: background .12s; }
.itens a:hover { background: var(--hz-surface-2); color: var(--hz-text); }
.itens .principal { font-weight: 500; }
.itens .valor { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.itens .detalhe { grid-column: 1 / -1; font-size: .85rem; color: var(--hz-text-muted); }
.itens .atraso { color: var(--hz-danger); }
.contador { font: italic 500 .75rem/1.5 var(--hz-font-label); background: var(--hz-surface-2); border: 1px solid var(--hz-border-strong); border-radius: var(--hz-radius-pill); padding: 0 .55rem; color: var(--hz-text-muted); letter-spacing: 0; }
.c-alerta { background: var(--hz-danger); color: #fff; border-color: var(--hz-danger); }
.vazio { color: var(--hz-text-muted); margin: .25rem 0; font-size: .95rem; }

/* ---------- Detalhes e histórico ---------- */
.dados { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 0; }
.dados dt { font: italic 500 .8rem/1.6 var(--hz-font-label); color: var(--hz-text-muted); }
.dados dd { margin: 0; }
.quebra { white-space: pre-wrap; overflow-wrap: anywhere; }
.historico { list-style: none; margin: 0; padding: 0; }
.historico li { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--hz-border-strong); flex-wrap: wrap; }
.historico li:last-child { border-bottom: 0; }
.historico time { color: var(--hz-text-muted); font-variant-numeric: tabular-nums; min-width: 8.5rem; font-size: .9rem; }
.historico .nota { display: block; color: var(--hz-text-muted); font-size: .9rem; }

/* ---------- Proposta: escopo, investimento, prévia, versões ---------- */
.grupos { display: flex; flex-direction: column; gap: .9rem; }
.grupo { background: var(--hz-surface-2); }
.tabela-linhas, .tabela-previa { display: flex; flex-direction: column; gap: .5rem; }
.linha-inv { display: grid; grid-template-columns: minmax(180px, 3fr) 70px 90px 120px 150px 110px auto; gap: .5rem; align-items: center; }
.linha-inv.cab { font: italic 500 .76rem/1.3 var(--hz-font-label); color: var(--hz-text-muted); }
.linha-inv label, .linha-previa label { gap: 0; }
.linha-inv .subtotal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.linha-inv .acoes { flex-wrap: nowrap; gap: .25rem; }
.linha-opcional, .linha-opcional td { color: var(--hz-text-muted); }
.linha-inv.linha-opcional input { font-style: italic; }
.linha-previa { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .5rem; align-items: center; }
.so-celular { display: none; }
.soma-linhas { margin: .25rem 0; }
.soma-linhas .ok { color: var(--hz-ok); font-weight: 600; }
.soma-linhas .erro { color: var(--hz-danger); font-weight: 600; }
.barra-salvar {
  position: sticky; bottom: 0; z-index: 4; padding: .85rem 0; margin-top: .5rem;
  background: rgba(244, 242, 245, .94); backdrop-filter: blur(6px); border-top: 1px solid var(--hz-border);
}
.versoes { list-style: none; padding: 0; margin: .75rem 0; }
.versoes li { padding: .5rem 0; border-bottom: 1px dashed var(--hz-border-strong); }
.hash { margin-left: .5rem; font-family: var(--hz-font-mono); font-size: .82rem; }
.resumo-linhas { margin-top: 1rem; }
.resumo-linhas summary { cursor: pointer; color: var(--hz-slate); font-weight: 500; margin-bottom: .5rem; }
.resumo-linhas summary:hover { color: var(--hz-navy); }
.imagens { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.imagem-config { display: flex; flex-direction: column; gap: .6rem; background: var(--hz-surface-2); border: 1px solid var(--hz-border); border-radius: var(--hz-radius-sm); padding: 1rem; }
.previa-imagem { max-width: 240px; max-height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--hz-border); border-radius: var(--hz-radius-sm); padding: .5rem; }
.linha-modelo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--hz-border); }
.linha-modelo:last-child { border-bottom: 0; }
.itens.cartao { margin: 0 0 1.25rem; padding: .25rem 1.5rem; }
.itens a.botao { display: inline-flex; padding: .3rem .75rem; border-radius: var(--hz-radius-sm); }
.itens a.botao-primario, .itens a.botao-primario:hover { color: var(--hz-navy); }
.itens a.botao-primario:hover { background: var(--hz-orange-hover); }

/* ---------- Tela pública (login e erros sem sessão) ---------- */
body.publico {
  background-color: var(--hz-navy);
  background-image: radial-gradient(ellipse at 50% 35%, rgba(65, 83, 100, .35), transparent 65%), url(marca/ondas.svg);
  background-size: auto, 480px 160px; background-position: center, center;
}
body.publico .rodape { color: var(--hz-on-dark-muted); }
.login-marca { display: flex; justify-content: center; margin: 12vh 0 1.75rem; }
.login-marca img { width: 220px; max-width: 70vw; height: auto; display: block; }
.login {
  max-width: 400px; margin: 0 auto 2rem; padding: 2rem 2rem 1.75rem; border: 0; position: relative; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.login::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--hz-orange); }
.login h1 { font-size: 1.45rem; margin-bottom: 1.25rem; }
.login .botao-primario { width: 100%; min-height: 46px; margin-top: .25rem; font-size: 1rem; }
body.publico .conteudo > .cartao:not(.login) { max-width: 520px; margin: 14vh auto 2rem; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .topo { gap: .75rem 1rem; padding: 0 1rem; }
  .marca .produto { display: none; }
  .menu a { padding: 0 .6rem; }
  .menu a::after { left: .6rem; right: .6rem; }
}
@media (max-width: 720px) {
  /* Menu compacto: logo + Sair na 1ª linha; os 5 itens cabem inteiros na 2ª */
  .topo { position: relative; flex-wrap: wrap; padding: .65rem .75rem 0; gap: .4rem; min-height: 0; }
  .marca { padding-right: 4.5rem; }
  .marca img { height: 28px; }
  .marca .produto { display: inline; font-size: .72rem; padding-left: .6rem; }
  .menu {
    width: calc(100% + 1.5rem); margin: 0 -.75rem; padding: 0 .35rem; flex: none; min-height: 46px; justify-content: space-between;
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; border-top: 1px solid rgba(229, 225, 230, .1);
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { white-space: nowrap; padding: 0 .45rem; font-size: .9rem; }
  .menu a::after { left: .45rem; right: .45rem; }
  .sair { position: absolute; top: .55rem; right: .75rem; margin: 0; }
  .topo button.link { padding: .25rem .75rem; font-size: .85rem; white-space: nowrap; }

  .conteudo { padding: 1.25rem .75rem .5rem; }
  h1 { font-size: 1.5rem; margin-bottom: 1rem; }
  .cartao, .bloco { padding: 1.1rem 1rem; border-radius: 12px; }
  .cartoes { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .indicador { padding: .85rem .9rem .8rem 1rem; }
  .indicador strong { font-size: 1.3rem; }
  .indicador small { font-size: .78rem; }
  .cabecalho > .botao-primario { width: 100%; }

  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
  .tabela { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .tabela thead { display: none; }
  .tabela tr { background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: 12px; margin-bottom: .7rem; padding: .45rem .2rem; box-shadow: var(--hz-shadow); }
  .tabela tbody tr:hover { background: var(--hz-surface); }
  .tabela tr.linha-atraso, .tabela tbody tr.linha-atraso:hover { background: var(--hz-danger-row); box-shadow: inset 4px 0 0 var(--hz-danger), var(--hz-shadow); }
  .linha-atraso td:first-child { box-shadow: none; }
  .tabela td { border: 0; padding: .3rem .8rem; display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem; text-align: left !important; }
  .tabela td::before { content: attr(data-rotulo); font: italic 500 .76rem/1.6 var(--hz-font-label); color: var(--hz-text-muted); }
  .tabela td > .selo { justify-self: start; }
  .tabela td:not(.acoes-celula) > small { grid-column: 2; }
  .tabela td.acoes-celula { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; padding-top: .5rem; padding-bottom: .4rem; }
  .tabela td.acoes-celula::before { display: none; }
  .acoes-celula details.acao { margin: 0; }
  .filtros > * { flex: 1 1 100%; }
  .filtros .botao { flex: 1 1 auto; }
  .dados { grid-template-columns: 1fr; gap: .1rem; }
  .dados dd { margin-bottom: .6rem; }

  .linha-inv, .linha-previa { grid-template-columns: 1fr 1fr; background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: var(--hz-radius-sm); padding: .75rem; }
  .linha-inv.cab { display: none; }
  .linha-inv label:first-child, .linha-previa label:first-child { grid-column: 1 / -1; }
  .so-celular { display: block; font-size: .76rem; }
  .linha-inv .subtotal { text-align: left; }
  .barra-salvar .botao { flex: 1; }

  .login-marca { margin: 8vh 0 1.25rem; }
  .login { padding: 1.6rem 1.25rem 1.4rem; }
}
@media (max-width: 380px) {
  .cartoes { grid-template-columns: 1fr; }
  .tabela td { grid-template-columns: 6.5rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  a.indicador:hover { transform: none; }
}
@media print {
  .topo, .rodape, .barra-salvar { display: none; }
  body { background: #fff; }
  .cartao, .bloco, .indicador { box-shadow: none; }
}
