/*
 * CSS do Agendei (RNF-04: fonte ≥ 16 px, alto contraste,
 * botões grandes, navegação por teclado). Sem framework e sem CDN.
 *
 * As cores ficam nas variáveis abaixo. O teste tests/test_layout.py calcula
 * o contraste de cada par texto/fundo (mínimo 4,5:1, WCAG AA). Se trocar uma
 * cor, rode os testes.
 */

:root {
  /* Paleta da marca Agendei (marca/MANUAL-DA-MARCA.md): Petróleo, Limão, Gelo, Grafite. */
  --cor-petroleo: #0f3d3e;
  --cor-limao: #b9f25b;
  --cor-gelo: #f4f6f2;
  --fundo: #f4f6f2;
  --superficie: #ffffff;
  --texto: #1e2a2b;
  --texto-suave: #4a5a5b;
  --borda: #6b7a7b;
  --linha: #d5dcd8;
  --primaria: #0f3d3e;
  --primaria-escura: #0a2a2b;
  --texto-na-primaria: #f4f6f2;
  --destaque: #b9f25b; /* limão: nunca como cor de texto em fundo claro */
  --texto-no-destaque: #0f3d3e;
  --foco: #b45309;
  --erro-fundo: #fdecec;
  --erro-texto: #8a1c1c;
  --sucesso-fundo: #e6f4ea;
  --sucesso-texto: #14532d;
  --atencao-fundo: #fff4d6;
  --atencao-texto: #6b4500;
  /* Situações no calendário (texto sobre fundo, contraste testado) */
  --agendado-fundo: #0f3d3e;
  --agendado-texto: #f4f6f2;
  /* Fluxo de recepção (PRD v1.2): aguardando = verde limão da marca (contraste 9:1 com petróleo) */
  --aguardando-fundo: #b9f25b;
  --aguardando-texto: #0f3d3e;
  --em-atendimento-fundo: #fff4d6;
  --em-atendimento-texto: #6b4500;
  --encerrado-fundo: #14532d;
  --encerrado-texto: #ffffff;
  --faltou-fundo: #8a1c1c;
  --faltou-texto: #ffffff;
  --livre-fundo: #b9f25b;
  --livre-texto: #0f3d3e;
  --bloqueio-fundo: #e5e7eb;
  --almoco-fundo: #fdf0d5;
  --reserva-fundo: #d1d5db;
  --reserva-texto: #1f2937;
  --almoco-texto: #6b4500;
  --hoje-fundo: #f3fbe6; /* coluna de hoje no calendário: limão bem claro */
  --topo-fundo: #0f3d3e;
  --topo-texto: #f4f6f2;
  --raio: 0.6rem;
  --fonte-titulo: "Space Grotesk", system-ui, sans-serif;
  --fonte-texto: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Fontes da marca servidas pelo próprio sistema (LGPD: nada carregado de terceiros).
   Licença SIL OFL 1.1: static/vendor/fontes/LICENSE-*.txt */
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fontes/inter-latin-400-normal.da03732a27e1.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fontes/inter-latin-500-normal.51205681a1ba.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fontes/inter-latin-600-normal.2ede57db1a3a.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fontes/inter-latin-700-normal.8ca0a5155296.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fontes/space-grotesk-latin-500-normal.e495a4fdb26a.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fontes/space-grotesk-latin-700-normal.b9e357886774.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%; /* respeita o tamanho escolhido no navegador (padrão 16 px) */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fonte-texto);
  font-size: 1.0625rem; /* 17 px */
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
}

/* --- Foco sempre visível (teclado) ------------------------------------------ */

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}

/* --- "Pular para o conteúdo" ------------------------------------------------ */

.pular {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--superficie);
  color: var(--primaria-escura);
  font-weight: 700;
  border-radius: var(--raio);
}

.pular:focus {
  top: 1rem;
}

/* --- Topo e menu -------------------------------------------------------------- */

.topo {
  background: var(--topo-fundo);
  color: var(--topo-texto);
}

.topo__conteudo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.topo a {
  color: var(--topo-texto);
}

