/* IPRB Comodoro – MT — gestão.
   Identidade da IPRB (iprb.org.br): marinho, azul da marca, dourado e o vermelho de destaque. */
:root {
  /* Marca RTERA v1.1, a mesma do Delta: Ink, Slate, Stone, Mist, Paper e Sand de acento. */
  --ground: #f5f5f4;         /* Paper */
  --surface: #fafaf9;
  --raised: #f2f2f1;
  --active: #ebebea;
  --border: #d1d5db;         /* Mist */
  --rule: #e4e4e2;
  --control: #b9bec6;
  --text: #111214;           /* Ink */
  --muted: #475569;          /* Stone */
  --faint: #5f6b7a;
  --night: #111214;          /* painel do login: Ink */
  --night-text: #f5f5f4;
  --night-muted: #9ca3af;
  --lateral: #f5f5f4;        /* barra lateral no mesmo Paper da página, como no Delta */
  --lateral-hover: #ebebea;
  --flame: #111214;          /* ação principal: Ink */
  --flame-press: #1e2933;    /* Slate */
  --flame-ink: #a5452f;      /* terracota: saídas e erro */
  --saida: #a8875c;          /* Sand escuro: série de saídas */
  --gold: #bfa27a;           /* Sand: único acento */
  --sand-forte: #806139;     /* Sand legível em texto e foco */
  --flame-soft: #ebe5dc;
  --ember: #806139;
  --positive: #4f6b5a;
  --pill-positive-bg: #e3ebe5; --pill-positive-ink: #2c4234;
  --pill-negative-bg: #f4e4df; --pill-negative-ink: #7a3121;
  --pill-warning-bg: #efe7da;  --pill-warning-ink: #5c4527;
  --pill-neutral-bg: #ebebea;  --pill-neutral-ink: #111214;
  --radius-card: 6px; --radius-control: 6px; --radius-chip: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-marca: "Montserrat", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --fs-title: 20px; --fs-kpi: 24px; --fs-section: 15px; --fs-body: 14px; --fs-small: 12.5px;
  --control-height: 38px; --row-height: 50px; --pad: 28px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; border-top: 4px solid #267047; background: var(--ground); color: var(--text);
  font: 400 var(--fs-body)/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--flame); color: #fff; }
:focus-visible { outline-color: var(--flame); }
input, select, textarea, button { font: inherit; color: inherit; caret-color: var(--flame); }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--sand-forte); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: #c9c9c6 transparent; }
h1, h2, h3 { margin: 0; font-family: var(--font-marca); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; text-wrap: balance; }
.carregando { padding: 40px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.saida-txt { color: var(--flame-ink); }
.muted { color: var(--muted); }
.vazio-traco { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 254px minmax(0, 1fr); min-height: 100dvh; }
.lateral {
  background: var(--lateral); border-right: 1px solid var(--border); color: var(--text);
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 22px 10px 12px; overflow-y: auto;
}
.marca { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 0 8px 22px; margin-bottom: 14px; border-bottom: 1px solid var(--border); text-decoration: none; }
.marca img { width: 112px; height: 112px; border-radius: 50%; }
.marca strong { display: block; font-family: var(--font-marca); font-size: 16px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.marca span { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--sand-forte); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-grupo { margin: 14px 10px 6px; font-size: 12px; color: var(--muted); }
.nav-grupo:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px;
  border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 400; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--lateral-hover); }
.nav a[aria-current="page"] { font-weight: 600; background: var(--lateral-hover); }
.nav svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a[aria-current="page"] svg, .nav a:hover svg { color: var(--text); }
.lateral-pe { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--active); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.quem-bloco { min-width: 0; flex: 1; }
.lateral-pe .quem { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral-pe .papel { color: var(--muted); font-size: 11px; }
.ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--text); cursor: pointer; }
.ico:hover { background: var(--lateral-hover); }
.ico svg { width: 17px; height: 17px; }

