/* Monitor do Diário Oficial · Calper
   Layout e tokens do Projeto Modelo Calper (Gestão Modelo): topbar branca, sidebar grafite,
   breadcrumb, cabeçalho de página e cards. Não use hex solto: use os tokens abaixo. */
:root {
  --brand: #d6293b;
  --brand-hover: #a91d2c;
  --brand-soft: #fdecee;
  --ink: #17181c;
  --ink-2: #3f4048;
  --muted: #6b7280;
  --line: #e9eaee;
  --line-strong: #d4d6dc;
  --page: #f5f6f8;
  --surface: #ffffff;
  --table-head: #fafafa;
  --sidebar: #17181c;
  --sidebar-hover: #232429;
  --sidebar-text: #9a9ba3;

  --success-bg: #e8f6ed; --success-fg: #166534;
  --neutral-bg: #f1f1f3; --neutral-fg: #52525b;
  --warning-bg: #fff1e3; --warning-fg: #c2410c; --warning-strong: #9a3412;
  --danger-bg: #fdecee; --danger-fg: #b91c1c;
  --info-bg: #e8effd; --info-fg: #1d4ed8; --info-border: #c7d7fb;
  --online: #16a34a;

  /* Grifos do PDF */
  --laranja: #ffb15c; --laranja-bg: #ffe8cf; --laranja-fg: #7a3500;
  --amarelo: #ffe14d; --amarelo-bg: #fff5bf; --amarelo-fg: #5c4700;

  /* Apelidos usados nas telas antigas */
  --vermelho: var(--brand); --vinho: var(--brand-hover); --cinza: var(--muted);
  --texto: var(--ink); --texto-2: var(--ink-2); --fundo: var(--page); --borda: var(--line);
  --borda-campo: var(--line-strong); --verde: var(--success-fg); --preto: var(--ink);

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 700; color: var(--ink); }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
a { color: var(--brand-hover); }
a:hover { color: var(--brand); }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mudo { color: var(--muted); font-size: 13px; }
.sec { color: var(--ink-2); }
.quebra { overflow-wrap: anywhere; word-break: break-word; }
svg { flex-shrink: 0; }

