/* Púlpito · apresentações da Millenium
   Identidade: o preto e branco da Millenium, o quadrado de cantos arredondados do monograma
   e a dupla de letras da marca (caixa-alta larga e pesada + caixa-alta fina espaçada).
   Uma só cor de destaque, o vermelho de "no ar" das mesas de corte: só aparece quando algo está no telão. */

:root {
  color-scheme: dark;
  --fundo: oklch(0.155 0.004 270);
  --fundo-2: oklch(0.19 0.005 270);
  --fundo-3: oklch(0.235 0.006 270);
  --fundo-4: oklch(0.28 0.007 270);
  --linha: oklch(0.31 0.006 270);
  --linha-forte: oklch(0.42 0.007 270);
  --texto: oklch(0.975 0.002 270);
  --texto-2: oklch(0.82 0.006 270);
  --texto-3: oklch(0.7 0.008 270);
  --vivo: oklch(0.63 0.215 27);
  --vivo-escuro: oklch(0.52 0.19 27);
  --vivo-fundo: oklch(0.27 0.075 27);
  --ok: oklch(0.8 0.15 155);
  --alerta: oklch(0.85 0.14 85);
  --erro: oklch(0.74 0.16 25);

  --r1: 8px;
  --r2: 12px;
  --r3: 18px;
  --sombra: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 18px 50px -20px oklch(0 0 0 / 0.7);
  --sai: cubic-bezier(0.22, 1, 0.36, 1);
  --fonte: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* camadas */
  --z-cabecalho: 10;
  --z-solte: 20;
  --z-aviso: 40;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fundo);
  color: var(--texto);
  font: 400 1.0625rem/1.5 var(--fonte);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
