:root {
  --red: #ed1c24;
  --red-600: #cf151c;
  --red-800: #8f1015;
  --wine: #4b0d14;
  --wine-2: #2f0b10;
  --ink: #1f1c1d;
  --ink-2: #332f30;
  --ivory: #f8f5ef;
  --ivory-2: #f1ede6;
  --paper: #fffdfa;
  --white: #fff;
  --muted: #6e686a;
  --line: #e5ded7;
  --line-2: #d8d0c8;
  --soft-red: #fff0ef;
  --soft-green: #eef8f3;
  --green: #23845c;
  --amber: #a86913;
  --soft-amber: #fff7e7;
  --blue: #305e91;
  --soft-blue: #eef3f9;
  --shadow-sm: 0 8px 24px rgba(31, 28, 29, .055);
  --shadow-md: 0 18px 50px rgba(31, 28, 29, .09);
  --shadow-lg: 0 32px 90px rgba(31, 28, 29, .16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --sidebar: 284px;
  --topbar: 78px;
  --portal-gutter: clamp(18px, 2.25vw, 34px);
  --tap: 44px;
  --font-ui: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-ui);
  --type-label: .6875rem;
  --type-micro: .75rem;
  --type-ui: .875rem;
  --type-body: .9375rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body { margin: 0; font-family: var(--font-ui); font-weight: 400; line-height: 1.5; color: var(--ink); background: var(--ivory); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.portal-body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; display: block; }
svg.icon { width: 1.15em; height: 1.15em; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 9999; transform: translateY(-140%); background: var(--ink); color: white; padding: 10px 16px; border-radius: 8px; transition: .2s; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(237, 28, 36, .4); outline-offset: 3px; }

/* Shared controls */
.portal-btn { min-height: 44px; border: 0; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 680; letter-spacing: -.01em; transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease; white-space: nowrap; }
.portal-btn:hover { transform: translateY(-2px); }
.portal-btn:active { transform: translateY(0); }
.portal-btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(237, 28, 36, .22); }
.portal-btn-primary:hover { background: var(--red-600); box-shadow: 0 13px 30px rgba(237, 28, 36, .28); }
.portal-btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); }
.portal-btn-secondary:hover { border-color: var(--ink); }
.portal-btn-ghost { background: transparent; color: var(--ink); border: 1px solid transparent; }
.portal-btn-ghost:hover { background: var(--ivory-2); }
.portal-btn-light { background: white; color: var(--ink); }
.portal-btn-light:hover { background: var(--ivory); }
.portal-btn-small { min-height: 38px; padding-inline: 14px; font-size: .84rem; }
.portal-btn-lg { min-height: 52px; padding-inline: 24px; }
.portal-btn-block, .portal-btn.full, .full { width: 100%; }
/* Não havia NENHUMA regra de estado desabilitado no portal: o botão travado continuava
   vermelho cheio, com sombra, e ainda subia 2px no hover. */
