/* =====================================================
   Kit visual Meta CS v1.0 — padrão oficial desde 18/10/2026

   Os tokens do kit entram como vieram (kit/tokens.css e kit/tokens-dark.css),
   para poderem ser atualizados por cópia quando o kit mudar. Abaixo, os nomes
   que as 16 páginas já usam (--cor-p, --cor-bg…) viram apelidos dos tokens do
   kit. Assim a troca de identidade acontece num lugar só, e nenhuma página
   precisou ser reescrita para o tema mudar.

   O tema escuro não aparece aqui: o kit redefine os --color-* dele em
   :root[data-theme="dark"], e como estes apelidos são var(), seguem junto.
   Só o que o kit não cobre (sidebar e bordas semânticas) tem bloco próprio.
   ===================================================== */
@import url("kit/tokens.css");
@import url("kit/tokens-dark.css");

/* --- Geist, a fonte do kit, servida pelo próprio Hosting --- */
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Regular.ttf')  format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Medium.ttf')   format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Bold.ttf')     format('truetype'); font-weight: 700; font-display: swap; }

:root {
  /* ── Marca ──────────────────────────────────────────
     O roxo #534AB7 saiu em 19/10/2026; a primária do ecossistema é o azul
     institucional. --cor-p-btn existe porque no tema escuro o kit separa as
     duas coisas: o azul que se lê como texto não é o azul que serve de fundo
     de botão. No tema claro os dois coincidem, e o fallback resolve. */
  --cor-p:        var(--color-accent);
  --cor-p-btn:    var(--color-button-primary, var(--color-accent));
  --cor-p-dark:   var(--color-accent-hover);
  --cor-p-txt:    var(--color-text-on-brand);
  --cor-p-light:  var(--color-accent-subtle);
  --cor-p-bg:     var(--color-accent-light);

  /* ── Planos de fundo ──────────────────────────────── */
  --cor-bg:       var(--color-bg);
  --cor-surface:  var(--color-surface);
  --cor-surface2: var(--slate-50);
  --cor-surface3: var(--slate-100);

  /* ── Bordas ───────────────────────────────────────── */
  --cor-borda:    var(--color-border);
  --cor-borda2:   var(--color-border-light);

  /* ── Textos ───────────────────────────────────────── */
  --cor-txt:      var(--color-text-primary);
  --cor-txt2:     var(--color-text-secondary);
  --cor-txt3:     var(--color-text-muted);
  --cor-txt4:     var(--slate-400);

  /* ── Menu lateral ───────────────────────────────────
     O kit pede o azul da marca, item ativo em fundo branco com texto azul e
     uma barra branca na borda. A largura de 230px e a estrutura continuam;
     a sidebar de 72px que abre ao passar o mouse é a etapa 2. */
  --sb-bg:              var(--color-brand-surface);
  --sb-txt:             rgba(255,255,255,0.75);
  --sb-label:           rgba(255,255,255,0.5);
  --sb-hover:           rgba(255,255,255,0.09);
  --sb-hover-txt:       #ffffff;
  --sb-active-bg:       #ffffff;
  --sb-active-txt:      var(--color-accent);
  --sb-active-border:   #ffffff;
  --sb-divider:         rgba(255,255,255,0.14);
  --sb-header-txt:      #ffffff;
  --sb-avatar-bg:       rgba(255,255,255,0.18);

  /* ── Semânticos ─────────────────────────────────────
     Cada estado continua sendo um par: a cor do texto e a da tarja. O kit já
     publica os dois (-dark para o texto, -light para a tarja) com contraste
     conferido, e é dele que saem agora. A borda da tarja o kit não traz —
     fica a cor base, que é o tom do meio entre as duas. */
  --cor-erro:     var(--color-danger-dark);
  --cor-erro-bg:  var(--color-danger-light);
  --cor-erro-bd:  var(--color-danger);
  --cor-ok:       var(--color-success-dark);
  --cor-ok-bg:    var(--color-success-light);
  --cor-ok-bd:    var(--color-success);
  --cor-aviso:    var(--color-warning-dark);
  --cor-aviso-bg: var(--color-warning-light);
  --cor-aviso-bd: var(--color-warning);
  --cor-info:     var(--color-info-dark);
  --cor-info-bg:  var(--color-info-light);
  --cor-info-bd:  var(--color-info);

  /* ── Raio e elevação do kit, com os nomes daqui ───── */
  --raio-badge:   var(--radius-sm);
  --raio-campo:   var(--radius-md);
  --raio-painel:  var(--radius-lg);
  --raio-modal:   var(--radius-xl);
}

/* ── Tema Escuro ─────────────────────────────────────
   Só o que o kit não cobre. O resto vem de kit/tokens-dark.css.
   Os temas Azul Técnico e Terroso foram aposentados em 19/10/2026: o kit
   prevê dois temas, e quem tivesse um deles salvo cai no claro sozinho —
   aplicarTema() já resolve o nome e regrava (ver js/tema.js). */