/* Logotipo "agendei" com o ✓ no lugar do pingo do i, em selo branco sobre o Petróleo.
   Feito com a fonte da marca (Space Grotesk 700, -4,5%) e o símbolo em SVG. */
.marca {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.2rem 0.9rem 0.35rem;
  margin-bottom: 0.625rem; /* 10 px: separa o logotipo do menu */
  background: var(--superficie);
  border-radius: var(--raio);
  text-decoration: none;
}

.topo a.marca {
  color: var(--primaria);
}

.marca__palavra {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.045em;
}

.marca__i {
  position: relative;
  display: inline-block;
}

.marca__check {
  position: absolute;
  left: 50%;
  top: -0.12em;
  width: 0.36em;
  height: 0.36em;
  transform: translateX(-42%);
}

.marca__check circle {
  fill: var(--destaque);
}

.marca__check path {
  fill: none;
  stroke: var(--texto-no-destaque);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: inline-block;
  min-height: 2.75rem; /* 44 px: alvo de toque confortável */
  padding: 0.6rem 0.75rem;
  border-radius: var(--raio);
  text-decoration: none;
  font-weight: 600;
}

.menu a:hover,
.menu a[aria-current="page"] {
  background: var(--primaria-escura);
  text-decoration: underline;
  text-decoration-color: var(--destaque);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.topo .menu a:focus-visible,
.topo .menu summary:focus-visible,
.topo .botao:focus-visible {
  outline-color: var(--topo-texto);
}

/* Submenu "Administração" (<details>): suspenso no computador, em lista no celular. */
.menu__grupo {
  position: relative;
}

.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--raio);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

/* Seta desenhada com borda (sem fonte de ícones, por causa da CSP). */
.menu summary::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}

.menu details[open] > summary::after {
  transform: translateY(15%) rotate(-135deg);
}

.menu summary:hover,
.menu details[open] > summary,
.menu summary.menu__atual {
  background: var(--primaria-escura);
}

.menu summary.menu__atual {
  text-decoration: underline;
  text-decoration-color: var(--destaque);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.menu__grupo ul {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  margin-top: 0.25rem;
  padding: 0.35rem;
  background: var(--primaria-escura);
  border-radius: var(--raio);
}

.menu__grupo ul a {
  display: block;
}

.menu__grupo ul a:hover,
.menu__grupo ul a[aria-current="page"] {
  background: var(--topo-fundo);
}

@media (min-width: 48rem) {
  .menu__grupo ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    min-width: 16rem;
    box-shadow: 0 0.75rem 1.5rem rgb(0 0 0 / 0.25);
  }
}

.usuario-atual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-left: auto;
}

/* --- Conteúdo -------------------------------------------------------------------- */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

main:focus {
  outline: none;
}

.estreito {
  max-width: 30rem;
  margin: 2rem auto;
}

h1,
h2,
h3 {
  font-family: var(--fonte-titulo);
  color: var(--primaria);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 500;
}

/* Horários e datas alinhados (marca: Inter com números tabulares). */
table,
time,
.indicador__valor {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--primaria);
  text-underline-offset: 0.15em;
}

.cartao {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 1.5rem;
}

.cartoes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.cartoes .cartao h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

/* O primeiro elemento do cartão encosta no respiro do próprio cartão. */
.cartao > :first-child {
  margin-top: 0;
}

/* Botão sozinho num parágrafo: o espaço já é o do parágrafo. */
p > .botao:only-child {
  margin-top: 0;
}

/* Quebra de linha mais equilibrada: títulos sem linha curta sobrando e textos sem
   uma palavra sozinha na última linha. */
h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

/* Textos longos (aviso de privacidade): linha de leitura confortável (até ~75 letras). */
.texto-corrido {
  max-width: 62ch; /* ~75 letras por linha com a fonte Inter */
}

/* Busca rápida de pessoa na tela inicial. */
.busca-rapida {
  max-width: 48rem;
}

.suave {
  color: var(--texto-suave);
}

/* --- Formulários e botões ------------------------------------------------------------- */

