/* ═══ Design system — SSO RioSaúde ═══════════════════════════════════════════
   Marca: azul-marinho institucional + azul-claro do brasão (logo-sirs).
   Sem fontes externas (ambiente sem internet garantida): stack de sistema. */

:root {
  /* marca */
  --navy-900: #0d2440;
  --navy-800: #123253;
  --navy-700: #17406a;
  --navy-600: #1d4f83;
  --azul-500: #2f8fd6;
  --azul-400: #4aa8e8;
  --azul-100: #dcedfa;
  --azul-50: #eef6fd;

  /* neutros */
  --ink-900: #16202c;
  --ink-700: #3c4a5c;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;

  /* semânticas */
  --ok-600: #15803d;
  --ok-100: #dcfce7;
  --erro-600: #b91c1c;
  --erro-100: #fee2e2;
  --aviso-600: #a16207;
  --aviso-100: #fef9c3;

  --radius: 10px;
  --radius-sm: 7px;
  --sombra-1: 0 1px 2px rgba(13, 36, 64, 0.06), 0 1px 3px rgba(13, 36, 64, 0.1);
  --sombra-2: 0 4px 6px -1px rgba(13, 36, 64, 0.08), 0 10px 24px -6px rgba(13, 36, 64, 0.12);
  /* ── TIPOGRAFIA (padronização com o Patrimônio: Inter, self-hosted) ──────
     REVERSÍVEL: para voltar à fonte anterior, comente a linha ativa e
     descomente a de baixo. Nenhum outro lugar declara família de fonte. */
  --fonte: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
  /* --fonte: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif; */
}

/* Inter variável self-hosted (sem CDN — funciona offline, como no Patrimônio) */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter/InterVariable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--fonte);
  margin: 0;
  color: var(--ink-900);
  background: var(--ink-50);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--navy-600); text-decoration: none; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.86em; background: var(--ink-100); border: 1px solid var(--ink-200); border-radius: 5px; padding: 1px 6px; }