[data-theme="dark"] {
  --sb-bg:            var(--color-brand-surface);
  --sb-active-bg:     rgba(255,255,255,0.14);
  --sb-active-txt:    #ffffff;
  --sb-active-border: var(--color-accent);
  --sb-avatar-bg:     rgba(255,255,255,0.14);
  --sb-divider:       var(--color-border);
}

/* =====================================================
   RH Hub — Estilos Globais
   Usado em todas as páginas do sistema
   ===================================================== */

/* --- Reset básico: remove margens e paddings padrão do navegador --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* faz o padding não "empurrar" o tamanho dos elementos */
}

/* --- Fonte e cor base do sistema --- */
body {
  font-family: var(--font-sans);
  background-color: var(--cor-bg);
  color: var(--cor-txt);
  font-size: 14px;
  line-height: 1.5;
  /* Os três ajustes que o resto do ecossistema usa e aqui faltavam — é o que
     fazia a Geist "parecer outra fonte" ao lado do Checklist. cv11 e ss01
     trocam o desenho de algumas letras (o a e o g, entre outras) e o
     antialiasing afina o traço nas telas comuns. */
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   TELA DE LOGIN
   ===================================================== */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; /* ocupa a altura toda da tela */
  background: linear-gradient(135deg, var(--color-brand-surface) 0%, #004a8f 55%, #003a73 100%);
}

.login-box {
  background: var(--cor-surface);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 600;
  color: var(--cor-txt);
}

.login-logo p {
  font-size: 13px;
  color: var(--cor-txt3);
  margin-top: 4px;
}

/* --- Campos de formulário --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--cor-txt2);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--cor-borda);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--cor-txt);
  background: var(--cor-surface2);
  transition: all 0.2s;
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Caixas de marcacao nao sao campos de texto: a regra acima as esticava. */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  box-shadow: none;
  border-radius: 3px;
  accent-color: var(--cor-p);
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--cor-p);
  background: var(--cor-surface);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--cor-p) 13%, transparent), 0 1px 2px rgba(0,0,0,.04);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* --- Mensagem de erro no login --- */
.error-msg {
  background: var(--cor-erro-bg);
  border: 1px solid var(--cor-erro-bd);
  color: var(--cor-erro);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none; /* fica escondido até ter erro */
}

/* =====================================================
   BOTÕES
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--raio-campo);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.18s;
  text-decoration: none;
  letter-spacing: .01em;
}

/* Botão principal (roxo) */
/* O fundo sai de --cor-p-btn, nao de --cor-p: no tema escuro o kit separa o
   azul que se le como texto do azul que serve de fundo de botao. */
.btn-primary {
  background: var(--cor-p-btn);
  color: var(--cor-p-txt);
  border-color: var(--cor-p-btn);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--cor-p-dark);
  border-color: var(--cor-p-dark);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

/* Login — botão primário ocupa toda a largura */
.login-box .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

/* Botão secundário (contorno) */
.btn-secondary {
  background: var(--cor-surface);
  color: var(--cor-txt2);
  border-color: var(--cor-borda);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

.btn-secondary:hover {
  background: var(--cor-surface2);
  border-color: var(--cor-borda);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* Botão de perigo (vermelho) */
.btn-danger {
  background: var(--cor-surface);
  color: var(--cor-erro);
  border-color: var(--cor-erro-bd);
  box-shadow: var(--shadow-xs);
}

.btn-danger:hover {
  background: var(--cor-erro-bg);
  border-color: var(--cor-erro);
}

/* Botão de desligamento (âmbar) */
.btn-desligar {
  background: var(--cor-surface);
  color: var(--cor-aviso);
  border: 1.5px solid var(--cor-aviso-bd);
  box-shadow: 0 1px 2px rgba(217,119,6,.07);
}

.btn-desligar:hover:not(:disabled) {
  background: var(--cor-aviso-bg);
  border-color: var(--cor-aviso);
}

.btn-desligar:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Botão pequeno */
.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 7px;
}

/* Botão em estado de carregando */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* =====================================================
   LAYOUT COM SIDEBAR (usado no dashboard e outras páginas)
   ===================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Barra lateral --- */
/* Menu do kit: 72px recolhido, 256px ao passar o mouse ou receber foco pelo
   teclado. Abre POR CIMA do conteúdo — por isso o conteúdo reserva só os
   72px. O atraso evita que ele abra de passagem: 120ms para abrir, 180ms
   para fechar, que é o que o kit pede. */
.sidebar {
  width: 72px;
  min-width: 72px;
  background: var(--sb-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: var(--z-sidebar, 40);
  border-radius: 0 var(--radius-shell) var(--radius-shell) 0;
  transition: width var(--duration-base) var(--ease-out) .18s,
              box-shadow var(--duration-base) var(--ease-out) .18s;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { width: 0; }

/* Com o menu fixo o conteúdo recua: aberto por escolha, ele ocupa espaço em
   vez de passar por cima. Ao passar o mouse continua passando por cima. */
html.menu-fixado .main-content { margin-left: 256px; }

.sidebar:hover,
.sidebar:focus-within,
html.menu-fixado .sidebar {
  width: 256px;
  box-shadow: var(--shadow-brand);
  transition-delay: .12s;
}

/* Botão de fixar: quem usa o menu o tempo todo não quer depender do mouse. */
.sb-fixar {
  position: absolute;
  top: 18px; right: 12px;
  width: 28px; height: 28px;
  border: 0; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out), background var(--duration-instant);
}
.sidebar:hover .sb-fixar,
.sidebar:focus-within .sb-fixar,
html.menu-fixado .sidebar .sb-fixar { opacity: 1; }
.sb-fixar:hover { background: rgba(255,255,255,0.22); }
html.menu-fixado .sidebar .sb-fixar { background: #fff; color: var(--cor-p); }

/* Cabeçalho do menu, no formato do resto do ecossistema: a marca, um traço e
   o nome do sistema. Com o menu estreito sobra só o símbolo, centralizado. */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--sb-divider);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-header .sb-logo    { height: 32px; width: auto; flex-shrink: 0; }
.sidebar-header .sb-simbolo { height: 32px; width: 32px; flex-shrink: 0; display: none; }
.sidebar-header .sb-div {
  width: 1px; height: 24px; flex-shrink: 0;
  background: color-mix(in srgb, #fff 25%, transparent);
}
.sidebar-header h2 {
  /* 13px e peso médio: é o nome do sistema ao lado da marca, não um título
     de página disputando atenção com ela. */
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-header-txt);
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--duration-fast) var(--ease-out);
}

/* Menu estreito: a marca inteira não cabe em 72px, então entra o símbolo. */
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header {
  justify-content: center;
  padding: 0;
}
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-logo,
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-div,
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header h2 { display: none; }
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-simbolo { display: block; }

/* --- Perfil do usuário logado na sidebar --- */
.sidebar-user {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--sb-divider);
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sb-avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  overflow: hidden;
}

