/* Sistema de Requisições e Controle de Almoxarifado
   Tema claro/escuro automático (RNF-USA-08), a partir de 360 px (RNF-USA-02),
   alvos de toque de 44 px (RNF-USA-03) e contraste WCAG AA (RNF-USA-07). */

:root {
  --fundo: #f2f4f8;
  --cartao: #ffffff;
  --superficie: #f7f9fc;
  --borda: #e3e8ef;
  --borda-forte: #cdd5e0;
  --texto: #0f172a;
  --texto-fraco: #4b5a6e;

  /* Requisição que acabou de chegar (destaque "NOVA") */
  --novo: #047857;
  --novo-fundo: #d1fae5;
  --novo-forte: #10b981;
  --novo-anel: rgba(16, 185, 129, .55);
  --ok-ponto: #16a34a;
  --ok-anel: rgba(22, 163, 74, .45);
  --destaque: #1d4ed8;
  --destaque-forte: #1e40af;
  --destaque-texto: #ffffff;
  --destaque-fraco: #eaf1ff;
  --anel: rgba(29, 78, 216, .28);
  --ok: #166534;
  --ok-fundo: #dcfce7;
  --atencao: #8a4b05;
  --atencao-fundo: #fef3c7;
  --erro: #b91c1c;
  --erro-fundo: #fee2e2;
  --neutro-fundo: #eef2f6;
  --topo-fundo: rgba(255, 255, 255, .86);

  --lateral: #0f172a;
  --lateral-borda: #1e293b;
  --lateral-texto: #cbd5e1;
  --lateral-fraco: #94a3b8;

  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --sombra-media: 0 6px 16px -4px rgba(15, 23, 42, .10), 0 2px 4px rgba(15, 23, 42, .05);
  --sombra-grande: 0 24px 48px -12px rgba(15, 23, 42, .28);
  --raio: 10px;
  --raio-grande: 16px;
  --toque: 44px;
  --largura-lateral: 256px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0b1120;
    --cartao: #111827;
    --superficie: #0f172a;
    --borda: #1f2937;
    --borda-forte: #334155;
    --texto: #e5e7eb;
    --texto-fraco: #9ca3af;
    --destaque: #60a5fa;
    --destaque-forte: #93c5fd;
    --destaque-texto: #0b1120;
    --destaque-fraco: #172554;
    --anel: rgba(96, 165, 250, .35);
    --ok: #4ade80;
    --ok-fundo: #052e16;
    --atencao: #fbbf24;
    --atencao-fundo: #2d1f05;
    --erro: #f87171;
    --erro-fundo: #350d0f;
    --neutro-fundo: #1f2937;
    --topo-fundo: rgba(17, 24, 39, .86);

    --novo: #6ee7b7;
    --novo-fundo: #06281e;
    --novo-forte: #34d399;
    --novo-anel: rgba(52, 211, 153, .5);
    --ok-ponto: #4ade80;
    --ok-anel: rgba(74, 222, 128, .4);

    --lateral: #070b16;
    --lateral-borda: #172033;

    --sombra: 0 1px 2px rgba(0, 0, 0, .4);
    --sombra-media: 0 4px 12px rgba(0, 0, 0, .45);
    --sombra-grande: 0 24px 48px -12px rgba(0, 0, 0, .7);
  }
}

/* O atributo hidden sempre vence: sem isto, regras como display:grid
   deixavam a tela de login e os contadores visíveis depois de escondidos. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--fundo);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }

a { color: var(--destaque); }

.icone svg, svg.icone, .logo svg, .kpi-icone svg, .contador-icone svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- estrutura */

#aplicacao {
  display: grid;
  grid-template-columns: var(--largura-lateral) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "lateral topo"
    "lateral conteudo";
  min-height: 100vh;
  min-height: 100dvh;
}

/* Menu lateral (computador) */
.lateral {
  grid-area: lateral;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem .75rem;
  background: linear-gradient(180deg, #0b1324 0%, var(--lateral) 60%);
  border-right: 1px solid var(--lateral-borda);
}

.logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 10px rgba(29, 78, 216, .35);
}
.logo svg { width: 21px; height: 21px; }

.marca {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .25rem .5rem .5rem;
  color: #fff;
}
.marca .nome { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.marca .nome small { display: block; font-weight: 500; font-size: .75rem; color: var(--lateral-fraco); }

nav.menu { display: flex; flex-direction: column; gap: 2px; }

nav.menu a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: var(--toque);
  padding: 0 .75rem;
  border-radius: var(--raio);
  text-decoration: none;
  color: var(--lateral-texto);
  font-weight: 500;
  font-size: .95rem;
  transition: background-color .15s, color .15s;
}
nav.menu a .icone { display: inline-flex; flex: none; }
nav.menu a .icone svg { width: 20px; height: 20px; }
nav.menu a .contador { margin-left: auto; }
nav.menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
nav.menu a[aria-current="page"] { background: rgba(96, 165, 250, .16); color: #fff; }
nav.menu a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -.75rem;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
}
nav.menu a:focus-visible { outline: 2px solid #93c5fd; outline-offset: 0; }

/* Barra do topo */
.topo {
  grid-area: topo;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 64px;
  padding: .5rem 1.5rem;
  background: var(--topo-fundo);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--borda);
}

