/* ==========================================================================
   Torino — base visual compartilhada (portal do funcionário + área do gestor)
   Fundo branco com as cores da marca: dourado da coroa, preto das letras e
   o verde, branco e vermelho da faixa italiana.
   ========================================================================== */
/* Fontes servidas pelo próprio sistema, em pesos estáticos (um arquivo por peso).
   A fonte variável do Google Fonts saía fina em alguns WebKit (o peso 800 não era
   aplicado ao desenho das letras); assim o negrito sai certo em qualquer aparelho,
   funciona sem internet no app instalado e não depende de servidor externo. */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fontes/plus-jakarta-sans-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fontes/plus-jakarta-sans-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fontes/plus-jakarta-sans-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fontes/plus-jakarta-sans-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800 900; font-display: swap; src: url(/fontes/plus-jakarta-sans-800.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fontes/jetbrains-mono-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600 900; font-display: swap; src: url(/fontes/jetbrains-mono-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --superficie: rgba(255, 255, 255, 0.88);
  --superficie-forte: #ffffff;
  --superficie-2: #faf8f3;
  --superficie-3: #f1eee6;
  --borda: rgba(52, 40, 12, 0.10);
  --borda-forte: rgba(52, 40, 12, 0.19);
  --linha-grade: rgba(52, 40, 12, 0.05);
  --texto: #161412;
  --texto-2: #47423a;
  --texto-3: #7a7366;

  /* Marca */
  --ouro: #c9a13b;
  --ouro-claro: #f0d991;
  --ouro-escuro: #8c6a1c;
  --preto: #161412;
  --verde: #0b6b35;
  --vermelho: #c0161a;
  --tinta-ouro: #2a1f06; /* texto e ícones sobre fundo dourado */
  /* Nomes antigos apontando para a marca (o resto do CSS usa estes). */
  --roxo: var(--ouro-escuro);
  --indigo: var(--ouro);
  --ciano: var(--verde);
  --rosa: var(--vermelho);
  --grad: linear-gradient(120deg, #9a7522 0%, #c9a13b 28%, #f0d991 50%, #c9a13b 72%, #9a7522 100%);
  --grad-quente: linear-gradient(120deg, #c9a13b 0%, #8c6a1c 100%);
  --grad-italia: linear-gradient(90deg, #0b6b35 0 33.34%, #f7f7f3 33.34% 66.67%, #c0161a 66.67% 100%);
  --grad-texto: linear-gradient(100deg, #5c4410 0%, #a8822a 38%, #8c6a1c 62%, #4d390c 100%);
  --aurora-1: #e8c766;
  --aurora-2: #0b6b35;
  --aurora-3: #c0161a;
  --aurora-opac: 0.09;

  /* Situações (paleta de status fixa) */
  --ok: #0ca30c;
  --alerta: #e8a20c;
  --serio: #e0703f;
  --critico: #d03b3b;
  --info: #2a78d6;
  --neutro: #898781;
  --pos-texto: #047857;
  --neg-texto: #be123c;

  /* Gráficos */
  --serie: #b08a2e;
  --div-pos: #0e7a3d;
  --div-neg: #c0161a;
  --graf-grade: #ece8de;
  --graf-eixo: #d6cfbf;

  --sombra: 0 22px 50px -26px rgba(52, 40, 12, 0.30);
  --sombra-cor: 0 12px 28px -12px rgba(176, 138, 46, 0.65);
  --anel-foco: 0 0 0 3px rgba(201, 161, 59, 0.38);
  --raio: 22px;
  --raio-md: 16px;
  --raio-sm: 12px;
  --fonte: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(201, 161, 59, 0.16); /* toque dourado discreto em vez do cinza do iOS */
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* no iPhone o 100vh passa da área visível quando a barra do Safari aparece */
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Sem zoom de toque duplo em botões e links (ex.: tocar duas vezes em "Bater ponto") */
a, button, label, summary, select, [role='button'], [role='tab'] { touch-action: manipulation; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: rgba(201, 161, 59, 0.35); }

/* Fundo aurora ----------------------------------------------------------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  opacity: var(--aurora-opac);
  animation: flutuar 28s ease-in-out infinite alternate;
  will-change: transform;
}
.aurora span:nth-child(1) { background: radial-gradient(circle, var(--aurora-1) 0%, transparent 62%); top: -32vmax; left: -22vmax; }
.aurora span:nth-child(2) { background: radial-gradient(circle, var(--aurora-2) 0%, transparent 62%); bottom: -38vmax; right: -24vmax; animation-duration: 34s; animation-delay: -9s; }
.aurora span:nth-child(3) { background: radial-gradient(circle, var(--aurora-3) 0%, transparent 62%); top: 18%; left: 38%; width: 46vmax; height: 46vmax; opacity: calc(var(--aurora-opac) * 0.55); animation-duration: 40s; animation-delay: -18s; }
@keyframes flutuar {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(7vmax, 5vmax, 0) scale(1.12); }
  100% { transform: translate3d(-5vmax, 8vmax, 0) scale(0.94); }
}
.grade-fundo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--linha-grade) 1px, transparent 1px), linear-gradient(90deg, var(--linha-grade) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 15%, transparent 72%);
}

/* Superfícies ------------------------------------------------------------ */
.vidro {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
.texto-grad {
  background: var(--grad-texto);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Marca ------------------------------------------------------------------ */
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.marca-logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: var(--sombra-cor);
  color: var(--tinta-ouro);
}
.marca-logo svg { width: 20px; height: 20px; }
.marca-img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.lateral-topo .marca-img { width: 164px; }

/* Faixa italiana fina no topo de todas as telas */
body::before {
  content: ''; position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 200; pointer-events: none;
  background: var(--grad-italia);
  box-shadow: 0 1px 0 rgba(201, 161, 59, 0.75);
}

/* Botões ----------------------------------------------------------------- */
.btn {
  --altura: 42px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--altura);
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: var(--superficie-3);
  color: var(--texto);
  font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent; /* o próprio botão já reage ao toque (:active) */
  -webkit-user-select: none; user-select: none;
}
/* Efeitos de passar o mouse só onde há mouse: no iPhone o :hover fica "preso" depois do toque */
@media (hover: hover) {
  .btn:hover { background: var(--superficie-2); border-color: var(--borda-forte); transform: translateY(-1px); }
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--anel-foco); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primario {
  background: var(--grad); background-size: 160% 100%;
  border-color: transparent; color: var(--tinta-ouro); font-weight: 700;
  box-shadow: var(--sombra-cor);
}
.btn-primario::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .7s ease;
}
.btn-fantasma { background: transparent; border-color: transparent; }
.btn-perigo { background: rgba(208, 59, 59, 0.16); border-color: rgba(208, 59, 59, 0.4); background: color-mix(in srgb, var(--critico) 16%, transparent); border-color: color-mix(in srgb, var(--critico) 40%, transparent); }
@media (hover: hover) {
  .btn-primario:hover { background: var(--grad); background-size: 160% 100%; background-position: 100% 0; border-color: transparent; box-shadow: 0 16px 40px -10px rgba(176, 138, 46, 0.75); }
  .btn-primario:hover::after { transform: translateX(120%); }
  .btn-fantasma:hover { background: var(--superficie-3); border-color: transparent; }
  .btn-perigo:hover { background: var(--critico); color: #fff; border-color: transparent; }
}
/* No toque, o retorno visual vem no :active */
.btn-fantasma:active { background: var(--superficie-3); }
.btn-perigo:active { background: var(--critico); color: #fff; border-color: transparent; }
.btn-sm { --altura: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-xl { --altura: 58px; padding: 0 28px; font-size: 17px; border-radius: 16px; font-weight: 700; }
.btn-icone { width: var(--altura); padding: 0; flex: none; }
.btn-bloco { width: 100%; }
/* Tela de toque (celular, tablet): botões pequenos com área confortável para o dedo.
   Em tabelas fica um pouco menor (38px) para as linhas não crescerem demais. */
@media (pointer: coarse) {
  .btn-sm { --altura: 40px; }
  td .btn-sm, th .btn-sm { --altura: 38px; }
}

/* Campos ----------------------------------------------------------------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span, .rotulo { font-size: 12.5px; font-weight: 600; color: var(--texto-2); letter-spacing: 0.01em; }
.campo small { color: var(--texto-3); font-size: 12px; }
/* Caixas dentro do rótulo (senha com olho, envio de arquivo) não herdam a letra miúda do rótulo */
.campo > .senha-caixa, .campo > .arquivo-zona { font-size: inherit; font-weight: inherit; color: inherit; letter-spacing: normal; }
.entrada, .campo input, .campo select, .campo textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: var(--superficie-2);
  color: var(--texto);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
/* Safari: tira o visual nativo (sombra interna, cantos e altura próprios) dos campos de texto */
.entrada, .campo textarea, .campo select,
.campo input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='color']) { -webkit-appearance: none; appearance: none; }
.campo textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.campo select, select.entrada { -webkit-appearance: none; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b89a8' stroke-width='2.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 12px center; }
select option { background: var(--superficie-forte); color: var(--texto); }
@media (hover: hover) {
  .entrada:hover, .campo input:hover, .campo select:hover, .campo textarea:hover { border-color: var(--borda-forte); }
}
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: rgba(201, 161, 59, 0.7); box-shadow: var(--anel-foco); }
.campo input[type='date'], .campo input[type='time'], .campo input[type='month'], .campo input[type='datetime-local'],
input.entrada[type='date'], input.entrada[type='time'], input.entrada[type='month'] {
  color-scheme: inherit;
  min-height: 44px; /* no iPhone o campo de data vazio encolhe */
  text-align: left;
  line-height: normal;
}
/* iPhone: valor da data/hora alinhado à esquerda como nos outros campos, sem margem extra */
.campo input::-webkit-date-and-time-value, input.entrada::-webkit-date-and-time-value { text-align: left; margin: 0; }
.campo input::-webkit-datetime-edit, input.entrada::-webkit-datetime-edit { padding: 0; }
/* Tela de toque: 16px nos campos. Com menos que isso o iPhone dá zoom na página ao tocar no campo. */
@media (pointer: coarse), (max-width: 640px) {
  .entrada, .campo input, .campo select, .campo textarea { font-size: 16px; }
}
.busca { position: relative; }
.busca svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--texto-3); pointer-events: none; }
.busca .entrada { padding-left: 40px; }

/* Interruptor */
.interruptor { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.interruptor input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.interruptor .trilho { width: 44px; height: 26px; border-radius: 99px; background: var(--superficie-3); border: 1px solid var(--borda-forte); position: relative; transition: background .25s; flex: none; }
.interruptor .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s cubic-bezier(.4,1.6,.6,1); }
.interruptor input:checked + .trilho { background: var(--grad); border-color: transparent; }
.interruptor input:checked + .trilho::after { transform: translateX(18px); }
.interruptor input:focus-visible + .trilho { box-shadow: var(--anel-foco); }

/* Senha com botão de mostrar/ocultar */
.senha-caixa { position: relative; display: block; }
.senha-caixa input { padding-right: 50px; }
/* centralizado na altura do campo, qualquer que seja o tamanho do botão (34px ou 40px no toque) */
.senha-caixa button { position: absolute; right: 4px; top: 0; bottom: 0; margin: auto 0; }

/* Caixa de marcar */
.marcar { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; -webkit-user-select: none; user-select: none; font-size: 14px; color: var(--texto-2); -webkit-tap-highlight-color: transparent; }
.marcar input { width: 18px; height: 18px; margin: 0; accent-color: var(--roxo); flex: none; }
@media (pointer: coarse) {
  .marcar { min-height: 44px; } /* a linha inteira é a área de toque */
  .marcar input { width: 22px; height: 22px; }
}

/* Envio de arquivo */
.arquivo-zona {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  border: 1.5px dashed var(--borda-forte);
  background: var(--superficie-2);
  min-height: 72px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .arquivo-zona:hover { border-color: rgba(201, 161, 59, 0.6); background: var(--superficie-3); }
}
.arquivo-zona:active { border-color: rgba(201, 161, 59, 0.6); background: var(--superficie-3); }
/* O input cobre a zona toda (o iPhone abre câmera/fotos/arquivos ao tocar em qualquer ponto) */
.arquivo-zona input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
.arquivo-zona:focus-within { box-shadow: var(--anel-foco); border-color: rgba(201, 161, 59, 0.7); }
.arquivo-icone { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--superficie-3); color: var(--texto-2); }
.arquivo-icone svg { width: 20px; height: 20px; }
.arquivo-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.arquivo-texto b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Celular estreito: até 2 linhas (o "Toque para escolher o arquivo" era cortado no iPhone SE) */
@media (max-width: 480px) {
  .arquivo-texto b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
}
.arquivo-texto small { color: var(--texto-3); font-size: 12px; }
.arquivo-zona.escolhido { border-style: solid; border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.arquivo-zona.escolhido .arquivo-icone { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }

/* Indicador de carregando dentro de botões */
.giro { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite; flex: none; }
@keyframes girar { to { transform: rotate(360deg); } }

/* Avatar ----------------------------------------------------------------- */
.avatar {
  --tam: 40px;
  width: var(--tam); height: var(--tam); flex: none;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--h) 40% 50%), hsl(calc(var(--h) + 28) 46% 31%));
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--tam) * 0.37);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.avatar-anel { padding: 3px; border-radius: 50%; background: conic-gradient(from 200deg, #f0d991, #9a7522, #c9a13b, #f0d991); display: inline-grid; }
.avatar-anel .avatar { box-shadow: 0 0 0 3px var(--superficie-forte); }

/* Pílulas de situação ---------------------------------------------------- */
.pilula {
  --c: var(--neutro);
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px 0 9px;
  border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--texto);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.pilula svg { width: 14px; height: 14px; color: var(--c); }
.pilula .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pilula.pulsar .ponto { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); animation: pulsar 1.8s ease-out infinite; }
@keyframes pulsar { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.c-ok { --c: var(--ok); } .c-alerta { --c: var(--alerta); } .c-serio { --c: var(--serio); }
.c-critico { --c: var(--critico); } .c-info { --c: var(--info); } .c-neutro { --c: var(--neutro); }
.c-roxo { --c: var(--roxo); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--texto-2);
  background: var(--superficie-3); border: 1px solid var(--borda);
}
.chip svg { width: 13px; height: 13px; flex: none; }

/* Toasts ----------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 1000;
  inset: auto max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) auto;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px));
  /* a pilha usa "popover" (comum.js) para ficar acima das janelas abertas: zera o visual padrão */
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: var(--texto); width: auto; height: auto;
}
/* Celular: avisos centralizados embaixo, acima da barra de início do iPhone */
@media (max-width: 640px) {
  .toasts { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  /* Com uma janela aberta, o aviso vai para o alto e não cobre os botões dela (que ficam embaixo) */
  html:has(dialog.modal[open]) .toasts { top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--superficie-forte);
  border: 1px solid var(--borda-forte);
  box-shadow: var(--sombra);
  font-size: 14px; font-weight: 500;
  animation: toast-entra .35s cubic-bezier(.2,1.2,.4,1);
}
.toast .toast-icone { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; background: var(--ok); }
.toast.erro .toast-icone { background: var(--critico); }
.toast .toast-icone svg { width: 15px; height: 15px; }
.toast.saindo { animation: toast-sai .25s ease forwards; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-sai { to { opacity: 0; transform: translateX(30px); } }

/* Modal ------------------------------------------------------------------ */
dialog.modal {
  /* largura e altura respeitam as áreas seguras (notch deitado, barra de início) */
  width: min(var(--largura, 560px), calc(100vw - 32px));
  width: min(var(--largura, 560px), calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)))); /* 100% = tela visível, sem a barra de rolagem */
  max-width: none;
  max-height: calc(100vh - 48px);
  /* dvh = altura visível de verdade no iPhone (com a barra do Safari à mostra) */
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 0;
  border: 1px solid var(--borda-forte);
  border-radius: 24px;
  background: var(--superficie-forte);
  color: var(--texto);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-entra .3s cubic-bezier(.2,1.1,.4,1); }