.sidebar-user .user-name {
  font-size: 12px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 10px;
  color: var(--sb-label);
}

/* --- Navegação na sidebar --- */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sb-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 20px 4px;
}
/* Recolhido, o grupo vira um traço de 20px — o kit pede isso para o menu
   estreito não virar uma lista sem respiro. */
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .nav-section-label {
  font-size: 0;
  margin: 14px auto 6px;
  width: 20px;
  height: 2px;
  padding: 0;
  border-radius: 2px;
  background: var(--sb-label);
}

/* O rótulo é um nó de texto solto dentro do link, então ele some por
   font-size: 0 — o ícone recupera o seu tamanho logo abaixo. É o que
   permite recolher o menu sem reescrever o HTML das 16 páginas. */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 16px;
  margin: 0 8px 2px;
  border-radius: var(--radius-md);
  color: var(--sb-txt);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--duration-instant) var(--ease-out),
              color var(--duration-instant) var(--ease-out),
              font-size var(--duration-base) var(--ease-out) .18s;
  border-left: 3px solid transparent;
}
html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .nav-link { font-size: 0; }
.sidebar:hover .nav-link,
.sidebar:focus-within .nav-link,
html.menu-fixado .sidebar .nav-link { transition-delay: 0s, 0s, .12s; }

.nav-link:hover {
  background: var(--sb-hover);
  color: var(--sb-hover-txt);
}

/* Item ativo do kit: fundo branco, icone e texto azuis, barra branca na
   borda. No tema escuro o branco vira um veu sobre o azul (ver tokens). */
.nav-link.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-txt);
  font-weight: 600;
  border-left-color: var(--sb-active-border);
}

.nav-link .nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  /* Os ícones do kit são SVG com stroke em currentColor: herdam a cor do
     link, inclusive no item ativo e no tema escuro, sem regra própria. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link .nav-icon svg { width: 18px; height: 18px; }

/* --- Botão de sair no rodapé da sidebar --- */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sb-divider);
}

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--sb-txt);
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

/* --- Área de conteúdo principal --- */
.main-content {
  margin-left: 72px;  /* só a faixa recolhida; aberta, o menu passa por cima */
  transition: margin-left var(--duration-base) var(--ease-out);
  flex: 1;
  /* Sem isto, um filho flex não encolhe abaixo do conteúdo: uma tabela larga
     alarga a página inteira e, no celular, corta a barra inferior. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Barra superior --- */
/* Topo do kit: 64px, fundo translúcido com desfoque e sombra só depois que
   a página rola — parada no alto, a borda basta. */
.topbar {
  background: color-mix(in srgb, var(--cor-surface) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cor-borda);
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar, 30);
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.topbar.rolado { box-shadow: var(--shadow-xs); }

/* Trilha: grupo › página. Montada por js/shell.js a partir do próprio menu,
   para não precisar de um campo novo em cada página. */
.trilha {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--cor-txt3);
  min-width: 0;
}
.trilha-sep { opacity: .55; }
/* Os degraus do caminho nunca quebram; quem cede é o último, que às vezes é um
   nome de pessoa. Corta com reticências em vez de empurrar a barra inteira. */