label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--texto);
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: var(--raio);
}

/* Campos de uma linha com a mesma altura (data, texto e lista lado a lado alinham). */
input:not([type="checkbox"], [type="radio"], [type="file"]),
select {
  height: 3rem;
}

.botao,
button {
  display: inline-block;
  min-height: 2.75rem;
  min-width: 2.75rem;
  margin-top: 1.25rem;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--texto-na-primaria);
  background: var(--primaria);
  border: 2px solid var(--primaria);
  border-radius: var(--raio);
  cursor: pointer;
  text-decoration: none;
}

.botao:hover,
button:hover {
  background: var(--primaria-escura);
  border-color: var(--primaria-escura);
}

.botao--secundario {
  color: var(--primaria-escura);
  background: var(--superficie);
  border-color: var(--primaria-escura);
}

.botao--secundario:hover {
  color: var(--texto-na-primaria);
}

.topo .botao {
  margin-top: 0;
  color: var(--topo-texto);
  background: transparent;
  border-color: var(--topo-texto);
}

.form-inline {
  display: inline;
  margin: 0;
}

/* --- Avisos ----------------------------------------------------------------------------- */

/* Aviso = fundo suave + contorno na cor do texto (sem a barra só de um lado). */
.erro,
.aviso {
  padding: 0.85rem 1rem;
  border: 1px solid;
  border-radius: var(--raio);
}

.erro {
  color: var(--erro-texto);
  background: var(--erro-fundo);
}

.aviso {
  color: var(--sucesso-texto);
  background: var(--sucesso-fundo);
}

/* --- MFA ------------------------------------------------------------------------------- */

.qrcode svg {
  display: block;
  width: 14rem;
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  background: #fff;
}

code {
  font-size: 1.0625rem;
  letter-spacing: 0.05em;
  word-break: break-all;
}

/* --- Rodapé ------------------------------------------------------------------------------ */

.rodape {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
  color: var(--texto-suave);
}

/* --- Preferências do usuário -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .botao,
  button {
    border: 2px solid ButtonText;
  }
}

.suave-topo {
  opacity: 0.92;
}

/* --- Cadastros: cabeçalho, filtros, tabelas, ações ------------------------------------------ */

.cabecalho-pagina {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.cabecalho-pagina h1 {
  margin: 0;
}

.cabecalho-pagina .botao {
  margin-top: 0;
}

.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  margin: 1rem 0;
}

.filtros > div {
  flex: 1 1 12rem;
}

.filtros button,
.filtros .opcao {
  margin-top: 0;
}

/* Botão do filtro com a altura dos campos (3rem), alinhado embaixo. */
.filtros button,
.filtros .botao {
  min-height: 3rem;
  padding-block: 0.5rem;
}

.tabela-rolavel {
  overflow-x: auto;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  background: var(--superficie);
  font-variant-numeric: tabular-nums;
}

/* Botões dentro da tabela alinham com o texto da linha (sem a margem dos formulários). */
.tabela .botao,
.tabela button {
  margin-top: 0;
}

.tabela .acoes {
  gap: 0.5rem;
}

/* Lista de atendimentos: data/hora e telefone não quebram quando a coluna dos botões cresce
   (ex.: depois de "Chegou" aparecem três botões); quem quebra são os botões. */
.lista-atendimentos .tabela tbody th,
.lista-atendimentos .tabela td[data-rotulo="Telefone"] {
  white-space: nowrap;
}

/* Coluna dos botões com largura fixa: com "Chegou" + "Faltou" ou com três botões, as outras
   colunas não se mexem (o terceiro botão desce para a linha de baixo). */
@media screen and (min-width: 40.01rem) {
  .lista-atendimentos .coluna-registrar {
    width: 18rem;
  }
}

.tabela th,
.tabela td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--linha);
  text-align: left;
  vertical-align: top;
}

.tabela thead th {
  background: var(--fundo);
  border-bottom: 2px solid var(--borda);
}

.tabela tbody th {
  font-weight: 600;
}