.topo { height: 68px; display: flex; align-items: center; padding: 0 var(--pad) 0 40px; border-bottom: 1px solid var(--border); }
.busca { position: relative; width: min(288px, 100%); }
.busca svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.busca input[type=search] { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; }
.topo-movel { display: none; }
main { min-width: 0; padding: 32px var(--pad) 64px 40px; width: 100%; }

/* ---------- título da tela ---------- */
.titulo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.titulo h1 { font-size: var(--fs-title); display: flex; align-items: center; gap: 10px; }
.h1-ico { display: inline-grid; color: var(--muted); }
.h1-ico svg { width: 18px; height: 18px; }
.titulo .sub { color: var(--muted); margin-top: 4px; }
.titulo-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s var(--ease);
}
.btn:hover { background: var(--raised); border-color: #b9b9b6; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn svg { width: 16px; height: 16px; }
.btn-chama { background: var(--flame); border-color: var(--flame); color: #fff; }
.btn-chama:hover { background: var(--flame-press); border-color: var(--flame-press); }
.btn-preto { background: var(--night); border-color: var(--night); color: #fff; }
.btn-preto:hover { background: #272c32; border-color: #272c32; }
.btn-texto { border-color: transparent; background: transparent; padding: 0 10px; }
.btn-texto:hover { background: var(--active); border-color: transparent; }
.btn-perigo { color: var(--flame-ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

.segmento { display: inline-flex; background: var(--active); border-radius: var(--radius-control); padding: 3px; }
.segmento a, .segmento button {
  height: 32px; padding: 0 14px; display: inline-flex; align-items: center; border: 0; background: none;
  border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 500; cursor: pointer;
}
.segmento [aria-current="true"] { background: var(--surface); color: var(--text); }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 500; color: var(--text); }
.campo small { color: var(--muted); font-size: var(--fs-small); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=search], input[type=tel], select, textarea {
  height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface); width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(18,18,18,.08); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=month] { width: auto; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--flame); }
.grade-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grade-form .larga { grid-column: 1 / -1; }
.erro-form { color: var(--flame-ink); font-weight: 500; min-height: 1.5em; margin: 0; }

/* ---------- painéis ---------- */
.painel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.painel-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.painel-cab h2 { font-size: var(--fs-section); }
.btn svg { width: 15px; height: 15px; }
.barra-mes { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -6px 0 14px; }
.mes-nav { display: flex; align-items: center; gap: 6px; }
.mes-nav strong { font-weight: 500; font-size: 13.5px; min-width: 132px; text-align: center; }
.btn-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--text); cursor: pointer; position: relative; }
.btn-ico:hover { background: var(--active); }
.btn-ico svg { width: 16px; height: 16px; }
.cal input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.secao { font-family: var(--font); font-size: 15px; font-weight: 400; color: var(--muted); margin: 34px 0 14px; }
.grade-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 12px; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.grade-3 .painel { min-height: 430px; }
.rosca { display: flex; align-items: center; gap: 20px; min-height: 320px; }
.rosca svg { width: 132px; height: 132px; flex: none; }
.rosca ul { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.rosca li i, .valores i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.abas { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); margin: -4px 0 8px; }
.abas button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.abas [aria-selected="true"] { border-bottom-color: var(--text); font-weight: 500; }
.caixa-tabela { border: 1px solid var(--border); border-radius: 4px; min-height: 300px; }
table.valores { width: 100%; border-collapse: collapse; font-size: 12px; }
table.valores th { background: var(--raised); text-align: left; font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.valores td { padding: 7px 10px; border-bottom: 1px solid var(--rule); }
table.valores .num { text-align: right; font-weight: 500; }
.nota-pe { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.painel-corpo { padding: 16px 20px 20px; }

/* faixa de números: tipo, não ladrilho */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.kpi { padding: 26px 14px 24px; min-height: 100px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; gap: 12px; }
.kpi-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi dt { color: var(--muted); font-weight: 400; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.kpi dd { white-space: nowrap; font-family: var(--font-marca); margin: 6px 0 0; font-size: var(--fs-kpi); font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .nota { margin-top: 6px; font-size: var(--fs-small); color: var(--muted); }
.kpi.destaque dd { font-size: var(--fs-kpi); }

.colunas { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.colunas > div { display: grid; gap: 20px; min-width: 0; }

/* gráfico de barras */
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico text { font: 500 11.5px var(--font); fill: var(--muted); }
.grafico .lin { stroke: var(--rule); }
.legenda { display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* lista de categorias com barra */
.barras { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.barras li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.barras .trilho { grid-column: 1 / -1; height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.barras .trilho b { display: block; height: 100%; background: var(--flame); border-radius: 3px; transform-origin: left; animation: crescer .7s var(--ease) both; }
.barras.saidas .trilho b { background: var(--saida); }
@keyframes crescer { from { transform: scaleX(0); } }

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0 16px; height: var(--row-height); border-bottom: 1px solid var(--rule); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clicavel { cursor: pointer; transition: background .12s; }
tbody tr.clicavel:hover { background: var(--raised); }
td .linha2 { display: block; color: var(--muted); font-size: var(--fs-small); }
td.acoes { width: 1%; white-space: nowrap; text-align: right; }
tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--radius-chip); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-ok { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill-mal { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill-atencao { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill-neutro { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }

.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filtros input[type=search] { max-width: 300px; }

.vazio { padding: 48px 24px; text-align: center; color: var(--muted); }
.vazio strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.vazio .btn { margin-top: 16px; }

/* listas do painel */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.lista li:last-child { border-bottom: 0; }
.lista .lado { margin-left: auto; text-align: right; }

/* pessoa */
.ficha { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.dados dl { margin: 0; display: grid; gap: 14px; }
.dados dt { color: var(--muted); font-size: 13px; }
.dados dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.meses-dizimo { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 4px; }
.meses-dizimo span { height: 30px; border-radius: 4px; background: var(--rule); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.meses-dizimo span.deu { background: var(--flame); color: #fff; }

/* documentos */
.docs-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; padding: 16px; }
.doc { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); text-decoration: none; transition: border-color .15s, transform .2s var(--ease); }
.doc:hover { border-color: #bdbdba; transform: translateY(-2px); }
.doc .previa { aspect-ratio: 4/3; background: var(--raised); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--rule); }
.doc .previa img { width: 100%; height: 100%; object-fit: cover; }
.doc .previa b { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.doc .meta { padding: 10px 12px; font-size: 13px; }
.doc .meta strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .meta span { color: var(--muted); font-size: 12px; }
.solta { border: 1.5px dashed var(--control); border-radius: var(--radius-card); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.solta:hover, .solta.sobre { border-color: var(--flame); background: var(--flame-soft); color: var(--text); }
.solta input { display: none; }
.anexos { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.anexos a { font-weight: 500; }

/* convites */
.link-convite { display: flex; gap: 8px; margin-top: 8px; }
.link-convite input { font-size: 13px; }

/* ---------- diálogo ---------- */
dialog {
  border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
}
dialog[open] { animation: abrir .28s var(--ease); }
dialog::backdrop { background: rgba(22,25,29,.55); }
@keyframes abrir { from { opacity: 0; transform: translateY(12px) scale(.98); } }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dlg-cab { padding: 22px 24px 4px; }
.dlg-cab h2 { font-size: 19px; }
.dlg-corpo { padding: 16px 24px; overflow-y: auto; display: grid; gap: 16px; }
.dlg-pe { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--rule); }
.dlg-pe .esq { margin-right: auto; }
.tipo-escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo-escolha label { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--control); border-radius: var(--radius-control); cursor: pointer; font-weight: 500; transition: all .15s; }
.tipo-escolha input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-escolha input:checked + label { background: var(--night); border-color: var(--night); color: #fff; }
.tipo-escolha input:focus-visible + label { outline: 2px solid var(--flame); outline-offset: 2px; }
.valor-grande input { height: 52px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

#aviso {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--night); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: abrir .25s var(--ease);
}

/* ---------- entrada (login, convite, configurar) ---------- */
.entrada { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.entrada-marca {
  background: var(--night); color: var(--night-text); display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px; overflow: hidden; position: relative;
}
.entrada-marca img { width: min(340px, 64%); height: auto; border-radius: 50%; align-self: center; margin: auto 0; animation: surgir 1s var(--ease) both; }
@keyframes surgir { from { opacity: 0; transform: scale(.94); } }
.entrada-marca h2 { font-size: 30px; line-height: 1.15; max-width: 16ch; }
.entrada-marca .local { color: var(--gold); font-family: var(--font-marca); font-weight: 700; margin: 10px 0 0; }
.entrada-marca p { color: var(--night-muted); margin: 8px 0 0; }
.entrada-form { display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 32px 24px 20px; }
.entrada-cartao { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 32px; display: grid; gap: 22px; }
.entrada-form form { display: grid; gap: 18px; }
.entrada-selo { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--night-muted); margin: 0; }
.restrito { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin: 0; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--flame-ink); }
.restrito svg { width: 14px; height: 14px; }
.aviso-restrito { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.5; color: var(--muted); }
.assinatura { font-size: 12px; color: var(--muted); text-align: center; padding: 16px var(--pad) 20px; }
.assinatura a { color: var(--text); font-weight: 600; text-decoration: none; }
.assinatura a:hover { text-decoration: underline; }
main + .assinatura { border-top: 1px solid var(--border); margin: 0 var(--pad) 0 40px; padding-left: 0; padding-right: 0; text-align: left; }
.entrada-form h1 { font-size: 28px; }
.entrada-form .sub { color: var(--muted); margin: -8px 0 6px; }
.entrada-form .btn { height: 46px; font-size: 15px; }

/* ---------- entrada por rolagem ---------- */
.surge { animation: subir .5s var(--ease) both; }
.surge:nth-child(2) { animation-delay: 60ms; }
.surge:nth-child(3) { animation-delay: 120ms; }
.surge:nth-child(4) { animation-delay: 180ms; }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- celular ---------- */
@media (max-width: 1000px) {
  .grade-3 { grid-template-columns: 1fr 1fr; }
  .grade-3 .painel:last-child { grid-column: 1 / -1; }
  .grade-3 .painel { min-height: 0; }
  .grade-2 { grid-template-columns: 1fr; }
  .colunas, .ficha { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --pad: 16px; --fs-title: 22px; --fs-kpi: 24px; }
  .topo { display: none; }
  main { padding-left: var(--pad); }
  .grade-3 { grid-template-columns: 1fr; }
  .rosca { min-height: 0; }
  .caixa-tabela { min-height: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; inset: 0 auto 0 0; width: min(290px, 84vw); z-index: 40; transform: translateX(-102%);
    transition: transform .3s var(--ease); visibility: hidden;
  }
  .shell.menu-aberto .lateral { transform: none; visibility: visible; }
  .shell.menu-aberto::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .topo-movel {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
    background: var(--lateral); color: var(--text); height: 56px; padding: 0 12px; border-bottom: 1px solid var(--border);
  }
  .topo-movel img { width: 34px; height: 34px; border-radius: 50%; }
  .topo-movel strong { font-weight: 600; }
  .topo-movel button { background: none; border: 0; color: var(--text); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
  .topo-movel svg { width: 22px; height: 22px; }
  main { padding-top: 20px; }
  .kpi { padding: 16px; }
  .kpi.destaque dd { font-size: var(--fs-kpi); }
}
@media (max-width: 480px) {
  .kpi-ico { display: none; }
  .kpi { padding: 14px 12px; }
  .kpi dd, .kpi.destaque dd { font-size: 21px; }
  .titulo { align-items: flex-start; }
  .titulo-acoes { width: 100%; }
  .titulo-acoes .btn-chama { flex: 1; }
  .grade-form { grid-template-columns: 1fr; }
  .entrada { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .entrada-marca { padding: 28px 24px; flex-direction: row; align-items: center; gap: 16px; justify-content: flex-start; }
  .entrada-marca img { width: 60px; margin: 0; }
  .entrada-marca .local { margin-top: 2px; font-size: 13px; }
  .entrada-marca h2 { font-size: 18px; max-width: none; }
  .entrada-marca p:not(.local) { display: none; }
  .entrada-form { place-items: start center; padding: 24px 16px 12px; }
  .entrada-cartao { padding: 24px 20px; }
  main + .assinatura { margin: 0 16px; }
  .esconde-movel { display: none; }
  td, th { padding-left: 12px; padding-right: 12px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog form { max-height: 94dvh; }
  .meses-dizimo { grid-template-columns: repeat(6, 1fr); }
}
.esconde-movel-inv { display: none; }
@media (max-width: 900px) { .esconde-movel-inv { display: inline; } }

/* ---------- apresentação ---------- */
.apresentacao { position: fixed; inset: 0; z-index: 100; background: var(--ground); display: grid; grid-template-rows: 1fr auto; }
.palco { display: grid; place-items: center; padding: 3vh 4vw 0; min-height: 0; overflow: auto; }
.slide { width: min(1200px, 100%); animation: subir .45s var(--ease) both; }
.slide h2 { font-size: clamp(28px, 4.4vw, 60px); font-weight: 500; letter-spacing: -0.02em; margin: 6px 0 4vh; }
.slide-rot { font-family: var(--font-mono); font-size: clamp(11px, 1vw, 14px); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.slide-sub { font-size: clamp(15px, 1.6vw, 22px); color: var(--muted); max-width: 46ch; margin: 0; }
.slide.grande h2 { font-size: clamp(44px, 9vw, 128px); }
.slide-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.slide-nums div { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3vh 24px; }
.slide-nums span { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slide-nums strong { display: block; margin-top: 10px; font-family: var(--font-marca); font-weight: 500; font-size: clamp(26px, 3.4vw, 46px); white-space: nowrap; }
.slide-grafico svg { width: 100%; height: auto; }
.slide .legenda { margin-top: 12px; font-size: 15px; }
.slide-duas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4vw; align-items: center; }
.slide .rosca { min-height: 0; gap: 32px; }
.slide .rosca svg { width: clamp(150px, 20vw, 280px); height: auto; }
.slide .rosca ul { font-size: clamp(13px, 1.3vw, 17px); gap: 6px; }
.slide table.valores { font-size: clamp(13px, 1.2vw, 16px); background: var(--surface); border: 1px solid var(--border); }
.slide-lista { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.slide-lista li { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 2.2vh 0; border-bottom: 1px solid var(--border); font-size: clamp(16px, 1.8vw, 24px); }
.slide-lista small { display: block; font-size: .65em; color: var(--muted); margin-top: 2px; }
.slide-lista strong { font-family: var(--font-marca); font-weight: 500; white-space: nowrap; }
.slide.capa { display: flex; align-items: center; gap: 5vw; }
.slide.capa img { width: clamp(120px, 18vw, 240px); height: auto; border-radius: 50%; flex: none; }
.slide.capa h2 { margin-bottom: 12px; }
.slide-verso { font-family: var(--font-marca); font-size: clamp(20px, 2.6vw, 36px); line-height: 1.35; max-width: 32ch; margin: 0 0 18px; text-wrap: balance; }
.apr-barra { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.apr-barra [data-fechar] { position: absolute; right: 16px; }
@media (max-width: 700px) {
  .slide-duas, .slide.capa { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
}
.doc .meta .pill { display: inline-block; margin-bottom: 4px; font-size: 11px; }
.doc .meta .pill-ok { color: var(--pill-positive-ink); }
.doc .meta .pill-neutro { color: var(--pill-neutral-ink); }
.btn-link { background: none; border: 0; padding: 0; color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.anexos a { display: inline-flex; align-items: center; gap: 6px; }
.anexos svg { width: 14px; height: 14px; color: var(--muted); }
.entrada-form .erro-form:empty { display: none; }
.senha-caixa { position: relative; display: block; }
.senha-caixa input { width: 100%; padding-right: 44px; }
.ver-senha { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
.ver-senha:hover { color: var(--text); background: var(--lateral-hover); }
.ver-senha svg { width: 18px; height: 18px; }
.lembrar { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; margin-top: -4px; }
.lembrar input { width: 18px; height: 18px; accent-color: var(--flame); margin: 0; }