.usuario { display: flex; align-items: center; gap: .7rem; margin-right: auto; min-width: 0; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--destaque-fraco);
  color: var(--destaque);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
}
.usuario-texto { min-width: 0; line-height: 1.2; }
.usuario-texto strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-texto small { display: block; font-size: .78rem; color: var(--texto-fraco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

button.com-icone { display: inline-flex; align-items: center; gap: .45rem; }
button.com-icone .icone { width: 20px; height: 20px; flex: none; }

main {
  grid-area: conteudo;
  width: 100%;
  max-width: 1400px;
  justify-self: center;
  min-width: 0;
  padding: 1.75rem 1.5rem 4rem;
}
main:focus { outline: none; }

#conteudo > h1:first-child { margin-bottom: 1.1rem; }

.cartao {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio-grande);
  box-shadow: var(--sombra);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.duas-colunas { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .duas-colunas { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); align-items: start; }
}

.grade { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Celular e tablet: o menu vira uma faixa rolável abaixo do topo */
@media (max-width: 1023.98px) {
  #aplicacao {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "marca topo"
      "menu menu"
      "conteudo conteudo";
  }
  .lateral { display: contents; }

  .marca {
    grid-area: marca;
    padding: .5rem .25rem .5rem 1rem;
    color: var(--texto);
    background: var(--cartao);
    border-bottom: 1px solid var(--borda);
  }
  .marca .nome small { color: var(--texto-fraco); }

  .topo {
    position: static;
    padding: .5rem 1rem .5rem .75rem;
    background: var(--cartao);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  nav.menu {
    grid-area: menu;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    gap: .25rem;
    overflow-x: auto;
    padding: .5rem 1rem;
    background: var(--topo-fundo);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--borda);
    scrollbar-width: none;
  }
  nav.menu::-webkit-scrollbar { display: none; }
  nav.menu a { flex: none; white-space: nowrap; gap: .5rem; padding: 0 .85rem; color: var(--texto); }
  nav.menu a .icone svg { width: 18px; height: 18px; }
  nav.menu a:hover { background: var(--neutro-fundo); color: var(--texto); }
  nav.menu a[aria-current="page"] { background: var(--destaque); color: var(--destaque-texto); }
  nav.menu a[aria-current="page"]::before { display: none; }
  nav.menu a .contador { margin-left: 0; }
  nav.menu a:focus-visible { outline: 3px solid var(--destaque); outline-offset: -3px; }

  main { padding: 1.25rem 1rem 4rem; }
}

@media (max-width: 640px) {
  .usuario-texto, .topo .rotulo {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .topo { justify-content: flex-end; }
  .usuario { margin-right: 0; }
  .topo button.com-icone { padding: 0 .65rem; }
  h1 { font-size: 1.35rem; }
}

@media (max-width: 400px) {
  .marca .nome small { display: none; }
}

/* --------------------------------------------------------------- campos */

label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .3rem; }
label.opcao { display: flex; gap: .6rem; align-items: center; font-weight: 500; font-size: .9rem; cursor: pointer; }
.campo { margin-bottom: .9rem; }
.dica { font-size: .8rem; color: var(--texto-fraco); margin-top: .25rem; }

input, select, textarea, button {
  font: inherit;
  color: var(--texto);
}

input, select, textarea {
  width: 100%;
  min-height: var(--toque);
  padding: .5rem .75rem;
  background: var(--cartao);
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--texto-fraco); opacity: .75; }
textarea { min-height: 5rem; resize: vertical; }

select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 16px;
}

input[type="checkbox"], input[type="radio"] {
  width: 1.25rem;
  min-height: 1.25rem;
  height: 1.25rem;
  padding: 0;
  accent-color: var(--destaque);
  flex: none;
}

input:hover:not(:disabled):not([type="checkbox"]):not([type="radio"]), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--texto-fraco);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--destaque);
  box-shadow: 0 0 0 3px var(--anel);
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--destaque);
  outline-offset: 2px;
}

input:disabled, select:disabled, textarea:disabled { background: var(--neutro-fundo); color: var(--texto-fraco); }

fieldset { border: 1px solid var(--borda); border-radius: var(--raio-grande); padding: 1rem; margin: 0 0 .9rem; }
legend { font-weight: 650; font-size: .875rem; padding: 0 .4rem; }

details > summary { font-weight: 600; color: var(--destaque); }

.linha-campos { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }

/* --------------------------------------------------------------- botões */

button {
  min-height: var(--toque);
  min-width: var(--toque);
  padding: 0 1rem;
  background: var(--cartao);
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  cursor: pointer;
  font-weight: 600;
  font-size: .925rem;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: var(--neutro-fundo); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }

button.principal { background: var(--destaque); color: var(--destaque-texto); border-color: var(--destaque); }
button.principal:hover:not(:disabled) { background: var(--destaque-forte); border-color: var(--destaque-forte); }
button.perigo { background: var(--erro-fundo); color: var(--erro); border-color: var(--erro); }
button.perigo:hover:not(:disabled) { background: var(--erro); color: #fff; }
button.discreto { background: transparent; box-shadow: none; }
button.discreto:hover:not(:disabled) { background: var(--neutro-fundo); }
.topo button.discreto { border-color: transparent; }
button.pequeno { min-height: 36px; padding: 0 .7rem; font-size: .85rem; }
button.largo { width: 100%; }

/* Abas (botões que ficam marcados) */
button[aria-pressed] { border-radius: 999px; }

.botoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.rodape-caixa { justify-content: flex-end; margin-top: 1.25rem; }

/* --------------------------------------------------------------- tabelas */

.rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--borda); vertical-align: top; }
th {
  font-size: .72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--texto-fraco);
  background: var(--superficie);
  white-space: nowrap;
}
thead tr:first-child th:first-child { border-top-left-radius: var(--raio); }
thead tr:first-child th:last-child { border-top-right-radius: var(--raio); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Campos dentro de tabelas não encolhem até ficarem ilegíveis: a tabela rola. */
td :where(input:not([type="checkbox"]):not([type="radio"]), select) { min-width: 6.5rem; }
td input[aria-label="Material"] { min-width: 12rem; }
.tabela-itens th:first-child { width: 48%; }
tbody tr { transition: background-color .1s; }
tbody tr:hover { background: var(--superficie); }

.paginacao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .75rem;
}
.paginacao .dica { margin: 0; }

/* ---------------------------------------------------------------- selos */

.selo {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); }
.selo.atencao { background: var(--atencao-fundo); color: var(--atencao); }
.selo.erro { background: var(--erro-fundo); color: var(--erro); }
.selo.neutro { background: var(--neutro-fundo); color: var(--texto-fraco); }
.selo.destaque { background: var(--destaque-fraco); color: var(--destaque); }
.selo.novo { background: #047857; color: #fff; letter-spacing: .04em; } /* branco sobre verde escuro: contraste AA nos dois temas */
.selo.novo::before { background: #fff; animation: piscar 1s steps(2, start) infinite; }

.contador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}

/* ----------------------------------------------------------- contadores */

.painel-contadores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.painel-contadores button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icone valor" "rotulo rotulo";
  align-items: center;
  gap: .35rem .55rem;
  padding: .75rem .85rem;
  min-height: 78px;
  text-align: left;
  border-color: var(--borda);
  border-radius: var(--raio-grande);
}
.painel-contadores .contador-icone {
  grid-area: icone;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--destaque-fraco);
  color: var(--destaque);
}
.painel-contadores .contador-icone svg { width: 17px; height: 17px; }
.painel-contadores .valor { grid-area: valor; }
.painel-contadores .rotulo { grid-area: rotulo; }
.painel-contadores button:hover:not(:disabled) { border-color: var(--destaque); background: var(--cartao); box-shadow: var(--sombra-media); }
.painel-contadores button[aria-pressed="true"] { background: var(--destaque); color: var(--destaque-texto); border-color: var(--destaque); }
.painel-contadores button[aria-pressed="true"] .contador-icone { background: rgba(255, 255, 255, .18); color: inherit; }
/* Algo esperando ação no balcão (devolução a conferir). */
.painel-contadores button.alerta { background: var(--atencao-fundo); color: var(--atencao); border-color: var(--atencao); }
.painel-contadores button.alerta .contador-icone { background: rgba(255, 255, 255, .5); color: inherit; }
/* Chegou requisição nova para separar. */
.painel-contadores button.chegou:not([aria-pressed="true"]) { border-color: var(--novo-forte); background: var(--novo-fundo); color: var(--novo); }
.painel-contadores button.chegou .contador-icone { background: var(--novo-forte); color: #fff; }
.painel-contadores .valor { font-size: 1.6rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.painel-contadores .rotulo { font-size: .78rem; font-weight: 500; opacity: .9; line-height: 1.25; }

/* ----------------------------------------------------------------- fila */

.fila { display: flex; flex-direction: column; gap: .5rem; max-height: 70vh; overflow-y: auto; padding: 2px; }

.fila-item {
  width: 100%;
  text-align: left;
  display: block;
  padding: .7rem .9rem;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-left: 4px solid var(--borda-forte);
  border-radius: var(--raio);
  min-height: 72px;
  font-weight: 500;
}
.fila-item:hover:not(:disabled) { background: var(--superficie); box-shadow: var(--sombra-media); }
.fila-item.nova { border-color: var(--novo-forte); border-left-color: var(--novo-forte); background: linear-gradient(90deg, var(--novo-fundo), var(--cartao) 65%); }
.fila-item[aria-current="true"] { border-color: var(--destaque); background: var(--destaque-fraco); }
.fila-item.urgente { border-left-color: var(--erro); }
.fila-item .numero { font-weight: 700; }
.fila-item .onde { font-size: .9rem; }
.fila-item .abaixo { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; font-size: .8rem; color: var(--texto-fraco); }

.espera.atencao { color: var(--atencao); font-weight: 700; }
.espera.atraso { color: var(--erro); font-weight: 700; }

/* ------------------------------------------------------------- mensagens */

.aviso {
  padding: .7rem .9rem;
  border-radius: var(--raio);
  border: 1px solid transparent;
  border-left: 4px solid;
  margin-bottom: .75rem;
  font-size: .925rem;
}
.aviso.ok { background: var(--ok-fundo); color: var(--ok); border-left-color: var(--ok); }
.aviso.erro { background: var(--erro-fundo); color: var(--erro); border-left-color: var(--erro); }
.aviso.atencao { background: var(--atencao-fundo); color: var(--atencao); border-left-color: var(--atencao); }
.aviso.info { background: var(--destaque-fraco); color: var(--destaque); border-left-color: var(--destaque); }
.aviso .dica { color: inherit; opacity: .85; }

#recados {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 60;
  width: min(92vw, 520px);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
#recados .aviso { box-shadow: var(--sombra-grande); margin: 0; animation: surgir .2s ease-out; }

@keyframes surgir {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.vazio {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--texto-fraco);
  border: 1px dashed var(--borda-forte);
  border-radius: var(--raio-grande);
  background: var(--superficie);
}

/* -------------------------------------------------------------- diálogos */

dialog {
  width: min(94vw, 560px);
  max-height: 90vh;
  border: 1px solid var(--borda);
  border-radius: 16px;
  background: var(--cartao);
  color: var(--texto);
  padding: 1.5rem;
  box-shadow: var(--sombra-grande);
}
dialog[open] { animation: surgir .18s ease-out; }
dialog > h2, dialog form > h2 { margin-bottom: 1rem; }
dialog::backdrop {
  background: rgba(15, 23, 42, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ---------------------------------------------------------------- login */

/* Tela dividida: vitrine escura animada à esquerda, formulário num cartão de vidro à
   direita. No celular, a vitrine vira uma faixa no alto. A vitrine é sempre escura; o
   formulário segue o tema claro/escuro do aparelho. */
.tela-login {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, .85fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fundo);
}

/* ---- vitrine */
.login-vitrine {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.75rem, 4vw, 3.25rem) clamp(1.75rem, 5vw, 4.5rem);
  color: #dbe5f3;
  background: #050a18;
}
/* Aurora: manchas de cor que se movem devagar */
.login-vitrine::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: -2;
  background:
    radial-gradient(38% 32% at 22% 28%, rgba(59, 130, 246, .58), transparent 70%),
    radial-gradient(30% 28% at 78% 18%, rgba(16, 185, 129, .36), transparent 70%),
    radial-gradient(42% 38% at 62% 82%, rgba(99, 102, 241, .48), transparent 70%),
    radial-gradient(26% 24% at 12% 88%, rgba(14, 165, 233, .32), transparent 70%);
  filter: blur(24px);
  animation: aurora 22s ease-in-out infinite alternate;
}
/* Grade fina por cima, sumindo nas bordas */
.login-vitrine::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 35% 45%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 35% 45%, #000 25%, transparent 80%);
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, -2%, 0) rotate(6deg) scale(1.05); }
  100% { transform: translate3d(-3%, 3%, 0) rotate(-4deg) scale(1); }
}