[hidden] { display: none !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
fieldset:disabled .escolha { opacity: 0.55; cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; border-radius: 4px; }
::selection { background: oklch(0.975 0.002 270 / 0.25); }

.so-leitor {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- marca ---------- */

.simbolo { width: 32px; height: 32px; flex: none; }
/* o P desenhado como o M da Millenium: letra em colchete com pé inclinado e a cruz no vazio */
.simbolo .quadro { fill: var(--texto); }
.simbolo .letra { fill: var(--fundo); }
.simbolo .cruz { stroke: var(--fundo); }

/* assinatura no mesmo arranjo da marca Millenium: símbolo + nome largo e espaçado + três verbos finos */
.assinatura { display: flex; align-items: center; gap: 16px; font-size: clamp(2rem, 9vw, 2.5rem); }
.assinatura-texto { display: grid; gap: 0.2em; }
.assinatura .nome {
  font-stretch: 125%;
  font-weight: 900;
  font-size: 1em;
  letter-spacing: 0.16em;
  margin-right: -0.16em; /* o espaço depois da última letra não conta na largura */
  line-height: 0.8;
  text-transform: uppercase;
}
.lema-marca {
  display: flex; justify-content: space-between; gap: 0.3em;
  font-stretch: 125%; font-weight: 300; font-size: 0.34em; letter-spacing: 0.025em; line-height: 1;
  text-transform: uppercase; color: var(--texto-2);
}

.marca-pequena {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-stretch: 125%; font-weight: 900; font-size: 1rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.marca-pequena .simbolo { width: 28px; height: 28px; }

/* ---------- botões ---------- */

.botao {
  --b-fundo: var(--fundo-3);
  --b-texto: var(--texto);
  --b-linha: var(--linha);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--b-linha); border-radius: var(--r2);
  background: var(--b-fundo); color: var(--b-texto);
  font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms var(--sai), border-color 160ms var(--sai), transform 120ms var(--sai), opacity 160ms;
}
.botao:hover { --b-fundo: var(--fundo-4); --b-linha: var(--linha-forte); }
.botao:active { transform: scale(0.97); }
.botao:disabled, .botao[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.botao svg { width: 18px; height: 18px; flex: none; }

.botao.principal { --b-fundo: var(--texto); --b-texto: var(--fundo); --b-linha: var(--texto); }
.botao.principal:hover { --b-fundo: oklch(0.88 0.004 270); --b-linha: oklch(0.88 0.004 270); }
.botao.vivo { --b-fundo: var(--vivo-escuro); --b-texto: #fff; --b-linha: var(--vivo-escuro); }
.botao.vivo:hover { --b-fundo: oklch(0.56 0.2 27); --b-linha: oklch(0.56 0.2 27); }
.botao.perigo { --b-fundo: transparent; --b-texto: var(--erro); --b-linha: oklch(0.74 0.16 25 / 0.45); }
.botao.perigo:hover { --b-fundo: oklch(0.74 0.16 25 / 0.12); --b-linha: var(--erro); }
.botao.perigo-cheio { --b-fundo: oklch(0.55 0.19 25); --b-texto: #fff; --b-linha: oklch(0.55 0.19 25); }
.botao.fantasma { --b-fundo: transparent; --b-linha: transparent; }
.botao.fantasma:hover { --b-fundo: var(--fundo-3); --b-linha: transparent; }
.botao.grande { min-height: 52px; padding: 0 22px; font-size: 1rem; border-radius: 14px; }
.botao.icone { width: 44px; padding: 0; }
.botao.largo { width: 100%; }

.botao .girando { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar 700ms linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- campos ---------- */

.campo { display: grid; gap: 8px; }
.campo label, .campo .rotulo { font-weight: 600; font-size: 0.9375rem; color: var(--texto); }
.campo .ajuda { font-size: 0.875rem; color: var(--texto-3); }
.entrada {
  width: 100%; min-height: 50px; padding: 0 14px;
  background: var(--fundo); color: var(--texto);
  border: 1px solid var(--linha-forte); border-radius: var(--r2);
  font-size: 1.0625rem;
  transition: border-color 160ms var(--sai), box-shadow 160ms var(--sai);
}
.entrada::placeholder { color: var(--texto-3); }
.entrada:hover { border-color: oklch(0.52 0.007 270); }
.entrada:focus { outline: none; border-color: var(--texto); box-shadow: 0 0 0 3px oklch(0.975 0.002 270 / 0.16); }
.entrada[aria-invalid="true"] { border-color: var(--erro); }
.campo .msg-erro { font-size: 0.875rem; color: var(--erro); display: flex; gap: 6px; align-items: flex-start; }
.campo-senha { position: relative; }
.campo-senha .entrada { padding-right: 52px; }
.campo-senha .ver { position: absolute; right: 3px; top: 3px; width: 44px; min-height: 44px; }

.aviso-form {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r2);
  background: oklch(0.74 0.16 25 / 0.1); border: 1px solid oklch(0.74 0.16 25 / 0.35);
  color: oklch(0.88 0.06 25); font-size: 0.9375rem;
}
.aviso-form svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--erro); }

/* escolha em botões (papéis, abas) */
.escolhas { display: grid; gap: 8px; }
.escolha {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--linha); border-radius: var(--r2);
  cursor: pointer; transition: border-color 160ms, background-color 160ms;
}
.escolha:hover { border-color: var(--linha-forte); }
.escolha:has(input:checked) { border-color: var(--texto); background: var(--fundo-3); }
.escolha input { grid-row: span 2; margin: 3px 0 0; accent-color: var(--texto); width: 18px; height: 18px; }
.escolha strong { font-weight: 600; }
.escolha span { font-size: 0.875rem; color: var(--texto-3); }

.abas { display: inline-flex; padding: 4px; gap: 4px; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 14px; }
.aba {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent;
  color: var(--texto-2); font-weight: 600; font-size: 0.9375rem; cursor: pointer;
  transition: background-color 160ms, color 160ms;
}
.aba:hover { color: var(--texto); }
.aba[aria-selected="true"] { background: var(--fundo-4); color: var(--texto); }

/* ---------- etiquetas ---------- */

.selo {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: var(--fundo-3); color: var(--texto-2); border: 1px solid var(--linha);
}
.selo.vivo { background: var(--vivo-fundo); color: oklch(0.93 0.04 27); border-color: oklch(0.63 0.215 27 / 0.5); }
.selo.vivo::before, .ponto-vivo::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vivo);
  box-shadow: 0 0 0 0 oklch(0.63 0.215 27 / 0.6); animation: pulsar 1.8s var(--sai) infinite;
}
.ponto-vivo { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: oklch(0.9 0.06 27); }
.selo.ok { color: var(--ok); }
.selo.alerta { color: var(--alerta); }
@keyframes pulsar { 0% { box-shadow: 0 0 0 0 oklch(0.63 0.215 27 / 0.55); } 70%, 100% { box-shadow: 0 0 0 7px oklch(0.63 0.215 27 / 0); } }

/* ---------- cabeçalho do app ---------- */

.cabecalho {
  position: sticky; top: 0; z-index: var(--z-cabecalho);
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: oklch(0.155 0.004 270 / 0.88);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--linha);
}
.cabecalho .espaco { flex: 1; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--fundo-3); border: 1px solid var(--linha); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.02em;
  cursor: pointer; transition: border-color 160ms;
}
.avatar:hover { border-color: var(--linha-forte); }