/* Lista de atendimentos no celular: cada linha vira um cartão (sem rolar de lado).
   Só na tela: a impressão continua em tabela. */
@media screen and (max-width: 40rem) {
  .tabela--cartoes thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .tabela--cartoes,
  .tabela--cartoes tbody,
  .tabela--cartoes tr,
  .tabela--cartoes th,
  .tabela--cartoes td {
    display: block;
  }

  .tabela--cartoes {
    background: none;
  }

  .tabela--cartoes tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--superficie);
    border: 1px solid var(--linha);
    border-radius: var(--raio);
  }

  .tabela--cartoes th,
  .tabela--cartoes td {
    padding: 0.25rem 0;
    border: 0;
  }

  .tabela--cartoes td[data-rotulo]::before {
    content: attr(data-rotulo) ": ";
    color: var(--texto-suave);
  }
}

.etiqueta {
  display: inline-block;
  padding: 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primaria-escura);
  border: 1px solid var(--primaria-escura);
  border-radius: var(--raio);
}

.etiqueta--inativo,
.etiqueta--lotado {
  color: var(--erro-texto);
  border-color: var(--erro-texto);
}

.vagas .etiqueta {
  margin: 0 0.25rem 0.25rem 0;
}

.campo {
  margin-bottom: 0.25rem;
}

.campo--erro input,
.campo--erro select,
.campo--erro textarea {
  border-color: var(--erro-texto);
}

.ajuda {
  margin: 0.35rem 0 0;
  color: var(--texto-suave);
}

.erro-campo p {
  margin: 0.35rem 0 0;
  color: var(--erro-texto);
  font-weight: 600;
}

fieldset {
  margin: 1rem 0 0;
  padding: 0.5rem 1rem 0.75rem;
  border: 2px solid var(--borda);
  border-radius: var(--raio);
}

legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

/* Dentro de um cartão, o grupo vira uma seção com linha em cima (sem caixa dentro de caixa). */
.cartao fieldset {
  margin-top: 1.5rem;
  padding: 0.25rem 0 0;
  border: 0;
  border-top: 1px solid var(--linha);
  border-radius: 0;
}

.cartao legend {
  padding: 0 0.5rem 0 0;
}

/* Grupo dentro de grupo (ex.: dias da semana de cada faixa): só o rótulo, sem outra linha. */
.cartao fieldset fieldset {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: 0;
}

.opcao {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-weight: 400;
  min-height: 2.75rem;
}