dialog.modal::backdrop { background: rgba(28, 22, 10, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes modal-entra { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--borda); flex: none; }
.modal-topo > div { min-width: 0; }
.modal-topo > .btn { flex: none; } /* o X não encolhe quando o título é longo */
.modal-topo h3 { font-size: 18px; }
.modal-topo p { color: var(--texto-3); font-size: 13px; margin-top: 2px; }
/* Só o corpo rola; topo e botões ficam sempre à vista. A rolagem não "vaza" para a página atrás. */
.modal-corpo { padding: 20px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--borda); background: var(--superficie-2); flex-wrap: wrap; flex: none; }
/* Com o teclado do iPhone aberto (comum.js mede a parte visível): a janela sobe e cabe acima do teclado.
   O portal do funcionário tem o próprio ajuste (funcionario.js, --vv-altura), por isso fica de fora. */
body:not(.portal) > dialog.modal.com-teclado { top: var(--teclado-topo, 0px); bottom: auto; margin: 8px auto 0; max-height: calc(var(--teclado-altura, 100dvh) - 16px); }
/* com o teclado aberto sobra pouco espaço: topo enxuto, sem o subtítulo */
dialog.modal.com-teclado .modal-topo { padding-top: 10px; padding-bottom: 8px; }
dialog.modal.com-teclado .modal-topo p { display: none; }
/* Página atrás não rola com uma janela aberta (no iPhone o dedo arrastava o fundo) */
@media (pointer: coarse) {
  html:has(dialog.modal[open]) { overflow: hidden; }
}
/* Celular em pé: margens e respiros menores */
@media (max-width: 640px) {
  dialog.modal { border-radius: 20px; }
  .modal-topo { padding: 16px 14px 12px 18px; gap: 10px; }
  .modal-corpo { padding: 16px 18px; }
  .modal-acoes { padding: 12px 18px 14px; }
}
/* Celular deitado (pouca altura): topo e botões compactos para sobrar espaço ao conteúdo */
@media (max-height: 520px) {
  dialog.modal { border-radius: 18px; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .modal-topo { padding: 10px 14px 8px 18px; }
  .modal-topo h3 { font-size: 16px; }
  .modal-topo p { font-size: 12px; margin-top: 0; }
  .modal-corpo { padding: 12px 18px; }
  .modal-acoes { padding: 8px 18px 10px; }
}

/* Utilitários ------------------------------------------------------------ */
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--texto-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.oculto { display: none !important; }
.pos { color: var(--pos-texto); }
.neg { color: var(--neg-texto); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--superficie-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--borda-forte); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* App (PWA) ---------------------------------------------------------------- */
[hidden] { display: none !important; }
.btn-instalar {
  border: 1.5px solid rgba(201, 161, 59, 0.6);
  background: linear-gradient(180deg, #fffdf6, #f7efd8);
  color: var(--ouro-escuro); font-weight: 700;
}
@media (hover: hover) {
  .btn-instalar:hover { background: linear-gradient(180deg, #fffaf0, #f1e4c0); border-color: var(--ouro); }
}
.btn-instalar:active { background: linear-gradient(180deg, #fffaf0, #f1e4c0); border-color: var(--ouro); }
.btn-instalar.pronto { animation: chamar-instalar 2.4s ease-in-out infinite; }
@keyframes chamar-instalar { 50% { box-shadow: 0 0 0 6px rgba(201, 161, 59, 0.2); } }
.faixa-app {
  display: flex; align-items: center; gap: 12px;
  margin: 0 clamp(16px, 3vw, 36px) 14px; padding: 10px 12px;
  margin: 0 max(clamp(16px, 3vw, 36px), env(safe-area-inset-right)) 14px max(clamp(16px, 3vw, 36px), env(safe-area-inset-left)); /* iPhone deitado: longe do entalhe */
  border-radius: 16px; border: 1px solid rgba(201, 161, 59, 0.45);
  background: linear-gradient(90deg, #fff8e8, #ffffff);
  box-shadow: var(--sombra);
}
.faixa-app img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 0 0 1px var(--borda); flex: none; }
.faixa-app > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.faixa-app b { font-size: 14px; }
.faixa-app small { color: var(--texto-3); font-size: 12.5px; }
/* Celular: o texto não cabe ao lado do botão — ícone + texto + fechar em cima, botão inteiro embaixo */
@media (max-width: 560px) {
  .faixa-app { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: 'img texto fechar' 'botao botao botao'; column-gap: 12px; row-gap: 10px; }
  .faixa-app img { grid-area: img; align-self: center; }
  .faixa-app > div { grid-area: texto; align-self: center; }
  .faixa-app [data-instalar] { grid-area: botao; width: 100%; }
  .faixa-app [data-fechar-faixa] { grid-area: fechar; align-self: start; margin: -4px -4px 0 0; }
}
.guia-ios { display: flex; flex-direction: column; gap: 12px; }
.guia-passo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--superficie-2); border: 1px solid var(--borda); font-size: 15px; }
.guia-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--grad); color: var(--tinta-ouro); font-weight: 800; }
.guia-icone { display: inline-flex; align-items: center; gap: 4px; color: #0a6cff; white-space: nowrap; }
.guia-icone svg { width: 18px; height: 18px; }
.guia-tres { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--superficie-3); border: 1px solid var(--borda-forte); font-weight: 900; letter-spacing: 1px; vertical-align: middle; }
.guia-dica { font-size: 12.5px; color: var(--texto-3); }
/* No iPhone o aviso sobe de baixo, perto da barra do Safari onde fica o ••• */
dialog.modal.folha-ios {
  margin: auto auto calc(8px + env(safe-area-inset-bottom));
  width: min(430px, calc(100vw - 16px));
  width: min(430px, calc(100% - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
dialog.modal.folha-ios[open] { animation: folha-sobe .35s cubic-bezier(.2, 1, .3, 1); }
@keyframes folha-sobe { from { transform: translateY(48px); opacity: 0; } }
/* Botão e seta lado a lado: a seta aponta para a barra do Safari, embaixo (vale também no portal,
   que empilha os botões das outras janelas no celular) */
dialog.modal.folha-ios .modal-acoes { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: nowrap; padding-bottom: 14px; }
dialog.modal.folha-ios .modal-acoes .btn { width: auto; flex: none; }
@media (max-height: 520px) {
  .guia-ios { gap: 8px; }
  .guia-passo { padding: 8px 12px; font-size: 14px; }
}
.guia-seta { display: inline-flex; align-items: center; gap: 6px; color: var(--ouro-escuro); font-size: 13px; font-weight: 700; white-space: nowrap; }
.guia-seta svg { width: 26px; height: 26px; animation: guia-quica 1.1s ease-in-out infinite; }
@keyframes guia-quica { 50% { transform: translateY(6px); } }