.trilha > span { white-space: nowrap; }
.trilha-atual {
  color: var(--cor-txt);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Fora da vista, mas no documento: leitor de tela continua anunciando o h1 da
   página, que a trilha repetiria para quem enxerga. */
.so-leitor {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.topbar-esq { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cor-txt);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Conteúdo da página --- */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* =====================================================
   CARDS E MÉTRICAS
   ===================================================== */

.metrics-grid {
  display: grid;
  /* 150px: seis cards cabem numa linha a partir de ~1280px de tela */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--cor-surface);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--cor-borda);
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}

.metric-card .label {
  font-size: 12px;
  color: var(--cor-txt3);
  font-weight: 500;
}

.metric-card .value {
  font-size: 28px;
  font-weight: 600;
  color: var(--cor-txt);
  margin-top: 4px;
}

.metric-card .sublabel {
  font-size: 11px;
  color: var(--cor-txt4);
  margin-top: 2px;
}

.card {
  background: var(--cor-surface);
  border-radius: var(--raio-painel);
  border: 1px solid var(--cor-borda);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cor-txt2);
  margin-bottom: 16px;
}

/* =====================================================
   TABELA DE COLABORADORES
   ===================================================== */

.table-container {
  background: var(--cor-surface);
  border-radius: 12px;
  border: 1px solid var(--cor-borda);
  overflow: hidden; /* garante que a tabela respeite o border-radius */
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}

.table-toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cor-borda2);
  flex-wrap: wrap;
  gap: 10px;
}

.search-input {
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--cor-borda);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 260px;
  background: var(--cor-surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='6.5' cy='6.5' r='5' stroke='%239ca3af' stroke-width='1.5'/%3E%3Cpath d='M10.5 10.5l3 3' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color 0.2s;
  color: var(--cor-txt);
}

.search-input:focus {
  border-color: var(--cor-p);
  background-color: var(--cor-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--cor-surface2);
  font-size: 11px;
  font-weight: 600;
  color: var(--cor-txt3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cor-borda2);
}

tbody tr {
  border-bottom: 1px solid var(--cor-surface2);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--cor-surface2);
}

tbody td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--cor-txt2);
}

/* --- Linha com avatar + nome do colaborador --- */
.colab-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colab-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* Cores alternadas para os avatares */
.av-0 { background: var(--cor-p-bg); color: var(--cor-p); }
.av-1 { background: #E1F5EE; color: #0F6E56; }
.av-2 { background: #FAECE7; color: #993C1D; }
.av-3 { background: #E6F1FB; color: #185FA5; }
.av-4 { background: #FAEEDA; color: #854F0B; }

.colab-name {
  font-weight: 500;
  color: var(--cor-txt);
  font-size: 13px;
}

.colab-id {
  font-size: 11px;
  /* txt3, e não txt4: a 11px o txt4 fica em 3.3 de contraste nos dois
     temas, abaixo do mínimo de 4.5. O kit reserva --color-text-muted
     (= txt3) justamente para legendas. */
  color: var(--cor-txt3);
}

/* =====================================================
   BADGES (etiquetas coloridas)
   ===================================================== */

/* O kit troca a pilula por um retangulo de raio 6 com anel de 1px. O ponto
   colorido continua: estado e cor + forma + texto, nunca so cor. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--raio-badge);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .01em;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: var(--cor-ok-bg); color: var(--cor-ok); border: 1px solid var(--cor-ok-bd); }
.badge-green::before  { background: var(--cor-ok); }

.badge-amber  { background: var(--cor-aviso-bg); color: var(--cor-aviso); border: 1px solid var(--cor-aviso-bd); }
.badge-amber::before  { background: var(--cor-aviso); }

.badge-red  { background: var(--cor-erro-bg); color: var(--cor-erro); border: 1px solid var(--cor-erro-bd); }
.badge-red::before  { background: var(--cor-erro); }

.badge-blue  { background: var(--cor-info-bg); color: var(--cor-info); border: 1px solid var(--cor-info-bd); }
.badge-blue::before  { background: var(--cor-info); }

/* O texto do selo neutro sai de --cor-txt2, nao de --cor-txt3: sobre a tarja
   cinza o tom mais claro dava 4.33, abaixo do minimo AA de 4.5. */
.badge-gray   { background: var(--cor-surface3); color: var(--cor-txt2); border: 1px solid var(--cor-borda); }
.badge-gray::before   { background: var(--cor-txt4); }

.badge-purple { background: var(--cor-p-bg); color: var(--cor-p-dark); border: 1px solid var(--cor-p-light); }
.badge-purple::before { background: var(--cor-p); }

/* =====================================================
   MODAL (janela flutuante de cadastro/edição)
   ===================================================== */

/* Fundo escuro atrás do modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none; /* não captura cliques quando escondido */
  transition: opacity 0.2s;
}

/* Quando o modal está visível */
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--cor-surface);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-10px);
  transition: transform 0.2s;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

/* Variante usada no modal de desligamento */
.modal-box {
  background: var(--cor-surface, #fff);
  border-radius: 16px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cor-txt);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--cor-txt4);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--cor-txt2);
}