/* ═══ Autenticação (login / MFA) ═══ */
.auth-wrap { display: flex; min-height: 100vh; }
.auth-hero {
  flex: 1.1;
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(74, 168, 232, 0.28), transparent 55%),
    radial-gradient(800px 500px at 110% 110%, rgba(47, 143, 214, 0.22), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #eaf3fb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.4rem;
}
.auth-hero img { width: min(320px, 70%); }
.auth-hero h2 { font-size: 1.7rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.6rem; color: #fff; }
.auth-hero p { color: #b9d3e8; max-width: 42ch; margin: 0; }
.auth-hero .selo { font-size: 0.8rem; color: #8fb4d4; letter-spacing: 0.04em; }
.auth-painel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
  background: #fff;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-mobile { display: none; }
.auth-card h1 { font-size: 1.45rem; color: var(--navy-800); margin: 0 0 0.35rem; }
.auth-card .subtitulo { color: var(--ink-500); margin: 0 0 1.6rem; font-size: 0.94rem; }
.auth-card form { display: grid; gap: 1rem; }
.auth-qr { display: block; width: 190px; height: 190px; margin: 0.4rem auto; border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 8px; background: #fff; }
.auth-links { display: grid; gap: 0.55rem; justify-items: center; margin-top: 0.4rem; }
/* login social (RF-04) */
.divisor-ou { display: flex; align-items: center; gap: 0.8rem; color: var(--ink-500); font-size: 0.8rem; margin: 0.1rem 0; }
.divisor-ou::before, .divisor-ou::after { content: ''; flex: 1; height: 1px; background: var(--ink-200); }
.botao-google:hover { border-color: var(--ink-400); color: var(--navy-700); background: var(--ink-50); }
.auth-links button { background: none; border: none; color: var(--azul-500); cursor: pointer; font-size: 0.88rem; font-family: inherit; padding: 2px; }
.auth-links button:hover { text-decoration: underline; }

@media (max-width: 820px) {
  .auth-hero { display: none; }
  .auth-card .logo-mobile { display: block; width: min(260px, 80%); margin: 0 auto 2rem; }
}

/* ═══ Campos ═══ */
.campo { display: grid; gap: 0.35rem; font-size: 0.88rem; color: var(--ink-700); font-weight: 500; }
.campo input, .campo select, .campo textarea, .busca, .linha input, .linha select {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink-900);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus, .busca:focus, .linha input:focus, .linha select:focus {
  outline: none;
  border-color: var(--azul-500);
  box-shadow: 0 0 0 3px rgba(47, 143, 214, 0.18);
}
.campo-codigo input { text-align: center; font-size: 1.5rem; letter-spacing: 0.45em; font-family: ui-monospace, monospace; }

/* ═══ Botões ═══ */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.25rem;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--sombra-1);
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
}
.botao:hover { filter: brightness(1.12); box-shadow: var(--sombra-2); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: 0.55; cursor: default; filter: none; transform: none; }
.botao.sec { background: #fff; color: var(--navy-700); border: 1.5px solid var(--ink-300); box-shadow: none; }
.botao.sec:hover { border-color: var(--azul-500); color: var(--azul-500); filter: none; }
.botao.perigo { background: linear-gradient(180deg, #dc2626, var(--erro-600)); }
.botao.mini { padding: 0.3rem 0.7rem; font-size: 0.8rem; font-weight: 500; }
.botao.largo { width: 100%; }

/* ═══ Shell do painel ═══ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #d7e6f4;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0 1rem;
}
.sidebar .marca { padding: 0 1.3rem 1.3rem; border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
.sidebar .marca img { width: 100%; max-width: 176px; display: block; }
.sidebar .marca .produto { margin-top: 0.6rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--azul-400); font-weight: 600; }
.sidebar nav { flex: 1; padding: 0.9rem 0.7rem; display: grid; gap: 2px; align-content: start; }
.sidebar nav a {
  display: block;
  color: #b7cde1;
  padding: 0.58rem 0.85rem;
  font-size: 0.93rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar nav a.ativo { background: rgba(74, 168, 232, 0.16); color: #fff; border-left-color: var(--azul-400); font-weight: 600; }
.sidebar .rodape { margin: 0 0.9rem; padding: 0.85rem; background: rgba(255, 255, 255, 0.06); border-radius: var(--radius); display: flex; gap: 0.65rem; align-items: center; }
.sidebar .avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azul-500), var(--azul-400));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .quem { min-width: 0; flex: 1; }
.sidebar .quem .nome { font-size: 0.86rem; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .quem .papel { font-size: 0.72rem; color: var(--azul-400); }
.sidebar .sair { background: none; border: none; color: #b7cde1; cursor: pointer; font-size: 1.05rem; padding: 4px; border-radius: 6px; }
.sidebar .sair:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.conteudo { flex: 1; min-width: 0; padding: 2rem 2.4rem 3rem; }
.conteudo h2 { color: var(--navy-800); font-size: 1.35rem; margin: 0 0 0.3rem; }
.conteudo h3 { color: var(--navy-700); font-size: 1.05rem; margin: 1.8rem 0 0.7rem; }
.conteudo > p:first-of-type { margin-top: 0; }
.descricao { color: var(--ink-500); font-size: 0.92rem; margin: 0 0 1.2rem; }

/* ═══ Cartões / dashboard ═══ */
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 1rem; margin: 1.2rem 0 2rem; }
.cartao {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--sombra-1);
  border-top: 3px solid var(--azul-500);
}
.cartao .num { font-size: 1.9rem; font-weight: 700; color: var(--navy-800); line-height: 1.15; }
.cartao .rotulo { color: var(--ink-500); font-size: 0.84rem; margin-top: 0.15rem; }

/* ═══ Tabelas ═══ */
table.lista {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sombra-1);
}
table.lista th {
  text-align: left;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--ink-200);
}
table.lista td { padding: 0.62rem 0.9rem; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
table.lista tr:last-child td { border-bottom: none; }
table.lista tbody tr { transition: background 0.1s; }
table.lista tbody tr:hover { background: var(--azul-50); }

/* ═══ Badges ═══ */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge.ok { background: var(--ok-100); color: var(--ok-600); }
.badge.off { background: var(--erro-100); color: var(--erro-600); }
.badge.info { background: var(--azul-100); color: var(--navy-600); }
.badge.aviso { background: var(--aviso-100); color: var(--aviso-600); }

/* ═══ Formulários / painéis ═══ */
.form {
  display: grid;
  gap: 0.85rem;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 1.3rem;
  margin: 1.1rem 0;
  max-width: 620px;
  box-shadow: var(--sombra-1);
}
.form > strong { color: var(--navy-800); font-size: 0.98rem; }
.form label { font-size: 0.86rem; color: var(--ink-700); font-weight: 500; display: grid; gap: 0.3rem; }
.form input, .form select, .form textarea {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--azul-500);
  box-shadow: 0 0 0 3px rgba(47, 143, 214, 0.18);
}
.linha { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.linha input, .linha select { width: auto; flex: 1; min-width: 150px; }
.linha input[type="checkbox"], .form input[type="checkbox"] { width: auto; flex: none; min-width: 0; accent-color: var(--azul-500); }
.form.amplo { max-width: none; }

/* grade de permissões: rótulo colado ao checkbox, colunas responsivas */
.grade-permissoes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.3rem 1.2rem;
  padding: 0.5rem 0.2rem 0.2rem;
}
.checar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.87rem;
  font-weight: 400;
  color: var(--ink-700);
  cursor: pointer;
  padding: 0.18rem 0.3rem;
  border-radius: 5px;
}
.checar:hover { background: var(--azul-50); }
.checar input { accent-color: var(--azul-500); width: 15px; height: 15px; }

