/* =====================================================================
   Plataforma FE — estilos
   ===================================================================== */
:root {
  --brand: #12437f;
  --brand-2: #1d5aa6;
  --brand-soft: #e7eef8;
  --accent: #3da3d1;
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #142033;
  --ink-2: #4a5a72;
  --ink-3: #8592a6;
  --line: #e3e9f2;
  --ok: #1f8a5b;      --ok-soft: #e3f4ec;
  --warn: #b7791f;    --warn-soft: #fbf1df;
  --bad: #c0392b;     --bad-soft: #fbe7e5;
  --violet: #6b4fbb;  --violet-soft: #efeafb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 67, 127, .06), 0 4px 16px rgba(18, 67, 127, .06);
  --shadow-lg: 0 10px 40px rgba(10, 30, 60, .22);
  --side: 252px;
  --top: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13px; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; word-break: break-word; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Entrada ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #dbe7f7 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #d9eef8 0, transparent 55%), var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.login-card .logo { width: 64px; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; }
.login-card .sub { color: var(--ink-2); margin: 6px 0 22px; }
.demo-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 8px; }
.demo-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.demo-item:last-child { border-bottom: 0; }
.demo-item:hover { background: var(--brand-soft); }

/* ---------- Estrutura ---------- */
.shell { min-height: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; height: var(--top); border-bottom: 1px solid var(--line); }
.sidebar .brand img { width: 34px; }
.sidebar .brand b { font-size: 14px; line-height: 1.15; color: var(--brand); }
.sidebar .brand span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.nav { padding: 10px; overflow: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 550; text-decoration: none; margin-bottom: 2px; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav .soon { margin-left: auto; font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.me-box { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 10px; align-items: center; }
.me-box .grow b { display: block; font-size: 13.5px; }
.me-box .grow span { font-size: 12px; color: var(--ink-3); }

.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); background: rgba(243, 246, 251, .88); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid transparent; }
.topbar .menu-btn { display: none; }
.topbar h2 { font-size: 17px; }
.main { margin-left: var(--side); min-height: 100%; }
.content { max-width: 1160px; margin: 0 auto; padding: 8px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 18px; }
.page-head .lead { color: var(--ink-2); margin-top: 4px; max-width: 640px; }