/* Grid de 2 colunas dentro do formulário */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Elemento que ocupa as 2 colunas */
.col-span-2 {
  grid-column: span 2;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--cor-borda2);
}

/* Modal de altura fixa: cabeçalho, abas e botões parados; só o miolo rola.
   Sem isso, abas com poucos campos (Dependentes, Bancário) encolhiam o modal
   e ele pulava de posição a cada troca de aba. */
.modal.modal-fixo {
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-fixo > form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-fixo .modal-corpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}
.modal-fixo .modal-actions {
  margin-top: 16px;
  flex-shrink: 0;
}

/* =====================================================
   ALERTAS / NOTIFICAÇÕES
   ===================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--cor-txt);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 9999;
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.25s;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid #16a34a; }
.toast.error   { border-left: 4px solid #dc2626; }

/* =====================================================
   ESTADO VAZIO (quando não há dados na tabela)
   ===================================================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--cor-txt4);
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  color: var(--cor-txt3);
}

.empty-state small {
  font-size: 12px;
  color: var(--cor-txt4);
}

/* =====================================================
   PAGINAÇÃO
   ===================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--cor-borda2);
  font-size: 12px;
  color: var(--cor-txt3);
}

.pagination-buttons {
  display: flex;
  gap: 6px;
}

/* =====================================================
   FILTROS DE CHIP
   ===================================================== */

.chip-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  border: 1.5px solid var(--cor-borda);
  background: var(--cor-surface);
  color: var(--cor-txt3);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.chip:hover {
  border-color: var(--cor-p);
  color: var(--cor-p);
}

.chip.active {
  background: var(--cor-p);
  border-color: var(--cor-p);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--cor-p) 30%, transparent);
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */

.text-muted   { color: var(--cor-txt4); }
.text-small   { font-size: 12px; }
.fw-500       { font-weight: 500; }
.mb-0         { margin-bottom: 0; }
.mt-auto      { margin-top: auto; }

/* Spinner de carregamento */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   TEMAS ESCUROS — Override de estilos inline
   Captura os padrões mais comuns de background:white e cores fixas usadas
   inline nas páginas. Tudo aqui sai de token, então vale para qualquer tema
   escuro — por isso o seletor lista os dois, e não só "dark".
   A maioria das regras [style*="..."] ficou sem alvo depois da tokenização;
   mantidas porque ainda cobrem o que sobrou de cor fixa.
   ===================================================== */

/* Fundo geral e main content */
[data-theme="dark"] body,
[data-theme="dark"] .main-content {
  background: var(--cor-bg);
  color: var(--cor-txt);
}

/* Topbar */
[data-theme="dark"] .topbar {
  background: var(--cor-surface);
  border-color: var(--cor-borda);
  color: var(--cor-txt);
}

[data-theme="dark"] .topbar-title {
  color: var(--cor-txt);
}

/* Cards e containers brancos */
[data-theme="dark"] .card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .table-container,
[data-theme="dark"] .modal {
  background: var(--cor-surface);
  border-color: var(--cor-borda);
  color: var(--cor-txt);
}

/* Inputs, selects e textareas (inclusive os não cobertos pelo style.css) */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--cor-surface2) !important;
  color: var(--cor-txt) !important;
  border-color: var(--cor-borda) !important;
}

/* Placeholders no dark */
[data-theme="dark"] ::placeholder {
  color: var(--cor-txt4) !important;
  opacity: 1;
}

/* Botão secundário no dark */
[data-theme="dark"] .btn-secondary {
  background: var(--cor-surface);
  color: var(--cor-txt2);
  border-color: var(--cor-borda);
  box-shadow: none;
}
[data-theme="dark"] .btn-secondary:hover {
  background: var(--cor-surface2);
  box-shadow: none;
}

/* Sombras em cards no dark — desativa para não vazar */
[data-theme="dark"] .card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .table-container {
  box-shadow: none;
}

/* Tabela */
[data-theme="dark"] thead th {
  background: var(--cor-surface2);
  color: var(--cor-txt3);
  border-color: var(--cor-borda2);
}
[data-theme="dark"] tbody tr {
  border-color: var(--cor-surface3);
}
[data-theme="dark"] tbody tr:hover {
  background: var(--cor-surface2);
}
[data-theme="dark"] tbody td {
  color: var(--cor-txt2);
}

/* Inline background:white / #fff */
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"] {
  background: var(--cor-surface) !important;
}

/* Inline backgrounds cinza claro */
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background:#f4f5f7"],
[data-theme="dark"] [style*="background: #f4f5f7"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #fafafa"] {
  background: var(--cor-surface2) !important;
}