.bloco-role { border-top: 1px solid var(--ink-200); padding-top: 0.7rem; }
.bloco-role .cabecalho { display: flex; justify-content: space-between; align-items: center; }
.busca { max-width: 320px; }

.msg-erro { color: var(--erro-600); background: var(--erro-100); border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 0.55rem 0.9rem; margin: 0.6rem 0; font-size: 0.9rem; }
.msg-ok { color: var(--ok-600); background: var(--ok-100); border: 1px solid #bbf7d0; border-radius: var(--radius-sm); padding: 0.55rem 0.9rem; margin: 0.6rem 0; font-size: 0.9rem; }

.segredo {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  background: var(--ink-50);
  border: 1px dashed var(--ink-300);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
  display: inline-block;
}
.codigos {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  line-height: 2;
  background: var(--azul-50);
  border: 1px dashed var(--azul-500);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  columns: 2;
  text-align: center;
}

.carregando { text-align: center; margin-top: 22vh; color: var(--ink-500); }

/* ═══ Tela de espera (autocadastro — /aguardando) ═══ */
.aguardando-icone {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 0.9rem;
  animation: aguardando-pulso 2.4s ease-in-out infinite;
}
@keyframes aguardando-pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.94); }
}

/* ─── E11-S1: diff before/after na auditoria ─────────────────────────────── */
.diff-par { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; padding: 0.6rem 0; }
.diff-par pre { background: var(--azul-50, #eef4fa); border-radius: 8px; padding: 0.7rem; font-size: 0.75rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ─── E12-S1: knowledge base ─────────────────────────────────────────────── */
.kb { display: grid; grid-template-columns: 250px 1fr; gap: 1.4rem; align-items: start; }
.kb-indice nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.8rem; }
.kb-indice nav button { text-align: left; background: none; border: none; padding: 0.45rem 0.7rem; border-radius: 7px; cursor: pointer; color: inherit; font: inherit; font-size: 0.86rem; }
.kb-indice nav button:hover { background: var(--azul-50, #eef4fa); }
.kb-indice nav button.ativo { background: var(--azul-100, #dbe9f7); font-weight: 600; }
.kb-conteudo { min-width: 0; }
.kb-acoes { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
.markdown { line-height: 1.65; font-size: 0.94rem; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.4em 0 0.5em; line-height: 1.25; }
.markdown table { border-collapse: collapse; margin: 0.8em 0; display: block; overflow-x: auto; max-width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--azul-100, #dbe9f7); padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.markdown pre { background: var(--azul-50, #eef4fa); border-radius: 8px; padding: 0.8rem; overflow-x: auto; font-size: 0.8rem; }
.markdown code { font-size: 0.85em; }
.markdown blockquote { border-left: 3px solid var(--azul-300, #7fb0dd); margin: 0.8em 0; padding: 0.2em 1em; color: var(--ink-500, #5b6b7b); }

/* exportação PDF via impressão do navegador */
@media print {
  .sidebar, .imprimir-ocultar { display: none !important; }
  .shell { display: block; }
  .conteudo { padding: 0; }
  .kb { display: block; }
}

/* ─── E03-S4: map picker ─────────────────────────────────────────────────── */
.mapa-picker { height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid var(--azul-100, #dbe9f7); }
.pino-mapa { color: #d23f31; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }

/* ─── Painel de acessos do usuário (redesenho) ───────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--azul-50, #eef4fa); border: 1px solid var(--azul-100, #dbe9f7); border-radius: 999px; padding: 0.15rem 0.3rem 0.15rem 0.65rem; font-size: 0.8rem; margin: 0.12rem 0.25rem 0.12rem 0; }
.chip button { background: none; border: none; cursor: pointer; color: var(--ink-500, #5b6b7b); font-size: 0.85rem; line-height: 1; padding: 0.1rem 0.3rem; border-radius: 999px; }
.chip button:hover { background: #fdecec; color: #b00020; }
.acao-remover { background: none; border: none; cursor: pointer; color: var(--ink-500, #5b6b7b); font-size: 0.8rem; text-decoration: underline; padding: 0.2rem 0.4rem; border-radius: 6px; white-space: nowrap; }
.acao-remover:hover { color: #b00020; background: #fdecec; text-decoration: none; }
.grupos-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 0.9rem; }
.grupo-form { border: 1px solid var(--azul-100, #dbe9f7); border-radius: 10px; padding: 0.7rem 0.9rem 0.9rem; }
.grupo-form legend, .grupo-form .titulo { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500, #5b6b7b); margin-bottom: 0.5rem; }
.grupo-form .linha { flex-wrap: wrap; }
.grupo-form select { flex: 1; min-width: 140px; }
@media (max-width: 900px) { .grupos-form { grid-template-columns: 1fr; } }

/* ─── Overlay de foto do funcionário ─────────────────────────────────────── */
.foto-overlay { position: fixed; inset: 0; background: rgba(13, 36, 64, 0.55); display: flex; align-items: center; justify-content: center; z-index: 60; }
.foto-cartao { background: #fff; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: center; max-width: min(420px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.foto-cartao img { max-width: 100%; max-height: 65vh; border-radius: 8px; }
.foto-cartao .legenda { font-weight: 600; font-size: 0.9rem; }
.foto-mini { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; cursor: zoom-in; border: 2px solid var(--azul-100, #dbe9f7); display: block; }


/* ─── Ícones (Heroicons) ─────────────────────────────────────────────────── */
.icone { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.icone-mini { width: 0.95rem; height: 0.95rem; flex-shrink: 0; vertical-align: -0.15em; display: inline-block; }
.icone-mini.ok { color: var(--ok-600, #15803d); }
.sidebar nav a { display: flex; align-items: center; gap: 0.6rem; }
.paginacao button { display: inline-flex; align-items: center; gap: 0.3rem; }
.chip button .icone-mini { vertical-align: middle; }

/* ─── RBAC por rotas ─────────────────────────────────────────────────────── */
.rbac-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 0.8rem; margin-top: 0.9rem; align-items: start; }
@media (max-width: 1100px) { .rbac-grupos { grid-template-columns: 1fr; } }
.rbac-grupo { border: 1px solid var(--ink-200); border-radius: var(--radius); background: #fff; overflow: hidden; }
.rbac-grupo > header { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.8rem; background: var(--ink-50); border-bottom: 1px solid var(--ink-200); }
.rbac-grupo .recurso { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--navy-700); }
.rbac-grupo .contagem { font-size: 0.74rem; color: var(--ink-500); }
.rbac-grupo .tudo { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 0.76rem; color: var(--azul-500); padding: 0.1rem 0.4rem; border-radius: 5px; }
.rbac-grupo .tudo:hover { background: var(--azul-50); }
.form label.rbac-perm, .rbac-perm { display: flex; flex-direction: row; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0.8rem; cursor: pointer; border-left: 3px solid transparent; border-top: 1px solid var(--ink-100); font-weight: 400; }
.rbac-perm:first-of-type { border-top: none; }
.rbac-perm:hover { background: var(--ink-50); }
.rbac-perm.marcada { border-left-color: var(--azul-400); background: var(--azul-50); }
.rbac-perm input { margin-top: 0.2rem; flex-shrink: 0; width: 1rem !important; height: 1rem; accent-color: var(--azul-500); }
.rbac-perm .info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.rbac-perm .nome { font-size: 0.88rem; font-weight: 600; color: var(--ink-900); }
.rbac-perm .rotas { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.rbac-perm .rotas em { color: var(--ink-500); font-size: 0.78rem; font-style: normal; }
code.rota { display: inline-block; font-size: 0.74rem; padding: 0.08rem 0.45rem; border-radius: 5px; background: var(--ink-100); border: 1px solid var(--ink-200); white-space: nowrap; }
code.rota strong { font-weight: 700; }
code.rota.metodo-get strong { color: var(--ok-600); }
code.rota.metodo-post strong { color: var(--azul-500); }
code.rota.metodo-patch strong, code.rota.metodo-put strong { color: var(--aviso-600); }
code.rota.metodo-delete strong { color: var(--erro-600); }

/* ═══ Auditoria: abas, paginação, gráfico e ranking (E11-S4) ═══ */
.abas { display: flex; gap: 0.3rem; border-bottom: 2px solid var(--ink-200); margin: 1.1rem 0 1.3rem; flex-wrap: wrap; }
.aba {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: 0.55rem 0.95rem; font-size: 0.92rem; font-weight: 600; color: var(--ink-500); cursor: pointer;
}
.aba:hover { color: var(--navy-700); }
.aba.ativa { color: var(--azul-500); border-bottom-color: var(--azul-500); }

.paginacao { display: flex; align-items: center; gap: 0.7rem; justify-content: flex-end; margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-500); flex-wrap: wrap; }

.grafico-barras {
  display: flex; align-items: flex-end; gap: 5px; height: 150px; padding: 0.8rem 1rem 0.5rem;
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--sombra-1);
}
.grafico-barras .dia { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.grafico-barras .valor { font-size: 0.66rem; color: var(--navy-700); font-variant-numeric: tabular-nums; line-height: 1; }
.grafico-barras .barra { width: 100%; max-width: 28px; border-radius: 3px 3px 0 0; background: var(--azul-500); min-height: 2px; transition: height 0.2s; }
.grafico-barras .leg { font-size: 0.62rem; color: var(--ink-500); white-space: nowrap; }

.duas-colunas { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .duas-colunas { grid-template-columns: 1fr; } }
.ranking { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--sombra-1); padding: 0.9rem 1.1rem; font-size: 0.88rem; }
.ranking h4 { margin: 0 0 0.6rem; color: var(--navy-700); font-size: 0.95rem; }
.ranking ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; color: var(--ink-700); }
.ranking .qtd { color: var(--ink-500); font-variant-numeric: tabular-nums; }

/* ── E08 biometria facial (onboarding) ─────────────────────────────────── */
.camera-wrap { position: relative; width: 320px; max-width: 100%; aspect-ratio: 4 / 3; background: var(--ink-900); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--ink-200); }
.camera { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.camera-vazia { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-300); font-size: 0.88rem; }
.termo { background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: 0.8rem 1rem; font-size: 0.88rem; color: var(--ink-700); max-height: 260px; overflow: auto; }
.termo p { margin: 0 0 0.6rem; }
.termo ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.link-perigo { background: none; border: none; color: var(--erro-600); cursor: pointer; font-size: inherit; font-family: inherit; padding: 0; text-decoration: underline; }

/* ═══ Responsividade (padrão Filament: drawer < 1024px, overlay, burger) ═══ */
.topo-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 45;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
  padding: 0.55rem 0.9rem;
  align-items: center;
  gap: 0.7rem;
  box-shadow: var(--sombra-1);
}
.topo-mobile .burger {
  background: none;
  border: none;
  color: #d7e6f4;
  padding: 0.45rem;
  margin: -0.2rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.topo-mobile .burger:hover { background: rgba(255, 255, 255, 0.1); }
.topo-mobile .titulo { font-size: 0.95rem; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-mobile img { height: 26px; width: auto; display: block; }
.sidebar-overlay { display: none; }

@media (max-width: 1023px) {
  .topo-mobile { display: flex; }
  .shell { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 85vw);
    height: 100dvh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }
  .sidebar.aberta { transform: translateX(0); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
  .sidebar-overlay.aberta {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(13, 36, 64, 0.55);
    z-index: 55;
  }
  .conteudo { padding: 1.1rem 1rem 2.4rem; }
  .conteudo h2 { font-size: 1.2rem; }
  .cartoes { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; }
  .cartao { padding: 0.85rem 0.95rem; }
  .cartao .num { font-size: 1.5rem; }
  .busca { max-width: 100%; flex: 1 1 100%; }
  .linha > select { flex: 1 1 45%; min-width: 0; }
  .form { padding: 1rem; }
  .abas { overflow-x: auto; flex-wrap: nowrap; }
  /* tabelas rolam sozinhas mesmo sem contêiner com overflow */
  table.lista { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kb { grid-template-columns: 1fr; }
  .grafico-barras { overflow-x: auto; }
  .codigos { columns: 1; }
  .rbac-grupos { grid-template-columns: 1fr; }
  .foto-overlay { padding: 0.7rem; }
  .diff-par { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
  .botao.mini { padding: 0.45rem 0.85rem; }
  .sidebar nav a, .sidebar nav button { padding: 0.75rem 0.85rem; }
  .aba { padding: 0.7rem 0.95rem; }
}

/* ═══ Formulário de novo usuário (E13): colunas + chips de unidade ═══ */
.form-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; }
@media (max-width: 760px) { .form-colunas { grid-template-columns: 1fr; } }
.chips-escolha { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-toggle {
  border: 1.5px solid var(--ink-300); background: #fff; color: var(--ink-700);
  border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.chip-toggle:hover { border-color: var(--azul-400); color: var(--navy-700); }
.chip-toggle.ativo { background: var(--azul-500); border-color: var(--azul-500); color: #fff; }
.chip-toggle:focus-visible { outline: 2px solid var(--azul-400); outline-offset: 2px; }
.rotulo-suave { color: var(--ink-500); font-weight: 400; }

/* ═══ Seleção de unidades: checkboxes em colunas (E13) ═══ */
.lista-unidades {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.15rem 1.2rem; max-height: 260px; overflow-y: auto;
  padding: 0.55rem 0.7rem; border: 1px solid var(--ink-200); border-radius: 8px; background: #fff;
}
.lista-unidades label {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 500; color: var(--ink-700);
  text-transform: uppercase; cursor: pointer; padding: 0.15rem 0;
}
.lista-unidades label:hover { color: var(--navy-700); }
.lista-unidades input[type="checkbox"] { width: auto; min-width: 0; flex: none; accent-color: var(--azul-500); }

/* perfil por unidade (E13): override opcional por unidade marcada */
.perfil-por-unidade { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0.4rem 1.2rem; }
.perfil-por-unidade .item { display: flex; align-items: center; gap: 0.55rem; }
.perfil-por-unidade .item > span {
  flex: 1; min-width: 0; font-size: 0.76rem; font-weight: 500; color: var(--ink-700);
  text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.perfil-por-unidade .item select { flex: 1; font-size: 0.82rem; }
