:root {
  --ink: #1c2418;
  --muted: #5e6a58;
  --paper: #f3f0e6;
  --card: #fffdf8;
  --line: #e3dccb;
  --green: #1d6b32;
  --green-dark: #124622;
  --yellow: #ffe45c;
  --sombra: 0 10px 30px rgba(28, 36, 24, 0.06);
  --entrega: #f4b4a8;
  --deposito: #f6c56b;
  --terceiros: #f8c9a0;
  --compras: #b7e0a8;
  --socorro: #4a4a4a;
  --manutencao: #d5d5d5;
  --comercial: #d4c4f0;
  --rota: #f7d38a;
  --agape: #e7c2a0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { touch-action: manipulation; }
button, input, select { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }

.topo {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.marca {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.marca-logo {
  width: 86px;
  height: 28px;
  flex: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 45%, rgba(255,255,255,0.75) 50%, rgba(255,255,255,0.45) 55%, transparent 100%) 0 0 / 50% 100%,
    linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  background-repeat: no-repeat;
  -webkit-mask: url("/static/logo_soller_marca.svg") center / contain no-repeat;
  mask: url("/static/logo_soller_marca.svg") center / contain no-repeat;
  animation: logoSlideIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             logoShimmer 2.5s ease-in-out 0.8s infinite;
}
@keyframes logoSlideIn {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes logoShimmer {
  0%, 100% { background-position: -100% 0, 0 0; }
  50% { background-position: 200% 0, 0 0; }
}
.marca h1 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  line-height: 1;
}
.modos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 16px 0;
  padding: 4px;
  background: #e7e1d2;
  border-radius: 14px;
}
.modos button {
  border: 0;
  background: transparent;
  border-radius: 11px;
  min-height: 42px;
  font-weight: 700;
}
.modos,
.modos[hidden] { display: none !important; }
body[data-papel="admin"] .modos,
body[data-papel="admin"] .modos:not([hidden]) { display: none !important; }

.atalhos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.atalho {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 10px;
  text-align: center;
}
.atalho:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: default;
}
.atalho:disabled .atalho-icone { box-shadow: none; }
.atalho-icone {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #3c9a5c 0%, #1a6b36 100%);
  box-shadow: 0 10px 18px rgba(29, 107, 50, 0.16);
  color: white;
}
.atalho-retorno .atalho-icone { background: var(--ink); }
.voltar {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--green-dark);
  font-weight: 700;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
}
.voltar[hidden], .quem[hidden] { display: none; }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.topo-menu { position: relative; display: flex; align-items: center; gap: 8px; }
.topo-menu[hidden] { display: none; }
.icone-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.icone-btn.is-on { border-color: var(--green); color: var(--green-dark); }
.folha {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(280px, calc(100vw - 24px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
}
.folha[hidden] { display: none; }
.folha-topo {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.folha-topo strong { font-size: 14px; }
.folha-menu {
  width: max-content;
  min-width: 248px;
  max-width: calc(100vw - 32px);
  padding: 8px;
}
.folha-menu [data-ir],
.folha-menu [data-sair] {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 12px;
  border-radius: 10px;
  font-weight: 700;
}
.folha-menu [data-ir].is-on { background: #e7f0e4; color: var(--green-dark); }
.folha-menu [data-ir][hidden] { display: none; }
.folha-quem {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 14px;
  margin: 0 0 6px;
  border-bottom: 1px solid var(--line);
}
.folha-quem-txt, .folha-quem-meta {
  display: grid;
  gap: 4px;
  align-content: center;
}
.folha-quem-txt { min-width: 0; }
.folha-quem-txt strong, .folha-clima {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}
.folha-quem-txt strong {
  overflow: hidden;
  text-overflow: ellipsis;
}
.folha-quem-txt small, .folha-lugar {
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
}
.folha-quem-meta {
  margin-left: auto;
  justify-items: end;
  flex: none;
}
.folha-clima {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}
.folha-lugar {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folha-vazio {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 16px 12px 18px;
  text-align: center;
  color: var(--muted);
}
.folha-vazio strong { font-size: 13px; color: var(--ink); }
.folha-vazio span { font-size: 12px; }
.folha-menu [data-sair] { color: #8d1d1d; }
body[data-tela="retorno"] #retorno { max-width: 420px; }
body[data-tela="entrar"],
body[data-tela="esqueci"],
body[data-tela="senha"],
body[data-tela="abrindo"] {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body[data-tela="entrar"] .topo,
body[data-tela="esqueci"] .topo,
body[data-tela="senha"] .topo,
body[data-tela="abrindo"] .topo { display: none; }
.entrar-marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.entrar-marca .marca-logo {
  width: 156px;
  height: 50px;
}
.entrar-marca h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  line-height: 1;
}
body[data-tela="entrar"] main,
body[data-tela="esqueci"] main,
body[data-tela="senha"] main,
body[data-tela="abrindo"] main {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 12px 16px;
  overflow: hidden;
}
body[data-tela="entrar"] #entrar,
body[data-tela="esqueci"] #esqueci,
body[data-tela="senha"] #senha,
body[data-tela="abrindo"] #abrindo {
  width: min(100%, 380px);
}
#form-entrar,
#form-esqueci,
#form-senha {
  width: 100%;
  padding: 22px 18px 18px;
  gap: 12px;
}
#form-entrar .campo,
#form-esqueci .campo,
#form-senha .campo { gap: 6px; }
#form-entrar input,
#form-esqueci input,
#form-senha input {
  font-size: 16px;
  height: 46px;
  min-height: 46px;
  background: #fff;
}
.senha-caixa { position: relative; display: block; }
.senha-caixa input { width: 100%; padding-right: 44px; }
.senha-olho {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.senha-olho .olho-oculto { display: none; }
.senha-olho.is-on { color: var(--ink); }
.senha-olho.is-on .olho-ver { display: none; }
.senha-olho.is-on .olho-oculto { display: block; }
#form-entrar input:-webkit-autofill,
#form-senha input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 40px #fff inset;
}
.codigo-caixa { position: relative; display: block; height: 58px; }
.codigo-caixas { display: flex; justify-content: center; gap: 8px; }
.codigo-caixas i {
  width: 44px;
  height: 58px;
  border: 1px solid #e4dcc8;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}
.codigo-caixas i.is-agora { border-color: #1c6a34; }
.codigo-caixa input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  caret-color: transparent;
  border: 0;
  background: transparent;
}
#form-esqueci [data-esqueci-numero],
#form-esqueci [data-esqueci-codigo] {
  display: grid;
  gap: 12px;
}
#form-esqueci [data-esqueci-numero][hidden],
#form-esqueci [data-esqueci-codigo][hidden] { display: none; }
#form-entrar .esqueci,
#form-esqueci .esqueci {
  justify-self: end;
  width: auto;
  margin: -2px 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
}
#form-entrar .registrar,
#form-esqueci .registrar,
#form-senha .registrar,
#form-senha .senha-outra,
#form-esqueci .senha-outra {
  width: 100%;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#form-senha [data-senha-escolha],
#form-senha [data-senha-troca] {
  display: grid;
  gap: 10px;
}
#form-senha [data-senha-escolha][hidden],
#form-senha [data-senha-troca][hidden] { display: none; }
.senha-chamada {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 8px;
}
.senha-usuario {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.senha-chamada strong {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.senha-chamada span {
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}
#form-senha [data-senha-escolha] .registrar,
#form-senha [data-senha-troca] .registrar { margin-top: 16px; }
#form-senha .senha-outra,
#form-senha .senha-sair {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid #e4dcc8;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
}
#form-senha .senha-sair {
  width: 100%;
  border: 0;
  min-height: 36px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.entrar-giro {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: entrar-gira 0.7s linear infinite;
}
#form-entrar.is-carregando .entrar-giro,
#form-senha.is-carregando .entrar-giro { display: block; }
#form-entrar.is-carregando .registrar:disabled,
#form-senha.is-carregando .registrar:disabled {
  background: linear-gradient(180deg, #2f8b4e 0%, #1c6a34 100%);
  color: #fff;
  cursor: wait;
}
.abrindo-ficha {
  width: 100%;
  justify-items: center;
  padding: 28px 18px 26px;
  gap: 16px;
}
.abrindo-giro {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(28, 106, 52, 0.18);
  border-top-color: #1c6a34;
  border-radius: 50%;
  animation: entrar-gira 0.7s linear infinite;
}
.abrindo-estado {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .abrindo-giro { animation: none; border-color: #1c6a34; }
}
@keyframes entrar-gira { to { transform: rotate(360deg); } }

main { padding: 14px 16px 32px; }
.painel { display: grid; gap: 14px; }
.painel[hidden] { display: none !important; }

.ficha, .recentes, .kpis, .barras, .grade, .cards article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sombra);
}
.ficha { padding: 16px; display: grid; gap: 10px; }
#abrindo .ficha {
  justify-items: center;
  padding: 28px 18px 26px;
  gap: 16px;
}
.ficha[hidden], .abertas[hidden] { display: none; }
.mes-topo {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.mes-topo select { flex: 1; min-width: 0; height: 46px; min-height: 46px; box-sizing: border-box; }
.par {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
h2 { font-size: 18px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
legend, .campo span, .data-campo span, .combo > span, .combo-rotulo > span, .kms span, .mes-topo span {
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.campo { display: grid; gap: 6px; align-content: start; }
.data-face {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 10px;
  overflow: hidden;
}
.data-face b {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.data-face input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  border: 0;
  min-height: 0;
  padding: 0;
}
.par > * { min-width: 0; }
.par-igual { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.combo-placa .combo-botao em,
.combo-placa .combo-lista button {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.04em;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}
textarea[name="destino"] {
  display: block;
  padding: 12px;
  line-height: 1.35;
  resize: none;
  overflow: hidden;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
[data-campo-nf][hidden] { display: none; }

.combo {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.combo.is-aberto { z-index: 30; }
.combo-rotulo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 16px;
}
.combo-aviso {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: #8d1d1d;
  white-space: nowrap;
}
.placa-carro {
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  line-height: 16px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ece7db;
  color: #5c564c;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.placa-carro[hidden] { display: none; }
.placa-uso {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  color: #8d1d1d;
}
.placa-uso[hidden] { display: none; }
.combo-aviso.is-treme { animation: tremer 0.42s ease; }
@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-3px); }
  30% { transform: translateX(3px); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}
.combo-aviso[hidden] { display: none; }
.ficha, .par, .par > * { min-width: 0; max-width: 100%; }
.combo-botao {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  text-align: left;
}
.combo-botao i, .combo-lista i {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  flex: none;
  background: var(--entrega);
}
.combo-botao i[data-tom="deposito"], .combo-lista i[data-tom="deposito"] { background: var(--deposito); }
.combo-botao i[data-tom="terceiros"], .combo-lista i[data-tom="terceiros"] { background: var(--terceiros); }
.combo-botao i[data-tom="compras"], .combo-lista i[data-tom="compras"] { background: var(--compras); }
.combo-botao i[data-tom="socorro"], .combo-lista i[data-tom="socorro"] { background: var(--socorro); }
.combo-botao i[data-tom="manutencao"], .combo-lista i[data-tom="manutencao"] { background: var(--manutencao); }
.combo-botao i[data-tom="comercial"], .combo-lista i[data-tom="comercial"] { background: var(--comercial); }
.combo-botao i[data-tom="rota"], .combo-lista i[data-tom="rota"] { background: var(--rota); }
.combo-botao i[data-tom="agape"], .combo-lista i[data-tom="agape"] { background: var(--agape); }
.combo-botao em {
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.combo[data-combo="motorista"] .combo-botao:disabled {
  background: #f6f3ea;
  color: var(--ink);
  opacity: 1;
  cursor: default;
}
.combo[data-combo="motorista"] .combo-botao:disabled em {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}
.combo[data-combo="motorista"] .combo-botao:disabled::after {
  border-right-color: #d5cfc2;
  border-bottom-color: #d5cfc2;
}
.combo-varios .combo-botao {
  height: auto;
  align-items: center;
  padding: 10px 12px;
}
.combo-varios .combo-botao em {
  white-space: normal;
  overflow: visible;
  line-height: 1.35;
  font-size: 16px;
}
.combo-botao::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex: none;
}
.combo-varios .combo-lista button.is-on::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--green-dark);
  border-bottom: 2px solid var(--green-dark);
  transform: rotate(45deg) translateY(-1px);
  flex: none;
}
.combo-lista {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(28, 36, 24, 0.12);
}
.combo-lista[hidden] { display: none; }
.combo-lista button {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-weight: 700;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.combo-lista button:hover,
.combo-lista button:focus,
.combo-lista button:active {
  background: transparent;
  outline: none;
}
.combo-lista button.is-on,
.combo-lista button.is-on:hover,
.combo-lista button.is-on:focus,
.combo-lista button.is-on:active {
  background: #f4f0e4;
}

.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcoes button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 650;
}
.opcoes button.is-on { border-color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green-dark); }
.opcoes button[data-tom="entrega"] { background: var(--entrega); }
.opcoes button[data-tom="deposito"] { background: var(--deposito); }
.opcoes button[data-tom="terceiros"] { background: var(--terceiros); }
.opcoes button[data-tom="compras"] { background: var(--compras); }
.opcoes button[data-tom="socorro"] { background: var(--socorro); color: #fff; }
.opcoes button[data-tom="manutencao"] { background: var(--manutencao); }
.opcoes button[data-tom="comercial"] { background: var(--comercial); }
.opcoes button[data-tom="rota"] { background: var(--rota); }
.opcoes button[data-tom="agape"] { background: var(--agape); }
.opcoes-placa button {
  border-radius: 8px;
  border-width: 2px;
  border-color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.06em;
  background: #f7f7f2;
}
.opcoes-placa button.is-on { background: var(--yellow); }

.kms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kms label { display: grid; gap: 6px; }
.kms input { font-size: 20px; font-variant-numeric: tabular-nums; }
.km-off span { color: #b7b1a4; }
.km-off input,
.travada input:disabled,
.travada textarea:disabled,
.travada .combo-botao:disabled {
  background: #f6f3ea;
  color: #b7b1a4;
  border-color: #efe8d8;
  opacity: 1;
  -webkit-text-fill-color: #b7b1a4;
}
.travada .combo-rotulo > span,
.travada .combo > span,
.travada .campo span,
.travada .km-off span,
.travada .combo-botao:disabled em,
.travada .foto:disabled {
  color: #b7b1a4;
}
.travada .combo-botao:disabled i { opacity: 0.45; }
.travada .combo-botao:disabled::after {
  border-right-color: #d5cfc2;
  border-bottom-color: #d5cfc2;
}
.travada .foto:disabled {
  background: #f6f3ea;
  border-color: #efe8d8;
}
.abertas .combo-botao em,
.abertas .combo-lista button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.travada .abertas > span { color: var(--muted); }
.travada .abertas .combo-botao {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  -webkit-text-fill-color: var(--ink);
}
.travada .abertas .combo-botao em {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}
.travada .abertas .combo-botao::after {
  border-right-color: var(--muted);
  border-bottom-color: var(--muted);
}
.modal-card.modal-aviso {
  width: min(100%, 300px);
  padding: 18px 16px 16px;
}
.modal-card.modal-aviso header {
  position: relative;
  top: auto;
  margin: 0 0 6px;
  padding: 0 40px 0 0;
  background: none;
  color: var(--ink);
}
.modal-card.modal-aviso h2 {
  color: var(--ink);
  font-size: 17px;
}
.modal-card.modal-aviso .modal-x {
  right: 0;
  background: #f3f0e6;
  color: var(--ink);
}
.modal-aviso p {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
}
.modal-card.modal-confirma { width: min(100%, 340px); }
.modal-card.modal-confirma header {
  display: block;
  margin-bottom: 14px;
  padding: 0 40px 18px 0;
}
.modal-card.modal-confirma .modal-x {
  top: 0;
  transform: none;
}
.modal-confirma header p {
  margin: 2px 0 0;
}
.confirma-corpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0 0 12px;
  align-items: stretch;
}
.confirma-lista {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
  align-content: start;
}
.confirma-lista .confirma-largo { grid-column: 1 / -1; }
.confirma-lista div { display: grid; gap: 1px; min-width: 0; }
.confirma-lista dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.confirma-lista dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.confirma-km { display: grid; }
.confirma-km b { font-weight: 700; font-variant-numeric: tabular-nums; }
.confirma-km small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
}
.confirma-foto-caixa {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: #f6f3ea;
  overflow: hidden;
}
.confirma-foto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.confirma-acoes {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}
.confirma-voltar {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.modal-confirma .registrar { min-height: 46px; border-radius: 999px; }
.conta strong { color: var(--ink); font-size: 18px; }
.erro {
  color: #8d1d1d;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foto {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #c9dfcc;
  background: #f3f8f4;
  color: var(--green-dark);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 8px;
}
.foto.is-ok { background: #e5f3e8; border-color: var(--green); }
.foto:disabled,
.foto:disabled.is-ok {
  background: #f6f3ea;
  color: #b7b1a4;
  border-color: #efe8d8;
  opacity: 1;
}
.registrar {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #2f8b4e 0%, #1c6a34 100%);
  box-shadow: 0 8px 16px rgba(29, 107, 50, 0.16);
  color: white;
  font-weight: 700;
  font-size: 16px;
}
.registrar:disabled {
  background: #c5d4c8;
  color: rgba(255, 255, 255, 0.85);
}

.recentes { padding: 14px; display: grid; gap: 8px; }
.viagem {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}
.modal-fundo {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(22, 32, 20, 0.42);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: min(100%, 380px);
  background: #fffcf7;
  border: 1px solid rgba(227, 220, 203, 0.9);
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(28, 36, 24, 0.18);
  padding: 0 16px 18px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.modal-card header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 -16px 14px;
  padding: 16px 52px 12px 18px;
  background: #fffcf7;
  color: var(--ink);
  border-bottom: 1px solid rgba(227, 220, 203, 0.95);
}
.modal-x {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f3f0e6;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.modal-card h2,
.modal-data {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.modal-card h2 small,
.modal-data small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.modal-fotos figure { margin: 0; display: grid; gap: 6px; }
.modal-fotos figcaption {
  text-align: center;
}
.modal-fotos figcaption,
.modal-card dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-fotos img,
.modal-fotos span {
  width: 100%;
  height: 120px;
  border-radius: 14px;
}
.modal-fotos[hidden] { display: none; }
.modal-fotos img { cursor: zoom-in; object-fit: cover; background: #f6f3ea; }
.foto-ampliada {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}
.foto-ampliada[hidden] { display: none; }
.foto-ampliada .modal-fundo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.foto-ampliada img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 920px);
  max-height: calc(100dvh - 40px);
  margin: 0;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(28, 36, 24, 0.28);
}
.modal-fotos span {
  display: grid;
  place-items: center;
  background: #f6f3ea;
  color: var(--muted);
  border: 1px dashed #e3dccb;
  font-size: 13px;
  font-weight: 700;
}
.modal-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin: 0;
}
.modal-grade div { display: grid; gap: 2px; min-width: 0; }
.modal-grade .largo { grid-column: 1 / -1; }
.modal-card dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.modal-card dd small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}
.km-andamento {
  color: #8a9184;
  animation: km-pulsa 1.6s ease-in-out infinite;
}
@keyframes km-pulsa {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .km-andamento { animation: none; opacity: 0.65; }
}
.selo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.selo-ok { background: #e5f3e8; color: var(--green); }
.selo-falta { background: #fff1d6; color: #9a6400; }
.viagem > div { min-width: 0; }
.viagem strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viagem-km { display: grid; justify-items: end; gap: 1px; }
.viagem-km small { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.viagem-vivo {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #9a6400;
}
.em-rota {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: 999px;
  background: #e7f6ea;
  color: #1c6a34;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.em-rota i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f8a3d;
  box-shadow: 0 0 0 0 rgba(31, 138, 61, 0.5);
  animation: em-rota-pulsa 1.4s ease-out infinite;
}
@keyframes em-rota-pulsa {
  0% { box-shadow: 0 0 0 0 rgba(31, 138, 61, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(31, 138, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 138, 61, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .em-rota i { animation: none; }
}
.frota-carga {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 16px 28px;
  background: var(--paper);
  animation: frota-carga-in 0.2s ease;
}
.frota-carga[hidden] { display: none !important; }
.frota-carga-painel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  width: min(100%, 1100px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d7e6d4;
  background: #f3faf4;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
}
.frota-carga-painel p { margin: 0; }
.frota-carga-giro {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(29, 107, 50, 0.2);
  border-top-color: var(--green);
  animation: entrar-gira 0.75s linear infinite;
  flex-shrink: 0;
}
.frota-carga-ossos {
  display: grid;
  gap: 12px;
  width: min(100%, 1100px);
  margin: 0 auto;
}
.frota-osso {
  border-radius: 14px;
  background: linear-gradient(90deg, #e6e0d0 0%, #f8f5ec 46%, #e6e0d0 100%);
  background-size: 220% 100%;
  animation: frota-shimmer 1.15s ease-in-out infinite;
}
.frota-osso-topo { height: 46px; }
.frota-osso-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.frota-osso-kpis .frota-osso { height: 64px; }
.frota-osso-card { height: 92px; }
@keyframes frota-carga-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}
@keyframes frota-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@media (min-width: 980px) {
  .frota-osso-kpis { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .frota-carga-giro,
  .frota-osso,
  .frota-carga { animation: none; }
}
.viagem-km .em-rota { color: #1c6a34; font-size: 11px; }
.viagem-km .viagem-vivo { color: #9a6400; font-size: 12px; font-weight: 600; }

.mes-atualizar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  height: 46px;
  min-height: 46px;
  padding: 0 16px;
  background: linear-gradient(180deg, #2f8b4e, #1c6a34);
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.mes-atualizar .entrar-giro { display: none; }
.mes-atualizar.is-carregando .entrar-giro { display: block; }
.mes-atualizar,
.mes-atualizar span {
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1;
}
.mes-acoes { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mes-exportar {
  height: 46px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .mes-topo select,
  .mes-exportar,
  .mes-atualizar { height: 42px; min-height: 42px; }
  .mes-exportar, .mes-atualizar { padding: 0 10px; font-size: 13px; }
}
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.kpis article { display: grid; gap: 2px; min-width: 0; }
.kpis span { color: var(--muted); font-size: 11px; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.03em; }
.kpis strong { font-size: 22px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpis strong small {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.kpis strong.kpi-longo { font-size: 16px; letter-spacing: -0.03em; }
.barras { padding: 12px 14px; display: grid; gap: 8px; }
.barras-modo { display: flex; gap: 6px; }
.barras-modo button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 13px;
}
.barras-modo button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.barra { display: grid; grid-template-columns: 108px 1fr 78px; gap: 8px; align-items: center; font-size: 13px; }
.barra span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #efe8d4;
  overflow: hidden;
}
.barra i b { display: block; height: 100%; background: var(--green); }
.barra em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.filtros-linha {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.filtros-linha label { display: grid; gap: 4px; min-width: 0; }
.filtros-linha span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.filtros-linha select { width: 100%; min-width: 0; }

.tabela-wrap { display: none; }
.grade { width: 100%; border-collapse: collapse; overflow: hidden; }
.grade th {
  background: var(--yellow);
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px;
}
.grade td {
  padding: 10px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}
.grade tr:hover td { background: #fff8dc; }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.tag-entrega { background: var(--entrega); }
.tag-deposito { background: var(--deposito); }
.tag-terceiros { background: var(--terceiros); }
.tag-compras { background: var(--compras); }
.tag-socorro { background: var(--socorro); color: #fff; }
.tag-manutencao { background: var(--manutencao); }
.tag-comercial { background: var(--comercial); }
.tag-rota { background: var(--rota); }
.tag-agape { background: var(--agape); }
.km { font-weight: 800; }
.tempo { font-weight: 500; color: var(--muted); white-space: nowrap; }

.cards { display: grid; gap: 8px; }
.cards article { padding: 12px 14px; display: grid; gap: 4px; cursor: pointer; }
.grade tbody tr[data-viagem] { cursor: pointer; }
.cards header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card-quem { display: grid; gap: 1px; min-width: 0; }
.card-quem strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-quem small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-rodape {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 8px;
  margin-top: 2px;
}
.card-tags { display: grid; gap: 4px; min-width: 0; }
.cards .card-rodape .tag,
.card-fonte {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  line-height: 1.2;
}
.card-fonte {
  background: #ece7db;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  gap: 0.35em;
  white-space: nowrap;
}
.card-fonte em { font-style: normal; }
.card-fonte em.is-sistema { color: var(--green); }
.card-km { display: grid; justify-items: end; gap: 1px; }
.card-km b { font-variant-numeric: tabular-nums; }
.card-km small { font-size: 12px; font-weight: 600; color: var(--muted); }
.cards p { color: var(--muted); font-size: 14px; }
.cards .extrato-data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e9e3d4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cards .extrato-data:first-child { margin-top: 0; }
.cards .extrato-data span,
.cards .extrato-data b {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cards .extrato-data small {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

@media (min-width: 980px) {
  .topo { padding: 22px 28px 14px; }
  body[data-tela="inicio"] .modos,
  body[data-tela="retorno"] .modos { display: none; }
  body[data-tela="registrar"] .modos,
  body[data-tela="mes"] .modos { display: none; }
  body[data-tela="inicio"] main,
  body[data-tela="retorno"] main {
    display: block;
    max-width: 720px;
    margin-inline: auto;
  }
  body[data-tela="entrar"] main,
  body[data-tela="esqueci"] main,
  body[data-tela="senha"] main {
    display: grid;
    max-width: none;
  }
  body[data-tela="inicio"] .atalhos { min-height: 280px; }
  body[data-tela="inicio"] .atalho { min-height: 240px; }
  body[data-tela="registrar"] main {
    display: block;
    max-width: 640px;
    margin-inline: auto;
  }
  body[data-tela="mes"] main {
    display: block;
    max-width: 1100px;
    margin-inline: auto;
    padding: 18px 28px 40px;
  }
  .tabela-wrap { display: block; }
  .cards { display: none; }
  .kpis { grid-template-columns: repeat(6, 1fr); }
  .kpis span { font-size: 12px; letter-spacing: 0.04em; }
  .kpis strong { font-size: 26px; }
  .kpis strong small { font-size: 13px; }
  .kpis strong.kpi-longo { font-size: 20px; }
}

.festa {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(28, 36, 24, 0.46);
}
.festa[hidden] { display: none; }
.festa canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.festa-card {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-radius: 24px;
  padding: 22px 28px 18px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(28, 36, 24, 0.16);
  animation: festaSobe 0.45s cubic-bezier(0.2, 1.35, 0.4, 1);
}
.festa-mao {
  display: block;
  font-size: 64px;
  line-height: 1;
  animation: festaPulo 0.55s ease;
}
.festa-card strong {
  display: block;
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 20px;
}
.festa-card p { margin: 4px 0 0; color: var(--muted); }
.festa.is-fim { animation: festaSome 0.35s ease forwards; }
@keyframes festaSobe {
  from { transform: translateY(18px) scale(0.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes festaPulo {
  0% { transform: scale(0.4) rotate(-12deg); }
  60% { transform: scale(1.15) rotate(6deg); }
  100% { transform: none; }
}
@keyframes festaSome {
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .festa-card, .festa-mao, .festa.is-fim { animation: none; }
}