/* Inline text colors escuros → claro no dark */
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color: #111827"],
[data-theme="dark"] [style*="color:#1a1a2e"],
[data-theme="dark"] [style*="color: #1a1a2e"],
[data-theme="dark"] [style*="color:#374151"],
[data-theme="dark"] [style*="color: #374151"] {
  color: var(--cor-txt2) !important;
}
[data-theme="dark"] [style*="color:#6b7280"],
[data-theme="dark"] [style*="color: #6b7280"] {
  color: var(--cor-txt3) !important;
}
[data-theme="dark"] [style*="color:#9ca3af"],
[data-theme="dark"] [style*="color: #9ca3af"] {
  color: var(--cor-txt4) !important;
}

/* Inline borders */
[data-theme="dark"] [style*="border-bottom:1px solid #e5e7eb"],
[data-theme="dark"] [style*="border-bottom: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1.5px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1.5px solid #e5e7eb"] {
  border-color: var(--cor-borda) !important;
}

/* Chips */
[data-theme="dark"] .chip {
  background: var(--cor-surface2);
  border-color: var(--cor-borda);
  color: var(--cor-txt3);
  box-shadow: none;
}
[data-theme="dark"] .chip.active {
  background: var(--cor-p);
  border-color: var(--cor-p);
  color: white;
}

/* Pagination */
[data-theme="dark"] .pagination {
  border-color: var(--cor-borda2);
  color: var(--cor-txt3);
}

/* Toast */
[data-theme="dark"] .toast {
  background: var(--cor-surface);
  color: var(--cor-txt);
}

/* Search input */
[data-theme="dark"] .search-input {
  background-color: var(--cor-surface2) !important;
  border-color: var(--cor-borda);
  color: var(--cor-txt);
}
[data-theme="dark"] .search-input:focus {
  background-color: var(--cor-surface) !important;
}

/* Table toolbar */
[data-theme="dark"] .table-toolbar {
  border-color: var(--cor-borda2);
}

/* Modal actions border */
[data-theme="dark"] .modal-actions {
  border-color: var(--cor-borda2);
}

/* =====================================================
   MENU DA CONTA — avatar no canto superior direito
   Injetado por js/menu-usuario.js. Reúne identidade,
   trocar senha, tema e sair, que antes estavam em
   quatro lugares diferentes.
   ===================================================== */

.menu-usuario {
  position: relative;
  display: flex;
  align-items: center;
  /* Divisor à esquerda: a área de ações já tem os botões da página, e a
     conta precisa ler como outra coisa, não como o último deles. */
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--cor-borda);
}

.mu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--cor-p);
  color: var(--cor-p-txt);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow .15s, transform .15s;
}
.mu-avatar:hover { transform: scale(1.05); }
/* Com foto, a imagem cobre o círculo inteiro e as iniciais somem por baixo. */
.mu-avatar .mu-foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mu-avatar.com-foto { position: relative; overflow: hidden; }
.mu-avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cor-p-light);
}

.mu-avatar-grande {
  width: 40px;
  height: 40px;
  font-size: 14px;
  cursor: default;
}
.mu-avatar-grande:hover { transform: none; }

/* O painel fica ACIMA do conteúdo e ABAIXO dos modais (z-index 1000):
   aberto por engano, não pode ficar sobre um formulário em uso. */
.mu-painel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 900;
  min-width: 246px;
  padding: 6px;
  background: var(--cor-surface);
  border: 1px solid var(--cor-borda);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}

.mu-cabecalho {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
}
.mu-identidade { min-width: 0; }
.mu-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--cor-txt);
  /* Nome longo não pode empurrar o painel: corta com reticências. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 168px;
}
.mu-email {
  font-size: 11.5px;
  color: var(--cor-txt3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 168px;
}
/* Selo do perfil: o mesmo formato usado no resto do ecossistema. */
.mu-selo {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cor-p-bg);
  color: var(--cor-p-dark);
  font-size: 11.5px;
  font-weight: 500;
}

.mu-separador {
  height: 1px;
  background: var(--cor-borda2);
  margin: 4px 0;
}

.mu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--cor-txt2);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.mu-item:hover { background: var(--cor-surface3); }
.mu-item:focus-visible {
  outline: 2px solid var(--cor-p);
  outline-offset: -2px;
}
.mu-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.mu-icone svg { width: 15px; height: 15px; }

/* Trocar senha fica fora de alcance para quem entra pela Microsoft: a senha
   passa a ser assunto do Entra, e um link que não leva a nada é pior que um
   item apagado. */
.mu-item-off {
  cursor: not-allowed;
  opacity: .55;
  flex-wrap: wrap;
}
.mu-item-off:hover { background: none; }
.mu-nota {
  flex-basis: 100%;
  margin: -2px 0 0 25px;
  font-size: 11px;
  color: var(--cor-txt3);
}
.mu-sair { color: var(--cor-erro); }

.mu-secao { padding: 6px 10px 10px; }
.mu-rotulo {
  /* "Tema", e não "TEMA": o rótulo do kit é escrito normalmente aqui, ao
     contrário dos overlines de seção das páginas. */
  font-size: 12px;
  font-weight: 500;
  color: var(--cor-txt3);
  margin-bottom: 6px;
}
/* Tema: dois botões escritos por extenso, lado a lado, dentro de um trilho.
   As bolinhas coloridas de antes não diziam a ninguém qual era qual. */