.demo-bar { background: #fff6dd; color: #6b4b00; font-size: 13px; padding: 7px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #f1e2b6; }
.demo-bar button { font-size: 12.5px; padding: 3px 10px; }

.bottom-nav { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(10, 25, 50, .35); z-index: 35; }

/* ---------- Cartões e blocos ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.click { cursor: pointer; transition: transform .08s ease, box-shadow .15s; }
.card.click:hover { box-shadow: 0 2px 4px rgba(18, 67, 127, .08), 0 10px 26px rgba(18, 67, 127, .1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid > *, .cards > *, .stack > * { min-width: 0; }
.kpi > div:last-child { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { display: grid; gap: 14px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.kpi { display: flex; gap: 14px; align-items: center; }
.kpi .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi .ico svg { width: 22px; height: 22px; }
.kpi b { font-size: 24px; display: block; line-height: 1.1; }
.kpi span { color: var(--ink-2); font-size: 13px; }
.kpi.bad .ico { background: var(--bad-soft); color: var(--bad); }
.kpi.ok .ico { background: var(--ok-soft); color: var(--ok); }
.kpi.violet .ico { background: var(--violet-soft); color: var(--violet); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover .li-title { color: var(--brand); }
.li-title { font-weight: 600; }
.date-box { width: 46px; flex: none; text-align: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); padding: 5px 0; }
.date-box b { display: block; font-size: 17px; line-height: 1.1; }
.date-box span { font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }

.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.empty svg { width: 34px; height: 34px; margin: 0 auto 8px; opacity: .6; }

/* ---------- Avatares ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px; overflow: hidden; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; }
.av.lg { width: 52px; height: 52px; font-size: 16px; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid #fff; margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- Botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 11px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #d4dde9; border-radius: 10px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29, 90, 166, .25); border-color: var(--brand-2); }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; padding: 0; accent-color: var(--brand); flex: none; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search input { padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--ink-3); }
.err { color: var(--bad); font-size: 13px; }

/* ---------- Chips, selos, abas ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.gray { background: #eef1f5; color: var(--ink-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tabs { display: flex; gap: 4px; background: #e6ecf4; padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.pills button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Mural ---------- */
.post { padding: 18px; }
.post + .post { margin-top: 14px; }
.post .meta { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.post .meta b { font-size: 14px; }
.post .body { margin-top: 8px; color: #24334a; }
.post .acts { display: flex; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.comments { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { background: var(--bg); border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 0; }
.comment .bubble b { font-size: 13px; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; }
.pin { color: var(--warn); }

.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font: inherit; text-align: left; cursor: pointer; overflow: hidden; margin-top: 8px; }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--brand-soft); z-index: 0; transition: width .3s; }
.poll-opt > *:not(.bar) { position: relative; z-index: 1; }
.poll-opt.mine { border-color: var(--brand-2); }
.poll-opt.mine .bar { background: #d4e3f6; }
.poll-opt:disabled { cursor: default; }
.poll-opt .pct { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.poll-opt .mk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c3cfdf; flex: none; display: grid; place-items: center; }
.poll-opt.mine .mk { border-color: var(--brand); background: var(--brand); }
.poll-opt.mine .mk::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.voters { font-size: 12px; color: var(--ink-3); margin: 3px 0 0 30px; }

/* ---------- Deliberações ---------- */
.vote-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vote-btns button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 8px; font: inherit; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-2); }
.vote-btns button svg { width: 24px; height: 24px; }
.vote-btns button.sim.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.vote-btns button.nao.on { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.vote-btns button.abstencao.on { border-color: var(--ink-3); background: #eef1f5; color: var(--ink); }
.vote-btns button:disabled { cursor: default; opacity: .7; }
.tally { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef1f5; }
.tally i { display: block; height: 100%; }
.tally .s { background: var(--ok); } .tally .n { background: var(--bad); } .tally .a { background: #a9b4c4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.progress { height: 6px; border-radius: 999px; background: #e6ecf4; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand-2); }
.cargo-pick { border: 1px solid var(--line); border-radius: 12px; max-height: 300px; overflow: auto; padding: 6px 12px; }
.cargo-pick .grp { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; }
.cargo-pick .check { padding: 4px 0; }

/* ---------- Agenda ---------- */
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #f7f9fc; border-bottom: 1px solid var(--line); }
.cal-head div { padding: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: #fafbfd; }
.cal-day.out .n { color: #c0c8d4; }
.cal-day .n { font-size: 13px; font-weight: 600; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .n { background: var(--brand); color: #fff; }
.cal-day.sel { background: #f2f7ff; }
.ev-chip { display: block; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; }
.ev-more { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; padding-left: 4px; }
.cal-dots { display: none; gap: 3px; justify-content: center; margin-top: 2px; }
.t-reuniao { background: #e7eef8; color: #12437f; border-color: #12437f; }
.t-evento  { background: #e3f4ec; color: #1f6e4b; border-color: #1f8a5b; }
.t-prazo   { background: #fbe7e5; color: #a3301f; border-color: #c0392b; }
.t-outro   { background: #efeafb; color: #5a3fa6; border-color: #6b4fbb; }
.dot.t-reuniao { background: #12437f; } .dot.t-evento { background: #1f8a5b; } .dot.t-prazo { background: #c0392b; } .dot.t-outro { background: #6b4fbb; }
.year { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.year .card h3 { text-transform: capitalize; margin-bottom: 6px; }

/* ---------- Demandas ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #e9eef5; border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.col-head .n { margin-left: auto; color: var(--ink-3); font-weight: 600; }
.task { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); cursor: pointer; margin-bottom: 8px; border-left: 3px solid transparent; }
.task:hover { box-shadow: 0 3px 12px rgba(18, 67, 127, .12); }
.task.p-alta { border-left-color: var(--bad); }
.task.p-media { border-left-color: var(--warn); }
.task.p-baixa { border-left-color: #b9c4d3; }
.task b { display: block; font-size: 14px; margin-bottom: 8px; }
.task .row { font-size: 12px; color: var(--ink-3); }
.late { color: var(--bad) !important; font-weight: 700; }

/* ---------- Tabelas ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8fbff; }
.matrix td, .matrix th { text-align: center; padding: 8px 6px; font-size: 13px; }
.matrix td:first-child, .matrix th:first-child { text-align: left; min-width: 210px; position: sticky; left: 0; background: #fff; }
.matrix th:first-child { background: #f8fafc; }
.lv { display: inline-block; white-space: nowrap; min-width: 28px; padding: 2px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.lv-0 { color: #c0c8d4; } .lv-1 { background: #eef1f5; color: var(--ink-2); } .lv-2 { background: #e3f0f8; color: #1f6f95; }
.lv-3 { background: var(--brand-soft); color: var(--brand); } .lv-4 { background: var(--brand); color: #fff; }
.lv small { font-weight: 600; opacity: .8; }

/* ---------- Mapa dos núcleos ---------- */
:root { --map-0: #e9eef5; --map-1: #9fc0e6; --map-2: #4f86c6; --map-3: #12437f; }
.mapa-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mapa-br { width: 100%; height: auto; max-height: 460px; display: block; margin: 0 auto; }
.mapa-br .uf path { stroke: #fff; stroke-width: 1; stroke-linejoin: round; transition: filter .15s; }
.mapa-br .uf.tem { cursor: pointer; }
.mapa-br .uf.tem:hover path { filter: brightness(1.12); }
.mapa-br .uf.sel path { stroke: var(--accent); stroke-width: 2.5; }
.mapa-br .rot circle { fill: #fff; stroke: var(--brand); stroke-width: 1.5; }
.mapa-br .rot text { font-size: 11px; font-weight: 700; fill: var(--brand); font-family: var(--font); }
.mapa-info h3 { font-size: 16px; }

/* ---------- Organograma ---------- */
.org-sec + .org-sec { margin-top: 26px; }
.org-sec > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.org-card { display: flex; flex-direction: column; gap: 10px; }
.org-card .cargo { font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
.org-card .who { display: flex; gap: 10px; align-items: center; }
.org-card .who b { font-size: 14px; }
.org-card .sub { border-top: 1px dashed var(--line); padding-top: 8px; }
.umbrella { border: 2px dashed #c9d7ea; border-radius: var(--radius); padding: 14px; }
.umbrella > .lbl { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }

/* ---------- Modal e avisos ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 25, 50, .42); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #142033; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.toast.bad { background: var(--bad); }
.info { background: var(--brand-soft); color: #1b3a63; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.info.warn { background: var(--warn-soft); color: #6d4a10; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Celular ---------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; padding-bottom: 76px; }
  .topbar { padding: 0 16px; background: #fff; border-bottom-color: var(--line); }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 4px 16px 32px; }
  .demo-bar { padding: 6px 16px; gap: 8px; }
  .demo-bar > span { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2, .mapa-card { grid-template-columns: 1fr; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 4px 0; text-decoration: none; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--brand); }
}
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 54px; padding: 4px 2px; }
  .cal-day .n { margin: 0 auto; width: 24px; height: 24px; font-size: 12.5px; }
  .cal-day .ev-chip, .cal-day .ev-more { display: none; }
  .cal-dots { display: flex; }
  .cal-head div { padding: 6px 0; font-size: 11px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .page-head { margin: 8px 0 14px; }
  .kpi b { font-size: 21px; }
  .card { padding: 15px; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .demo-bar, .modal-foot, .btn { display: none !important; }
  .main { margin: 0; }
  .modal-wrap { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; }
}

/* =====================================================================
   Portal dos Ministérios
   ===================================================================== */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.fotos .foto { position: relative; }
.fotos .foto button { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.92); }
.pt { min-height: 100%; background: var(--bg); }
.pt-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pt-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; }
.pt-brand img { width: 36px; }
.pt-brand b { display: block; color: var(--brand); font-size: 15px; }
.pt-brand span { font-size: 12px; color: var(--ink-3); }
.pt-hero { background: radial-gradient(900px 400px at 0% 0%, #dbe7f7 0, transparent 60%), radial-gradient(700px 400px at 100% 100%, #d9eef8 0, transparent 55%), #fff; border-bottom: 1px solid var(--line); }
.pt-hero-in { max-width: 1080px; margin: 0 auto; padding: 56px 24px 48px; }
.pt-hero h1 { font-size: 38px; letter-spacing: -.02em; color: var(--brand); margin: 14px 0 12px; max-width: 700px; }
.pt-hero p { font-size: 17px; color: var(--ink-2); max-width: 680px; margin-bottom: 10px; }
.pt-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.pt-big { padding: 12px 22px; font-size: 16px; border-radius: 13px; }
.pt-sec { max-width: 1080px; margin: 0 auto; padding: 40px 24px 0; }
.pt-sec > h2 { font-size: 24px; margin-bottom: 16px; }
.pt-steps { list-style: none; counter-reset: p; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pt-steps li { counter-increment: p; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.pt-steps li::before { content: counter(p); width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 4px; }
.pt-steps span { color: var(--ink-2); font-size: 14px; }
.pt-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pt-logo { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 13px; font-weight: 600; }
.pt-logo img { width: 100%; height: 90px; object-fit: contain; }
.pt-login-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pt-login-cta > div h2 { font-size: 20px; margin-bottom: 4px; }
.pt-foot { max-width: 1080px; margin: 48px auto 0; padding: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.pt-form-wrap { max-width: 760px; margin: 0 auto; padding: 24px; }
.pm { min-height: 100%; background: var(--bg); }
.pm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.pm-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-id img { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pm-id b { display: block; font-size: 16px; }
.pm-id span { font-size: 12px; color: var(--ink-3); }
.pm-tabs { display: flex; gap: 4px; padding: 8px 24px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.pm-tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.pm-tabs a svg { width: 18px; height: 18px; }
.pm-tabs a.on { background: var(--brand-soft); color: var(--brand); }
.pm-main { max-width: 900px; margin: 0 auto; padding: 22px 24px 40px; }
.pm-foot { text-align: center; padding: 0 0 30px; }
.pm-destaque { border-left: 4px solid var(--brand); }
.gasto { display: grid; grid-template-columns: 1.1fr 1.4fr .8fr auto; gap: 8px; }
.pm-totais { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; background: var(--bg); border-radius: 12px; padding: 12px; }
.pm-totais div { display: flex; flex-direction: column; }
.pm-totais b { font-size: 18px; }
.pm-acoes { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; background: rgba(243,246,251,.95); padding: 12px 0; }
.min-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; flex: none; }
.st-mini { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
@media (max-width: 760px) {
  .pt-top, .pm-top { padding: 10px 16px; }
  .pt-hero-in { padding: 36px 16px 32px; }
  .pt-hero h1 { font-size: 28px; }
  .pt-hero p { font-size: 15.5px; }
  .pt-sec, .pt-form-wrap { padding-left: 16px; padding-right: 16px; }
  .pt-steps { grid-template-columns: 1fr 1fr; }
  .pm-tabs { padding: 6px 12px; }
  .pm-tabs a span { font-size: 13px; }
  .pm-main { padding: 16px 16px 32px; }
  .pm-quem { display: none; }
  .gasto { grid-template-columns: 1fr .7fr auto; }
  .gasto input[name="g_desc"] { grid-column: 1 / 3; grid-row: 2; }
  .pm-totais b { font-size: 15px; }
}

/* ---------- Página pública do ministério ---------- */
.lp { background: var(--bg); min-height: 100%; }
.lp-hero { background: linear-gradient(135deg, #12437f, #1d5aa6 60%, #3da3d1); background-size: cover; background-position: center; color: #fff; }
.lp-hero-in { max-width: 1000px; margin: 0 auto; padding: 64px 24px 84px; display: flex; gap: 28px; align-items: flex-end; }
.lp-logo { width: 132px; height: 132px; object-fit: contain; background: #fff; border-radius: 24px; padding: 10px; box-shadow: var(--shadow-lg); flex: none; }
.lp-selo { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.lp-selo svg { width: 14px; height: 14px; }
.lp-hero h1 { font-size: 40px; letter-spacing: -.02em; margin: 12px 0 6px; color: #fff; }
.lp-sub { font-size: 18px; opacity: .92; max-width: 640px; }
.lp-meta { margin-top: 8px; font-size: 14px; opacity: .85; }
.lp-share { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }
.lp-share:hover { background: rgba(255,255,255,.24); }
.lp-sec { max-width: 1000px; margin: 0 auto; padding: 36px 24px 0; }
.lp-sec > h2 { font-size: 24px; margin-bottom: 14px; }
.lp-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: -44px; padding-top: 0 !important; position: relative; z-index: 2; }
.lp-nums > div { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.lp-nums b { font-size: 30px; color: var(--brand); letter-spacing: -.02em; line-height: 1.1; }
.lp-nums span { color: var(--ink-2); font-size: 14px; }
.lp-texto { font-size: 16.5px; line-height: 1.65; color: #24334a; max-width: 760px; }
.lp-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.lp-gal img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; display: block; }
.lp-gal-dica { display: none; text-align: center; margin-top: 8px; font-size: 12.5px; }
.lp-video { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.lp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lp-ajuda { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.lp-pix { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.lp-qr { width: 132px; height: 132px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.lp-qr svg { width: 100%; height: 100%; display: block; }
.lp-chave { word-break: break-all; }
.lp-foot { max-width: 1000px; margin: 48px auto 0; padding: 22px 24px 36px; border-top: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.lp-foot img { width: 40px; }
a.pt-logo.click { color: inherit; text-decoration: none; transition: box-shadow .15s; }
a.pt-logo.click:hover { box-shadow: 0 2px 4px rgba(18,67,127,.08), 0 10px 26px rgba(18,67,127,.14); }
@media (max-width: 760px) {
  .lp-hero-in { flex-direction: column; align-items: flex-start; padding: 40px 16px 72px; gap: 16px; }
  .lp-nums { margin-top: -40px; gap: 10px; }
  .lp-nums > div { padding: 14px; }
  .lp-gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .lp-gal::-webkit-scrollbar { display: none; }
  .lp-gal a { flex: 0 0 82%; scroll-snap-align: center; }
  .lp-gal-dica { display: block; }
  .lp-logo { width: 96px; height: 96px; border-radius: 18px; }
  .lp-hero h1 { font-size: 30px; }
  .lp-sub { font-size: 16px; }
  .lp-sec { padding: 28px 16px 0; }
  .lp-nums { grid-template-columns: 1fr 1fr; }
  .lp-nums b { font-size: 24px; }
  .lp-pix { flex-direction: column; align-items: flex-start; }
  .lp-foot { padding: 20px 16px 30px; }
}

.pv { flex: none; border: 1px dashed #c3cfdf; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.pv img { width: 100%; height: 100%; }
.pv-logo { width: 72px; height: 72px; }
.pv-logo img { object-fit: contain; padding: 4px; }
.pv-capa { width: 150px; height: 50px; }
.pv-capa img { object-fit: cover; }

/* ---------- Portal dos Núcleos ---------- */
.tabs a { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 7px 14px; border-radius: 9px; white-space: nowrap; text-decoration: none; }
.tabs a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.ellipsis-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ata-doc { line-height: 1.6; }
.ata-doc .ata-cab { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 12px; margin-bottom: 14px; }
.ata-doc .ata-cab img { width: 44px; }
.ata-doc .ata-cab b { display: block; color: var(--brand); }
.ata-doc .ata-cab span { font-size: 13px; color: var(--ink-3); }
.ata-doc h2 { color: var(--brand); margin-bottom: 4px; }
.ata-doc h3 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.ata-doc .ata-ass { display: none; }
@media (max-width: 640px) { .kv { grid-template-columns: 100px 1fr; } }
.pn-board { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
@media (max-width: 960px) { .pn-board { grid-template-columns: repeat(3, 82vw); } }
.task .btn.sm { padding: 3px 8px; font-size: 12px; }
@media (max-width: 640px) { .pm-main .toolbar .search { max-width: none !important; flex: 1 1 100%; } }