/* menu suspenso nativo (popover) */
.menu[popover] {
  margin: 0; inset: auto; position: fixed;
  min-width: 240px; padding: 6px; border-radius: 14px;
  background: var(--fundo-2); color: var(--texto); border: 1px solid var(--linha-forte);
  box-shadow: var(--sombra);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right;
  transition: opacity 160ms var(--sai), transform 160ms var(--sai), overlay 160ms allow-discrete, display 160ms allow-discrete;
}
.menu[popover]:popover-open { opacity: 1; transform: none; }
@starting-style { .menu[popover]:popover-open { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu .quem { padding: 10px 12px 12px; border-bottom: 1px solid var(--linha); margin-bottom: 6px; }
.menu .quem strong { display: block; }
.menu .quem span { font-size: 0.875rem; color: var(--texto-3); word-break: break-all; }
.menu .item {
  display: flex; width: 100%; align-items: center; gap: 10px;
  min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  text-align: left; text-decoration: none; font-size: 0.9375rem; cursor: pointer;
}
.menu .item:hover, .menu .item:focus-visible { background: var(--fundo-3); outline: none; }
.menu .item svg { width: 18px; height: 18px; color: var(--texto-3); }
.menu .item.perigo { color: var(--erro); }
.menu .item.perigo svg { color: var(--erro); }
.menu hr { border: 0; border-top: 1px solid var(--linha); margin: 6px 0; }

/* ---------- ver como (só o superadmin) ---------- */

.segmentos { display: flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--fundo); border: 1px solid var(--linha); }
.segmentos button {
  flex: 1; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--texto-2); font-weight: 600; font-size: 0.875rem; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms, color 160ms;
}
.segmentos button:hover { color: var(--texto); background: var(--fundo-3); }
.segmentos button[aria-pressed="true"] { background: var(--texto); color: var(--fundo); cursor: default; }
.menu .ver-como { display: grid; gap: 8px; padding: 8px 6px 10px; border-bottom: 1px solid var(--linha); margin-bottom: 6px; }
.menu .ver-como > span { padding: 0 6px; font-size: 0.8125rem; font-weight: 600; color: var(--texto-3); }

/* a faixa lembra que a tela está "vendo como" outro papel */
.cabecalho { flex-wrap: wrap; }
.faixa-ver-como {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 2px 0 -2px; padding: 8px 8px 8px 12px; border-radius: var(--r2);
  background: oklch(0.85 0.14 85 / 0.1); border: 1px solid oklch(0.85 0.14 85 / 0.35);
}
.faixa-texto { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; font-size: 0.9375rem; color: var(--texto-2); }
.faixa-texto svg { width: 18px; height: 18px; flex: none; color: var(--alerta); }
.faixa-texto strong { color: var(--texto); }
.faixa-ver-como .segmentos { background: oklch(0.155 0.004 270 / 0.6); }
.botao.pequeno { min-height: 36px; padding: 0 12px; font-size: 0.875rem; border-radius: 9px; }
/* no celular a faixa fica numa linha só; trocar de papel fica no menu da conta */
@media (max-width: 600px) {
  .faixa-nota, .faixa-ver-como .segmentos { display: none; }
}

/* ---------- página ---------- */

.pagina { width: min(1080px, 100%); margin: 0 auto; padding: 28px 16px 96px; }
.topo-pagina { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topo-pagina h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
.topo-pagina p { color: var(--texto-3); margin-top: 6px; font-size: 0.9375rem; }

/* ---------- rodapé ---------- */

.rodape {
  border-top: 1px solid var(--linha);
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
  color: var(--texto-3); font-size: 0.875rem;
}
.rodape-assina { width: min(1048px, 100%); margin: 0 auto; display: flex; align-items: center; gap: 10px; } /* alinhado ao conteúdo da .pagina */
.rodape-assina .simbolo { width: 20px; height: 20px; }

/* ---------- caixas de diálogo ---------- */

dialog.caixa {
  width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--linha-forte); border-radius: var(--r3);
  background: var(--fundo-2); color: var(--texto); box-shadow: var(--sombra);
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 200ms var(--sai), transform 200ms var(--sai), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.caixa[open] { opacity: 1; transform: none; }
@starting-style { dialog.caixa[open] { opacity: 0; transform: translateY(8px) scale(0.98); } }
dialog.caixa::backdrop { background: oklch(0.1 0.004 270 / 0.72); transition: opacity 200ms; }
.caixa form, .caixa .corpo { display: grid; gap: 18px; padding: 24px; }
.caixa h2 { font-size: 1.25rem; }
.caixa .texto { color: var(--texto-2); }
.caixa .acoes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ---------- avisos rápidos ---------- */

.avisos {
  position: fixed; z-index: var(--z-aviso); left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  translate: -50% 0; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none;
}
.aviso {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px;
  background: var(--texto); color: var(--fundo); font-weight: 600; font-size: 0.9375rem;
  box-shadow: var(--sombra); pointer-events: auto;
  animation: entrar-aviso 260ms var(--sai);
}
.aviso.erro { background: oklch(0.55 0.19 25); color: #fff; }
.aviso svg { width: 18px; height: 18px; flex: none; }
@keyframes entrar-aviso { from { opacity: 0; transform: translateY(10px); } }

/* ---------- utilidades ---------- */

kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 5px; text-align: center;
  border: 1px solid var(--linha-forte); border-bottom-width: 2px; font: 600 0.75rem/1.5 var(--fonte); color: var(--texto);
}

.linha-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mudo { color: var(--texto-3); }
.numeros { font-variant-numeric: tabular-nums; }
.esqueleto { background: linear-gradient(90deg, var(--fundo-2), var(--fundo-3), var(--fundo-2)); background-size: 200% 100%; animation: brilho 1.4s linear infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* passar sozinho: caixas de marcar e atalhos de tempo */
.opcao { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; }
.opcao input { width: 22px; height: 22px; flex: none; accent-color: var(--texto); cursor: pointer; }
.auto-campos { border: 0; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.auto-campos:disabled { opacity: 0.45; }
.atalhos-seg { display: flex; flex-wrap: wrap; gap: 8px; }