.portal-btn[disabled], .portal-btn:disabled { background: var(--ivory-2); color: var(--muted); border: 1px solid var(--line); box-shadow: none; cursor: not-allowed; }
.portal-btn[disabled]:hover, .portal-btn:disabled:hover { transform: none; background: var(--ivory-2); box-shadow: none; }
.portal-filterbar select[disabled], .portal-section-head select[disabled], .comparison-controls select[disabled], .row-actions button[disabled] { background: var(--ivory-2); color: var(--muted); cursor: not-allowed; }
.portal-icon-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.portal-icon-button.light { background: rgba(255,255,255,.14); color: white; border-color: rgba(255,255,255,.3); }
.portal-card { background: var(--paper); border: 1px solid rgba(216, 208, 200, .8); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.portal-card-hero { overflow: hidden; }
.portal-stack { display: grid; gap: 18px; align-content: start; }
.subtle-card { padding: clamp(20px, 2vw, 26px); background: #f3efe9; border-style: dashed; box-shadow: none; }
.subtle-card > span { width: 42px; height: 42px; border-radius: 50%; background: white; display: inline-flex; align-items: center; justify-content: center; color: var(--red); margin-bottom: 18px; }
.subtle-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.subtle-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .91rem; }
.eyebrow, .eyebrow-light, .modal-kicker { text-transform: uppercase; letter-spacing: .15em; font-size: .69rem; font-weight: 750; }
.eyebrow-light { color: rgba(255,255,255,.7); }
.modal-kicker { color: var(--red); display: block; margin-bottom: 8px; }

/* Portal chrome */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: var(--ivory); }
.portal-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 60; background: linear-gradient(180deg, #211e1f 0%, #171516 100%); color: white; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.06); }
.portal-sidebar::before { content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(to bottom, black, transparent 58%); }
.portal-sidebar::after { content: ""; position: absolute; left: 24px; bottom: 110px; width: 1px; height: 170px; background: linear-gradient(transparent, var(--red), transparent); opacity: .8; }
.portal-sidebar-head { min-height: 82px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.portal-brand { display: inline-flex; align-items: center; padding: 4px 5px; background: var(--white); border-radius: 7px; line-height: 0; }
.portal-brand img { width: auto; height: 36px; }
.portal-sidebar-close { display: none; border: 0; background: rgba(255,255,255,.08); color: white; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; }
.portal-context { margin: 17px 16px 10px; padding: 16px; border-radius: 15px; background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.portal-context > span { display: block; color: rgba(255,255,255,.52); text-transform: uppercase; letter-spacing: .11em; font-size: .61rem; margin-bottom: 6px; }
.portal-context > strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 520; display: block; line-height: 1.15; }
.portal-context button { margin-top: 12px; border: 0; background: transparent; color: rgba(255,255,255,.66); padding: 0; display: flex; gap: 6px; align-items: center; font-size: .76rem; }
.portal-nav { flex: 1; overflow-y: auto; padding: 8px 14px 18px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.portal-nav section + section { margin-top: 22px; }
.portal-nav h2 { margin: 0 12px 8px; font-size: .61rem; text-transform: uppercase; letter-spacing: .15em; color: rgba(255,255,255,.36); font-weight: 700; }
.portal-nav a { min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; color: rgba(255,255,255,.68); font-size: .865rem; position: relative; transition: .2s ease; }
.portal-nav a + a { margin-top: 2px; }
.portal-nav a svg { width: 18px; height: 18px; }
.portal-nav a:hover { color: white; background: rgba(255,255,255,.055); }
.portal-nav a.is-active { background: linear-gradient(90deg, rgba(237,28,36,.18), rgba(237,28,36,.05)); color: white; }
.portal-nav a.is-active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--red); box-shadow: 0 0 22px rgba(237,28,36,.8); }
.portal-nav a small { margin-left: auto; border: 1px solid rgba(255,255,255,.14); padding: 2px 5px; border-radius: 4px; color: rgba(255,255,255,.5); font-size: .55rem; text-transform: uppercase; letter-spacing: .07em; }
.portal-sidebar-foot { padding: 14px 16px 20px; border-top: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.portal-sidebar-foot > a { display: flex; align-items: center; gap: 9px; font-size: .78rem; color: rgba(255,255,255,.58); padding: 9px 8px; }
.portal-sidebar-foot > a svg:last-child { margin-left: auto; }
.sidebar-demo-tag { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(237,28,36,.12); color: #ffaaa9; display: flex; align-items: center; gap: 8px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.portal-sidebar-overlay { display: none; }
.portal-workspace { grid-column: 2; min-width: 0; }
.portal-topbar { height: var(--topbar); position: sticky; top: 0; z-index: 45; background: rgba(248,245,239,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(216,208,200,.72); display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 34px; }
.portal-topbar-left, .portal-topbar-actions { display: flex; align-items: center; gap: 12px; }
.portal-menu-button { display: none; border: 0; background: white; width: 42px; height: 42px; border-radius: 50%; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.portal-page-title > span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .13em; color: var(--red); font-weight: 750; }
.portal-page-title h1 { margin: 1px 0 0; font-family: var(--font-display); font-weight: 540; font-size: 1.48rem; letter-spacing: -.025em; line-height: 1; }
.topbar-action { min-height: 42px; border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 999px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; font-size: .79rem; }
.topbar-action kbd, .command-dialog kbd { font: 600 .62rem var(--font-ui); color: var(--muted); border: 1px solid var(--line); background: var(--ivory); padding: 3px 6px; border-radius: 5px; }
.topbar-action.icon-only { width: 42px; padding: 0; justify-content: center; position: relative; }
.topbar-action.has-indicator i { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid white; }
.portal-user-menu { position: relative; }
.portal-user-menu > button { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 3px 0 3px 8px; }
.user-avatar { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--ink); color: white; font-size: .74rem; font-weight: 600; }
.user-avatar.large { width: 48px; height: 48px; font-size: .85rem; }
.user-copy { display: grid; text-align: left; line-height: 1.1; }
.user-copy strong { font-size: .79rem; }
.user-copy small { color: var(--muted); font-size: .68rem; margin-top: 4px; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 12px); width: 270px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 80; }
.user-dropdown > div { display: flex; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 7px; }
.user-dropdown p { margin: 0; display: grid; }
.user-dropdown p strong { font-size: .85rem; }
.user-dropdown p small { color: var(--muted); margin-top: 4px; font-size: .7rem; }
.user-dropdown > a { display: flex; gap: 9px; align-items: center; padding: 10px; border-radius: 9px; font-size: .8rem; }
.user-dropdown > a:hover { background: var(--ivory-2); }
.portal-notification-panel { position: fixed; right: 24px; top: 86px; width: 370px; max-height: calc(100vh - 110px); overflow: auto; z-index: 70; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 12px; }
.notification-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px; }
.notification-panel-head div { display: grid; }
.notification-panel-head span { color: var(--muted); font-size: .7rem; }
.notification-panel-head strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 540; }
.notification-panel-head button { border: 0; background: var(--ivory-2); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.portal-notification-panel article { display: flex; gap: 12px; padding: 13px 10px; border-radius: 12px; }
.portal-notification-panel article.is-unread { background: var(--soft-red); }
.portal-notification-panel article > span { width: 36px; height: 36px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; color: var(--red); }
.portal-notification-panel article div { flex: 1; }
.portal-notification-panel article strong { display: block; font-size: .8rem; }
.portal-notification-panel article p { margin: 4px 0; font-size: .74rem; color: var(--muted); line-height: 1.4; }
.portal-notification-panel article small { font-size: .65rem; color: #948c8e; }
.portal-notification-panel > a { min-height: 42px; margin-top: 6px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--red); font-size: .78rem; font-weight: 700; }
.portal-content { width: min(1560px, 100%); margin: 0 auto; padding: 28px 32px 78px; }
.portal-page-head { min-height: 32px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.portal-page-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.candidate-label { display: inline-flex; align-items: center; gap: 7px; color: var(--red); font-size: .71rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 720; margin-bottom: 6px; }
.demo-notice { min-height: 40px; border: 1px solid #ead8c1; background: #fff8ed; color: #75542e; border-radius: 12px; padding: 8px 13px; display: flex; align-items: center; gap: 9px; font-size: .75rem; margin-bottom: 20px; }
.demo-notice svg { color: var(--red); }
.portal-mobile-nav { display: none; }

/* Layout helpers */
.portal-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
/* O grid não tinha margem inferior e o .portal-card não tem margem: o bloco seguinte
   encostava nele (0px) na inadimplência, nos acordos e na recuperação. Usa o combinador
   `+` para não sobrar margem quando o grid é o último elemento da página. */
.portal-grid + .portal-card, .portal-grid + .portal-filterbar, .portal-grid + .portal-card-table, .portal-grid + .portal-grid { margin-top: 20px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.metric-card { min-height: 122px; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; display: flex; gap: 15px; align-items: flex-start; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -25px; bottom: -30px; width: 80px; height: 80px; border-radius: 50%; border: 1px solid rgba(237,28,36,.1); }
.metric-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.metric-card > div { display: grid; }
.metric-card > div > span { color: var(--muted); font-size: .73rem; }
.metric-card strong { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; margin-top: 7px; font-weight: 560; letter-spacing: -.03em; }
.metric-card small { color: var(--muted); margin-top: 7px; font-size: .69rem; }
.portal-section-head { min-height: 52px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.portal-section-head > div:first-child > span { color: var(--red); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; font-weight: 750; display: block; margin-bottom: 4px; }
.portal-section-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.34rem; font-weight: 560; letter-spacing: -.025em; }
.portal-section-head > a, .portal-section-head > button.table-text-action { font-size: .73rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.portal-section-head > small { color: var(--muted); font-size: .67rem; }
.segmented-control { display: inline-flex; background: var(--ivory-2); border-radius: 9px; padding: 3px; }
.segmented-control button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; font-size: .67rem; color: var(--muted); }
.segmented-control button.is-active { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(31,28,29,.08); }
.chart-card, .distribution-card { padding: clamp(20px, 2vw, 26px); } /* era 24px: 2px de defasagem contra o .portal-card-section vizinho na mesma fileira */
.chart-wrap { min-height: 255px; position: relative; width: 100%; }
.chart-wrap canvas { width: 100%; height: 255px; display: block; }
.chart-wrap.donut-chart { min-height: 220px; }
.chart-wrap.donut-chart canvas { height: 220px; }
.chart-wrap.donut-chart.small, .chart-wrap.small { min-height: 190px; }
.chart-wrap.donut-chart.small canvas, .chart-wrap.small canvas { height: 190px; }
.chart-foot-note { padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .68rem; }
.chart-foot-note span, .chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot-red, .dot-wine, .dot-charcoal { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--red); }
.dot-wine { background: var(--wine); }
.dot-charcoal { background: var(--ink); }
.chart-legend { display: flex; gap: 14px; font-size: .67rem; color: var(--muted); }
.chart-insight { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ivory-2); display: flex; align-items: center; gap: 11px; }
.chart-insight > span { width: 35px; height: 35px; border-radius: 50%; background: white; color: var(--red); display: flex; align-items: center; justify-content: center; }
.chart-insight p { margin: 0; display: grid; }
.chart-insight strong { font-size: .77rem; }
.chart-insight small { color: var(--muted); margin-top: 3px; font-size: .68rem; }
.chart-insight.positive { background: var(--soft-green); }
.chart-insight.positive > span { color: var(--green); }

/* Tables and filters */
.portal-table-wrap { width: 100%; overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.portal-table th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .085em; font-weight: 700; border-bottom: 1px solid var(--line); }
.portal-table td { padding: 14px; border-bottom: 1px solid #eee8e2; font-size: .79rem; vertical-align: middle; }
.portal-table tbody tr:last-child td { border-bottom: 0; }
.portal-table tbody tr { transition: background .15s ease; }
.portal-table tbody tr:hover { background: rgba(248,245,239,.7); }
.portal-table td strong { font-size: .8rem; }
.portal-table td > small, .portal-table td strong + small { display: block; color: var(--muted); margin-top: 4px; font-size: .64rem; }
.portal-table tfoot td { background: var(--ivory-2); }
/* Coluna numérica: à direita e com dígitos tabulares, para as casas decimais alinharem.
   Antes, R$ e % ficavam à esquerda no desktop e à direita no mobile (l. ~1760) — o mesmo
   valor trocava de lado ao redimensionar a janela. */
.portal-table :is(th, td).num { text-align: right; font-variant-numeric: tabular-nums; }
.compact-table .portal-table { min-width: 550px; }
.compact-table .portal-table td { padding-block: 11px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: .64rem; font-weight: 600; white-space: nowrap; }
.status-badge > span { width: 6px; height: 6px; border-radius: 50%; }
.status-success { color: #196947; background: var(--soft-green); }
.status-success > span { background: var(--green); }
.status-danger { color: #a0181d; background: var(--soft-red); }
.status-danger > span { background: var(--red); }
.status-warning { color: #8b5e15; background: var(--soft-amber); }
.status-warning > span { background: #d08b20; }
.status-neutral { color: #595355; background: #efebe6; }
.status-neutral > span { background: #827b7d; }
.status-info { color: #24496f; background: var(--soft-blue); }
.status-info > span { background: var(--blue); }
.row-actions { display: flex; gap: 6px; }
.row-actions button, .row-menu { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: white; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.row-actions button:hover, .row-menu:hover { color: var(--red); border-color: rgba(237,28,36,.3); }
.table-text-action { border: 0; background: transparent; color: var(--red); font-size: .7rem; display: inline-flex; align-items: center; gap: 5px; padding: 0; font-weight: 650; white-space: nowrap; }
.portal-filterbar { min-height: 68px; padding: 11px; background: rgba(255,253,250,.9); border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.portal-filterbar select, .portal-section-head select, .comparison-controls select { min-height: 43px; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 0 34px 0 12px; color: var(--ink); font-size: .76rem; }
.portal-search-field { min-height: 43px; min-width: 280px; display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; flex: 1; }
.portal-search-field svg { color: var(--muted); }
.portal-search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: .76rem; }
.portal-search-field.small { min-width: 210px; min-height: 38px; }
.portal-summary-strip { min-height: 92px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink); border-radius: var(--radius-lg); color: white; padding: 14px; margin-bottom: 18px; overflow: hidden; position: relative; }
.portal-summary-strip::after { content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); }
.portal-summary-strip > div { display: flex; align-items: center; gap: 13px; padding: 8px 18px; border-right: 1px solid rgba(255,255,255,.1); position: relative; z-index: 1; }
.portal-summary-strip > div:last-child { border-right: 0; }
.portal-summary-strip > div > span { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #ff8e8e; }
.portal-summary-strip p { margin: 0; display: grid; }
.portal-summary-strip small { color: rgba(255,255,255,.52); font-size: .66rem; }
.portal-summary-strip strong { margin-top: 4px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 520; }

/* Resident dashboard */
.resident-welcome { min-height: 248px; padding: 34px 38px; background: radial-gradient(circle at 80% 20%, rgba(237,28,36,.12), transparent 34%), linear-gradient(125deg, #292526 0%, #171516 64%, #26060a 100%); color: white; display: grid; grid-template-columns: minmax(0, 1.35fr) .7fr minmax(260px, .8fr); align-items: center; gap: 24px; position: relative; }
.resident-welcome::after { content: ""; position: absolute; inset: 0; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, transparent, black); }
.resident-welcome-copy, .next-billing-panel, .resident-line-visual { position: relative; z-index: 1; }
.resident-welcome h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 3.2vw, 3.7rem); line-height: .96; font-weight: 470; letter-spacing: -.05em; margin: 10px 0 13px; }
.resident-welcome h2 em { color: #ff7276; font-weight: 420; }
.resident-welcome-copy > p { color: rgba(255,255,255,.62); margin: 0; font-size: .87rem; }
.resident-status { margin-top: 25px; display: flex; gap: 10px; align-items: center; }
.resident-status > span { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.09); color: #8ce0bb; }
.resident-status > div { display: grid; }
.resident-status strong { font-size: .77rem; }
.resident-status small { color: rgba(255,255,255,.48); font-size: .64rem; margin-top: 3px; }
.resident-line-visual { height: 170px; }
.resident-line-visual::before { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.resident-line-visual::after { content: ""; position: absolute; width: 130px; height: 130px; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(42deg); border: 2px solid transparent; border-top-color: var(--red); border-right-color: var(--red); border-radius: 50%; }
.resident-line-visual span { position: absolute; left: 23%; top: 58%; width: 55%; height: 1px; background: linear-gradient(90deg, transparent, var(--red), transparent); transform: rotate(-24deg); }
.resident-line-visual i, .resident-line-visual b { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 18px rgba(237,28,36,.9); }
.resident-line-visual i { left: 24%; top: 60%; }
.resident-line-visual b { right: 23%; top: 36%; }
.next-billing-panel { padding: 26px; border-radius: 20px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); display: grid; }
.next-billing-panel > span { font-size: .68rem; color: rgba(255,255,255,.56); text-transform: uppercase; letter-spacing: .1em; }
.next-billing-panel > strong { font-family: var(--font-display); font-size: 2.1rem; margin-top: 8px; font-weight: 520; }
.next-billing-panel > small { color: rgba(255,255,255,.55); margin-top: 2px; font-size: .69rem; }
.next-billing-panel > div { margin-top: 21px; display: flex; gap: 8px; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 16px; }
.quick-actions-grid > a { min-height: 82px; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; display: flex; align-items: center; padding: 14px; gap: 12px; box-shadow: var(--shadow-sm); transition: .2s ease; }
.quick-actions-grid > a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quick-actions-grid > a > span { width: 43px; height: 43px; border-radius: 13px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.quick-actions-grid > a > div { display: grid; flex: 1; }
.quick-actions-grid strong { font-size: .83rem; }
.quick-actions-grid small { color: var(--muted); font-size: .66rem; margin-top: 3px; }
.quick-actions-grid > a > svg { color: #aaa1a3; }
/* Mesmo valor do .portal-card-section (l. ~1333): eram 24px contra 26px, e os dois cards
   da mesma fileira do dashboard começavam o conteúdo desalinhados em 2px. */
.portal-grid-dashboard > .portal-card { padding: clamp(20px, 2vw, 26px); }
.mini-timeline a { display: grid; grid-template-columns: 11px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.mini-timeline a:last-child { border-bottom: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; }
.timeline-dot.status-success { background: var(--green); box-shadow: 0 0 0 4px var(--soft-green); }
.timeline-dot.status-warning { background: #d08b20; box-shadow: 0 0 0 4px var(--soft-amber); }
.timeline-dot.status-neutral { background: #8f888a; box-shadow: 0 0 0 4px #efebe6; }
/* faltavam: 'Em análise' (status-info) e status-danger ficavam sem cor e a bolinha sumia */
.timeline-dot.status-info { background: var(--blue); box-shadow: 0 0 0 4px var(--soft-blue); }
.timeline-dot.status-danger { background: var(--red); box-shadow: 0 0 0 4px var(--soft-red); }
.mini-timeline div { display: grid; }
.mini-timeline strong { font-size: .75rem; }
.mini-timeline small { color: var(--muted); margin-top: 4px; font-size: .62rem; }
.insight-list a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.insight-list a:last-child { border-bottom: 0; }
.insight-icon { width: 41px; height: 41px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.insight-icon.red { background: var(--soft-red); color: var(--red); }
.insight-icon.charcoal { background: #eae6e2; color: var(--ink); }
.insight-icon.coral { background: #fff0eb; color: #d25142; }
.insight-list a > div { flex: 1; display: grid; }
.insight-list strong { font-size: .77rem; }
.insight-list small { color: var(--muted); font-size: .65rem; margin-top: 4px; }
.insight-list a > svg { color: #a39b9d; }

/* Invoices and finances */
.invoice-featured { min-height: 180px; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; margin-bottom: 18px; }
.invoice-accent { background: var(--red); color: white; padding: 22px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.invoice-accent span { font-size: .59rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.invoice-accent strong { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; margin-top: 9px; font-weight: 520; }
.invoice-accent small { margin-top: 3px; opacity: .7; }
.invoice-main { padding: 25px 28px; display: flex; flex-direction: column; justify-content: center; }
/* :not(.status-badge) para o selo de status do card usar as mesmas cores da tabela abaixo dele */
.invoice-main > span:not(.status-badge) { display: inline-flex; color: var(--amber); background: var(--soft-amber); width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: .63rem; font-weight: 700; }
.invoice-main > .status-badge { width: fit-content; }
.invoice-main h2 { font-family: var(--font-display); margin: 10px 0 4px; font-weight: 550; font-size: 1.5rem; }
.invoice-main > p { margin: 0; color: var(--muted); font-size: .72rem; }
.invoice-main > div { display: flex; gap: 14px; align-items: baseline; margin-top: 17px; }
.invoice-main > div strong { font-family: var(--font-display); font-size: 1.65rem; font-weight: 550; }
.invoice-main > div small { color: var(--muted); }
.invoice-actions { padding: 22px 24px 22px 10px; min-width: 190px; display: grid; align-content: center; gap: 8px; }
.financial-status-card { min-height: 150px; border-radius: var(--radius-lg); padding: 28px; display: flex; align-items: center; justify-content: space-between; color: white; margin-bottom: 20px; }
.financial-status-card.is-regular { background: linear-gradient(120deg, #194d3a, #0f2f25); }
.financial-status-card > div { display: flex; align-items: center; gap: 17px; }
.financial-status-card > div > span { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; }
.financial-status-card h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 500; margin: 4px 0; }
.financial-status-card small, .financial-status-card p { color: rgba(255,255,255,.65); }
.financial-status-card p { margin: 0; font-size: .75rem; }
.finance-timeline { display: grid; grid-template-columns: repeat(8, 1fr); padding: 25px 4px 30px; }
.finance-timeline > div { text-align: center; position: relative; }
.finance-timeline > div::before { content: ""; position: absolute; top: 31px; left: 50%; width: 100%; height: 2px; background: #d9d2cc; }
.finance-timeline > div:last-child::before { display: none; }
.finance-timeline span, .finance-timeline small { display: block; font-size: .64rem; color: var(--muted); }
.finance-timeline i { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%; display: block; margin: 11px auto 8px; border: 3px solid white; box-shadow: 0 0 0 2px var(--green); background: var(--green); }
.finance-timeline .is-due i { box-shadow: 0 0 0 2px var(--amber); background: var(--amber); }
.financial-summary-list > div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .76rem; }
.financial-summary-list > div:last-child { border-bottom: 0; }
.financial-summary-list span { color: var(--muted); }
.financial-summary-list strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 550; }

/* Agreements, payment, documents, notifications, forms */
.agreement-card { margin-top: 12px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg, white, #faf8f5); }
.agreement-card-head { display: flex; align-items: center; gap: 12px; }
.agreement-card-head > span:first-child { width: 42px; height: 42px; border-radius: 50%; background: var(--soft-green); color: var(--green); display: flex; align-items: center; justify-content: center; }
.agreement-card-head > div { flex: 1; }
.agreement-card-head small { color: var(--muted); font-size: .63rem; }
.agreement-card-head h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 550; }
.agreement-card > p { color: var(--muted); font-size: .75rem; margin: 18px 0; }
.agreement-progress > div { height: 8px; background: var(--ivory-2); border-radius: 999px; overflow: hidden; }
.agreement-progress > div span { height: 100%; display: block; border-radius: inherit; background: var(--green); }
.agreement-progress > small { color: var(--muted); font-size: .64rem; margin-top: 7px; display: block; }
.agreement-card dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); }
.agreement-card dl div { display: grid; }
.agreement-card dt { color: var(--muted); font-size: .62rem; }
.agreement-card dd { margin: 5px 0 0; font-weight: 700; font-size: .76rem; }
.agreement-callout { padding: clamp(20px, 2vw, 26px); background: linear-gradient(145deg, #fff3f1, white); }
.agreement-callout h2 { font-family: var(--font-display); font-size: 2rem; line-height: 1; font-weight: 500; margin: 10px 0; }
.agreement-callout p { color: var(--muted); line-height: 1.55; font-size: .8rem; }
.state-showcase { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.state-showcase > div { border: 1px solid var(--line); border-radius: 10px; min-height: 72px; display: grid; place-items: center; align-content: center; gap: 5px; }
.state-showcase strong { font-size: .62rem; }
.state-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.state-icon.loading { border: 2px solid #dfd8d1; border-top-color: var(--red); animation: spin .8s linear infinite; }
.state-icon.pending { background: var(--soft-amber); color: var(--amber); }
.state-icon.analysis { background: #edf3fa; color: var(--blue); }
.state-icon.success { background: var(--soft-green); color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.payment-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.payment-choice-card { padding: 28px; }
.payment-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 10px 0 24px; }
.payment-tabs button { min-height: 46px; border: 0; border-bottom: 2px solid transparent; background: transparent; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--muted); font-weight: 650; font-size: .75rem; }
.payment-tabs button.is-active { color: var(--red); border-bottom-color: var(--red); }
.pix-layout { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center; padding: 10px; }
.demo-qr { aspect-ratio: 1; background: white; border: 10px solid white; box-shadow: 0 0 0 1px var(--line); position: relative; overflow: hidden; background-image: repeating-linear-gradient(0deg, transparent 0 7px, var(--ink) 7px 12px), repeating-linear-gradient(90deg, transparent 0 9px, var(--ink) 9px 14px); background-blend-mode: multiply; }
.demo-qr::after { content: "P"; position: absolute; inset: 34%; background: white; border: 6px solid var(--red); display: flex; align-items: center; justify-content: center; color: var(--red); font-weight: 700; font-size: 1.4rem; }
.demo-qr i { position: absolute; width: 44px; height: 44px; border: 8px solid white; box-shadow: inset 0 0 0 7px var(--ink); background: white; z-index: 1; }
.demo-qr i:nth-child(1) { top: 7px; left: 7px; }
.demo-qr i:nth-child(2) { top: 7px; right: 7px; }
.demo-qr i:nth-child(3) { bottom: 7px; left: 7px; }
.pix-layout > div:last-child > span { color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: .63rem; font-weight: 700; }
.pix-layout h3 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 520; margin: 6px 0; }
.pix-layout p { color: var(--muted); font-size: .77rem; line-height: 1.5; }
.pix-layout > div:last-child > small { display: block; margin-top: 12px; color: var(--muted); }
.secure-checkout-demo { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; background: var(--soft-green); }
.secure-checkout-demo > span { width: 40px; height: 40px; border-radius: 50%; background: white; color: var(--green); display: flex; align-items: center; justify-content: center; }
.secure-checkout-demo h3 { margin: 0; font-size: 1rem; }
.secure-checkout-demo p { margin: 5px 0 0; color: #48665a; line-height: 1.45; font-size: .73rem; }
.saved-card { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: flex; align-items: center; gap: 13px; }
.saved-card > span { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: center; }
.saved-card > div { display: grid; flex: 1; }
.saved-card strong { font-size: .78rem; }
.saved-card small { color: var(--muted); font-size: .65rem; margin-top: 4px; }
.saved-card button { border: 0; border-radius: 999px; background: var(--red); color: white; padding: 9px 13px; font-size: .7rem; font-weight: 700; }
.barcode-panel { text-align: center; }
.barcode-visual { height: 76px; width: min(100%, 440px); margin: 12px auto; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 15px); }
.barcode-panel code, .modal-invoice code { display: block; padding: 10px; background: var(--ivory-2); border-radius: 8px; font-size: .69rem; overflow-wrap: anywhere; }
.barcode-panel > div:last-child, .modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.payment-summary-card { padding: 26px; height: fit-content; }
.payment-summary-card > span { color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: .62rem; font-weight: 700; }
.payment-summary-card h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 6px 0 20px; font-weight: 540; }
.payment-summary-card dl { margin: 0; }
.payment-summary-card dl div { padding: 11px 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.payment-summary-card dt { color: var(--muted); font-size: .69rem; }
.payment-summary-card dd { margin: 0; font-size: .72rem; font-weight: 600; text-align: right; }
.payment-total { margin-top: 18px; display: flex; justify-content: space-between; align-items: baseline; }
.payment-total span { color: var(--muted); }
.payment-total strong { font-family: var(--font-display); font-size: 1.9rem; font-weight: 550; }
.payment-summary-card > small { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; gap: 6px; color: var(--muted); font-size: .63rem; }
.certificate-hero { min-height: 145px; padding: 27px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; background: linear-gradient(120deg, white, #f5fbf8); }
.certificate-hero > div { display: flex; align-items: center; gap: 17px; }
.certificate-seal { width: 58px; height: 58px; border-radius: 18px; background: var(--soft-green); color: var(--green); display: flex; align-items: center; justify-content: center; }
.certificate-hero small { color: var(--green); text-transform: uppercase; letter-spacing: .1em; font-size: .61rem; }
.certificate-hero h2 { font-family: var(--font-display); font-size: 1.7rem; margin: 4px 0; font-weight: 540; }
.certificate-hero p { margin: 0; color: var(--muted); font-size: .74rem; }
.process-steps.vertical { list-style: none; padding: 0; margin: 12px 0 0; }
.process-steps.vertical li { display: grid; grid-template-columns: 42px 1fr; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.process-steps.vertical li:last-child { border-bottom: 0; }
.process-steps.vertical li > span { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--red); font-family: var(--font-display); }
.process-steps.vertical strong { font-size: .78rem; }
.process-steps.vertical p { color: var(--muted); margin: 4px 0 0; font-size: .7rem; }
.document-row-feature { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.document-row-feature > span { width: 41px; height: 41px; border-radius: 10px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.document-row-feature > div { display: grid; flex: 1; }
.document-row-feature strong { font-size: .76rem; }
.document-row-feature small { color: var(--muted); font-size: .63rem; margin-top: 4px; }
.document-row-feature button { border: 0; background: transparent; color: var(--red); }
.security-note, .sensitive-flow-note { margin-top: 16px; padding: 13px 14px; border-radius: 12px; background: #f1f5f8; display: flex; gap: 10px; align-items: flex-start; color: #405464; }
.security-note > svg, .sensitive-flow-note > svg { margin-top: 2px; flex: 0 0 auto; }
.security-note p, .sensitive-flow-note p { margin: 0; display: grid; }
.security-note strong, .sensitive-flow-note strong { font-size: .73rem; }
.security-note span, .sensitive-flow-note span { margin-top: 4px; font-size: .67rem; line-height: 1.45; }
.form-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.form-main-card { padding: 28px; }
.form-aside { align-self: start; }
.form-aside.portal-card, .form-aside > .portal-card { padding: 24px; }
.form-aside .aside-number { font-family: var(--font-display); color: var(--red); font-size: 2rem; }
.form-aside h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 540; margin: 6px 0; }
.form-aside p { color: var(--muted); line-height: 1.55; font-size: .75rem; }
.verification-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--soft-green); color: var(--green); padding: 7px 10px; font-size: .64rem; }
.verification-chip.wine { background: #f6e9eb; color: var(--wine); }
.portal-form { display: grid; gap: 16px; }
.portal-form-grid, .direct-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.portal-field { display: grid; gap: 7px; }
.portal-field.full { grid-column: 1 / -1; }
.portal-field > label, .portal-field > div > label { font-size: .7rem; color: var(--ink); font-weight: 650; }
.portal-field input, .portal-field select, .portal-field textarea { width: 100%; min-height: 47px; border: 1px solid var(--line-2); border-radius: 10px; background: white; color: var(--ink); padding: 10px 12px; outline: 0; transition: .18s; }
.portal-field textarea { min-height: 110px; resize: vertical; }
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,.08); }
.portal-field input[readonly] { background: var(--ivory-2); color: var(--muted); }
.portal-field > small { color: var(--muted); font-size: .62rem; }
.portal-field.is-invalid input, .portal-field.is-invalid select, .portal-field.is-invalid textarea { border-color: var(--red); }
.portal-check { display: flex; gap: 10px; align-items: flex-start; font-size: .7rem; color: var(--muted); line-height: 1.45; }
.portal-check input { margin-top: 2px; accent-color: var(--red); }
.portal-form-actions { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.portal-form-actions > small { color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: .62rem; }
.form-consent { padding: 12px; background: var(--ivory-2); border-radius: 10px; }
.file-drop { min-height: 135px; border: 1.5px dashed #cfc6be; border-radius: 13px; background: #fbf9f6; display: flex !important; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; cursor: pointer; transition: .18s; }
.file-drop:hover, .file-drop.is-dragover { border-color: var(--red); background: var(--soft-red); }
.file-drop:focus-within { outline: 3px solid rgba(237, 28, 36, .4); outline-offset: 3px; }
.file-drop.is-invalid { border-color: var(--red); background: var(--soft-red); box-shadow: 0 0 0 1px rgba(237, 28, 36, .18); }
.file-drop.is-invalid small { color: var(--red); font-weight: 600; }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop > span { width: 42px; height: 42px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; color: var(--red); box-shadow: var(--shadow-sm); }
.file-drop strong { font-size: .74rem; margin-top: 10px; }
.file-drop small { font-size: .62rem; color: var(--muted); margin-top: 4px; }
.file-drop.compact { min-height: 100px; }
.mini-steps { list-style: none; margin: 4px 0 0; padding: 0; }
.mini-steps li { display: flex; gap: 12px; padding: 12px 0; position: relative; }
.mini-steps li:not(:last-child)::after { content: ""; position: absolute; top: 43px; left: 15px; height: calc(100% - 20px); width: 1px; background: var(--line); }
.mini-steps li > span { width: 31px; height: 31px; flex: 0 0 auto; border-radius: 50%; background: var(--ivory-2); display: flex; align-items: center; justify-content: center; font-size: .67rem; }
.mini-steps li.is-active > span { background: var(--red); color: white; }
.mini-steps li div { display: grid; }
.mini-steps strong { font-size: .72rem; }
.mini-steps small { color: var(--muted); margin-top: 3px; font-size: .61rem; }
.notification-filterbar { justify-content: space-between; }
.notification-filterbar .segmented-control button span { display: inline-flex; margin-left: 4px; color: var(--red); }
.notification-center { padding: 8px; }
.notification-center > article { display: flex; gap: 13px; align-items: center; padding: 17px; border-radius: 13px; }
.notification-center > article + article { border-top: 1px solid var(--line); }
.notification-center > article.is-unread { background: #fff7f6; }
.notification-type { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--ivory-2); }
.notification-type.finance { background: var(--soft-red); color: var(--red); }
.notification-type.protocol { background: #edf3fa; color: var(--blue); }
.notification-center article > div { flex: 1; }
.notification-center article > div > div { display: flex; align-items: center; gap: 8px; }
.notification-center article strong { font-size: .8rem; }
.notification-center article i { font-style: normal; font-size: .54rem; background: var(--red); color: white; padding: 3px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; }
.notification-center article p { margin: 5px 0; color: var(--muted); font-size: .72rem; }
.notification-center article small { color: #9b9395; font-size: .62rem; }
.notification-center article > button { border: 0; background: transparent; color: var(--muted); }
.portal-empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; }
.portal-empty-state > span { width: 54px; height: 54px; border-radius: 50%; background: var(--ivory-2); color: var(--red); display: flex; align-items: center; justify-content: center; }
.portal-empty-state h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 520; margin: 12px 0 5px; }
.portal-empty-state p { color: var(--muted); margin: 0 0 12px; font-size: .73rem; }
.document-overview, .document-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.document-overview article, .document-category-grid article { min-height: 92px; padding: 18px; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-sm); }
.document-overview article > span, .document-category-grid article > span { width: 43px; height: 43px; border-radius: 12px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.document-overview article > div, .document-category-grid article > div { display: grid; flex: 1; }
.document-overview small, .document-category-grid small { color: var(--muted); font-size: .65rem; }
.document-overview strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 550; }
.document-category-grid { grid-template-columns: repeat(4, 1fr); }
.document-category-grid strong { font-size: .78rem; }
.document-category-grid article > svg:last-child { color: var(--muted); }
.document-name { display: flex; align-items: center; gap: 10px; }
.document-name > span { width: 36px; height: 36px; border-radius: 9px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.file-type, .file-category { display: inline-flex; padding: 5px 8px; border-radius: 6px; background: var(--ivory-2); color: var(--muted); font-size: .61rem; }
.protocol-metrics, .request-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.protocol-metrics article, .request-board article { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); }
.protocol-metrics article div { display: grid; }
.protocol-metrics small { color: var(--muted); font-size: .65rem; }
.protocol-metrics strong { font-family: var(--font-display); font-size: 1.55rem; font-weight: 550; }
/* A caixa de erro de POST usava .alert, que só existe em app.css — e o portal carrega
   apenas portal.css. O erro saía como texto solto com o SVG cru. */
.alert { display: grid; grid-template-columns: 24px 1fr; gap: 11px; padding: 16px; border-radius: 12px; font-size: .75rem; margin-bottom: 18px; }
.alert .icon { width: 20px; height: 20px; }
.alert strong { display: block; margin-bottom: 4px; }
.alert p { margin: 0; }
.alert ul { margin: 5px 0 0 17px; }
.alert-danger { color: #7d1218; background: #fbe7e8; border: 1px solid #f2c9cb; }

.protocol-success { padding: 15px 17px; background: var(--soft-green); border: 1px solid #d3ecdf; border-radius: 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: #215f46; }
.protocol-success > span { width: 40px; height: 40px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; color: var(--green); }
.protocol-success > div { flex: 1; }
.protocol-success strong { font-size: .8rem; }
.protocol-success p { margin: 4px 0 0; font-size: .69rem; }

/* Manager dashboard and modules */
.manager-welcome { min-height: 230px; padding: 33px 36px; display: grid; grid-template-columns: minmax(0, 1.4fr) 260px 240px; align-items: center; gap: 24px; color: white; background: radial-gradient(circle at 89% 10%, rgba(237,28,36,.2), transparent 34%), linear-gradient(120deg, #262223, #161415 68%, #3c090f); position: relative; }
.manager-welcome > div { position: relative; z-index: 2; }
.manager-welcome h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 3.3vw, 3.9rem); line-height: .98; font-weight: 470; letter-spacing: -.05em; margin: 9px 0; }
.manager-welcome > div:first-child > p { color: rgba(255,255,255,.6); font-size: .77rem; }
.manager-context-line { display: flex; gap: 15px; margin-top: 22px; flex-wrap: wrap; }
.manager-context-line span { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.66); font-size: .65rem; }
.manager-score { padding: 21px; border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.055); border-radius: 17px; }
.manager-score > span { color: rgba(255,255,255,.55); font-size: .65rem; }
.manager-score > strong { display: block; font-family: var(--font-display); font-size: 3rem; font-weight: 500; line-height: 1; margin-top: 8px; }
.manager-score > strong small { font-size: 1rem; }
.manager-score > div { height: 6px; background: rgba(255,255,255,.1); border-radius: 99px; margin: 15px 0 8px; overflow: hidden; }
.manager-score > div i { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.manager-score > small { color: rgba(255,255,255,.48); font-size: .62rem; }
.manager-building-visual { height: 170px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; opacity: .8; }
.manager-building-visual i { display: block; min-height: 28px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); position: relative; }
.manager-building-visual i:nth-child(2), .manager-building-visual i:nth-child(5), .manager-building-visual i:nth-child(8) { height: 78%; }
.manager-building-visual i:nth-child(3), .manager-building-visual i:nth-child(6), .manager-building-visual i:nth-child(9) { height: 54%; }
.manager-building-visual i::after { content: ""; position: absolute; inset: 7px; background-image: radial-gradient(circle, rgba(255,255,255,.34) 1px, transparent 2px); background-size: 10px 12px; }
.manager-metrics .metric-card:nth-child(4) { background: var(--ink); color: white; border-color: var(--ink); }
.manager-metrics .metric-card:nth-child(4) .metric-icon { background: rgba(255,255,255,.1); color: #ff7b7f; }
.manager-metrics .metric-card:nth-child(4) div > span, .manager-metrics .metric-card:nth-child(4) small { color: rgba(255,255,255,.55); }
.distribution-legend { display: grid; gap: 8px; }
.distribution-legend > div { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 9px; font-size: .7rem; }
.distribution-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.manager-recommendations { padding: 24px; }
.recommendation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recommendation-grid a { min-height: 120px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.recommendation-grid a:hover { background: var(--ivory-2); }
.insight-index { color: var(--red); font-family: var(--font-display); font-size: 1.3rem; }
.recommendation-grid strong { font-size: .76rem; line-height: 1.35; }
.recommendation-grid p { color: var(--muted); font-size: .66rem; line-height: 1.45; margin: 7px 0 0; }
.report-header-card { min-height: 146px; padding: 25px 28px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.report-header-card > div:first-child { display: flex; align-items: center; gap: 16px; }
.report-icon { width: 58px; height: 58px; border-radius: 17px; background: var(--soft-red); color: var(--red); display: inline-flex; align-items: center; justify-content: center; }
.report-header-card small, .rateio-cover small { color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: .6rem; }
.report-header-card h2, .rateio-cover h2 { font-family: var(--font-display); font-weight: 530; font-size: 1.7rem; margin: 4px 0; }
.report-header-card p, .rateio-cover p { margin: 0; color: var(--muted); font-size: .72rem; }
.report-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.report-kpis > div { display: grid; padding-left: 20px; border-left: 1px solid var(--line); }
.report-kpis > div small { color: var(--muted); text-transform: none; letter-spacing: 0; }
.report-kpis strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 550; margin-top: 5px; }
.report-kpis span { color: var(--green); font-size: .61rem; margin-top: 4px; }
.month-count { width: 27px; height: 27px; border-radius: 50%; background: var(--soft-red); color: var(--red); display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.rateio-cover { min-height: 142px; padding: 26px 29px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; background: linear-gradient(120deg, white, #faf2f1); }
.rateio-cover > div:first-child { display: flex; align-items: center; gap: 16px; }
.rateio-total { display: grid; text-align: right; }
.rateio-total strong { font-family: var(--font-display); font-size: 2rem; font-weight: 540; }
.rateio-total span { color: var(--muted); font-size: .68rem; }
.negative-value { color: var(--red); }
.search-certificate { padding: 27px; margin-bottom: 18px; }
.search-certificate-head { display: flex; gap: 16px; align-items: center; }
.search-certificate h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 530; margin: 4px 0; }
.search-certificate p { color: var(--muted); margin: 0; font-size: .72rem; }
.unit-search-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.unit-result { padding: 26px; }
.unit-result-status { display: flex; align-items: center; gap: 15px; }
.unit-result-status > span:first-child { width: 50px; height: 50px; border-radius: 50%; background: var(--soft-green); color: var(--green); display: flex; align-items: center; justify-content: center; }
.unit-result-status > div { flex: 1; }
.unit-result-status small { color: var(--green); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.unit-result-status h2 { font-family: var(--font-display); margin: 3px 0; font-size: 1.5rem; font-weight: 530; }
.unit-result-status p { margin: 0; color: var(--muted); font-size: .7rem; }
.unit-result-data { display: grid; grid-template-columns: repeat(3, 1fr); margin: 21px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.unit-result-data > div { padding: 15px; display: grid; border-right: 1px solid var(--line); }
.unit-result-data > div:last-child { border-right: 0; }
.unit-result-data small { color: var(--muted); font-size: .62rem; }
.unit-result-data strong { font-size: .77rem; margin-top: 5px; }
.unit-result-action { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-radius: 12px; background: var(--ivory-2); }
.unit-result-action > div { display: grid; }
.unit-result-action strong { font-size: .76rem; }
.unit-result-action small { color: var(--muted); margin-top: 4px; font-size: .64rem; }
.candidate-explainer { display: flex; align-items: flex-start; gap: 12px; padding: 15px; margin-bottom: 18px; border-radius: 13px; background: #fff4f3; border: 1px dashed rgba(237,28,36,.35); }
.candidate-explainer > svg { color: var(--red); margin-top: 2px; }
.candidate-explainer strong { font-size: .76rem; }
.candidate-explainer p { margin: 4px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.recovery-hero { min-height: 160px; padding: 27px; display: grid; grid-template-columns: 1fr 420px; gap: 35px; align-items: center; margin-bottom: 18px; background: linear-gradient(120deg, #241f20, #401016); color: white; }
.recovery-hero > div:first-child small { color: rgba(255,255,255,.55); }
.recovery-hero > div:first-child h2 { font-family: var(--font-display); font-size: 2.8rem; margin: 7px 0; font-weight: 510; }
.recovery-hero > div:first-child span { color: #8ce0bb; font-size: .7rem; display: flex; align-items: center; gap: 6px; }
.recovery-goal { padding: 20px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.recovery-goal > div:first-child { display: flex; justify-content: space-between; }
.recovery-goal span, .recovery-goal small { color: rgba(255,255,255,.55); font-size: .65rem; }
.recovery-goal > div:nth-child(2) { height: 7px; background: rgba(255,255,255,.1); border-radius: 99px; margin: 14px 0 8px; overflow: hidden; }
.recovery-goal > div:nth-child(2) i { display: block; height: 100%; background: var(--red); }
.candidate-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 13px; overflow: hidden; }
.candidate-kpi-grid > div { padding: 19px; background: white; display: grid; }
.candidate-kpi-grid small, .candidate-kpi-grid span { color: var(--muted); font-size: .62rem; }
.candidate-kpi-grid strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 540; margin: 7px 0; }
.comparison-controls { padding: 18px; display: flex; align-items: end; gap: 14px; margin-bottom: 16px; }
.comparison-controls > div { display: grid; gap: 6px; flex: 1; }
.comparison-controls label { font-size: .65rem; font-weight: 600; }
.comparison-controls > span { width: 42px; height: 42px; border-radius: 50%; background: var(--ivory-2); display: flex; align-items: center; justify-content: center; }
.comparison-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.comparison-grid article { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; position: relative; }
.comparison-grid article > span { position: absolute; top: 15px; left: 18px; color: var(--muted); font-size: .65rem; }
.comparison-grid article > div { margin-top: 22px; display: grid; }
.comparison-grid article small { color: var(--muted); font-size: .61rem; }
.comparison-grid article strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 540; margin-top: 4px; }
.comparison-grid article i { margin-top: 22px; color: var(--muted); }
.comparison-grid article em { position: absolute; right: 15px; top: 13px; color: var(--green); font-style: normal; font-size: .62rem; }
.comparison-grid .better strong { color: var(--green); }
.request-board { grid-template-columns: repeat(4, 1fr); }
.request-board article { display: grid; gap: 3px; }
.request-board article > span { color: var(--muted); font-size: .67rem; }
.request-board article > strong { font-family: var(--font-display); font-size: 1.8rem; font-weight: 540; }
.request-board article > small { color: var(--muted); font-size: .6rem; }
.access-overview { min-height: 135px; padding: 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.access-overview > div:first-child { display: flex; align-items: center; gap: 15px; }
.access-icon { width: 54px; height: 54px; border-radius: 17px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.access-overview h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 3px 0; font-weight: 540; }
.access-overview small, .access-overview p { color: var(--muted); }
.access-overview p { margin: 0; font-size: .7rem; }
.security-score { padding: 15px 19px; border-radius: 13px; background: var(--soft-green); display: grid; min-width: 260px; }
.security-score span { color: var(--green); font-size: .65rem; display: flex; align-items: center; gap: 6px; }
.security-score strong { font-family: var(--font-display); font-size: 1.25rem; margin-top: 4px; }
.security-score small { font-size: .6rem; margin-top: 3px; }
.user-table-cell { display: flex; align-items: center; gap: 10px; }
.user-table-cell > span { width: 35px; height: 35px; border-radius: 10px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 700; }
.user-table-cell > div { display: grid; }
.access-level { padding: 5px 8px; border-radius: 6px; background: var(--ivory-2); font-size: .63rem; }

/* Satisfaction */
.satisfaction-hero { min-height: 235px; padding: 34px 38px; background: radial-gradient(circle at 84% 10%, rgba(237,28,36,.23), transparent 33%), linear-gradient(120deg, #221f20, #111011 68%, #3b090e); color: white; display: grid; grid-template-columns: 1.2fr .65fr 250px; align-items: center; gap: 26px; position: relative; }
.satisfaction-hero > div { position: relative; z-index: 2; }
.satisfaction-hero h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 3.5vw, 4rem); line-height: .95; letter-spacing: -.05em; font-weight: 460; margin: 9px 0; }
.satisfaction-hero h2 em { color: #ff777b; font-style: normal; }
.satisfaction-hero > div:first-child > p { color: rgba(255,255,255,.58); font-size: .78rem; max-width: 620px; }
.satisfaction-source-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 21px; }
.satisfaction-source-row span { color: rgba(255,255,255,.58); display: inline-flex; align-items: center; gap: 5px; font-size: .62rem; }
.satisfaction-orbit { height: 170px; position: relative !important; }
.satisfaction-orbit::before, .satisfaction-orbit::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; }
.satisfaction-orbit::after { inset: 37px; }
.satisfaction-orbit > span { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; background: var(--red); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 30px var(--red); }
.satisfaction-orbit i { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); font-style: normal; font-family: var(--font-display); }
.satisfaction-orbit i:nth-child(1) { left: 7%; top: 47%; }
.satisfaction-orbit i:nth-child(2) { left: 35%; top: 4%; }
.satisfaction-orbit i:nth-child(3) { right: 8%; top: 22%; }
.satisfaction-orbit i:nth-child(4) { right: 17%; bottom: 4%; }
.satisfaction-orbit i:nth-child(5) { left: 27%; bottom: 10%; }
.satisfaction-score { padding: 22px; border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.055); border-radius: 17px; display: grid; }
.satisfaction-score > small { color: rgba(255,255,255,.5); font-size: .64rem; }
.satisfaction-score > strong { font-family: var(--font-display); font-size: 2.8rem; font-weight: 500; margin-top: 5px; }
.satisfaction-score > strong em { font-size: .85rem; color: rgba(255,255,255,.45); font-style: normal; }
.satisfaction-score > div { color: #ffcc71; letter-spacing: .08em; margin: 8px 0; }
.satisfaction-score .partial { color: #776c6f; }
.satisfaction-filters { margin-top: 17px; }
.date-range-control { min-height: 43px; min-width: 230px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: white; }
.date-range-control > div { display: grid; flex: 1; }
.date-range-control small { color: var(--muted); font-size: .58rem; }
.date-range-control strong { font-size: .68rem; margin-top: 2px; }
.satisfaction-metrics .metric-card:first-child { background: var(--red); color: white; border-color: var(--red); }
.satisfaction-metrics .metric-card:first-child .metric-icon { background: rgba(255,255,255,.13); color: white; }
.satisfaction-metrics .metric-card:first-child div > span, .satisfaction-metrics .metric-card:first-child small { color: rgba(255,255,255,.66); }
.channel-performance { display: grid; gap: 5px; }
.channel-performance article { display: grid; grid-template-columns: 32px minmax(110px, .7fr) minmax(100px, 1fr) 45px; gap: 11px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.channel-performance article:last-child { border-bottom: 0; }
.channel-rank { position: relative; display: flex; align-items: center; }
.channel-rank span { font-family: var(--font-display); color: var(--red); font-size: .9rem; }
.channel-performance article > div:nth-child(2) { display: grid; }
.channel-performance article > div:nth-child(2) strong { font-size: .72rem; }
.channel-performance article > div:nth-child(2) small { color: var(--muted); margin-top: 3px; font-size: .59rem; }
.channel-bar { height: 5px; background: var(--ivory-2); border-radius: 99px; overflow: hidden; }
.channel-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--wine), var(--red)); }
.channel-performance article > strong { font-family: var(--font-display); font-size: 1rem; text-align: right; }
.critical-count { background: var(--soft-red); color: var(--red); border-radius: 999px; padding: 6px 9px; font-size: .62rem; }
.critical-feed article { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.critical-score { width: 38px; height: 38px; border-radius: 50%; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.critical-score.warning { background: var(--soft-amber); color: var(--amber); }
.critical-feed strong { font-size: .68rem; }
.critical-feed p { color: var(--muted); font-size: .64rem; line-height: 1.4; margin: 4px 0; }
.critical-feed small { color: #9c9496; font-size: .57rem; }
.critical-feed button { border: 0; color: var(--red); background: transparent; font-size: .63rem; font-weight: 700; }
.comparison-gauge { padding-top: 8px; }
.comparison-gauge > div { display: flex; gap: 12px; justify-content: center; }
.comparison-gauge > div > span { --score: 90%; width: 105px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--red) var(--score), var(--ivory-2) 0); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.comparison-gauge > div > span::before { content: ""; position: absolute; inset: 8px; background: white; border-radius: 50%; }
.comparison-gauge strong, .comparison-gauge small { position: relative; z-index: 1; }
.comparison-gauge strong { font-family: var(--font-display); font-size: 1.3rem; }
.comparison-gauge small { color: var(--muted); font-size: .58rem; }
.comparison-gauge > p { margin: 17px 0 0; padding: 12px; background: var(--soft-green); border-radius: 10px; text-align: center; display: grid; }
.comparison-gauge > p strong { color: var(--green); }
.comparison-gauge > p span { font-size: .62rem; color: #527060; margin-top: 3px; }
.satisfaction-responses { padding: 24px; margin-top: 20px; }
.response-table-actions { display: flex; gap: 8px; }
.response-comment { min-width: 280px; color: var(--muted); }
.table-score { width: 34px; height: 34px; border-radius: 50%; background: var(--soft-red); color: var(--red); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.channel-badge { display: inline-flex; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .62rem; }
.data-source-note { margin-top: 20px; padding: 20px; display: flex; gap: 13px; background: #f0ede8; border-style: dashed; }
.data-source-note > span { width: 42px; height: 42px; border-radius: 50%; background: white; color: var(--red); display: flex; align-items: center; justify-content: center; }
.data-source-note strong { font-size: .78rem; }
.data-source-note p { color: var(--muted); font-size: .69rem; line-height: 1.5; margin: 4px 0 0; }

/* Modals, command, toast */
.portal-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.portal-modal-backdrop { position: absolute; inset: 0; background: rgba(18,16,17,.7); backdrop-filter: blur(5px); }
.portal-modal-dialog { position: relative; z-index: 1; width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--paper); border-radius: 22px; padding: 30px; box-shadow: var(--shadow-lg); }
.portal-modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ivory-2); display: flex; align-items: center; justify-content: center; }
.portal-modal-dialog h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 520; margin: 4px 0 10px; }
.portal-modal-dialog > div > p { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.modal-invoice-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.modal-invoice-summary > div { padding: 13px; border-radius: 12px; background: var(--ivory-2); display: grid; }
.modal-invoice-summary small { color: var(--muted); font-size: .62rem; }
.modal-invoice-summary strong { font-family: var(--font-display); margin-top: 5px; font-size: 1.2rem; }
.modal-legal { display: block; margin-top: 16px; text-align: center; color: var(--muted); font-size: .6rem; }
.certificate-paper { border: 1px solid var(--line-2); padding: 28px; text-align: center; background: white; box-shadow: 0 16px 35px rgba(31,28,29,.08); margin: 16px 0; }
.certificate-paper img { width: auto; height: 36px; margin: 0 auto 24px; }
.certificate-paper > span { color: var(--red); letter-spacing: .16em; font-size: .62rem; font-weight: 700; }
.certificate-paper h2 { font-size: 1.5rem; }
.certificate-paper p { line-height: 1.6; font-family: var(--font-display); font-size: 1rem; color: var(--ink-2) !important; }
.certificate-paper dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0; border: 1px solid var(--line); }
.certificate-paper dl div { padding: 10px; display: grid; border-right: 1px solid var(--line); }
.certificate-paper dl div:last-child { border-right: 0; }
.certificate-paper dt { color: var(--muted); font-size: .55rem; }
.certificate-paper dd { margin: 4px 0 0; font-size: .68rem; font-weight: 700; }
.certificate-paper > small { color: var(--red); font-weight: 700; font-size: .56rem; letter-spacing: .08em; }
.simulator-range { padding: 14px; background: var(--ivory-2); border-radius: 12px; }
.simulator-range > div:first-child { display: flex; justify-content: space-between; font-size: .7rem; }
.simulator-range input[type=range] { width: 100%; accent-color: var(--red); }
.simulator-result { display: grid; text-align: center; margin-top: 10px; }
.simulator-result small, .simulator-result span { color: var(--muted); font-size: .61rem; }
.simulator-result strong { font-family: var(--font-display); font-size: 1.7rem; margin: 5px 0; }
.command-palette { position: fixed; inset: 0; z-index: 110; padding-top: 12vh; background: rgba(16,14,15,.62); backdrop-filter: blur(6px); }
.command-dialog { width: min(620px, calc(100% - 32px)); margin: 0 auto; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.command-search { height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.command-search input { flex: 1; border: 0; outline: 0; background: transparent; }
.command-results { padding: 10px; }
.command-results > span { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .58rem; padding: 8px 10px; }
.command-results > a { min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.command-results > a:hover { background: var(--ivory-2); }
.command-results > a > svg { width: 20px; color: var(--red); }
.command-results > a > div { display: grid; flex: 1; }
.command-results strong { font-size: .76rem; }
.command-results small { color: var(--muted); font-size: .63rem; margin-top: 3px; }
.portal-toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 8px; }
.portal-toast { min-width: 300px; max-width: 420px; padding: 14px 16px; border-radius: 13px; background: var(--ink); color: white; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; font-size: .74rem; }
.portal-toast > span { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: #79d0aa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* Login */
.portal-login-page { width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(440px, .7fr); overflow-x: hidden; background: var(--paper); }
.login-visual-panel { min-height: 100vh; position: sticky; top: 0; overflow: hidden; color: white; }
.login-background, .login-background img, .login-overlay, .login-grid-pattern { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-background img { object-fit: cover; }
.login-overlay { background: linear-gradient(105deg, rgba(16,14,15,.92), rgba(16,14,15,.52) 65%, rgba(75,13,20,.62)); }
.login-grid-pattern { opacity: .13; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to right, black, transparent); }
.login-visual-content { position: relative; z-index: 2; min-height: 100%; padding: 42px 48px; display: flex; flex-direction: column; }
.login-brand { display: inline-flex; width: fit-content; padding: 7px 9px; background: var(--white); border-radius: 10px; line-height: 0; }
.login-brand img { width: auto; height: 52px; }
.login-message { margin: auto 0; max-width: 740px; }
.login-message > span { text-transform: uppercase; letter-spacing: .15em; font-size: .69rem; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 8px; }
.login-message > span i { width: 28px; height: 2px; background: var(--red); }
.login-message h1 { font-family: var(--font-display); font-size: clamp(3.6rem, 6vw, 7rem); line-height: .87; font-weight: 430; letter-spacing: -.065em; margin: 18px 0 26px; }
.login-message h1 em { color: #ff6b70; font-weight: 400; }
.login-message p { max-width: 560px; font-size: 1rem; line-height: 1.55; color: rgba(255,255,255,.66); }
.login-feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; overflow: hidden; }
.login-feature-strip article { min-height: 82px; background: rgba(18,16,17,.4); display: flex; align-items: center; gap: 10px; padding: 14px; backdrop-filter: blur(8px); }
.login-feature-strip article > svg { color: #ff7378; }
.login-feature-strip div { display: grid; }
.login-feature-strip strong { font-size: .72rem; }
.login-feature-strip small { color: rgba(255,255,255,.5); margin-top: 3px; font-size: .59rem; }
.login-red-thread { position: absolute; inset: auto 0 0; z-index: 1; pointer-events: none; opacity: .8; }
.login-red-thread svg { width: 100%; height: 45vh; }
.login-red-thread path { fill: none; stroke: var(--red); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(237,28,36,.8)); }
.login-form-panel { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 42px; background: var(--paper); }
.login-form-shell { width: min(430px, 100%); }
.login-mobile-brand { display: none; }
.login-mobile-brand img { width: auto; height: 44px; }
.login-demo-pill { width: fit-content; padding: 7px 10px; border-radius: 999px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; gap: 6px; font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.login-alert { margin-top: 14px; padding: 12px; display: flex; gap: 9px; border-radius: 10px; font-size: .7rem; }
.login-alert.success { color: var(--green); background: var(--soft-green); }
.login-alert.error { color: #9f171d; background: var(--soft-red); }
.login-heading { margin-top: 27px; }
.login-heading > span { color: var(--red); text-transform: uppercase; letter-spacing: .13em; font-size: .65rem; font-weight: 700; }
.login-heading h2 { font-family: var(--font-display); font-size: 2.5rem; line-height: .98; letter-spacing: -.04em; font-weight: 500; margin: 9px 0 12px; }
.login-heading p { color: var(--muted); font-size: .76rem; line-height: 1.5; }
.login-back { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .7rem; margin-bottom: 22px; }
.profile-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--ivory-2); border-radius: 11px; margin: 21px 0 17px; }
.profile-switch button { border: 0; background: transparent; min-height: 38px; border-radius: 8px; color: var(--muted); font-size: .68rem; font-weight: 650; }
.profile-switch button[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 3px 8px rgba(31,28,29,.08); }
.login-form { display: grid; gap: 13px; }
.login-field { display: grid; gap: 7px; }
.login-field > label, .login-label-row label { font-size: .69rem; font-weight: 650; }
.login-label-row { display: flex; justify-content: space-between; }
.login-label-row a { color: var(--red); font-size: .65rem; }
.login-field > div:not(.login-label-row) { min-height: 49px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 11px; transition: .18s; }
.login-field > div:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,.08); }
.login-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.login-field > div > span { color: var(--muted); }
.password-toggle { border: 0; background: transparent; color: var(--muted); }
/* o JS insere o erro como filho direto de .portal-field, e `.portal-field > small`
   (l.448) vencia por especificidade — a mensagem de erro saía cinza */
.field-error, .portal-field > small.field-error { min-height: 0; color: var(--red); font-size: .61rem; }
.login-check { display: flex; gap: 8px; color: var(--muted); font-size: .65rem; align-items: center; }
.login-check input { accent-color: var(--red); }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-accounts > div:first-child { display: grid; margin-bottom: 8px; }
.demo-accounts > div:first-child strong { font-size: .72rem; }
.demo-accounts > div:first-child small { color: var(--muted); font-size: .61rem; margin-top: 3px; }
.demo-accounts > button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-align: left; }
.demo-accounts > button:hover { background: var(--ivory-2); }
.demo-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700; }
.demo-accounts > button > span:nth-child(2) { display: grid; flex: 1; }
.demo-accounts button strong { font-size: .68rem; }
.demo-accounts button small { color: var(--muted); font-size: .58rem; margin-top: 2px; }
.demo-password { margin-top: 8px; min-height: 42px; display: flex; align-items: center; gap: 9px; border-radius: 9px; background: var(--ivory-2); padding: 0 10px; }
.demo-password span { color: var(--muted); font-size: .62rem; }
.demo-password code { flex: 1; font-size: .7rem; }
.demo-password button { border: 0; background: transparent; color: var(--red); }
.login-security-note { margin-top: 18px; display: flex; gap: 9px; padding: 12px; border-radius: 10px; background: #f1f5f8; color: #4d6170; }
.login-security-note p { margin: 0; font-size: .62rem; line-height: 1.45; }
.login-support { margin-top: 17px; display: flex; gap: 8px; justify-content: center; color: var(--muted); font-size: .62rem; }
.recovery-success { text-align: center; padding: 24px 0; }
.recovery-success > span { width: 62px; height: 62px; margin: 0 auto; border-radius: 50%; background: var(--soft-green); color: var(--green); display: flex; align-items: center; justify-content: center; }
.recovery-success h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 520; }
.recovery-success p { color: var(--muted); line-height: 1.5; font-size: .73rem; }

/* Direct forms */
.direct-form-page { min-height: 100vh; background: var(--ivory); position: relative; }
.direct-form-header { height: 84px; padding: 0 clamp(22px, 4vw, 62px); display: flex; justify-content: space-between; align-items: center; background: rgba(255,253,250,.88); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.direct-form-brand img { width: auto; height: 44px; }
.direct-form-header > div { display: flex; gap: 20px; align-items: center; }
.direct-form-header > div span, .direct-form-header > div a { display: flex; align-items: center; gap: 6px; font-size: .69rem; color: var(--muted); }
.direct-form-header > div span svg { color: var(--green); }
.direct-form-header > div a { color: var(--red); font-weight: 600; }
.direct-form-thread { position: absolute; top: 84px; left: 0; width: 100%; height: 210px; overflow: hidden; pointer-events: none; opacity: .5; }
.direct-form-thread svg { width: 100%; height: 100%; }
.direct-form-thread path { fill: none; stroke: var(--red); stroke-width: 1.3; }
.direct-form-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 55px; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 44px; align-items: start; position: relative; z-index: 2; }
.direct-form-intro { padding: 32px 12px; position: sticky; top: 105px; }
.direct-form-icon { width: 64px; height: 64px; border-radius: 21px; background: var(--red); color: white; display: flex; align-items: center; justify-content: center; box-shadow: 0 15px 35px rgba(237,28,36,.24); }
.direct-form-intro > span { display: block; color: var(--red); text-transform: uppercase; letter-spacing: .13em; font-size: .66rem; font-weight: 720; margin-top: 23px; }
.direct-form-intro h1 { font-family: var(--font-display); font-size: 3.2rem; line-height: .95; letter-spacing: -.045em; font-weight: 500; margin: 9px 0 16px; }
.direct-form-intro > p { color: var(--muted); font-size: .81rem; line-height: 1.55; }
.direct-form-steps { list-style: none; margin: 28px 0; padding: 0; }
.direct-form-steps li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.direct-form-steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 43px; width: 1px; height: 21px; background: var(--line-2); }
.direct-form-steps li > span { width: 33px; height: 33px; border-radius: 50%; background: white; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.direct-form-steps li.is-active > span { color: white; background: var(--ink); border-color: var(--ink); }
.direct-form-steps li div { display: grid; }
.direct-form-steps strong { font-size: .72rem; }
.direct-form-steps small { color: var(--muted); font-size: .6rem; margin-top: 3px; }
.direct-support-card { display: flex; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.6); }
.direct-support-card > span { width: 38px; height: 38px; border-radius: 50%; background: var(--soft-red); color: var(--red); display: flex; align-items: center; justify-content: center; }
.direct-support-card > div { display: grid; }
.direct-support-card strong { font-size: .69rem; }
.direct-support-card a { color: var(--red); font-family: var(--font-display); font-size: 1.05rem; margin-top: 2px; }
.direct-support-card small { color: var(--muted); font-size: .58rem; }
.direct-form-card { padding: 34px; border: 1px solid var(--line); border-radius: 25px; background: var(--paper); box-shadow: var(--shadow-md); }
.direct-form-card-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 21px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.direct-form-card-head > div > span { color: var(--red); text-transform: uppercase; letter-spacing: .13em; font-size: .61rem; font-weight: 720; }
.direct-form-card-head h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 530; margin: 4px 0 0; }
.direct-demo-tag { padding: 7px 9px; border-radius: 999px; background: var(--soft-red); color: var(--red); display: flex; align-items: center; gap: 5px; font-size: .59rem; text-transform: uppercase; letter-spacing: .08em; }
.direct-note { margin: 0 0 20px; }
.direct-form { position: relative; }
.direct-privacy { padding: 13px; background: var(--ivory-2); border-radius: 11px; margin-top: 18px; }
.direct-form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.direct-form-actions > a { color: var(--muted); font-size: .7rem; display: flex; align-items: center; gap: 6px; }
.direct-alert { display: flex; gap: 10px; padding: 14px; border-radius: 11px; }
.direct-alert.error { background: var(--soft-red); color: #97161b; }
.direct-alert strong { font-size: .74rem; }
.direct-alert p { margin: 4px 0 0; font-size: .67rem; }
.direct-form-success { min-height: 470px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 35px; }
.direct-form-success > span { width: 76px; height: 76px; border-radius: 50%; background: var(--soft-green); color: var(--green); display: flex; align-items: center; justify-content: center; }
.direct-form-success > small { color: var(--green); text-transform: uppercase; letter-spacing: .12em; margin-top: 18px; }
.direct-form-success h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 520; margin: 7px 0; }
.direct-form-success > strong { font-family: var(--font-display); font-size: 2.5rem; color: var(--red); }
.direct-form-success p { max-width: 500px; color: var(--muted); line-height: 1.5; font-size: .75rem; }
.direct-form-success > div { display: flex; gap: 9px; margin-top: 12px; }
.direct-loading { position: absolute; inset: 0; background: rgba(255,253,250,.94); border-radius: 15px; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; z-index: 3; }
.direct-loading > span { width: 40px; height: 40px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
.direct-loading strong { font-size: .74rem; }
.direct-form-footer { min-height: 70px; padding: 18px clamp(22px, 4vw, 62px); border-top: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .62rem; }
.direct-form-footer p { margin: 0; }
.direct-form-footer > div { display: flex; gap: 14px; }
.eligibility-preview { margin-top: 17px; padding: 14px; border-radius: 11px; background: #f1f5f8; display: flex; gap: 11px; color: #425766; }
.eligibility-preview > span { width: 37px; height: 37px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; }
.eligibility-preview strong { font-size: .71rem; }
.eligibility-preview p { margin: 4px 0 0; font-size: .64rem; line-height: 1.45; }
.rating-fieldset { border: 0; margin: 0; padding: 0 0 22px; }
.rating-fieldset legend { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 14px; }
.rating-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating-options label { cursor: pointer; }
.rating-options input { position: absolute; opacity: 0; }
.rating-options label > span { aspect-ratio: 1; border-radius: 15px; border: 1px solid var(--line); background: var(--ivory-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.55rem; transition: .18s; }
.rating-options label > small { text-align: center; color: var(--muted); font-size: .53rem; line-height: 1.2; display: block; margin-top: 6px; }
.rating-options input:checked + span, .rating-options label:hover > span { background: var(--red); border-color: var(--red); color: white; transform: translateY(-2px); }
.rating-options input:focus-visible + span { outline: 3px solid rgba(237, 28, 36, .42); outline-offset: 3px; }

/* Print export */
.print-report { width: 900px; max-width: calc(100% - 40px); margin: 30px auto; padding: 40px; background: white; box-shadow: var(--shadow-md); }
.print-report header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--red); }
.print-report header img { width: auto; height: 45px; }
.print-report header div { text-align: right; display: grid; }
.print-report header span { color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: .65rem; }
.print-report header strong { font-family: var(--font-display); font-size: 1.7rem; font-weight: 520; }
.print-report header small { color: var(--muted); }
.print-demo-warning { margin: 18px 0; background: var(--soft-amber); padding: 12px; border-radius: 8px; font-size: .7rem; }
.print-report table { width: 100%; border-collapse: collapse; font-size: .7rem; }
.print-report th, .print-report td { padding: 10px; border: 1px solid var(--line); text-align: left; }
.print-report th { background: var(--ivory-2); }
.print-report footer { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .62rem; }
.print-button { margin-top: 20px; }

/* Responsive */
@media (max-width: 1280px) {
  :root { --sidebar: 264px; }
  .portal-content { padding-inline: 24px; }
  .resident-welcome { grid-template-columns: 1.2fr .45fr 260px; }
  .manager-welcome { grid-template-columns: 1.3fr 230px 180px; }
  .report-kpis { gap: 15px; }
  .satisfaction-hero { grid-template-columns: 1.2fr .45fr 230px; }
}

@media (max-width: 1080px) {
  :root { --sidebar: 280px; }
  .portal-shell { grid-template-columns: 1fr; }
  .portal-workspace { grid-column: 1; }
  .portal-sidebar { transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .portal-shell.is-sidebar-open .portal-sidebar { transform: translateX(0); }
  .portal-sidebar-close, .portal-menu-button { display: flex; }
  .portal-sidebar-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(18,16,17,.56); backdrop-filter: blur(3px); }
  .portal-shell.is-sidebar-open .portal-sidebar-overlay { display: block; }
  .portal-content { padding: 24px 22px 80px; }
  .resident-welcome { grid-template-columns: 1fr 240px; }
  .resident-line-visual { display: none; }
  .manager-welcome { grid-template-columns: 1fr 240px; }
  .manager-building-visual { display: none; }
  .satisfaction-hero { grid-template-columns: 1fr 230px; }
  .satisfaction-orbit { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .span-8, .span-7 { grid-column: span 12; }
  .span-5, .span-4 { grid-column: span 6; }
  .report-header-card { align-items: flex-start; }
  .report-kpis { grid-template-columns: 1fr; gap: 8px; }
  .report-kpis > div { padding-left: 12px; }
  .direct-form-shell { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
  .portal-login-page { grid-template-columns: 1fr 460px; }
  .login-feature-strip article { padding: 10px; }
  .login-visual-content { padding: 34px; }
}

@media (max-width: 820px) {
  .portal-topbar { padding-inline: 16px; }
  .portal-page-title > span, .topbar-search, .user-copy { display: none; }
  .portal-page-title h1 { font-size: 1.25rem; }
  .portal-content { padding: 18px 16px 92px; }
  .portal-page-head { align-items: flex-start; gap: 10px; }
  .portal-page-head p { font-size: .72rem; }
  .page-actions { flex-wrap: wrap; justify-content: flex-end; }
  .demo-notice { align-items: flex-start; }
  .resident-welcome, .manager-welcome, .satisfaction-hero { grid-template-columns: 1fr; padding: 28px; }
  .resident-welcome { min-height: 360px; }
  .manager-welcome, .satisfaction-hero { min-height: 380px; }
  .next-billing-panel, .manager-score, .satisfaction-score { width: 100%; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-grid { gap: 14px; }
  .span-5, .span-4, .span-6 { grid-column: span 12; }
  .metric-grid { gap: 11px; }
  .metric-card { min-height: 110px; padding: 16px; }
  .portal-filterbar { flex-wrap: wrap; }
  .portal-search-field { min-width: 100%; }
  .portal-filterbar select { flex: 1; }
  .invoice-featured { grid-template-columns: 90px 1fr; }
  .invoice-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); padding: 12px; border-top: 1px solid var(--line); }
  .financial-status-card { align-items: flex-start; gap: 18px; flex-direction: column; }
  .payment-layout, .form-page-layout { grid-template-columns: 1fr; }
  .payment-summary-card { order: -1; }
  .pix-layout { grid-template-columns: 150px 1fr; }
  .document-category-grid { grid-template-columns: repeat(2, 1fr); }
  .document-overview { grid-template-columns: 1fr; }
  .protocol-metrics, .request-board { grid-template-columns: repeat(2, 1fr); }
  .manager-recommendations .recommendation-grid { grid-template-columns: 1fr; }
  .report-header-card, .rateio-cover, .access-overview { flex-direction: column; align-items: stretch; gap: 20px; }
  .report-kpis { grid-template-columns: repeat(3, 1fr); }
  .rateio-total { text-align: left; }
  .unit-search-form { grid-template-columns: 1fr 1fr; }
  .unit-search-form button { grid-column: 1 / -1; }
  .recovery-hero { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .candidate-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .comparison-controls { flex-wrap: wrap; }
  .comparison-controls > div { min-width: 40%; }
  .comparison-controls > button { width: 100%; }
  .satisfaction-grid .span-8, .satisfaction-grid .span-7, .satisfaction-grid .span-5, .satisfaction-grid .span-4 { grid-column: span 12; }
  .response-table-actions { width: 100%; margin-top: 8px; }
  .portal-section-head { flex-wrap: wrap; }
  .portal-login-page { grid-template-columns: minmax(0, 1fr); }
  .login-visual-panel, .login-form-panel, .login-form-shell { min-width: 0; max-width: 100%; }
  .login-visual-panel { position: relative; min-height: clamp(280px, 42vw, 320px); }
  .login-visual-content { padding: 24px 28px; }
  .login-brand img { height: 42px; }
  .login-feature-strip { display: none; }
  .login-form-panel { min-height: auto; }
  .direct-form-shell { grid-template-columns: 1fr; padding-top: 35px; }
  .direct-form-intro { position: static; padding: 10px 4px; }
  .direct-form-steps, .direct-support-card { display: none; }
  .direct-form-intro h1 { font-size: 2.5rem; }
}

@media (max-width: 600px) {
  :root { --topbar: 68px; }
  .portal-topbar { height: var(--topbar); }
  .portal-content { padding: 14px 12px 90px; }
  .topbar-action.icon-only { width: 38px; height: 38px; }
  .user-avatar { width: 36px; height: 36px; }
  .portal-page-head { min-height: 0; margin-bottom: 10px; }
  .portal-page-head p { max-width: 245px; line-height: 1.4; }
  .page-actions .portal-btn { font-size: 0; width: 40px; min-height: 40px; padding: 0; }
  .page-actions .portal-btn svg { font-size: 1rem; }
  .demo-notice { font-size: .67rem; line-height: 1.35; }
  .portal-mobile-nav { position: fixed; inset: auto 0 0; z-index: 50; min-height: 70px; padding: 7px 8px max(7px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,253,250,.95); backdrop-filter: blur(18px); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(31,28,29,.08); }
  .portal-mobile-nav a, .portal-mobile-nav button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .56rem; }
  .portal-mobile-nav svg { width: 19px; height: 19px; }
  .portal-mobile-nav a.is-active,
  .portal-mobile-nav button.is-active { color: var(--red); }
  .portal-sidebar { width: min(86vw, 310px); }
  .portal-notification-panel { left: 10px; right: 10px; top: 74px; width: auto; }
  .resident-welcome, .manager-welcome, .satisfaction-hero { border-radius: 19px; padding: 24px 20px; }
  .resident-welcome h2, .manager-welcome h2, .satisfaction-hero h2 { font-size: 2.55rem; }
  .quick-actions-grid { gap: 8px; }
  .quick-actions-grid > a { min-height: 76px; padding: 10px; gap: 9px; }
  .quick-actions-grid > a > span { width: 38px; height: 38px; }
  .quick-actions-grid > a > svg { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 104px; padding: 14px; gap: 10px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-card strong { font-size: 1.45rem; }
  .metric-card div > span { font-size: .64rem; }
  .portal-card { border-radius: 17px; }
  .portal-grid-dashboard > .portal-card, .chart-card, .distribution-card, .satisfaction-responses { padding: 18px; }
  .portal-section-head h2 { font-size: 1.15rem; }
  .chart-wrap, .chart-wrap canvas { min-height: 220px; height: 220px; }
  .chart-legend { display: none; }
  .portal-summary-strip { grid-template-columns: 1fr; }
  .portal-summary-strip > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .portal-summary-strip > div:last-child { border-bottom: 0; }
  .portal-filterbar { align-items: stretch; }
  .portal-filterbar select, .portal-filterbar .portal-btn { width: 100%; }
  .invoice-featured { grid-template-columns: 74px 1fr; }
  .invoice-accent { padding: 12px; }
  .invoice-main { padding: 18px 14px; }
  .invoice-main h2 { font-size: 1.25rem; }
  .invoice-actions { grid-template-columns: 1fr; }
  .finance-timeline { overflow-x: auto; grid-template-columns: repeat(8, 62px); }
  .agreement-card dl { grid-template-columns: 1fr; gap: 10px; }
  .state-showcase { grid-template-columns: repeat(2, 1fr); }
  .pix-layout { grid-template-columns: 1fr; text-align: center; }
  .demo-qr { width: 180px; margin: 0 auto; }
  .barcode-panel > div:last-child, .modal-actions { flex-direction: column; }
  .certificate-hero { align-items: flex-start; flex-direction: column; }
  .portal-form-grid, .direct-form-grid { grid-template-columns: 1fr; }
  .portal-field.full { grid-column: auto; }
  .portal-form-actions { align-items: stretch; flex-direction: column; }
  .notification-filterbar .segmented-control { width: 100%; overflow-x: auto; }
  .notification-center > article { padding: 14px 10px; align-items: flex-start; }
  .notification-type { width: 38px; height: 38px; }
  .document-category-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .document-category-grid article { min-height: 78px; padding: 12px; }
  .document-category-grid article > span { width: 36px; height: 36px; }
  .protocol-metrics, .request-board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .protocol-metrics article, .request-board article { padding: 13px; }
  .manager-context-line { gap: 8px; }
  .report-header-card, .rateio-cover { padding: 20px; }
  .report-kpis { grid-template-columns: 1fr; }
  .report-kpis > div { border-left: 0; border-top: 1px solid var(--line); padding: 8px 0 0; }
  .unit-result-status { align-items: flex-start; flex-wrap: wrap; }
  .unit-result-data { grid-template-columns: 1fr; }
  .unit-result-data > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-result-data > div:last-child { border-bottom: 0; }
  .unit-result-action { flex-direction: column; align-items: stretch; gap: 12px; }
  .candidate-kpi-grid { grid-template-columns: 1fr 1fr; }
  .comparison-controls { display: grid; grid-template-columns: 1fr 42px 1fr; align-items: end; }
  .comparison-controls > button { grid-column: 1 / -1; }
  .access-overview { padding: 18px; }
  .security-score { min-width: 0; }
  .satisfaction-source-row { gap: 8px; }
  .satisfaction-filters .date-range-control { min-width: 100%; }
  .channel-performance article { grid-template-columns: 26px 1fr 42px; }
  .channel-bar { grid-column: 2 / -1; }
  .critical-feed article { grid-template-columns: 38px 1fr; }
  .critical-feed button { grid-column: 2; justify-self: start; }
  .response-table-actions { flex-direction: column; }
  .portal-modal-dialog { padding: 25px 18px; border-radius: 18px; }
  .certificate-paper { padding: 18px 12px; }
  .certificate-paper dl { grid-template-columns: 1fr; }
  .certificate-paper dl div { border-right: 0; border-bottom: 1px solid var(--line); }
  .certificate-paper dl div:last-child { border-bottom: 0; }
  .portal-toast-region { left: 10px; right: 10px; bottom: 82px; }
  .portal-toast { min-width: 0; width: 100%; }
  .login-visual-panel { min-height: clamp(230px, 50vw, 260px); }
  .login-visual-content { padding: 18px 20px; }
  .login-brand { display: none; }
  .login-message h1 { font-size: 3.2rem; }
  .login-feature-strip { display: none; }
  .login-form-panel { padding: 32px 20px; }
  .login-mobile-brand { display: block; margin-bottom: 18px; }
  .profile-switch { grid-template-columns: 1fr; }
  .profile-switch button { min-height: 36px; }
  .direct-form-header { height: 70px; padding-inline: 16px; }
  .direct-form-brand img { width: auto; height: 40px; }
  .direct-form-header > div span { display: none; }
  .direct-form-shell { width: calc(100% - 24px); padding: 28px 0 35px; }
  .direct-form-intro { padding: 0 4px; }
  .direct-form-icon { width: 52px; height: 52px; border-radius: 17px; }
  .direct-form-intro h1 { font-size: 2.35rem; }
  .direct-form-card { padding: 22px 16px; border-radius: 19px; }
  .direct-form-card-head { display: grid; gap: 10px; }
  .direct-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .direct-form-actions .portal-btn { width: 100%; }
  .direct-form-actions > a { justify-content: center; }
  .direct-form-footer { flex-direction: column; text-align: center; gap: 10px; }
  .rating-options { gap: 4px; }
  .rating-options label > span { border-radius: 10px; font-size: 1.25rem; }
  .rating-options label > small { display: none; }
  .direct-form-success { padding: 20px 0; }
  .direct-form-success > strong { font-size: 1.9rem; }
  .direct-form-success > div { flex-direction: column; width: 100%; }
}

/* Identidade tipográfica Pontual — login, áreas, formulários e relatórios */
body.portal-body {
  font-family: var(--font-ui);
  font-weight: 400;
  font-synthesis: none;
}

body.portal-body :is(h1, h2, h3, h4, h5, h6, strong, b, em, i, button, input, select, textarea) {
  font-family: var(--font-ui);
}

body.portal-body :is(em, i) { font-style: normal; }
body.portal-body :is(h1, h2) { font-weight: 700; letter-spacing: -.04em; }
body.portal-body :is(h3, h4, h5, h6, strong, b) { font-weight: 600; }
body.portal-body :is(button, .portal-btn, .portal-nav a, .portal-mobile-nav a, .topbar-action, .table-text-action) { font-weight: 600; }

body.portal-body :is(
  .eyebrow,
  .eyebrow-light,
  .modal-kicker,
  .sidebar-demo-tag,
  .portal-context > span,
  .portal-nav h2,
  .portal-page-title > span,
  .portal-section-head > div:first-child > span,
  .candidate-label,
  .login-message > span,
  .login-demo-pill,
  .login-heading > span,
  .direct-form-intro > span,
  .direct-form-card-head > div > span
) {
  font-size: var(--type-label);
  font-weight: 600;
  letter-spacing: .08em;
}

body.portal-body .portal-page-title h1 {
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
}

body.portal-body .portal-section-head h2 {
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
}

body.portal-body .portal-page-head p { font-size: var(--type-ui); line-height: 1.5; }
body.portal-body .portal-nav a { font-size: var(--type-ui); }
body.portal-body .portal-field > label,
body.portal-body .portal-field > div > label,
body.portal-body .login-field > label,
body.portal-body .login-label-row label { font-size: var(--type-micro); font-weight: 600; }

body.portal-body .login-message h1 {
  max-width: 760px;
  margin: 18px 0 22px;
  font-size: clamp(2.5rem, 4.4vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
}

body.portal-body .login-message h1 em,
body.portal-body .resident-welcome h2 em,
body.portal-body .manager-welcome h2 em,
body.portal-body .satisfaction-hero h2 em { font-weight: 600; font-style: normal; }

body.portal-body .login-heading h2 {
  font-size: clamp(1.75rem, 2.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.04em;
}

body.portal-body .login-heading p { font-size: .875rem; line-height: 1.55; }
body.portal-body .login-feature-strip strong { font-size: .8125rem; }
body.portal-body .login-feature-strip small,
body.portal-body .login-security-note p,
body.portal-body .login-support { font-size: .7rem; }
body.portal-body .profile-switch button { font-size: .75rem; }

body.portal-body :is(.resident-welcome h2, .manager-welcome h2, .satisfaction-hero h2) {
  margin-block: 9px 13px;
  font-size: clamp(1.9rem, 2.65vw, 2.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
}

body.portal-body :is(.resident-welcome-copy > p, .manager-welcome > div:first-child > p, .satisfaction-hero > div:first-child > p) {
  font-size: var(--type-body);
  line-height: 1.55;
}

body.portal-body .direct-form-intro h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
}

body.portal-body .direct-form-intro > p { font-size: .875rem; line-height: 1.58; }
body.portal-body .direct-form-card-head h2,
body.portal-body .direct-form-success h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.08; }
body.portal-body .direct-form-success > strong { font-size: 2.1rem; font-weight: 700; }

body.portal-body .metric-card strong { font-size: 1.7rem; font-weight: 700; }
body.portal-body .next-billing-panel > strong { font-size: 1.875rem; font-weight: 700; }
body.portal-body .invoice-accent strong { font-size: 2.125rem; font-weight: 700; }
body.portal-body .manager-score > strong { font-size: 2.5rem; font-weight: 700; }
body.portal-body .satisfaction-score > strong { font-size: 2.35rem; font-weight: 700; }
body.portal-body .recovery-hero > div:first-child h2 { font-size: 2.35rem; font-weight: 700; line-height: 1.04; }

body.portal-body .invoice-main h2 { font-size: 1.35rem; }
body.portal-body .financial-status-card h2 { font-size: 1.55rem; }
body.portal-body .agreement-callout h2 { font-size: 1.65rem; line-height: 1.06; }
body.portal-body .pix-layout h3 { font-size: 1.5rem; }
body.portal-body .payment-summary-card h2 { font-size: 1.35rem; }
body.portal-body .payment-total strong { font-size: 1.65rem; font-weight: 700; }
body.portal-body .certificate-hero h2 { font-size: 1.45rem; }
body.portal-body .form-aside .aside-number { font-size: 1.65rem; font-weight: 700; }
body.portal-body .form-aside h3 { font-size: 1.25rem; }
body.portal-body .document-overview strong,
body.portal-body .protocol-metrics strong { font-size: 1.4rem; font-weight: 700; }
body.portal-body :is(.report-header-card h2, .rateio-cover h2, .search-certificate h2) { font-size: 1.45rem; }
body.portal-body .rateio-total strong { font-size: 1.75rem; font-weight: 700; }
body.portal-body .unit-result-status h2 { font-size: 1.35rem; }
body.portal-body .request-board article > strong { font-size: 1.6rem; font-weight: 700; }
body.portal-body .access-overview h2 { font-size: 1.45rem; }
body.portal-body .portal-modal-dialog h2 {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.08;
}
body.portal-body .demo-qr::after { font-family: var(--font-ui); font-weight: 700; }

@media (max-width: 820px) {
  body.portal-body .login-message h1 { font-size: clamp(2.4rem, 5vw, 2.75rem); }
  body.portal-body :is(.resident-welcome h2, .manager-welcome h2, .satisfaction-hero h2) { font-size: clamp(1.9rem, 4vw, 2.1rem); }
  body.portal-body .direct-form-intro h1 { font-size: clamp(2rem, 3.5vw, 2.1rem); }
}

@media (max-width: 600px) {
  body.portal-body .portal-page-title h1 { font-size: 1.2rem; }
  body.portal-body .portal-section-head h2 { font-size: 1.125rem; }
  body.portal-body .login-message h1 { font-size: clamp(2.15rem, 6.4vw, 2.4rem); }
  body.portal-body .login-heading h2 { font-size: 1.75rem; }
  body.portal-body :is(.resident-welcome h2, .manager-welcome h2, .satisfaction-hero h2) { font-size: clamp(1.8rem, 5vw, 1.9rem); }
  body.portal-body .direct-form-intro h1 { font-size: 2rem; }
  body.portal-body .metric-card strong { font-size: 1.45rem; }
  body.portal-body .invoice-main h2 { font-size: 1.25rem; }
  body.portal-body .direct-form-success > strong { font-size: 1.9rem; }
  body.portal-body .manager-score > strong,
  body.portal-body .satisfaction-score > strong { font-size: 2.1rem; }
  body.portal-body .recovery-hero > div:first-child h2 { font-size: 2rem; }
  body.portal-body .portal-modal-dialog h2 { font-size: 1.45rem; }
}

/* Refinamento estrutural das areas internas */
.portal-content {
  width: min(1440px, 100%);
  padding-inline: var(--portal-gutter);
}

.portal-card-section {
  padding: clamp(20px, 2vw, 26px);
}

.portal-grid-dashboard > .portal-card.portal-card-section {
  padding: clamp(20px, 2vw, 26px);
}

.portal-card-table {
  overflow: hidden;
}

.portal-card.portal-card-table {
  padding: 0;
}

.portal-card-table > .portal-section-head {
  min-height: auto;
  padding: 24px 24px 14px;
  margin: 0;
}

/* Uma guia única de 24px dentro do card de tabela. O card tem padding 0 e delegava o
   recuo a cada filho: o título vinha a 24px e a primeira célula a 14px — 10px de degrau
   em todas as tabelas do portal. */
.portal-card-table .portal-table :is(th, td):first-child { padding-left: 24px; }
.portal-card-table .portal-table :is(th, td):last-child { padding-right: 24px; }
/* O contador de registros é injetado por JS dentro do mesmo card de padding 0. */
.portal-table-count { margin: 0; padding: 12px 24px; }
/* Única tabela do portal dentro de card-section (situação financeira): ali o recuo
   já vem do próprio card, então a célula zera o dela. */
.portal-card-section > .portal-table-wrap .portal-table :is(th, td):first-child { padding-left: 0; }
.portal-card-section > .portal-table-wrap .portal-table :is(th, td):last-child { padding-right: 0; }

.portal-card-section > .portal-section-head {
  min-height: auto;
  margin-bottom: 14px;
}

.portal-section-head > div:first-child {
  min-width: 0;
}

.portal-section-head > small {
  font-size: .75rem;
  line-height: 1.45;
}

.portal-btn,
.portal-icon-button,
.portal-sidebar-close,
.portal-menu-button,
.topbar-action.icon-only,
.notification-panel-head button,
.row-actions button,
.row-menu,
.portal-modal-close {
  min-inline-size: var(--tap);
  min-block-size: var(--tap);
}

.portal-btn-small {
  min-height: var(--tap);
}

.user-dropdown > button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 9px;
  font-size: .8rem;
  text-align: left;
}

.user-dropdown > button:hover,
.user-dropdown > button:focus-visible {
  background: var(--ivory-2);
}

.portal-nav a {
  min-height: var(--tap);
}

.portal-table th {
  font-size: .72rem;
  line-height: 1.25;
}

.portal-table td {
  font-size: .84rem;
  line-height: 1.45;
}

.portal-table td strong {
  font-size: .86rem;
}

.portal-table td > small,
.portal-table td strong + small {
  font-size: .72rem;
}

.status-badge {
  min-height: 29px;
  font-size: .7rem;
}

.row-actions {
  flex-wrap: wrap;
}

.row-actions button,
.row-menu {
  width: var(--tap);
  height: var(--tap);
}

.table-text-action {
  min-height: var(--tap);
  font-size: .76rem;
}

.portal-filterbar select,
.portal-section-head select,
.comparison-controls select,
.portal-search-field {
  min-height: var(--tap);
}

.portal-search-field input,
.portal-filterbar select,
.portal-section-head select,
.comparison-controls select {
  font-size: .84rem;
}

.quick-actions-grid small,
.metric-card small,
.mini-timeline small,
.insight-list small,
.chart-foot-note,
.chart-legend,
.chart-insight small {
  font-size: .72rem;
  line-height: 1.4;
}

.dual-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}

.dual-chart-grid > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #faf7f3);
}

.dual-chart-grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.chart-disclaimer {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ivory-2);
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.agreement-stepper {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agreement-stepper li {
  min-width: 0;
  min-height: 104px;
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  position: relative;
}

.agreement-stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 29px;
  right: -11px;
  width: 11px;
  height: 1px;
  background: var(--line-2);
}

.agreement-stepper .state-icon {
  margin-bottom: 3px;
}

.agreement-stepper strong {
  font-size: .78rem;
}

.agreement-stepper small {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}

.agreement-stepper li[aria-current="step"] {
  border-color: rgba(35, 132, 92, .3);
  background: var(--soft-green);
}

.unit-result[hidden] {
  display: none !important;
}

.notification-filterbar .segmented-control button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(31, 28, 29, .08);
}

.portal-table-empty,
.portal-table-count {
  font-size: .78rem;
  color: var(--muted);
}

.portal-table-empty {
  margin: 0;
  padding: 28px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--ivory);
}

.date-range-context {
  cursor: default;
  background: var(--ivory-2);
  border-style: dashed;
}

.satisfaction-filter-note {
  margin: 8px 0 0;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .76rem;
  line-height: 1.45;
}

.satisfaction-filter-note svg {
  color: var(--red);
  margin-top: .15em;
}

@media (min-width: 821px) and (max-width: 1080px) {
  .span-8 { grid-column: span 8; }
  .span-7 { grid-column: span 7; }
  .span-6 { grid-column: span 6; }
  .span-5 { grid-column: span 5; }
  .span-4 { grid-column: span 4; }
}

@media (max-width: 820px) {
  .portal-page-title > span,
  .user-copy {
    display: none;
  }

  .topbar-search {
    width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
    padding: 0;
    display: inline-flex;
    justify-content: center;
  }

  .topbar-search span,
  .topbar-search kbd {
    display: none;
  }

  .resident-welcome,
  .manager-welcome,
  .satisfaction-hero {
    min-height: auto;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4 {
    grid-column: span 12;
  }

  .dual-chart-grid {
    grid-template-columns: 1fr;
  }

  .portal-card-table > .portal-section-head {
    padding: 20px 20px 12px;
  }
}

@media (max-width: 680px) {
  .portal-content {
    padding-inline: 12px;
  }

  .portal-page-head {
    flex-wrap: wrap;
  }

  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .page-actions .portal-btn {
    width: auto;
    min-width: var(--tap);
    min-height: var(--tap);
    padding-inline: 13px;
    font-size: .78rem;
  }

  .portal-filterbar,
  .satisfaction-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .portal-filterbar > *,
  .satisfaction-filters > * {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .portal-search-field {
    min-width: 0;
  }

  .portal-search-field input,
  .portal-filterbar select {
    font-size: 1rem;
  }

  .portal-card-section {
    padding: 18px;
  }

  .portal-card-table > .portal-section-head {
    padding: 18px 16px 11px;
  }

  .agreement-stepper {
    grid-template-columns: 1fr;
  }

  .agreement-stepper li {
    min-height: 0;
    grid-template-columns: 34px 1fr;
    align-items: center;
    justify-items: stretch;
  }

  .agreement-stepper li:not(:last-child)::after {
    top: auto;
    right: auto;
    left: 28px;
    bottom: -11px;
    width: 1px;
    height: 11px;
  }

  .agreement-stepper .state-icon {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .portal-table-wrap.has-responsive-labels {
    overflow: visible;
    padding: 0 10px 10px;
  }

  .portal-table-wrap.has-responsive-labels .portal-table,
  .portal-table-wrap.has-responsive-labels .portal-table tbody,
  .portal-table-wrap.has-responsive-labels .portal-table tr,
  .portal-table-wrap.has-responsive-labels .portal-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .portal-table-wrap.has-responsive-labels .portal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody {
    display: grid;
    gap: 10px;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody tr {
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(31, 28, 29, .035);
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody td {
    padding: 9px 0;
    border-bottom: 1px solid #eee8e2;
    display: grid;
    grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .035em;
    text-align: left;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody td:last-child {
    border-bottom: 0;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tbody td > *,
  .portal-table-wrap.has-responsive-labels .portal-table tbody td > strong,
  .portal-table-wrap.has-responsive-labels .portal-table tbody td > small {
    justify-self: end;
  }

  .portal-table-wrap.has-responsive-labels .portal-table .row-actions {
    justify-content: flex-end;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tfoot,
  .portal-table-wrap.has-responsive-labels .portal-table tfoot tr,
  .portal-table-wrap.has-responsive-labels .portal-table tfoot td {
    display: block;
    width: 100%;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tfoot {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
  }

  .portal-table-wrap.has-responsive-labels .portal-table tfoot td {
    padding: 9px 13px;
    text-align: right;
  }

  .portal-mobile-nav a,
  .portal-mobile-nav button {
    min-width: var(--tap);
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: white !important; }
  .print-report { width: 100%; max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .print-button { display: none; }
  .print-report thead { display: table-header-group; }
  .print-report tfoot { display: table-footer-group; }
  .print-report tr { break-inside: avoid; page-break-inside: avoid; }
}