.login-marca { display: flex; align-items: center; gap: .8rem; color: #fff; }
.login-marca .logo { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 10px 30px rgba(59, 130, 246, .55); }
.login-marca .logo svg { width: 25px; height: 25px; }
.login-marca .nome { font-weight: 750; font-size: 1.1rem; line-height: 1.15; }
.login-marca .nome small { display: block; font-weight: 500; font-size: .8rem; color: #93a4bf; }

.login-chamada { max-width: 36rem; }
.login-chamada h2 {
  margin: 0 0 .9rem;
  color: #fff;
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.login-chamada .brilho {
  background: linear-gradient(90deg, #60a5fa, #a5b4fc 30%, #6ee7b7 60%, #60a5fa);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brilho-correr 9s linear infinite;
}
@keyframes brilho-correr { to { background-position: -200% 0; } }
.login-chamada > p { margin: 0 0 1.6rem; color: #b6c4da; font-size: clamp(1rem, 1.2vw, 1.15rem); }

/* Caminho da requisição: quatro etapas ligadas por um trilho, com uma luz que passa
   por elas. Cada etapa acende quando a luz chega (ciclo de 4,8 s, 1,2 s por etapa). */
.login-fluxo {
  padding: 1.15rem 1.15rem 1rem;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 20px 40px -20px rgba(0, 0, 0, .6);
}
.fluxo-etapas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
/* trilho */
.fluxo-etapas::before,
.fluxo-etapas::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  border-radius: 2px;
}
.fluxo-etapas::before { background: rgba(255, 255, 255, .12); }
/* luz que corre pelo trilho */
.fluxo-etapas::after {
  background: radial-gradient(closest-side, #a5f3fc, #60a5fa 45%, transparent) no-repeat;
  background-size: 56px 6px;
  height: 6px;
  top: 17px;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, .9));
  animation: luz-correr 4.8s linear infinite;
}
@keyframes luz-correr {
  0% { background-position: 0% 0; opacity: 0; }
  4% { opacity: 1; }
  75% { background-position: 100% 0; opacity: 1; }
  82%, 100% { background-position: 100% 0; opacity: 0; }
}
.fluxo-etapas li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  color: #b6c4da;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
}
.etapa {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: #0b1530;
  color: #93a4bf;
  animation: etapa-acender 4.8s ease-out infinite;
}
.etapa svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fluxo-etapas li:nth-child(2) .etapa { animation-delay: 1.2s; }
.fluxo-etapas li:nth-child(3) .etapa { animation-delay: 2.4s; }
.fluxo-etapas li:nth-child(4) .etapa { animation-delay: 3.6s; }
@keyframes etapa-acender {
  0%, 30%, 100% { color: #93a4bf; border-color: rgba(255, 255, 255, .14); background: #0b1530; box-shadow: none; }
  6%, 18% {
    color: #fff;
    border-color: rgba(147, 197, 253, .9);
    background: linear-gradient(135deg, #3b82f6, #4338ca);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .18), 0 8px 24px -4px rgba(59, 130, 246, .7);
  }
}

.fluxo-transferencia {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding-top: .95rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.fluxo-texto { flex: 1; min-width: 0; font-size: .86rem; color: #b6c4da; line-height: 1.4; }
.fluxo-texto strong { display: block; color: #fff; font-size: .95rem; font-weight: 650; }
.recurso-icone {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(96, 165, 250, .28), rgba(99, 102, 241, .22));
  color: #bfdbfe;
}
.recurso-icone svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fluxo-locais { flex: none; display: flex; align-items: center; gap: .4rem; }
.fluxo-locais > svg { width: 16px; height: 16px; fill: none; stroke: #6ee7b7; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.fluxo-locais .local {
  display: grid;
  justify-items: center;
  min-width: 3.4rem;
  padding: .3rem .55rem .35rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(5, 10, 24, .55);
}
.fluxo-locais small { color: #93a4bf; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.fluxo-locais b { color: #fff; font-size: 1.15rem; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }

.login-recursos { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.login-recursos li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .8rem .4rem .65rem;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: #cbd5e1;
  font-size: .8rem;
  font-weight: 550;
}
.login-recursos svg { width: 15px; height: 15px; fill: none; stroke: #93c5fd; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.login-rodape { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.login-relogio { color: #fff; font-size: clamp(2.2rem, 3.4vw, 3rem); font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.login-data { color: #93a4bf; font-size: .95rem; }
.login-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-left: auto;
  padding: .3rem .75rem;
  border: 1px solid rgba(74, 222, 128, .35);
  border-radius: 999px;
  background: rgba(22, 163, 74, .12);
  color: #86efac;
  font-size: .8rem;
  font-weight: 600;
  transition: color .3s, border-color .3s, background .3s;
}
.login-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulsar 2s ease-out infinite; }
/* O servidor não respondeu na última conferência */
.login-status.fora { border-color: rgba(251, 191, 36, .4); background: rgba(217, 119, 6, .14); color: #fcd34d; }
.login-status.fora::before { background: #fbbf24; animation: none; }

/* ---- formulário */
.login-area {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.1rem;
  padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(55% 40% at 90% 0%, color-mix(in srgb, var(--destaque) 13%, transparent), transparent 70%),
    radial-gradient(45% 35% at 0% 100%, color-mix(in srgb, #10b981 9%, transparent), transparent 70%),
    var(--fundo);
}

/* Borda com uma luz que gira devagar em volta do cartão */
@property --giro { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.login-formulario {
  position: relative;
  width: min(100%, 420px);
  padding: 2.1rem 2rem 1.6rem;
  border: 1px solid var(--borda);
  border-radius: 24px;
  background: color-mix(in srgb, var(--cartao) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 32px 64px -28px rgba(15, 23, 42, .30), 0 12px 24px -16px rgba(15, 23, 42, .16);
  animation: surgir .45s cubic-bezier(.2, .8, .2, 1);
}
.login-formulario::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--giro), transparent 0 68%, rgba(59, 130, 246, .95) 80%, rgba(16, 185, 129, .85) 88%, transparent 97%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borda-girar 7s linear infinite;
  pointer-events: none;
}
@keyframes borda-girar { to { --giro: 360deg; } }

.login-saudacao {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .55rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: var(--destaque-fraco);
  color: var(--destaque);
  font-size: .78rem;
  font-weight: 650;
}
.login-saudacao::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.login-formulario h1 { margin: 0 0 .3rem; font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; }
.login-sub { margin: 0 0 1.5rem; color: var(--texto-fraco); }
.login-formulario .campo { margin-bottom: 1.05rem; }
.login-formulario label:not(.opcao) { font-size: .85rem; }

#erro-login .aviso { margin: 0 0 1.1rem; border-radius: 12px; }
#erro-login .aviso.erro { animation: tremer .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes tremer {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.campo-icone { position: relative; }
.campo-icone > .icone {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--texto-fraco);
  pointer-events: none;
  transition: color .15s;
}
.campo-icone > .icone svg { width: 19px; height: 19px; }
.campo-icone input {
  min-height: 54px;
  padding-left: 2.9rem;
  border-color: var(--borda);
  border-radius: 14px;
  background: var(--superficie);
  font-size: 1.05rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.campo-icone input:focus-visible { background: var(--cartao); box-shadow: 0 0 0 4px var(--anel); }
.campo-icone input[type="password"], .campo-icone input#pin { padding-right: 3.25rem; letter-spacing: .08em; }
.campo-icone:focus-within > .icone { color: var(--destaque); }
.ver-pin {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: var(--toque);
  min-width: var(--toque);
  min-height: var(--toque);
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--texto-fraco);
}
.ver-pin:hover:not(:disabled) { background: var(--neutro-fundo); color: var(--texto); }
.ver-pin:active:not(:disabled) { transform: translateY(-50%); }
.ver-pin svg { width: 20px; height: 20px; }
.ver-pin[aria-pressed="true"] { color: var(--destaque); }

/* "Aparelho compartilhado" como chave liga/desliga (continua sendo um checkbox) */
label.interruptor { align-items: center; gap: .8rem; min-height: var(--toque); }
label.interruptor small { display: block; color: var(--texto-fraco); font-size: .78rem; font-weight: 400; }
.interruptor input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 44px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--borda-forte);
  cursor: pointer;
  transition: background .2s;
}
.interruptor input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .35);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.interruptor input[type="checkbox"]:checked { background: var(--destaque); }
.interruptor input[type="checkbox"]:checked::after { transform: translateX(18px); }
.interruptor input[type="checkbox"]:focus-visible { outline: 3px solid var(--destaque); outline-offset: 2px; box-shadow: none; }

button.botao-entrar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 54px;
  margin-top: .35rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8 60%, #4338ca);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 650;
}
button.botao-entrar.principal:hover:not(:disabled) { background: linear-gradient(135deg, #2563eb, #1e40af 60%, #3730a3); }
/* Reflexo que atravessa o botão ao passar o mouse */
button.botao-entrar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .75s ease;
}
button.botao-entrar:hover:not(:disabled)::before { transform: translateX(120%); }
.botao-entrar .icone { width: 20px; height: 20px; transition: transform .2s; }
.botao-entrar:hover .icone { transform: translateX(3px); }
.botao-entrar.carregando .icone { display: none; }
.botao-entrar.carregando::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.login-ajuda { margin: 1.2rem 0 0; text-align: center; font-size: .82rem; color: var(--texto-fraco); }
.login-seguro { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--texto-fraco); font-size: .78rem; }
.login-seguro .icone { width: 14px; height: 14px; }

/* Tela baixa (notebook): vitrine mais enxuta para caber sem rolar */
@media (min-width: 900px) and (max-height: 760px) {
  .login-vitrine { gap: 1.25rem; }
  .login-chamada > p { margin-bottom: 1.1rem; }
  .login-recursos { display: none; }
}

/* Celular e tablet em pé: vitrine compacta no alto, formulário logo abaixo */
@media (max-width: 899.98px) {
  .tela-login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-vitrine { gap: 1.1rem; padding: 1.25rem 1.25rem 1.6rem; }
  .login-chamada h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); margin-bottom: .4rem; }
  .login-chamada > p { margin: 0; font-size: .95rem; }
  .login-fluxo, .login-recursos, .login-rodape { display: none; }
  .login-area { place-items: start center; align-content: start; padding: 1.25rem 1rem 2rem; }
  .login-formulario { padding: 1.6rem 1.25rem 1.35rem; border-radius: 20px; }
  .login-formulario h1 { font-size: 1.7rem; }
  .login-sub { margin-bottom: 1.15rem; }
}

/* -------------------------------------------------------- linha do tempo */

.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { padding: .45rem 0 .45rem 1.1rem; border-left: 2px solid var(--borda); position: relative; }
.linha-tempo li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: .85rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cartao);
  border: 2px solid var(--destaque);
}
.linha-tempo .quando { font-size: .8rem; color: var(--texto-fraco); }

/* ------------------------------------------------------------ modo painel */

/* TV do almoxarifado: letras grandes, legível de longe, sempre escuro. */
body.painel { background: #060b16; color: #e6edf7; }
body.painel #aplicacao {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  grid-template-areas: "conteudo";
}
body.painel .lateral, body.painel .topo, body.painel nav.menu, body.painel .marca { display: none; }
body.painel main { max-width: none; padding: 1.5rem 1.75rem 2rem; }

.tv-topo { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-bottom: 1.25rem; }
.tv-topo h1 { margin: 0; color: #fff; font-size: clamp(1.6rem, 2.4vw, 2.5rem); }
.tv-topo .tv-sub { color: #9fb0c8; font-size: clamp(1rem, 1.2vw, 1.25rem); }
.tv-topo .ao-vivo { color: #9fb0c8; font-size: 1rem; }
.tv-relogio { margin-left: auto; color: #fff; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tv-topo button { background: #111b2c; color: #e6edf7; border-color: #26344b; box-shadow: none; }
.tv-topo button:hover:not(:disabled) { background: #1a2740; }

.tv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tv-kpi { background: #0e1726; border: 1px solid #1e2a3d; border-radius: 18px; padding: 1rem 1.3rem; }
.tv-kpi .v { display: block; color: #fff; font-size: clamp(2.4rem, 4.2vw, 4rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-kpi .r { display: block; color: #9fb0c8; font-size: clamp(1rem, 1.2vw, 1.25rem); margin-top: .4rem; }
.tv-kpi.urgente .v { color: #f87171; }
.tv-kpi.novo { border-color: #10b981; }
.tv-kpi.novo .v { color: #34d399; }

.tv-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.tv-cartao {
  position: relative;
  background: #0e1726;
  border: 1px solid #1e2a3d;
  border-left: 10px solid #3b4a62;
  border-radius: 18px;
  padding: 1.1rem 1.3rem 1.2rem;
}
.tv-cartao.urgente { border-left-color: #ef4444; }
.tv-cartao.nova {
  border-color: #10b981;
  border-left-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, .20), #0e1726 60%);
}
.tv-cartao.urgente.nova { border-left-color: #ef4444; }
.tv-num { color: #fff; font-size: clamp(1.5rem, 2.2vw, 2.2rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.tv-onde { color: #dbe5f3; font-size: clamp(1.25rem, 1.8vw, 1.75rem); font-weight: 650; margin-top: .15rem; }
.tv-abaixo { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; color: #9fb0c8; font-size: clamp(1.05rem, 1.3vw, 1.3rem); margin-top: .55rem; }
.tv-abaixo .espera.atencao { color: #fbbf24; }
.tv-abaixo .espera.atraso { color: #f87171; }
.tv-selos { position: absolute; top: 1rem; right: 1rem; display: flex; gap: .45rem; }
.tv-selo { padding: .25rem .75rem; border-radius: 999px; font-weight: 800; font-size: clamp(.95rem, 1.1vw, 1.15rem); letter-spacing: .05em; }
.tv-selo.nova { background: #10b981; color: #022c1e; }
.tv-selo.urgente { background: #ef4444; color: #fff; }
body.painel .vazio { background: #0e1726; border-color: #26344b; color: #9fb0c8; font-size: 1.4rem; padding: 3rem; }

/* Aviso de chegada em tela cheia, por alguns segundos */
.tv-chegada {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(3, 8, 18, .84);
  animation: surgir .3s ease-out;
}
.tv-chegada .caixa {
  max-width: min(92vw, 1100px);
  text-align: center;
  padding: 2.5rem 3rem;
  border-radius: 28px;
  background: #062a1f;
  border: 3px solid #10b981;
  box-shadow: 0 0 90px rgba(16, 185, 129, .45);
  animation: brilhar 1.1s ease-in-out infinite;
}
.tv-chegada.urgente .caixa { background: #2c0b0b; border-color: #ef4444; box-shadow: 0 0 90px rgba(239, 68, 68, .5); }
.tv-chegada .titulo { color: #fff; font-size: clamp(2.2rem, 5vw, 5rem); font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.tv-chegada .num { color: #a7f3d0; font-size: clamp(1.7rem, 3.6vw, 3.4rem); font-weight: 800; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.tv-chegada.urgente .num { color: #fecaca; }
.tv-chegada .onde { color: #e6edf7; font-size: clamp(1.3rem, 2.6vw, 2.4rem); margin-top: .25rem; }

@keyframes brilhar {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* ----------------------------------------------------- componentes novos */

/* Cabeçalho de tela: título, subtítulo e ações */
.cabecalho-tela {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.cabecalho-tela .titulos { margin-right: auto; min-width: 0; }
.cabecalho-tela h1 { margin: 0; }
.cabecalho-tela .subtitulo { margin: .2rem 0 0; color: var(--texto-fraco); font-size: .92rem; }

/* "Online": a tela está conversando com o servidor */
.ao-vivo {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--texto-fraco);
  white-space: nowrap;
}
.ao-vivo::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok-ponto);
  animation: pulsar 2s ease-out infinite;
}
.ao-vivo.parado::before { background: var(--atencao); animation: none; }
.topo .ao-vivo { margin-right: .5rem; }

@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 var(--ok-anel); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes piscar { to { visibility: hidden; } }

/* Cartões de número (painel inicial) */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  min-height: 92px;
  padding: 1rem 1.1rem;
  text-align: left;
  font-weight: 500;
  color: var(--texto);
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio-grande);
  box-shadow: var(--sombra);
}
button.kpi:hover:not(:disabled) { background: var(--cartao); border-color: var(--destaque); box-shadow: var(--sombra-media); }
.kpi-icone {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--destaque-fraco);
  color: var(--destaque);
}
.kpi-icone svg { width: 23px; height: 23px; }
.kpi-texto { min-width: 0; }
.kpi-valor { display: block; font-size: 1.85rem; font-weight: 750; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-rotulo { display: block; margin-top: .15rem; font-size: .84rem; color: var(--texto-fraco); line-height: 1.3; }
.kpi .kpi-chip { position: absolute; top: .65rem; right: .65rem; }
.kpi.tom-ok .kpi-icone { background: var(--ok-fundo); color: var(--ok); }
.kpi.tom-atencao .kpi-icone { background: var(--atencao-fundo); color: var(--atencao); }
.kpi.tom-erro .kpi-icone { background: var(--erro-fundo); color: var(--erro); }
.kpi.tom-neutro .kpi-icone { background: var(--neutro-fundo); color: var(--texto-fraco); }
.kpi.chegou { border-color: var(--novo-forte); background: linear-gradient(135deg, var(--novo-fundo), var(--cartao) 70%); }
.kpi.chegou .kpi-icone { background: var(--novo-forte); color: #fff; }

/* Requisições que acabaram de chegar */
.chegadas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.chegada {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .2rem .75rem;
  width: 100%;
  min-height: 62px;
  padding: .65rem .9rem;
  text-align: left;
  font-weight: 500;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-left: 4px solid var(--borda-forte);
  border-radius: var(--raio);
  box-shadow: none;
}
.chegada:hover:not(:disabled) { background: var(--superficie); box-shadow: var(--sombra-media); }
.chegada.urgente { border-left-color: var(--erro); }
.chegada.nova { border-color: var(--novo-forte); border-left-color: var(--novo-forte); background: linear-gradient(90deg, var(--novo-fundo), var(--cartao) 65%); }
.chegada.urgente.nova { border-left-color: var(--erro); }
.chegada .linha1 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.chegada .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.chegada .onde { grid-column: 1; color: var(--texto-fraco); font-size: .86rem; }
.chegada .quando { grid-row: 1 / span 2; grid-column: 2; font-size: .8rem; color: var(--texto-fraco); white-space: nowrap; }

/* Faixa que aparece quando chega requisição nova */
.faixa-chegada {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .9rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--novo-forte);
  border-radius: var(--raio-grande);
  background: var(--novo-fundo);
  color: var(--novo);
  font-weight: 650;
  animation: surgir .25s ease-out, chegou 1.1s ease-out 3;
}
.faixa-chegada.urgente { border-color: var(--erro); background: var(--erro-fundo); color: var(--erro); }
.faixa-chegada .icone svg { width: 22px; height: 22px; display: block; }
.faixa-chegada .acoes { margin-left: auto; display: flex; gap: .4rem; }

/* Cartão de aprovação que acabou de chegar */
.cartao.chegada-cartao { border-color: var(--novo-forte); box-shadow: inset 4px 0 0 var(--novo-forte), var(--sombra); }

/* Animação de chegada: anel que pulsa três vezes em volta do item novo */
.chegando { animation: chegou 1.1s ease-out 3; }
@keyframes chegou {
  0% { box-shadow: 0 0 0 0 var(--novo-anel); }
  65% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Transferência entre locais do ERP: 29 → 99 */
.transf {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .65rem;
  border: 1px solid var(--borda-forte);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--texto);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.transf b { font-weight: 800; font-variant-numeric: tabular-nums; }
.transf .seta { color: var(--destaque); font-weight: 800; }

/* Seção com título e link à direita */
.secao-titulo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.secao-titulo h2 { margin: 0; margin-right: auto; }

.painel-colunas { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .painel-colunas.duas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 640px) {
  .topo .ao-vivo { font-size: 0; gap: 0; }
  /* Celular: dois cartões por linha, ícone em cima do número */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .kpi { flex-direction: column; align-items: flex-start; gap: .5rem; min-height: 0; padding: .8rem .85rem; }
  .kpi-icone { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-icone svg { width: 19px; height: 19px; }
  .kpi-valor { font-size: 1.55rem; }
  .kpi-rotulo { font-size: .8rem; }
  .kpi .kpi-chip { top: .55rem; right: .55rem; }
  .secao-titulo h2 { flex-basis: 100%; }
}

/* --------------------------------------------------------------- impressão */

@media print {
  .lateral, .topo, nav.menu, .botoes, #recados, .nao-imprime { display: none !important; }
  #aplicacao { display: block; }
  body { background: #fff; color: #000; }
  .cartao { box-shadow: none; border: none; }
  table { font-size: 11pt; }
  th { background: none; }
  th, td { border-bottom: 1px solid #999; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

/* Barra fina no alto enquanto uma gravação está a caminho do servidor (App.ocupado) */
body.ocupado { cursor: progress; }
body.ocupado::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--destaque), var(--novo-forte), transparent) no-repeat;
  background-size: 45% 100%;
  animation: salvando 1s linear infinite;
}
@keyframes salvando {
  from { background-position: -45% 0; }
  to { background-position: 145% 0; }
}
button.enviando { cursor: progress; }
button.enviando::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: .5rem;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: girar .7s linear infinite;
}

/* Número da requisição numa linha só nas tabelas; ícone pequeno no selo 29 → 99 */
td a { white-space: nowrap; }
.transf .icone { display: inline-flex; color: var(--destaque); }
.transf .icone svg { width: 14px; height: 14px; display: block; }

/* Relatórios: busca dentro da lista item a item */
.linha-busca { margin-bottom: .75rem; }
.busca-lista { width: 100%; max-width: 26rem; }

/* Material entregue esperando "Confirmar recebimento" (Minhas requisições), com o
   mesmo verde da requisição nova; contador verde no menu */
.contador.ok { background: #047857; } /* branco sobre verde escuro: contraste AA */
.recebimentos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.recebimento {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--novo-forte);
  border-left: 4px solid var(--novo-forte);
  border-radius: var(--raio);
  background: linear-gradient(90deg, var(--novo-fundo), var(--cartao) 70%);
}
.recebimento .info { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.recebimento .linha1 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.recebimento .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.recebimento .onde { color: var(--texto-fraco); font-size: .86rem; }
.recebimento .botoes { flex: none; }
tr.a-confirmar td { background: var(--novo-fundo); }
tr.a-confirmar td:first-child { box-shadow: inset 4px 0 0 var(--novo-forte); }
td > button.discreto.pequeno { white-space: nowrap; } /* número da requisição numa linha só */
.painel-colunas.larga-estreita { margin-bottom: 1rem; }
.painel-colunas.larga-estreita > .cartao { margin-bottom: 0; }
@media (min-width: 1100px) { .painel-colunas.larga-estreita { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