.mu-temas {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--cor-borda);
  border-radius: 10px;
  background: var(--cor-bg);
}
.mu-tema {
  flex: 1;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--cor-txt2);   /* txt3 ficava em 4.44 no tema claro, abaixo do mínimo */
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.mu-tema:hover { color: var(--cor-txt); }
.mu-tema[aria-pressed="true"] {
  background: var(--cor-surface);
  color: var(--cor-p);
  box-shadow: var(--shadow-xs);
}
.mu-tema:focus-visible {
  outline: 2px solid var(--cor-p);
  outline-offset: 2px;
}
/* =====================================================
   ESTADOS VAZIOS E MOVIMENTO — kit visual Meta CS v1.0 (etapa 4)

   As telas montam o estado vazio por innerHTML, em momentos diferentes,
   então a ilustração entra por CSS: qualquer .empty-state criado depois
   já nasce com ela, sem a página precisar saber que o kit existe.
   ===================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--cor-txt3);
  padding: 34px 20px;
}

/* O emoji que as telas já passam some, e no lugar entra a ilustração.
   Mantemos o elemento: é ele que as páginas criam. */
.empty-state .empty-icon {
  font-size: 0;
  width: 150px;
  height: 150px;
  max-width: 60%;
  background: url('../img/kit/estado-vazio.webp') center/contain no-repeat;
  opacity: .92;
}

/* Quando a tela diz que é erro, a ilustração acompanha. */
.empty-state.erro .empty-icon,
.empty-state[data-tom="erro"] .empty-icon {
  background-image: url('../img/kit/estado-erro.webp');
}
.empty-state.sucesso .empty-icon,
.empty-state[data-tom="sucesso"] .empty-icon {
  background-image: url('../img/kit/estado-sucesso.webp');
}
.empty-state.sem-acesso .empty-icon,
.empty-state[data-tom="sem-acesso"] .empty-icon {
  background-image: url('../img/kit/estado-sem-acesso.webp');
}

/* ── Movimento ───────────────────────────────────────
   Entrada curta e em sequência. Tudo parte de um estado VISÍVEL quando
   'reduzir movimento' está ligado — a página nunca depende da animação
   para aparecer. */