/* ---------------------------------------------------------------- Estrutura (app shell) */
.app-shell { display: flex; flex-direction: column; height: 100%; }
.app-body { flex: 1; display: flex; min-height: 0; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; transform: translateY(-200%); }
.skip-link:focus { transform: none; color: #fff; }
.app-main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.app-main:focus { outline: none; }
.app-main > * { flex-shrink: 0; }
.rodape { margin: auto 0 0; padding-top: 12px; font-size: 12px; color: var(--muted); }

/* Topbar */
.topbar { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar__icon-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); flex-shrink: 0; }
.topbar__icon-button:hover { background: var(--page); color: var(--ink); }
.topbar__icon-button svg { width: 18px; height: 18px; }
.topbar__marca { display: flex; }
.topbar__logo { display: block; height: 38px; width: auto; }
.topbar__divider { width: 1px; height: 24px; flex-shrink: 0; background: var(--line); }
.topbar__title { min-width: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar__status, .topbar__date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px var(--success-bg); }
.topbar__dot--off { background: var(--danger-fg); box-shadow: 0 0 0 3px var(--danger-bg); }
.topbar__user { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.topbar__user > svg { width: 14px; height: 14px; }
.topbar__user-text { display: flex; flex-direction: column; min-width: 0; max-width: 180px; line-height: 1.2; }
.topbar__user-text strong, .topbar__user-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__user-text strong { font-size: 12px; color: var(--ink); }
.topbar__user-text small { font-size: 10.5px; color: var(--muted); }
.topbar__logout { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 4px; border-radius: 6px; color: var(--muted); }
.topbar__logout svg { width: 14px; height: 14px; }
.topbar__logout:hover { background: var(--brand-soft); color: var(--brand); }

/* Sidebar */
.sidebar { width: 252px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--sidebar); overflow: hidden; transition: width .18s ease; }
.sidebar__nav { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 12px 12px; }
.sidebar__label { margin: 4px 12px 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-text); white-space: nowrap; }
.sidebar__nav ul + .sidebar__label { margin-top: 22px; }
.sidebar__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar__item, .sidebar__footer-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--sidebar-text); font-size: 13.5px; text-decoration: none; }
.sidebar__item svg, .sidebar__footer-item svg { width: 18px; height: 18px; }
.sidebar__item span, .sidebar__texto { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__item:hover, .sidebar__footer-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar__item--active, .sidebar__item--active:hover { background: var(--brand); color: #fff; }
.sidebar__footer { flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; margin: 0 12px; padding: 12px 0 20px; border-top: 1px solid var(--sidebar-hover); }
.sidebar__footer-item { padding: 10px 12px; }
.so-recolhido { display: none; }
.so-expandido, .so-recolhido { line-height: 0; }

/* Menu recolhido: só os ícones */
.menu-recolhido .sidebar { width: 68px; }
.menu-recolhido .sidebar__label, .menu-recolhido .sidebar__item span, .menu-recolhido .sidebar__texto, .menu-recolhido .so-expandido { display: none; }
.menu-recolhido .so-recolhido { display: inline; }
.menu-recolhido .sidebar__nav ul + .sidebar__label { display: block; height: 1px; margin: 12px 8px; font-size: 0; background: var(--sidebar-hover); }
.menu-recolhido .sidebar__item, .menu-recolhido .sidebar__footer-item { justify-content: center; padding: 10px; }

/* Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb__current { color: var(--ink); font-weight: 600; }

/* Cabeçalho da página (topo) */
.topo { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.topo > div:not(.linha) { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.topo h1 { margin: 0; }
.topo p.sec { color: var(--muted); font-size: 14px; }

/* Faixa escura do Painel (mesma da página inicial do modelo) */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 22px 24px; border-radius: 14px; background: var(--sidebar); color: #fff; animation: subir .45s ease-out both; }
.hero__icone { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: var(--brand); color: #fff; }
.hero__icone svg { width: 22px; height: 22px; }
.hero h1 { margin: 0 0 6px; font-size: 19px; color: #fff; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--sidebar-text); }
.hero__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta svg { width: 14px; height: 14px; }
.hero .ponto { box-shadow: none; }
.hero__acoes { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn:not(.principal) { background: transparent; border-color: #3a3a42; color: #fff; }
.hero .btn:not(.principal):hover { background: var(--sidebar-hover); color: #fff; }
@keyframes subir { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.linha { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.colunas { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.colunas > .principal { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.colunas > .lateral { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.titulo-secao { margin: 4px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- Cards */
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.lateral .cartao h2 { font-size: 14px !important; }
.resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.resumo .cartao { gap: 6px; padding: 18px 20px; }
.resumo .cartao > .mudo:first-child { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.numero { font-weight: 800; font-size: 26px; letter-spacing: -.01em; }
.numero.destaque { color: var(--brand); }
.ponto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--online); flex-shrink: 0; }
.ponto.falha { background: var(--danger-fg); }
.ponto.neutro { background: var(--line-strong); }

/* Avisos: azul (informação), vermelho (erro) */
.aviso { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border: 1px solid var(--info-border); border-radius: 10px; background: var(--info-bg); color: var(--info-fg); font-size: 13.5px; line-height: 1.5; }
.aviso.erro { border-color: #f6c9ce; background: var(--danger-bg); color: var(--danger-fg); }
.aviso a { color: inherit; font-weight: 600; }

/* ---------------------------------------------------------------- Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--page); color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn.principal { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.principal:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; box-shadow: 0 6px 18px -8px rgba(214, 41, 59, .45); }
.btn.destrutivo { border-color: var(--danger-fg); color: var(--danger-fg); }
.btn.destrutivo:hover { background: var(--danger-bg); color: var(--danger-fg); }
.btn.discreto { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.discreto:hover { background: var(--page); }
.btn.pequeno { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ocupado { opacity: .7; cursor: progress; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
form.inline { display: inline; margin: 0; }

/* Seletor de edição (Hoje / Ontem / Outra data) */
.abas { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; align-items: center; }
.abas a { height: 34px; padding: 0 14px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; }
.abas a:hover { background: var(--page); color: var(--ink); }
.abas a.ativo { background: var(--brand); color: #fff; }
.abas .outra-data { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 4px 0 10px; height: 34px; border-radius: 7px; }
.abas .outra-data label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.abas .outra-data label svg { width: 15px; height: 15px; }
.abas .outra-data.ativo { background: var(--brand); }
.abas .outra-data.ativo label { color: #fff; }
.abas input[type=date] { height: 28px; min-height: 0; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 13px; }

/* Guias (abas sublinhadas) */
.guias { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.guias a { height: 42px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.guias a svg { width: 16px; height: 16px; }
.guias a:hover { color: var(--ink); }
.guias a.ativo { color: var(--ink); border-bottom: 2px solid var(--brand); margin-bottom: -1px; }
.contador { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- Ocorrências */
.ocorrencia { gap: 12px; border-left: 4px solid var(--laranja); }
.ocorrencia.ia { border-left-color: var(--amarelo); }
.etiqueta { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etiqueta svg { width: 12px; height: 12px; }
.etiqueta.palavra { background: var(--laranja-bg); color: var(--laranja-fg); }
.etiqueta.prompt { background: var(--amarelo-bg); color: var(--amarelo-fg); }
.etiqueta.cinza { background: var(--neutral-bg); color: var(--neutral-fg); font-weight: 500; }
.trecho { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.resumo-ia { margin: 0; font-weight: 600; line-height: 1.5; }
mark.laranja { background: var(--laranja); color: var(--ink); font-weight: 700; padding: 0 2px; border-radius: 2px; }
mark.amarelo { background: var(--amarelo); color: var(--ink); padding: 0 2px; border-radius: 2px; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; }
.pilula { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.pilula:hover { border-color: var(--line-strong); color: var(--ink); }
.pilula.ativo { background: var(--ink); border-color: var(--ink); color: #fff; }
.filtros button.pilula { cursor: pointer; text-align: left; height: auto; min-height: 32px; padding: 6px 12px; white-space: normal; }
.amostra { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.amostra.grande { width: 22px; height: 14px; }
.amostra.laranja { background: var(--laranja); }
.amostra.amarelo { background: var(--amarelo); }

/* ---------------------------------------------------------------- Formulários */
label.campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.linha > label.campo { flex: 1 1 180px; }
input[type=text], input[type=email], input[type=password], input[type=time], input[type=number], input[type=date], select, textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 400; }
textarea { padding: 10px 12px; min-height: 80px; line-height: 1.5; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.obrigatorio { color: var(--brand); }

/* ---------------------------------------------------------------- Tabelas */
.tabela { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tabela > h2, .tabela > div:first-child { padding: 18px 20px 14px; }
.tabela .rolar { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { height: 40px; padding: 0 16px; background: var(--table-head); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--muted); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
tr.selecionado td, tr.selecionado:hover td { background: var(--brand-soft); }
.direita { text-align: right; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-fg); }
.chip.aviso { background: var(--warning-bg); color: var(--warning-fg); }
.chip.erro { background: var(--danger-bg); color: var(--danger-fg); }
.chip.critico { background: var(--ink); color: #fff; }
.chip.admin { background: var(--danger-bg); color: var(--danger-fg); }
.chip.equipe { background: var(--neutral-bg); color: var(--neutral-fg); }
.chip.sucesso { background: var(--success-bg); color: var(--success-fg); }
pre.tecnico { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--sidebar); color: #f2f0ef; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }

/* ---------------------------------------------------------------- Estado vazio */
.cartao.vazio { align-items: center; text-align: center; padding: 44px 24px; gap: 10px; }
.cartao.vazio h2 { font-size: 16px; }
.icone-grande { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 4px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.icone-grande svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- Painel: lateral */
ol.execucao { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
ol.execucao li { display: flex; justify-content: space-between; gap: 12px; padding-left: 14px; position: relative; color: var(--ink-2); }
ol.execucao li::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--online); }
ol.execucao li.falha::before { background: var(--danger-fg); }
ol.execucao li.falha { color: var(--danger-fg); }
details.substituir summary, details.plano-b summary, details.restaurar summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details.substituir summary svg, details.plano-b summary svg, details.restaurar summary svg { width: 16px; height: 16px; }
details.substituir[open] summary { margin-bottom: 4px; }
details.plano-b { width: 100%; max-width: 600px; }
details.plano-b summary { min-height: 40px; }
details.plano-b form.envio { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; }
ul.lista-simples { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
ul.lista-simples li { display: flex; flex-direction: column; gap: 2px; }

/* Processando / atualização automática */
.ponto.pulsando { background: var(--brand); animation: pulsar 1.2s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .25; } }
.girando { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: girar .9s linear infinite; display: inline-block; flex: none; }
.girando.pequeno { width: 16px; height: 16px; border-width: 2px; }
@keyframes girar { to { transform: rotate(360deg); } }
.cartao.processando { border-color: #f6c9ce; background: #fffafa; }

/* Escolher arquivo (arrastar e soltar) */
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px; padding: 18px 20px; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--table-head); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.arrastando { border-color: var(--brand); background: var(--brand-soft); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone .dz-icone { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.dropzone .dz-icone svg { width: 22px; height: 22px; }
.dropzone .dz-textos { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dropzone .dz-textos strong { font-size: 14px; overflow-wrap: anywhere; }
.dropzone .dz-trocar { display: none; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--brand-hover); }
.dropzone.escolhido { border-style: solid; border-color: var(--success-fg); background: var(--success-bg); }
.dropzone.escolhido .dz-icone { color: var(--success-fg); }
.dropzone.escolhido .dz-trocar { display: inline; }
.dropzone.invalido { border-color: var(--danger-fg); background: var(--danger-bg); }
.dropzone.compacto { padding: 12px 14px; }
.dropzone.compacto .dz-icone { width: 36px; height: 36px; }

/* ---------------------------------------------------------------- Prompts da IA */
.grade-prompts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cartao.prompt { transition: border-color .15s, box-shadow .15s; }
.cartao.prompt:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px -12px rgba(24, 24, 27, .25); }
.cartao.prompt.pausado { background: var(--table-head); }
.cartao.prompt.pausado h3 { color: var(--muted); }
.texto-prompt { margin: 0; font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cartao.interno { background: var(--table-head); padding: 14px 16px; gap: 8px; }
article.teste { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
article.teste:first-of-type { border-top: 0; padding-top: 0; }
.achado-ia { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--amarelo); border-radius: 8px; background: var(--surface); }
.achado-ia.termo { border-left-color: var(--laranja); }
details.achados { display: flex; flex-direction: column; gap: 10px; }
details.achados > summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
details.achados .achado-ia + .achado-ia { margin-top: 10px; }
ol.versoes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
ol.versoes li { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
ol.versoes li:last-child { border-bottom: 0; padding-bottom: 0; }
details.restaurar summary { font-size: 13px; }
.comparar { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.texto-diff { margin: 0; line-height: 1.7; font-size: 14px; }
.diff-add { background: var(--success-bg); color: var(--success-fg); padding: 1px 3px; border-radius: 3px; }
.diff-rem { background: var(--danger-bg); color: var(--danger-fg); text-decoration: line-through; padding: 1px 3px; border-radius: 3px; }
.resposta { white-space: pre-wrap; line-height: 1.65; font-size: 14.5px; }
.resposta a { font-weight: 600; }
details.ajuda summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-hover); }
details.ajuda ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* ---------------------------------------------------------------- Visualizador do PDF (dentro do layout) */
.app-main.cheio { padding: 0; gap: 0; overflow: hidden; }
.visualizador { flex: 1; display: flex; min-height: 0; height: 100%; background: #3a3b42; }
.visualizador .lista { width: 340px; flex-shrink: 0; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.visualizador .pdf { flex: 1; min-width: 0; display: flex; }
.visualizador iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.legenda { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: 8px; }
.item-ocorrencia { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.item-ocorrencia:hover { border-color: var(--line-strong); color: var(--ink); }
.item-ocorrencia.atual { border: 2px solid var(--brand); }

/* ---------------------------------------------------------------- Login (moldura do modelo) */
.auth-shell { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); background: var(--page); }
.auth-shell__brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 36px 48px; color: #fff; background: linear-gradient(160deg, rgba(255,255,255,.04) 0%, rgba(0,0,0,.35) 100%), var(--sidebar); }
.auth-shell__brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); pointer-events: none; }
.auth-shell__glow { position: absolute; width: 520px; height: 520px; left: -140px; top: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(214,41,59,.28) 0%, rgba(214,41,59,0) 65%); filter: blur(8px); animation: brilho 14s ease-in-out infinite alternate; pointer-events: none; }
@keyframes brilho { to { transform: translate(120px, 60px) scale(1.15); } }
.auth-shell__logo { position: relative; display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; padding: 10px 14px; border-radius: 12px; background: #f4f4f5; box-shadow: 0 6px 20px rgba(0,0,0,.35); animation: subir .5s ease-out both; }
.auth-shell__logo img { display: block; height: 34px; width: auto; }
.auth-shell__pitch { position: relative; max-width: 460px; animation: subir .6s ease-out .08s both; }
.auth-shell__title { margin: 0; font-weight: 700; font-size: 34px; line-height: 1.15; letter-spacing: -.01em; }
.auth-shell__app { margin: 6px 0 0; font-size: 18px; font-weight: 600; color: #f87171; }
.auth-shell__text { margin: 18px 0 0; font-size: 14px; line-height: 1.6; color: var(--sidebar-text); }
.auth-shell__features { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-shell__features li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #e4e4e7; }
.auth-shell__feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border: 1px solid rgba(248,113,113,.28); background: rgba(214,41,59,.12); color: #fca5a5; }
.auth-shell__feature-icon svg { width: 16px; height: 16px; }
.auth-shell__copy { position: relative; margin: 0; font-size: 12px; color: #71717a; }
.auth-shell__main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 32px 30px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px -18px rgba(24,24,27,.25); animation: subir .55s ease-out .1s both; }
.auth-card h1 { font-size: 24px; }
.auth-card > p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.auth-card label.campo { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.auth-input input { width: 100%; height: 46px; padding-left: 38px; background: var(--table-head); text-transform: none; letter-spacing: normal; }
.auth-input input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(214,41,59,.12); outline: none; }
.auth-input:focus-within > svg { color: var(--brand); }
.auth-input .ver-senha { position: absolute; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.auth-input .ver-senha:hover { background: var(--page); color: var(--ink); }
.auth-input .ver-senha svg { width: 16px; height: 16px; }
.auth-input--acao input { padding-right: 44px; }
.auth-card .btn.principal { height: 46px; width: 100%; box-shadow: 0 8px 18px -8px rgba(214,41,59,.55); }
.auth-card .aviso.erro { animation: tremer .4s ease-in-out; }
@keyframes tremer { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.auth-shell__legal { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- Relatório do dia */
.icone-medio { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.icone-medio svg { width: 20px; height: 20px; }
.relatorio-resumo { border-left: 4px solid var(--brand); }
.pilula.alerta { background: var(--danger-bg); border-color: #f6c9ce; color: var(--danger-fg); }
.aviso.sucesso { border-color: #bfe5cc; background: var(--success-bg); color: var(--success-fg); }
.aviso svg { width: 18px; height: 18px; margin-top: 1px; }
.secao-relatorio h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .03em; }
.item-relatorio { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.item-relatorio:first-of-type { border-top: 0; }
.secao-relatorio > .linha + .item-relatorio, .secao-relatorio > .aviso + .item-relatorio { border-top: 0; padding-top: 4px; }
.item-relatorio__cab { font-size: 13px; }
.item-relatorio__resumo { margin: 0; font-size: 14px; line-height: 1.55; }
.so-imprimir { display: none; }
/* ---------------------------------------------------------------- Perfis, permissões e usuários (versão 0.5.0)
   Porte das telas de Configurações do Projeto Modelo Calper: grupo recolhível no menu, matriz com chaves,
   barra de alterações pendentes, diálogos e checklist de senha. */
.visualmente-oculto { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chip.info { background: var(--info-bg); color: var(--info-fg); }
.chip[hidden] { display: none; }

/* Menu lateral: grupo Configurações com subitens (trilho vertical, como no modelo) */
.sidebar__group > summary { list-style: none; cursor: pointer; }
.sidebar__group > summary::-webkit-details-marker { display: none; }
.sidebar__group--active > summary { color: #fff; }
.sidebar__chevron { flex: 0 0 auto !important; line-height: 0; transition: transform .15s ease; }
.sidebar__chevron svg { width: 16px; height: 16px; }
.sidebar__group[open] .sidebar__chevron { transform: rotate(90deg); }
.sidebar__subitems { margin: 2px 0 6px 19px !important; padding-left: 10px !important; border-left: 1px solid var(--sidebar-hover); }
.sidebar__subitem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-size: 13px; text-decoration: none; }
.sidebar__subitem svg { width: 16px; height: 16px; }
.sidebar__subitem span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__subitem:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar__subitem--active, .sidebar__subitem--active:hover { background: var(--brand); color: #fff; }
.menu-recolhido .sidebar__chevron, .menu-recolhido .sidebar__subitem span { display: none; }
.menu-recolhido .sidebar__subitems { margin: 2px 0 6px !important; padding-left: 0 !important; border-left: 0; }
.menu-recolhido .sidebar__subitem { justify-content: center; padding: 10px; }

/* Chave (switch) */
.switch { position: relative; display: inline-flex; flex-shrink: 0; width: 40px; height: 22px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; z-index: 1; }
.switch__thumb { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch__thumb::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch__thumb { background: var(--brand); }
.switch input:checked + .switch__thumb::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch__thumb { opacity: .45; }

/* Perfis e permissões */
.perms { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.perms__roles { padding: 16px 12px; gap: 0; }
.perms__roles-title { margin: 0 8px 10px; }
.perms__role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.perms__role-item { display: flex; align-items: center; gap: 4px; }
.perms__role { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); text-decoration: none; }
.perms__role:hover { background: var(--page); color: var(--ink); }
.perms__role--active, .perms__role--active:hover { border-color: var(--brand); background: var(--brand-soft); }
.perms__role-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.perms__role-name svg { width: 13px; height: 13px; color: var(--muted); }
.perms__role-meta { font-size: 12px; color: var(--muted); }
.perms__role-acao { width: 32px; padding: 0; }
.perms__role-protected { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; color: var(--muted); }
.perms__role-protected svg { width: 14px; height: 14px; }
.perms__new-role { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.perms__matrix { padding: 0; gap: 0; }
.perms__matrix-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; }
.perms__matrix-header h2 { margin: 0 0 4px; font-size: 18px; }
.perms__matrix-header p { margin: 0; font-size: 13px; color: var(--muted); max-width: 640px; }
.perms__somente-leitura { display: flex; align-items: center; gap: 6px; margin-top: 8px !important; color: var(--warning-fg) !important; font-weight: 600; }
.perms__somente-leitura svg { width: 14px; height: 14px; }
.perms__filter { position: relative; width: 260px; color: var(--muted); }
.perms__filter > svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; transform: translateY(-50%); }
.perms__filter input { width: 100%; padding-left: 36px; }
.perms__group[hidden], .permission-row[hidden] { display: none; }
.perms__group ul { list-style: none; margin: 0; padding: 0; }
.perms__group-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--table-head); }
.perms__group-header .titulo-secao { margin: 0; }
.perms__group-count { flex: 1; font-size: 12px; color: var(--muted); }
.perms__release-all { border: 0; background: none; padding: 4px 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.perms__vazio { padding: 24px 20px; text-align: center; }
.permission-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 20px; border-top: 1px solid var(--line); }
.permission-row--nested { min-height: 52px; padding-left: 48px; background-image: linear-gradient(var(--line), var(--line)); background-repeat: no-repeat; background-size: 2px 100%; background-position: 28px 0; }
.permission-row--changed { background-color: var(--warning-bg); }
.permission-row__icon { flex-shrink: 0; line-height: 0; color: var(--muted); }
.permission-row__icon svg { width: 18px; height: 18px; }
.permission-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.permission-row__label { font-size: 14px; font-weight: 600; }
.permission-row__id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--muted); }
.permission-row__desc { font-size: 12px; }
.permission-row__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.save-bar { position: sticky; bottom: -40px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--surface); font-size: 14px; color: var(--muted); }
.save-bar--pendente { background: var(--ink); color: #fff; }
.save-bar__actions { display: flex; gap: 10px; }
.save-bar--pendente .btn:not(.principal) { border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
.save-bar--pendente .btn:not(.principal):hover { background: rgba(255,255,255,.08); }

/* Usuários */
.usuario-celula { display: flex; align-items: center; gap: 12px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand-hover); font-size: 13px; font-weight: 700; }
.acoes { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.trava { display: inline-flex; color: var(--muted); }
.trava svg { width: 16px; height: 16px; }
.filtros-usuarios { gap: 16px; }
.filtros-usuarios .guias { margin: -8px -20px 0; padding: 0 12px; }
.senha-temporaria { border-color: var(--info-border); background: var(--info-bg); }
.senha-temporaria h2 { color: var(--info-fg); }
.senha-temporaria > .linha > svg { color: var(--info-fg); }
.senha-temporaria__valor { padding: 8px 14px; border: 1px dashed var(--info-fg); border-radius: 8px; background: var(--surface); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; letter-spacing: .08em; color: var(--ink); user-select: all; }

/* Diálogos */
.dialogo { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(23,24,28,.45); color: var(--ink); }
.dialogo::backdrop { background: rgba(23,24,28,.45); }
.dialogo__corpo { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.dialogo__corpo h2 { font-size: 18px; }
.dialogo__acoes { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Senha: checklist ao vivo */
.senha-form { max-width: 520px; }
.checklist { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.checklist li { display: flex; align-items: center; gap: 6px; }
.checklist svg { width: 14px; height: 14px; opacity: .35; }
.checklist li.ok { color: var(--success-fg); }
.checklist li.ok svg { opacity: 1; }
.auth-card__icone { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--danger-bg); color: var(--brand); }
.auth-card__icone svg { width: 24px; height: 24px; }

@media (max-width: 1100px) {
  .perms { grid-template-columns: minmax(0, 1fr); }
  .perms__filter { width: 100%; }
}

/* Escolha do modelo da IA: opções à vista, agrupadas por provedor */
.modelos { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.modelos__titulo { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.modelos__opcoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.modelo-opcao { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.modelo-opcao:hover { border-color: var(--line-strong); }
.modelo-opcao:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.modelo-opcao input { margin: 2px 0 0; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--brand); }
.modelo-opcao__texto { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.modelo-opcao__texto small { font-size: 12.5px; color: var(--muted); }

/* Consumo de IA */
.mes-nav { display: inline-flex; align-items: center; gap: 10px; }
.mes-nav strong { min-width: 150px; text-align: center; }
.mes-nav [aria-disabled] { opacity: .4; pointer-events: none; }
.girar { display: inline-flex; transform: rotate(180deg); }
.nowrap { white-space: nowrap; }
.texto-erro { color: var(--brand); }
.numeros-ia { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.numero-ia { gap: 4px; }
.numero-ia .titulo-secao { margin: 0 0 4px; }
.numero-ia__valor { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.numero-ia__detalhe { font-size: 12px; }
.numero-ia--destaque { border-color: var(--brand); }
.orcamento { gap: 10px; }
.barra { position: relative; height: 10px; border-radius: 999px; background: var(--page); overflow: visible; }
.barra > span { display: block; height: 100%; border-radius: 999px; background: var(--success-fg); }
.barra > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); }
.orcamento--alerta .barra > span { background: var(--warning-fg); }
.orcamento--estourado .barra > span { background: var(--brand); }
.orcamento--estourado { border-color: var(--brand); }
.legenda-ia { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legenda-ia__cor { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.legenda-ia__cor--req, .dias-ia__req { background: var(--ink-2); }
.legenda-ia__cor--ret, .dias-ia__ret { background: var(--brand); }
.dias-ia { display: grid; grid-template-columns: repeat(var(--dias), minmax(14px, 1fr)); gap: 4px; align-items: end; overflow-x: auto; }
.dias-ia__dia { display: flex; flex-direction: column; align-items: center; gap: 6px; outline: none; }
.dias-ia__barra { display: flex; flex-direction: column-reverse; justify-content: flex-start; width: 100%; height: 140px; border-radius: 4px; background: var(--page); overflow: hidden; }
.dias-ia__barra span { display: block; width: 100%; }
.dias-ia__dia:hover .dias-ia__barra, .dias-ia__dia:focus-visible .dias-ia__barra { outline: 2px solid var(--line-strong); }
.dias-ia__rotulo { font-size: 11px; color: var(--muted); }
.dias-ia__dia--hoje .dias-ia__rotulo { color: var(--brand); font-weight: 700; }
.grupos-ia { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.tabela__titulo { padding: 16px 20px 8px; }
.tabela__titulo h2 { font-size: 16px; }
.tabela-ia small { font-size: 12px; }
.linha-atual td { background: var(--brand-soft); }
.linha-apagada td { color: var(--muted); }
.paginacao { justify-content: center; padding: 12px; }
.form-preco { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

/* Prompts da IA: texto do prompt recolhível e regras gerais */
.prompt-texto > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.prompt-texto > summary::-webkit-details-marker { display: none; }
.prompt-texto__abrir { font-size: 13px; font-weight: 600; color: var(--brand); }
.prompt-texto[open] > summary .texto-prompt { display: none; }
.prompt-texto[open] .prompt-texto__abrir::after { content: " (fechar)"; }
.prompt-texto[open] > summary { margin-bottom: 8px; }
.regras-gerais > summary { list-style: none; }
.regras-gerais > summary::-webkit-details-marker { display: none; }
.regras-gerais > summary svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.regras-gerais__corpo { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.regras-gerais__form { display: flex; flex-direction: column; gap: 12px; }
.regras-gerais__versoes ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.regras-gerais__versoes li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }

/* Pesquisar no Diário por período */
.periodo { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.periodo legend { margin-bottom: 8px; }
.periodo .campo { flex: 0 1 170px; }
.periodo__atalhos { flex: 1 1 280px; margin: 0; }
.pilula.ativo { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.confirmar-pesquisa { border-color: var(--brand); }
.confirmar-pesquisa .numeros-ia { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.confirmar-pesquisa .numero-ia { display: flex; flex-direction: column; gap: 2px; }
.trechos__data { margin: 8px 0 0; }

/* Relatório: grifo de cada item */
.grifos-barra { gap: 10px; }
.grifos-barra .mudo { flex: 1 1 260px; }
.grifo-item { margin-top: 2px; }
.grifo-item > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); list-style: none; }
.grifo-item > summary::-webkit-details-marker { display: none; }
.grifo-item > summary svg { width: 15px; height: 15px; }
.grifo-item[open] > summary { margin-bottom: 8px; }
.grifo-item img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

@media print {
  .topbar, .sidebar, .breadcrumb, .nao-imprimir, .rodape, .skip-link { display: none !important; }
  .so-imprimir { display: inline; }
  html, body, .app-shell, .app-body { height: auto; display: block; background: #fff; }
  .app-main { overflow: visible; padding: 0; }
  .cartao { break-inside: auto; border-color: #ccc; }
  .item-relatorio { break-inside: avoid; }
}

.contexto-curto { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- Telas menores */
@media (max-width: 900px) {
  .topbar__hide-sm { display: none; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-shell__brand { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 16px 20px; }
  .auth-shell__logo img { height: 24px; }
  .auth-shell__title { font-size: 17px; }
  .auth-shell__app { margin-top: 0; font-size: 13px; }
  .auth-shell__text, .auth-shell__features, .auth-shell__copy { display: none; }
  .auth-shell__main { justify-content: flex-start; padding: 24px 16px 32px; }
  .auth-card { padding: 24px 20px 20px; }
  .visualizador { flex-direction: column; }
  .visualizador .lista { width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .visualizador .pdf { min-height: 70vh; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__left { gap: 10px; }
  .topbar__user-text, .topbar__title, .topbar__divider { display: none; }
  .topbar__logo { height: 30px; }
  .app-main { padding: 16px 14px 28px; gap: 16px; }
  .menu-recolhido .sidebar { width: 56px; }
  .menu-recolhido .sidebar__nav { padding: 12px 6px; }
  .menu-recolhido .sidebar__footer { margin: 0 6px; }
  .hero { padding: 16px; gap: 12px; }
  .hero__icone { width: 36px; height: 36px; }
  .hero > div:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .hero h1 { font-size: 16px; }
  .hero__acoes { margin-left: 0; width: 100%; }
  .hero__acoes > *, .hero__acoes form .btn { flex: 1 1 auto; }
  .hero__acoes .btn { width: 100%; }
  .resumo .cartao > .mudo:first-child { font-size: 11px; }
  .resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .resumo .cartao { padding: 14px; }
  .numero { font-size: 22px; }
  .dropzone { padding: 14px; }
  .cartao { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- Dashboard: busca por nº da edição */
.busca-edicao { display: flex; align-items: center; gap: 8px; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 12px; }
.busca-edicao label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.busca-edicao label svg { width: 15px; height: 15px; color: var(--brand); }
.busca-edicao input { min-height: 34px; height: 34px; width: 92px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 10px; font-weight: 700; color: var(--brand-hover); }

/* Card de destaque (Processos localizados) */
.resumo .cartao.destacado { border-color: #f3c0c6; position: relative; overflow: hidden; }
.resumo .cartao.destacado::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--laranja); }

/* ---------------------------------------------------------------- Dashboard: capa da edição */
.capa-bloco { display: flex; gap: 22px; align-items: stretch; flex-wrap: wrap; padding: 20px; border-radius: 14px; background: var(--sidebar); color: #fff; }
.capa-mini { position: relative; width: 190px; flex: none; aspect-ratio: 210 / 297; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); transition: transform .15s; }
.capa-mini:hover { transform: translateY(-3px); }
.capa-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.capa-mini .capa-lupa { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(10, 10, 12, 0); transition: background .15s; }
.capa-mini .capa-lupa svg { width: 30px; height: 30px; opacity: 0; transition: opacity .15s; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.capa-mini:hover .capa-lupa { background: rgba(10, 10, 12, .28); }
.capa-mini:hover .capa-lupa svg { opacity: 1; }
.capa-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.capa-info .titulo-secao { color: var(--sidebar-text); }
.capa-info h2 { color: #fff; font-size: 22px; }
.capa-info .btn:not(.principal) { background: transparent; border-color: #3a3a42; color: #fff; }
.capa-info .btn:not(.principal):hover { background: var(--sidebar-hover); color: #fff; }
