/* TGAD — ajustes globais de mobile (complementa o Tailwind das telas).
   Conservador de propósito: corrige problemas transversais sem quebrar o design. */

:root { --af-safe-bottom: env(safe-area-inset-bottom, 0px); }

* { -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  overflow-x: hidden;            /* mata o scroll horizontal das telas do Stitch */
  overscroll-behavior-y: contain;
}

/* nunca deixa mídia/figura estourar a largura da tela */
img, video, svg, canvas, table { max-width: 100%; }
img { height: auto; }

/* alvos de toque mínimos em navegação e botões de ícone */
nav a, nav button, [role="tab"], .material-symbols-outlined { touch-action: manipulation; }

/* barra de navegação inferior fixa: respeita a área segura do aparelho */
.bottom-0.fixed, [class*="fixed"][class*="bottom-0"] {
  padding-bottom: var(--af-safe-bottom);
}

/* garante respiro no fim das páginas que têm bottom-nav fixa (evita conteúdo escondido) */
body[data-tgad-route] main { scroll-margin-bottom: 96px; }

/* inputs não dão zoom no iOS (fonte >= 16px) */
input, select, textarea { font-size: 16px; }

/* filtro de período (Auditoria, Recebimentos): no celular o "até" não fica pendurado no fim da linha */
@media (max-width: 600px) {
  #periodo { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  #periodo > span:first-child, #periodo > #plimpar { grid-column: 1 / -1; }
  #periodo > #plimpar { justify-self: start; }
  #periodo > input[type=date] { width: 100%; min-width: 0; min-height: 40px; }
}

/* toast host nunca bloqueia cliques */
#af-toast-host { pointer-events: none; }

/* skeleton/transição suave para imagens carregando */
img[loading="lazy"] { background: var(--surface-2); }