@keyframes kit-entra {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* A animação só vale sob body.kit-animar, que o shell.js acrescenta quando
   a página está visível. Sem isso o conteúdo NASCE visível: com `both`, um
   elemento cuja animação não roda (aba em segundo plano, JS falho) ficaria
   em opacity 0 — a tela abria vazia. */
body.kit-animar .page-content > .card,
body.kit-animar .page-content > .metrics-grid > .metric-card,
body.kit-animar .page-content > .table-container {
  animation: kit-entra var(--duration-enter) var(--ease-out) both;
}
body.kit-animar .page-content > .card:nth-child(1), body.kit-animar .page-content > .metrics-grid > .metric-card:nth-child(1) { animation-delay: 0ms; }
body.kit-animar .page-content > .card:nth-child(2), body.kit-animar .page-content > .metrics-grid > .metric-card:nth-child(2) { animation-delay: 50ms; }
body.kit-animar .page-content > .card:nth-child(3), body.kit-animar .page-content > .metrics-grid > .metric-card:nth-child(3) { animation-delay: 100ms; }
body.kit-animar .page-content > .card:nth-child(4), body.kit-animar .page-content > .metrics-grid > .metric-card:nth-child(4) { animation-delay: 150ms; }
body.kit-animar .page-content > .card:nth-child(n+5) { animation-delay: 200ms; }

/* Linhas de tabela entram em sequência, até a décima: além disso o atraso
   viraria espera. */
body.kit-animar tbody tr { animation: kit-entra 260ms var(--ease-out) both; }
body.kit-animar tbody tr:nth-child(1) { animation-delay: 0ms; }
body.kit-animar tbody tr:nth-child(2) { animation-delay: 24ms; }
body.kit-animar tbody tr:nth-child(3) { animation-delay: 48ms; }
body.kit-animar tbody tr:nth-child(4) { animation-delay: 72ms; }
body.kit-animar tbody tr:nth-child(5) { animation-delay: 96ms; }
body.kit-animar tbody tr:nth-child(6) { animation-delay: 120ms; }
body.kit-animar tbody tr:nth-child(7) { animation-delay: 144ms; }
body.kit-animar tbody tr:nth-child(8) { animation-delay: 168ms; }
body.kit-animar tbody tr:nth-child(9) { animation-delay: 192ms; }
body.kit-animar tbody tr:nth-child(n+10) { animation-delay: 216ms; }

@media (prefers-reduced-motion: reduce) {
  body.kit-animar .page-content > .card,
  body.kit-animar .page-content > .metrics-grid > .metric-card,
  body.kit-animar .page-content > .table-container,
  body.kit-animar tbody tr { animation: none; }
}

/* =====================================================
   CELULAR E TABLET (< 1024px) — kit visual Meta CS v1.0

   Até aqui o backoffice não tinha navegação em tela pequena: o menu de
   230px ficava fixo e o conteúdo começava atrás dele. O que o kit pede e
   o que entra agora: topo azul arredondado, menu em gaveta e barra
   inferior com atalhos. Tudo montado por js/shell.js a partir do menu que
   já existe no HTML.
   ===================================================== */
@media (max-width: 1023px) {

  /* O menu vira gaveta: sai da esquerda e volta fechado. */
  .sidebar {
    width: min(292px, 86vw);
    min-width: 0;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
    z-index: var(--z-overlay, 50);
  }
  .sidebar:hover, .sidebar:focus-within, html.menu-fixado .sidebar { width: min(292px, 86vw); box-shadow: none; }
  .sidebar.aberto { transform: none; box-shadow: var(--shadow-brand); }

  /* No celular o menu nunca está recolhido: o texto dos itens sempre aparece. */
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .nav-link { font-size: 13.5px; }
  /* A gaveta do celular é larga: mostra a marca inteira, nunca o símbolo. */
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header { justify-content: flex-start; padding: 0 12px 0 20px; }
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-logo,
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-div { display: block; }
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header h2 { display: block; font-size: 13px; }
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .sidebar-header .sb-simbolo { display: none; }
  html:not(.menu-fixado) .sidebar:not(:hover):not(:focus-within) .nav-section-label {
    font-size: 10px; width: auto; height: auto; background: none;
    padding: 14px 20px 6px; margin: 0; border-radius: 0;
  }
  .sb-fixar { display: none; }

  .sh-veu {
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--slate-950) 45%, transparent);
    backdrop-filter: blur(2px);
    z-index: calc(var(--z-overlay, 50) - 1);
    border: 0; padding: 0;
  }

  .main-content { margin-left: 0; }

  /* Topo azul, emendando com a barra de status do aparelho. */
  .topbar {
    background: var(--color-brand-surface);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 0;
    border-radius: 0 0 var(--radius-shell) var(--radius-shell);
    box-shadow: var(--shadow-brand-top);
    height: 56px;
    padding: 0 8px 0 4px;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .topbar.rolado { box-shadow: var(--shadow-brand-top); }
  .topbar-title { color: #fff; font-size: 15px; }
  .trilha { display: none; }

  .sh-menu-btn {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-md);
    background: none; color: #fff; font-size: 19px;
    flex-shrink: 0;
  }
  .sh-menu-btn:active { background: rgba(255,255,255,0.14); }

  /* Os botões do topo herdam o azul: viram contorno branco. */
  .topbar-actions .btn-secondary {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
  }

  /* Barra inferior: atalhos para as telas mais usadas. */
  .sh-barra {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: var(--z-bottom-nav, 30);
    display: flex;
    background: color-mix(in srgb, var(--cor-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--cor-borda);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sh-barra a {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 58px;
    text-decoration: none; color: var(--cor-txt3);
    font-size: 10.5px; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .sh-barra a span:first-child { font-size: 19px; line-height: 1; }
  .sh-barra a span:first-child svg { width: 20px; height: 20px; display: block; }
  .sh-barra a span:last-child {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sh-barra a.ativo { color: var(--cor-p); }
  .sh-barra-marca {
    position: absolute; top: 0; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--cor-p);
    transition: left var(--duration-base) var(--ease-out), width var(--duration-base) var(--ease-out);
  }

  /* A barra não pode cobrir o fim do conteúdo. */
  .page-content { padding-bottom: 112px; }

  /* Tabela larga rola dentro do painel, em vez de alargar a página:
     é o que impede a barra inferior de ficar cortada no Android. */
  .table-container, .card, .metric-card { min-width: 0; }
  .table-container { overflow-x: auto; }

  /* ...mas rolar não basta: sem largura mínima o navegador espreme as
     colunas até o limite e o conteúdo quebra onde não devia — um nome
     completo virava quatro linhas e o CPF partia no meio ("012.345.678-"
     / "90"). Com a largura mínima, cada coluna fica legível e quem precisa
     das colunas da direita arrasta a tabela. */
  .table-container table,
  .tabela-rola table { min-width: 720px; }
  .table-container th,
  .table-container td,
  .tabela-rola th,
  .tabela-rola td { white-space: nowrap; }
  /* Nada quebra: a leitura no celular é arrastando a tabela de lado, e
     linha baixa mostra mais gente por tela. Deixar o nome quebrar livre
     dava três linhas por pessoa e 98px de altura por registro; a quebra
     solta também partia as iniciais do avatar ("MP" em duas linhas). */
  .table-container .colab-name { overflow-wrap: normal; }
}

/* Rede de segurança: nada deve alargar a página no celular. */
@media (max-width: 1023px) { html { overflow-x: clip; } }

@media (prefers-reduced-motion: reduce) {
  .mu-avatar, .mu-tema, .mu-item { transition: none; }
  .mu-avatar:hover { transform: none; }
}