.opcao input {
  width: 1.4rem;
  min-height: 1.4rem;
  height: 1.4rem;
  margin: 0;
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.acoes form {
  margin: 0;
}

.botao--perigo {
  color: var(--texto-na-primaria);
  background: var(--erro-texto);
  border-color: var(--erro-texto);
}

.botao--perigo:hover {
  background: #6b1515;
  border-color: #6b1515;
}

button.botao--secundario:hover {
  color: var(--texto-na-primaria);
}

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

.aviso--atencao {
  color: var(--atencao-texto);
  background: var(--atencao-fundo);
}

.faixa {
  margin-top: 1rem;
}

.faixa .opcao {
  display: inline-flex;
  margin-right: 1rem;
}

.faixa__horas {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.faixa__horas > .campo {
  flex: 1 1 10rem;
}

.lista-links li {
  margin: 0.5rem 0;
}

/* --- Marcação ------------------------------------------------------------------------------ */

.passos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0;
  list-style: none;
}

.passos [aria-current="step"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.horarios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.horarios .botao {
  margin-top: 0;
}

.resumo {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
}

.resumo dt {
  font-weight: 700;
}

.resumo dd {
  margin: 0;
}

.resumo-telefone__texto {
  font-size: 1.25rem;
  line-height: 1.6;
}


/* --- Calendário (T-22) --------------------------------------------------------------------- */

.calendario-e-painel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* Visão Dia: painel de marcação ao lado. Visão Semana: o calendário usa a largura
   toda (7 colunas) e o painel fica embaixo (o foco vai para ele ao clicar em "Livre"). */
@media (min-width: 64rem) {
  .calendario-e-painel:not(.calendario-e-painel--semana) {
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }
}

/* Uma linha da grade = um atendimento (calendario.js): alta o bastante para a hora,
   o ícone da situação e o nome, e para o toque (44 px). */
.calendario .fc-timegrid-slot {
  height: 2.75rem;
}

/* Hora e nome na mesma linha; o que não couber termina em "…" (o nome inteiro está
   no aria-label e na lista abaixo). Fonte ≥ 16 px (RNF-04). */
.calendario .fc-timegrid-event .fc-event-main {
  padding: 0.15rem 0.35rem;
  font-size: 1rem;
  line-height: 1.3;
}

.calendario .fc-timegrid-event .fc-event-main-frame {
  flex-direction: row;
  align-items: baseline;
  gap: 0.35rem;
}

.calendario .fc-timegrid-event .fc-event-time {
  flex: none;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.calendario .fc-timegrid-event .fc-event-main-frame,
.calendario .fc-timegrid-event .fc-event-title-container {
  min-width: 0;
  overflow: hidden;
}

.calendario .fc-timegrid-event .fc-event-title-container {
  flex: 1 1 auto;
}

.calendario .fc-timegrid-event .fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botões e destaque de "hoje" do FullCalendar nas cores da marca. */
.calendario.fc {
  --fc-button-text-color: var(--texto-na-primaria);
  --fc-button-bg-color: var(--primaria);
  --fc-button-border-color: var(--primaria);
  --fc-button-hover-bg-color: var(--primaria-escura);
  --fc-button-hover-border-color: var(--primaria-escura);
  --fc-button-active-bg-color: var(--primaria-escura);
  --fc-button-active-border-color: var(--cor-limao);
  --fc-today-bg-color: var(--hoje-fundo);
  --fc-border-color: var(--linha);
}

/* "Hoje" desabilitado (já está em hoje): contorno em vez de cinza apagado. */
.calendario .fc-button:disabled {
  color: var(--texto-suave);
  background: var(--superficie);
  border-color: var(--linha);
  opacity: 1;
}

.calendario .fc-button-active {
  box-shadow: inset 0 -3px 0 var(--cor-limao);
}

.calendario .fc-toolbar-title {
  font-size: 1.5rem;
}

@media (max-width: 40rem) {
  /* Barra do calendário em duas linhas: o período em cima, os botões embaixo. */
  .calendario .fc-header-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .calendario .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
    order: -1;
    flex-basis: 100%;
  }

  .calendario .fc-toolbar-title {
    font-size: 1.25rem;
  }

  /* Semana no celular: rola de lado só dentro do calendário, não a página. */
  .calendario {
    overflow-x: auto;
  }

  .calendario .fc-view-harness:has(.fc-timeGridWeek-view) {
    min-width: 42rem;
  }
}

.calendario {
  background: var(--superficie);
  padding: 0.5rem;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  /* A fonte do FullCalendar segue a da página (≥ 16 px, RNF-04). */
  font-size: 1rem;
}

.calendario .fc-button {
  min-height: 2.75rem;
  margin-top: 0;
  font-weight: 700;
}

.painel {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 1rem;
}

.painel:empty {
  display: none;
}

.evento {
  cursor: pointer;
}

.evento--agendado,
.calendario .evento--agendado {
  color: var(--agendado-texto);
  background: var(--agendado-fundo);
  border-color: var(--agendado-fundo);
}

.evento--aguardando,
.calendario .evento--aguardando {
  color: var(--aguardando-texto);
  background: var(--aguardando-fundo);
  border-color: var(--aguardando-texto);
}

.evento--em_atendimento,
.calendario .evento--em_atendimento {
  color: var(--em-atendimento-texto);
  background: var(--em-atendimento-fundo);
  border-color: var(--em-atendimento-texto);
}

.evento--encerrado,
.calendario .evento--encerrado {
  color: var(--encerrado-texto);
  background: var(--encerrado-fundo);
  border-color: var(--encerrado-fundo);
}

.evento--faltou,
.calendario .evento--faltou {
  color: var(--faltou-texto);
  background: var(--faltou-fundo);
  border-color: var(--faltou-fundo);
}

.evento--livre,
.calendario .evento--livre {
  color: var(--livre-texto);
  background: var(--livre-fundo);
  border: 1px dashed var(--livre-texto);
}

.calendario .evento .fc-event-main {
  color: inherit;
}

.calendario .evento--bloqueio,
.calendario .evento--feriado {
  background: var(--bloqueio-fundo);
  opacity: 0.9;
}

/* Reserva (T-75, US-37): cinza, tracejado, com o texto "Reserva" (não só a cor). */
.evento--reserva,
.calendario .evento--reserva,
.horario--reserva {
  color: var(--reserva-texto);
  background: var(--reserva-fundo);
  border: 1px dashed var(--reserva-texto);
}

/* Almoço (T-74): cor própria, diferente de bloqueio e feriado; texto com contraste AA. */
.calendario .evento--almoco,
.legenda__item.evento--almoco {
  color: var(--almoco-texto);
  background: var(--almoco-fundo);
  opacity: 1;
}

.calendario .evento--almoco .fc-event-title {
  color: var(--almoco-texto);
  font-style: normal;
}

.legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.legenda__item {
  padding: 0 0.5rem;
  border-radius: var(--raio);
}


/* --- Dashboard (T-29) ------------------------------------------------------------------------- */

.indicadores .cartao {
  padding: 1rem;
}

.indicadores {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  margin: 1rem 0 0;
}

/* Celular: dois por linha; o último de um grupo ímpar ocupa a linha toda. */
@media (max-width: 40rem) {
  .indicadores .cartao:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.indicador__valor {
  font-variant-numeric: tabular-nums;
}

.indicador__rotulo {
  margin: 0;
  color: var(--texto-suave);
  font-weight: 600;
}

.indicador__valor {
  margin: 0.25rem 0 0;
  font-size: 2rem;
  font-weight: 700;
}

.barra {
  display: block;
  width: 100%;
  min-width: 6rem;
  height: 0.75rem;
  accent-color: var(--primaria);
}


/* --- Marca: botões de confirmação em Limão (texto Petróleo, 9:1) ------------------------- */

.botao--confirmar,
button.botao--confirmar {
  color: var(--texto-no-destaque);
  background: var(--destaque);
  border-color: var(--destaque);
}

.botao--confirmar:hover,
button.botao--confirmar:hover {
  color: var(--texto-na-primaria);
  background: var(--primaria);
  border-color: var(--primaria);
}

/* Logomarca do sindicato no topo, ao lado do Agendei (PRD v1.3, US-28): selo branco. */
.topo__cliente {
  max-height: 2.5rem;
  max-width: 9rem;
  padding: 0.15rem 0.35rem;
  background: #ffffff;
  border-radius: var(--raio);
  object-fit: contain;
}

/*
 * Ctrl+P em qualquer tela: sem topo, menu, rodapé e botões. Na agenda, sai só a
 * lista de atendimentos (a folha completa, com anotações, é "Imprimir agenda do dia").
 */
.so-impressao {
  display: none;
}

.dashboard__logomarca {
  max-height: 18mm;
  max-width: 60mm;
  object-fit: contain;
}

@media print {
  .so-impressao {
    display: block;
  }

  .barra {
    display: none;
  }

  .pular,
  .topo,
  .rodape,
  .nao-imprimir,
  .calendario-e-painel,
  .legenda,
  .vagas,
  nav.acoes,
  .cabecalho-pagina .botao,
  main > [role="status"] {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .lista-atendimentos .tabela {
    font-size: 11pt;
  }

  .lista-atendimentos .etiqueta {
    color: #000000;
    background: none;
    border: 1px solid #000000;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}


/* --- Agenda do Presidente (T-81) ---------------------------------------------------------- */

.previa-mensagem {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  padding: 0.75rem 1rem;
  border-radius: var(--raio);
  background: var(--bloqueio-fundo);
}
