/* Portal do Cliente Summer (demonstração) — baseado no Portal do Membro. */
:root {
  color-scheme: light;
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f7f8fa; --border: #e3e7ed; --border-strong: #cfd6df;
  --text: #17202b; --text-2: #4c5968; --muted: #6b7785;
  --brand: #0b3d6e; --brand-2: #155a99; --accent: #fee109; --red: #1fa4dc;
  --primary: #0b3d6e; --primary-hover: #082c50; --on-primary: #ffffff; --success: #1f6f4a;
  --danger: #b4332f; --warn-bg: #fff4dc; --warn-text: #7a5300; --warn-line: #e8b54a;
  --ok-bg: #e4f4ea; --ok-text: #1b5e39; --info-bg: #e7f0fb; --info-text: #1d4f8a;
  --bad-bg: #fbe5e4; --bad-text: #8a2421; --neutral-bg: #eef0f3; --neutral-text: #3f4b59;
  --s1: #2a78d6; --s2: #eb6834; --grid: #e9ecf0; --axis: #6b7785;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 12px; --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a313b; --border-strong: #3a4350;
    --text: #e8ecf1; --text-2: #b6c0cc; --muted: #8d99a7;
    --brand: #082c50; --brand-2: #8fb0ec; --accent: #f2d61c; --red: #2bb3ea;
    --primary: #3f74d0; --primary-hover: #5585da; --on-primary: #ffffff; --success: #2f9a68;
    --danger: #e0605b; --warn-bg: #3a2c0d; --warn-text: #f2cf7d; --warn-line: #9c7420;
    --ok-bg: #12301f; --ok-text: #8fd9ad; --info-bg: #13263d; --info-text: #9cc6f3;
    --bad-bg: #3a1615; --bad-text: #f3a29e; --neutral-bg: #232a33; --neutral-text: #c3ccd6;
    --s1: #3987e5; --s2: #d95926; --grid: #262d36; --axis: #8d99a7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a313b; --border-strong: #3a4350;
  --text: #e8ecf1; --text-2: #b6c0cc; --muted: #8d99a7;
  --brand: #082c50; --brand-2: #8fb0ec; --accent: #f2d61c; --red: #2bb3ea;
  --primary: #3f74d0; --primary-hover: #5585da; --on-primary: #ffffff; --success: #2f9a68;
  --danger: #e0605b; --warn-bg: #3a2c0d; --warn-text: #f2cf7d; --warn-line: #9c7420;
  --ok-bg: #12301f; --ok-text: #8fd9ad; --info-bg: #13263d; --info-text: #9cc6f3;
  --bad-bg: #3a1615; --bad-text: #f3a29e; --neutral-bg: #232a33; --neutral-text: #c3ccd6;
  --s1: #3987e5; --s2: #d95926; --grid: #262d36; --axis: #8d99a7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--brand-2); }
code { font-family: var(--mono); font-size: .86em; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 26px; letter-spacing: -.01em; } h2 { font-size: 17px; }
.muted, .hint { color: var(--muted); } .hint { font-size: 13px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.big { width: 44px; height: 44px; color: var(--primary); }

/* Faixa de simulação e barra superior */
.sim-banner { background: var(--accent); color: #1b1404; text-align: center; font-size: 12px; font-weight: 600; padding: 5px 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px;
          background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--red); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo { display: block; height: 44px; width: auto; padding: 4px 8px; border-radius: 8px; background: #fff; flex: none; }
.brand-logo.light { height: 38px; padding: 3px 7px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; } .brand-text small { font-size: 11.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
            background: transparent; color: inherit; cursor: pointer; font-size: 15px; }
.demo-panel .icon-btn { border-color: var(--border); }
.demo-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer;
            border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font: 600 13px var(--font); }
.demo-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1b1404; }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 10px; border-left: 1px solid rgba(255,255,255,.2); min-width: 0;
       color: #fff; text-decoration: none; border-radius: 0 10px 10px 0; }
.who:hover { background: rgba(255,255,255,.1); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); font-weight: 700; flex: none; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who-text strong { font-size: 13px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { font-size: 12px; opacity: .75; }
.logout-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; flex: none;
              border: 1px solid rgba(255,255,255,.25); color: #fff; text-decoration: none; font: 600 13px var(--font); }
.logout-btn:hover { background: var(--red); border-color: var(--red); }

/* App instalável */
.install-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer;
               border: 0; background: var(--accent); color: #1b1404; font: 700 13px var(--font); }
.install-btn[hidden] { display: none; }
.ios-tip { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 16px; font-size: 14px;
           background: var(--info-bg); color: var(--info-text); border-bottom: 1px solid var(--border); }
.ios-tip .ico { width: 16px; height: 16px; vertical-align: -3px; }
.ios-tip .icon-btn { border-color: transparent; }
.offline { max-width: 520px; margin: 40px auto; }
body.standalone .sim-banner { padding-top: max(5px, env(safe-area-inset-top)); }
.cart { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.topbar { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }

/* Estrutura */
.layout { display: flex; min-height: calc(100vh - 90px); }
.sidenav { width: 232px; flex: none; padding: 20px 12px; border-right: 1px solid var(--border); background: var(--surface);
           display: flex; flex-direction: column; gap: 4px; }
.sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2);
             text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a.active { background: var(--info-bg); color: var(--info-text); font-weight: 600; }
main { flex: 1; min-width: 0; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 28px 48px; }
.main-in { container-type: inline-size; }
body.bare main { max-width: 980px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.head-stats { display: flex; gap: 24px; }
.head-stats span { display: flex; flex-direction: column; } .head-stats small { color: var(--muted); font-size: 12px; }
.head-stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 { margin-bottom: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; }

/* Botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
       border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
       font: 600 14.5px var(--font); text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, .bar-group:focus-visible {
  outline: 3px solid var(--s1); outline-offset: 2px; }
label { font-weight: 600; font-size: 14px; }
.field { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
         background: var(--surface); color: var(--text); font: 16px var(--font); }
.chip { min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
        color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--brand-2); border-color: var(--brand-2); color: var(--surface); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }

/* Mensagens */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.flash.erro { background: var(--bad-bg); color: var(--bad-text); } .flash.ok { background: var(--ok-bg); color: var(--ok-text); }
.flash.aviso { background: var(--warn-bg); color: var(--warn-text); }
.alert { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; flex-wrap: wrap; }
.alert > div { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
         background: var(--neutral-bg); color: var(--neutral-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); } .badge.info { background: var(--info-bg); color: var(--info-text); }
.badge.on-dark { background: rgba(255,255,255,.16); color: #fff; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.state-SETTLED.badge, .badge.state-SETTLED { background: var(--ok-bg); color: var(--ok-text); }
.badge.state-PENDING { background: var(--warn-bg); color: var(--warn-text); }
.badge.state-REQUIRES_REVIEW { background: var(--bad-bg); color: var(--bad-text); }
.badge.state-RESOLVED_MANUALLY { background: var(--info-bg); color: var(--info-text); }

/* Login — mesmo desenho do login do back-office SUMMER (summer_theme): slides à esquerda,
   cartão branco à direita. Fontes locais porque a CSP do Portal não deixa ir ao Google Fonts. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
             src: url("ibm-plex-sans.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap;
             src: url("montserrat-800.woff2") format("woff2"); }
body.ecra-inteiro { --lg-azul: #0b3d6e; --lg-azul-claro: #1a67ad; --lg-azul-escuro: #082c50; --lg-vermelho: #1fa4dc;
  --lg-fundo: #e3e9f2; --lg-cartao: #ffffff; --lg-tinta: #1f2733; --lg-tinta-2: #5a6573; --lg-borda: #d3dae3;
  font-family: "IBM Plex Sans", var(--font); background: var(--lg-fundo); color: var(--lg-tinta); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ecra-inteiro { --lg-fundo: #0f1216; --lg-cartao: #171b21; --lg-tinta: #e8ecf1;
    --lg-tinta-2: #9aa6b4; --lg-borda: #343c47; }
}
:root[data-theme="dark"] body.ecra-inteiro { --lg-fundo: #0f1216; --lg-cartao: #171b21; --lg-tinta: #e8ecf1;
  --lg-tinta-2: #9aa6b4; --lg-borda: #343c47; }
.lg { min-height: 100vh; display: flex; }
.lg-slides { display: none; }
.lg-lado { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; min-width: 0; }
.lg-cartao { width: 100%; max-width: 400px; background: var(--lg-cartao); border-radius: 22px; padding: 36px 32px 28px;
             box-shadow: 0 30px 70px -28px rgba(16, 42, 84, .35), 0 2px 6px rgba(16, 42, 84, .05); }
.lg-marca { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.lg-marca img { height: 56px; width: auto; flex: none; padding: 4px 6px; border-radius: 10px; background: #fff;
                filter: drop-shadow(0 6px 12px rgba(15, 30, 55, .15)); }
.lg-marca-nome { font-family: "Montserrat", var(--font); font-weight: 800; font-size: 19px; line-height: 1.1; color: var(--lg-azul); white-space: nowrap; }
:root[data-theme="dark"] .lg-marca-nome { color: #8fb0ec; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lg-marca-nome { color: #8fb0ec; } }
.lg-marca-sub { margin-top: 7px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.4;
                color: var(--lg-vermelho); }
.lg-form { display: flex; flex-direction: column; }
.lg-rotulo { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lg-tinta-2); margin-bottom: 8px; }
.lg-campo { height: 48px; padding: 0 14px; font: 14.5px "IBM Plex Sans", var(--font); color: var(--lg-tinta);
            background: var(--lg-cartao); border: 1px solid var(--lg-borda); border-radius: 10px; outline: none; }
.lg-campo:focus { border-color: #1b7fd4; box-shadow: 0 0 0 3px rgba(27, 127, 212, .15); }
.lg-lembrar { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 4px; font-size: 13.5px; font-weight: 400; color: var(--lg-tinta-2); cursor: pointer; align-self: flex-start; }
.lg-lembrar input { width: 18px; height: 18px; margin: 0; accent-color: #1b7fd4; }
.lg-entrar { height: 50px; margin-top: 22px; border: 0; border-radius: 10px; cursor: pointer; color: #fff;
             font: 600 15px "IBM Plex Sans", var(--font); background: linear-gradient(90deg, #1fa4dc 0%, #1b7fd4 100%);
             box-shadow: 0 14px 28px -12px rgba(27, 127, 212, .55); }
.lg-entrar:hover { filter: brightness(1.06); box-shadow: 0 16px 30px -12px rgba(27, 127, 212, .65); }
.lg-entrar:focus-visible { outline: 2px solid #1b7fd4; outline-offset: 3px; }
.lg-link { margin-top: 14px; text-align: center; font-size: 13.5px; color: #1b5fae; }
.lg-texto { margin: 0 0 14px; color: var(--lg-tinta-2); font-size: 14px; }
.lg-texto strong { color: var(--lg-tinta); word-break: break-all; }
.lg-cartao .pick-list { margin-bottom: 0; } .lg-cartao .pick-list + .lg-entrar { margin-top: 18px; }
.lg-cartao .flash { font-size: 14px; }
.lg-simulacao { margin: 18px 0 0; text-align: center; color: #7b8594; font-size: 12px; line-height: 1.45; }
.lg-rodape { margin: 30px 0 0; color: var(--lg-tinta-2); font-size: 12px; text-align: center; }
.lg-rodape a { color: #0b3f7a; font-weight: 700; }
:root[data-theme="dark"] .lg-rodape a { color: #8fb0ec; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lg-rodape a { color: #8fb0ec; } }
@media (min-width: 992px) {
  .lg-slides { display: block; position: relative; flex: 0 0 53.5%; min-height: 100vh; overflow: hidden; background: var(--lg-azul); color: #fff; }
}
.lg-progresso { position: absolute; top: 0; left: 0; right: 0; height: 6px; z-index: 3; background: #2a6fd6; }
.lg-progresso span { display: block; height: 100%; width: 0; background: var(--lg-vermelho); }
.lg-forma { position: absolute; height: auto; pointer-events: none; }
.lg-forma path { fill: currentColor; }
.lg-forma-azul { top: 0; right: 0; width: 44%; color: var(--lg-azul-claro); }
.lg-forma-vermelha { bottom: 0; left: 0; width: 28.5%; color: var(--lg-vermelho); }
.lg-palco { position: absolute; z-index: 1; left: 15%; right: 15%; top: 48%; transform: translateY(-50%); }
.lg-slide { display: none; } .lg-slide.ativo { display: block; animation: lg-entrar .55s ease both; }
@keyframes lg-entrar { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lg-topo { display: flex; align-items: center; gap: 14px; }
.lg-icone { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 12px; background: #fff; color: var(--lg-azul); }
.lg-icone svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-tag { padding: 6px 12px 5px; border-radius: 20px; background: var(--lg-vermelho); color: #fff; white-space: nowrap;
          font: 800 11px "Montserrat", var(--font); letter-spacing: .1em; text-transform: uppercase; }
.lg-contador { margin-left: auto; font: 800 15px "Montserrat", var(--font); color: rgba(255, 255, 255, .78); }
.lg-slides h2 { margin: 20px 0 28px; max-width: 470px; font: 800 clamp(30px, 3.1vw, 46px)/1.08 "Montserrat", var(--font); letter-spacing: -.01em; color: #fff; }
.lg-slides p { margin: 0 0 24px; font-size: 17px; line-height: 1.45; color: rgba(255, 255, 255, .93); }
.lg-slides ul { list-style: none; margin: 0; padding: 0; }
.lg-slides li { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding: 12px 16px; border-radius: 8px;
                background: var(--lg-azul-escuro); font-size: 15px; font-weight: 500; }
.lg-slides li svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #6fd0ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lg-nav { position: absolute; z-index: 1; left: 0; right: 0; bottom: 36px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.lg-seta { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .6);
           background: transparent; color: #fff; cursor: pointer; }
.lg-seta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-seta:hover { background: rgba(255, 255, 255, .12); }
.lg-pontos { display: flex; align-items: center; gap: 10px; margin: 0 4px; }
.lg-ponto { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .45); cursor: pointer;
            transition: width .25s ease, background .25s ease; }
.lg-ponto.ativo { width: 32px; background: #fff; }
.lg-slides button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (min-width: 992px) and (max-height: 760px) {
  .lg-slides h2 { font-size: 32px; margin: 14px 0 18px; } .lg-slides p { margin-bottom: 16px; }
  .lg-slides li { padding: 9px 14px; margin-bottom: 8px; } .lg-nav { bottom: 22px; }
}
@media (max-width: 420px) { .lg-cartao { padding: 28px 22px 22px; } .lg-marca img { height: 48px; } .lg-marca-nome { font-size: 17px; } }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }
.pick input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.pick span { display: flex; flex-direction: column; min-width: 0; } .pick small { color: var(--muted); font-size: 13px; }

/* Perfil */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.profile-avatar { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; flex: none;
                  background: var(--brand); color: #fff; font-size: 30px; font-weight: 800; box-shadow: inset 0 -4px 0 var(--red); }
.profile-head h1 { margin: 0 0 6px; overflow-wrap: anywhere; }
.profile-head .tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; }
.profile .kv { grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
.profile .kv dd a { word-break: break-all; }
.profile .empty-val { color: var(--muted); font-style: italic; }
.profile-note { display: flex; gap: 10px; align-items: flex-start; }

/* Painel */
.grid-dash { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.member-card { position: relative; overflow: hidden; border-radius: 18px; padding: 22px; color: #fff; min-height: 200px;
               background: radial-gradient(120% 140% at 100% 0%, #2756a3 0%, #0b3d6e 50%, #01266a 100%); border-bottom: 5px solid #1fa4dc; box-shadow: var(--shadow-lg);
               display: flex; flex-direction: column; }
.member-card::after { content: ""; position: absolute; right: -70px; top: -70px; width: 190px; height: 190px; border-radius: 50%;
                      border: 24px solid rgba(254, 225, 9, .16); pointer-events: none; }
.mc-top { display: flex; align-items: center; gap: 10px; }
.mc-org { font-weight: 700; letter-spacing: .06em; font-size: 12px; flex: 1; white-space: nowrap; text-transform: uppercase; opacity: .85; }
.mc-name { font-size: 20px; font-weight: 700; margin: auto 0 12px; padding-top: 24px; position: relative; z-index: 1; }
.mc-data { display: flex; gap: 22px; flex-wrap: wrap; margin: 0; position: relative; z-index: 1; }
.mc-data dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.mc-data dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
       display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi strong { font-size: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12.5px; }

/* Gráfico */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }
.chart { margin: 0; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .axis { fill: var(--axis); font-size: 12px; font-family: var(--font); }
.chart .value { fill: var(--text-2); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .s1 { fill: var(--s1); } .chart .s2 { fill: var(--s2); }
.chart .hit { fill: transparent; }
.chart .bar-group { cursor: default; outline: none; }
.chart:hover .bar-group path, .chart:focus-within .bar-group path { opacity: .55; transition: opacity .15s; }
.chart .bar-group:hover path, .chart .bar-group:focus path { opacity: 1; }
.table-view { margin-top: 12px; } .table-view summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
           border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; min-width: 170px; }
.tooltip strong { display: block; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip .tt-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Recibos (painel) */
.receipts { list-style: none; margin: 0; padding: 0; }
.receipts li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.receipts li:last-child { border-bottom: 0; }
.r-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-text); flex: none; }
.r-main { display: flex; flex-direction: column; flex: 1; min-width: 0; } .r-main small { color: var(--muted); }
.r-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipts .r-ver { border-color: var(--border); color: var(--brand-2); }
.recibos { list-style: none; margin: 0; padding: 0; }
.recibos li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.recibos li:last-child { border-bottom: 0; }
.recibos .r-acoes { display: flex; justify-content: flex-end; min-width: 0; }
.recibo-botoes { flex-wrap: wrap; } .recibo-botoes .ico { width: 16px; height: 16px; }

/* Janela do recibo */
.viewer { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px;
          background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(10, 16, 24, .6); backdrop-filter: blur(2px); }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
               border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.viewer-head h2 { margin: 0; font-size: 16px; }
.viewer-acoes { display: flex; align-items: center; gap: 8px; } .viewer-acoes .ico { width: 16px; height: 16px; }
.viewer-acoes .icon-btn { border-color: var(--border); }
.viewer-body { flex: 1; overflow: auto; padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 240px; }
.viewer-body .spinner { margin: 60px auto; }
.viewer-pagina { display: block; width: 100%; max-width: 794px; height: auto; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }
.viewer-body iframe { width: 100%; height: 70vh; border: 0; background: #fff; border-radius: 4px; }
@media (max-width: 560px) {
  .viewer { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .viewer-acoes .btn span { display: none; } .viewer-body { padding: 10px; }
  .recibos .r-acoes { width: 100%; justify-content: flex-start; } .recibos .recibo-botoes .btn { white-space: nowrap; }
}

/* Quotas e carrinho */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cart-layout > .card { margin-bottom: 0; }
.year-group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.year-group legend { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 12px; padding: 8px 0;
                     border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.year-group legend .muted { font-weight: 500; font-size: 13px; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; font-weight: inherit; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; cursor: pointer; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 6px;
       border-bottom: 1px solid var(--border); border-radius: 8px; }
.doc:has(input:checked) { background: var(--info-bg); }
.doc.reserved { opacity: .6; } .doc.reserved .check { cursor: not-allowed; }
.doc-main { display: flex; flex-direction: column; min-width: 0; font-weight: 400; }
.doc-main strong { font-weight: 600; text-transform: capitalize; } .doc-main small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.doc-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.cart { position: sticky; top: 84px; }
.cart-items { list-style: none; padding: 0; margin: 0 0 12px; max-height: 260px; overflow: auto; font-size: 14px; }
.cart-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.cart-items li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 16px; border-top: 2px solid var(--border); }
.cart-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.pay-marks { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.pay-marks span { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.empty { text-align: center; padding: 36px 20px; } .empty .ico { margin-bottom: 8px; }

/* Passos */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.stepper li + li::before { content: ""; width: 32px; height: 2px; background: var(--border-strong); margin-right: 4px; }
.stepper li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: 13px; font-weight: 700; }
.stepper li.current { color: var(--text); font-weight: 700; } .stepper li.current span { border-color: var(--brand-2); color: var(--brand-2); }
.stepper li.done span { background: var(--success); border-color: var(--success); color: #fff; }

/* Vinti4 (simulação) */
.gateway { max-width: 880px; margin: 0 auto 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.gw-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; background: #c8102e; color: #fff; flex-wrap: wrap; }
.gw-logo { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .gw-logo b { color: #ffd34d; }
.gw-secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.gw-body { display: grid; grid-template-columns: 1fr 1fr; }
.gw-order { padding: 24px; border-right: 1px solid var(--border); background: var(--surface-2); }
.gw-amount { font-size: 34px; font-weight: 800; margin: 2px 0 14px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gw-card-area { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.fake-card { position: relative; height: 170px; border-radius: 14px; padding: 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
             background: linear-gradient(135deg, #3a3f47, #1d2127); box-shadow: var(--shadow); font-family: var(--mono); }
.chip-gold { position: absolute; top: 22px; left: 18px; width: 42px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #e7c76a, #b48c2a); }
.fc-number { font-size: 19px; letter-spacing: .12em; } .fc-row { display: flex; justify-content: space-between; font-size: 12px; opacity: .75; }
.gw-actions { display: flex; flex-direction: column; gap: 10px; } .gw-actions .row > .btn { flex: 1; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0 0 14px; }
.kv dt { color: var(--muted); font-size: 14px; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.countdown { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 14px; color: var(--text-2); }
.countdown strong { font-variant-numeric: tabular-nums; font-size: 18px; color: var(--text); }
.countdown .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.countdown .bar i { display: block; height: 100%; width: 100%; background: var(--primary); transition: width 1s linear; }
.countdown.low .bar i { background: var(--danger); } .countdown.low strong { color: var(--danger); }
.processing { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(10, 16, 24, .55); backdrop-filter: blur(3px); }
.proc-box { background: var(--surface); border-radius: 16px; padding: 28px 30px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); text-align: center; }
.proc-box strong { display: block; font-size: 17px; margin: 14px 0 12px; }
.spinner { display: inline-block; width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--grid); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.proc-steps { text-align: left; margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.proc-steps li { padding: 3px 0; } .proc-steps li.on { color: var(--text); font-weight: 600; } .proc-steps li.done { color: var(--ok-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Resultado */
.outcome { display: flex; gap: 20px; align-items: center; }
.outcome h1 { margin-bottom: 6px; }
.outcome-icon svg { width: 72px; height: 72px; display: block; }
.outcome .ring { fill: none; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out forwards; }
.outcome .mark { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s .5s ease-out forwards; }
.outcome.state-SETTLED .ring, .outcome.state-SETTLED .mark { stroke: var(--success); }
.outcome.state-FAILED .ring, .outcome.state-FAILED .mark, .outcome.state-EXPIRED .ring, .outcome.state-EXPIRED .mark { stroke: var(--danger); }
.outcome.state-PENDING .ring, .outcome.state-PENDING .mark { stroke: var(--warn-line); }
.outcome.state-REQUIRES_REVIEW .ring, .outcome.state-REQUIRES_REVIEW .mark { stroke: var(--brand-2); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.state { margin: 0; color: var(--text-2); }
.plain { list-style: none; margin: 0; padding: 0; }
.receipt { border-top: 4px solid var(--success); }
.email-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.email-form .row { flex-wrap: nowrap; margin-top: 6px; } .email-form .field { min-height: 42px; }
.tech { border-style: dashed; }

/* Tabelas e listas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.table tfoot th { border-bottom: 0; border-top: 2px solid var(--border); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.payments { list-style: none; padding: 0; margin: 0; }
.payments a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 10px; border-bottom: 1px solid var(--border);
              color: inherit; text-decoration: none; border-radius: 8px; }
.payments a:hover { background: var(--surface-2); }
.p-main { display: flex; flex-direction: column; min-width: 0; } .p-main small { color: var(--muted); overflow-wrap: anywhere; }
.p-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } .p-side small { color: var(--muted); }

/* Modo demonstração */
.demo-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(560px, 100vw); background: var(--surface); color: var(--text);
              border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.demo-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.demo-head h2 { margin: 0; } .demo-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.demo-note { margin: 0 18px 10px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.demo-list { list-style: none; margin: 0; padding: 0 12px 18px; overflow: auto; flex: 1; }
.demo-list > li { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.demo-list > li.new { animation: flashin 1.2s ease-out; }
@keyframes flashin { from { background: var(--info-bg); } to { background: var(--surface); } }
.demo-list details > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.demo-list details > summary::-webkit-details-marker { display: none; }
.dl-method { font: 700 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--info-bg); color: var(--info-text); }
.dl-method.POST { background: var(--warn-bg); color: var(--warn-text); }
.dl-label { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-status { font: 600 12px var(--mono); padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-text); white-space: nowrap; }
.dl-status.bad { background: var(--bad-bg); color: var(--bad-text); } .dl-status.wait { background: var(--neutral-bg); color: var(--neutral-text); }
.dl-sub { grid-column: 2 / -1; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dl-body { padding: 0 12px 12px; }
.dl-body h4 { margin: 10px 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dl-body pre { margin: 0; padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.45 var(--mono);
               white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
body.demo-on main { margin-right: min(560px, 45vw); }

/* Telemóvel e ecrãs estreitos */
/* As grelhas reagem à largura do conteúdo (também com o painel de demonstração aberto) */
@container (max-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 760px) {
  .grid-dash, .gw-body { grid-template-columns: minmax(0, 1fr); }
  .gw-order { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 1100px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart { position: sticky; bottom: 0; top: auto; z-index: 10; box-shadow: var(--shadow-lg); }
  .cart-items { display: none; }
  .cart h2, .cart .hint, .cart .pay-marks { display: none; }
  .cart-total { padding-top: 0; border-top: 0; }
  body.demo-on main { margin-right: auto; }
}
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidenav { width: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); gap: 2px; }
  .sidenav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; }
  .grid-dash, .grid-2, .grid-2.wide-left, .gw-body { grid-template-columns: minmax(0, 1fr); }
  .gw-order { border-right: 0; border-bottom: 1px solid var(--border); }
  .who-text, .demo-btn span, .logout-btn span, .brand-text small, .install-btn span { display: none; }
}
@media (max-width: 560px) {
  main { padding: 18px 16px 40px; }
  .topbar { padding: 10px 16px; } .brand-logo { height: 38px; padding: 3px 6px; } .topbar .brand-text { display: none; }
  .top-actions { gap: 6px; } .demo-btn, .logout-btn { padding: 0 10px; }
  h1 { font-size: 22px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .doc { grid-template-columns: minmax(0, 1fr) auto; } .doc-tags { grid-column: 1; grid-row: 2; padding-left: 32px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0 0; } .kv dd { margin-bottom: 8px; }
  .outcome { flex-direction: column; align-items: flex-start; }
  .email-form .row { flex-wrap: wrap; }
  .stepper li + li::before { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .outcome .ring, .outcome .mark { stroke-dashoffset: 0; }
}
@media print {
  .topbar, .sidenav, .sim-banner, .demo-panel, .stepper, .tech, .email-form { display: none !important; }
  body { background: #fff; }
}
/* Imprimir a partir da janela do recibo: só as páginas do recibo */
@page { size: A4; margin: 10mm; }
.area-impressao { display: none; }
@media print {
  body.a-imprimir > *:not(.area-impressao) { display: none !important; }
  body.a-imprimir { background: #fff; }
  body.a-imprimir .area-impressao { display: block; }
  body.a-imprimir .area-impressao img { display: block; width: auto; max-width: 100%; max-height: 270mm; margin: 0 auto; break-after: page; }
  body.a-imprimir .area-impressao img:last-child { break-after: auto; }
}
