:root, [data-skin="atlantico"] {
  --bg: #f4f6f9; --card: #fff; --text: #1d2433; --muted: #6b7385; --line: #e3e7ee;
  --side: #0b1650; --side-2: #16225f; --side-3: #2a3775; --side-text: #cdd3e6; --side-muted: #8a9bad; --side-accent: #a9bdd6;
  --accent: #1d3a8f; --accent-soft: #e6ebf6; --note-text: #0b1650;
  --logo-line: #0b1650; --logo-fill: #8a9bad;
  --th-bg: #fafbfc; --chip: #eef0f4; --chip-text: #4b5366; --label: #444c5e; --input-bg: #fff; --input-line: #cfd5df;
  --ok: #15803d; --ok-soft: #e6f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #b91c1c; --bad-soft: #fde9e9;
  --link: var(--accent);
  --ed-pro: #6250d6; --ed-enterprise: #b45309;
  color-scheme: light;
}
/* ---- Skins ---- */
[data-skin="sintra"] {
  --bg: #f3f6f3; --side: #173326; --side-2: #1f4433; --side-3: #2e5c47; --side-text: #c8ddd1; --side-muted: #7fa290; --side-accent: #6ee7a8;
  --accent: #15803d; --accent-soft: #e3f4e9; --note-text: #14532d;
}
[data-skin="douro"] {
  --bg: #f7f4f4; --side: #3b1420; --side-2: #4d1c2b; --side-3: #6b2a3d; --side-text: #e6cdd4; --side-muted: #a7808b; --side-accent: #f9a8bc;
  --accent: #9f1239; --accent-soft: #fbe7ec; --note-text: #6b0f2a;
}
[data-skin="alentejo"] {
  --bg: #f8f5f1; --side: #3d2516; --side-2: #52321e; --side-3: #70462b; --side-text: #ecd9c8; --side-muted: #b08e74; --side-accent: #fdba74;
  --accent: #c2410c; --accent-soft: #fdeee4; --note-text: #7c2d12;
}
[data-skin="lisboa"] {
  --bg: #f5f4f9; --side: #2a1f4a; --side-2: #372a5f; --side-3: #4c3d7c; --side-text: #d8d1ee; --side-muted: #958bb8; --side-accent: #fcd34d;
  --accent: #6d28d9; --accent-soft: #efe8fd; --note-text: #4c1d95;
}
[data-skin="grafite"] {
  --bg: #f4f4f5; --side: #18181b; --side-2: #27272a; --side-3: #3f3f46; --side-text: #d4d4d8; --side-muted: #8b8b94; --side-accent: #e4e4e7;
  --accent: #3f3f46; --accent-soft: #ececee; --note-text: #27272a;
}
[data-skin="acores"] {
  --bg: #f2f7f6; --side: #0d3331; --side-2: #134542; --side-3: #1f5e5a; --side-text: #c5e4e1; --side-muted: #7fb0ab; --side-accent: #5eead4;
  --accent: #0f766e; --accent-soft: #e0f2ef; --note-text: #134e4a;
}
[data-skin="algarve"] {
  --bg: #f3f7fa; --side: #0c2f4a; --side-2: #123d5e; --side-3: #1d5479; --side-text: #cfe3f2; --side-muted: #84a9c4; --side-accent: #fbbf24;
  --accent: #0369a1; --accent-soft: #e0f0fa; --note-text: #0c4a6e;
}
/* ---- Modo escuro (qualquer tema): <html data-modo="escuro">, resolvido por static/tema.js ---- */
[data-modo="escuro"] {
  --bg: #0f1218; --card: #171b23; --text: #e3e8f2; --muted: #95a0b5; --line: #282f3c;
  --th-bg: #1b202a; --chip: #252c39; --chip-text: #c3cde0; --label: #b9c4da; --input-bg: #0f131a; --input-line: #343d4e;
  --ok: #4ade80; --ok-soft: #12291d; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #331717;
  --logo-line: #e3e8f2; --logo-fill: #56657d;
  --side: #0a0f24; --side-2: #141b38; --side-3: #24305a; --side-text: #b9c4da; --side-muted: #6b7894; --side-accent: #8fb0ff;
  --accent: #3b6fd4; --accent-soft: #1a2747; --link: #8fb0ff; --note-text: #c7d6ff;
  --ed-pro: #a78bfa; --ed-enterprise: #fbbf24;
  color-scheme: dark;
}
[data-modo="escuro"][data-skin="sintra"]   { --side: #0b1a12; --side-2: #13281d; --side-3: #21402f; --side-text: #bfd8c9; --side-muted: #6f8f7e; --side-accent: #6ee7a8; --accent: #15803d; --accent-soft: #12291d; --link: #4ade80; --note-text: #bbf7d0; }
[data-modo="escuro"][data-skin="douro"]    { --side: #1c0a10; --side-2: #2c121b; --side-3: #4a1d2c; --side-text: #e0c6cd; --side-muted: #94707b; --side-accent: #fda4bc; --accent: #be123c; --accent-soft: #33141d; --link: #fb7196; --note-text: #fecdd8; }
[data-modo="escuro"][data-skin="alentejo"] { --side: #1e1209; --side-2: #2e1d10; --side-3: #4a2f1b; --side-text: #e6d2bf; --side-muted: #9c7d64; --side-accent: #fdba74; --accent: #c2410c; --accent-soft: #33200f; --link: #fb923c; --note-text: #fed7aa; }
[data-modo="escuro"][data-skin="lisboa"]   { --side: #150f28; --side-2: #22193d; --side-3: #372a5f; --side-text: #d4cdea; --side-muted: #8a80ad; --side-accent: #fcd34d; --accent: #7c3aed; --accent-soft: #251b45; --link: #c4b5fd; --note-text: #ddd6fe; }
[data-modo="escuro"][data-skin="grafite"]  { --side: #0c0c0e; --side-2: #1c1c20; --side-3: #2e2e34; --side-text: #d4d4d8; --side-muted: #85858e; --side-accent: #e4e4e7; --accent: #52525b; --accent-soft: #26262b; --link: #d4d4d8; --note-text: #e4e4e7; }
[data-modo="escuro"][data-skin="acores"]   { --side: #071a19; --side-2: #0f2a28; --side-3: #1a403d; --side-text: #bfe0dc; --side-muted: #6f9c97; --side-accent: #5eead4; --accent: #0f766e; --accent-soft: #0f2a28; --link: #5eead4; --note-text: #99f6e4; }
[data-modo="escuro"][data-skin="algarve"]  { --side: #071827; --side-2: #0e2638; --side-3: #183c56; --side-text: #c7dced; --side-muted: #7393ab; --side-accent: #fbbf24; --accent: #0369a1; --accent-soft: #0e2638; --link: #7dd3fc; --note-text: #bae6fd; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.skin-opt { display: block; cursor: pointer; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.skin-opt input { position: absolute; opacity: 0; }
.skin-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.skin-opt .sw { display: flex; height: 46px; }
.skin-opt .sw i { flex: 1; }
.skin-opt .nm { display: block; padding: 7px 10px; font-weight: 600; color: var(--text); font-size: 13px; }
.skin-opt .nm small { display: block; font-weight: 400; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--link, var(--accent)); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
small, .muted { color: var(--muted); }

/* layout */
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); color: var(--side-text); overflow-y: auto; padding: 18px 0;
  scrollbar-width: thin; scrollbar-color: var(--side-3) transparent; }
.logo { display: block; width: auto; }
.logo .fl { fill: var(--logo-fill); }
.logo .ln { stroke: var(--logo-line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 20px 18px; margin-bottom: 12px; border-bottom: 1px solid var(--side-3); color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .logo { --logo-line: #fff; --logo-fill: var(--side-muted); flex: none; }
.brand .logo .ln { stroke-width: 24px; }
.login-head .logo .ln { stroke-width: 22px; }
main:has(.login-wrap) { padding: 0; max-width: none; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: 4px; line-height: 1; }
.brand .wordmark { font-size: 21px; }
.brand small { display: block; white-space: nowrap; font-family: system-ui, sans-serif; font-size: 9.5px; letter-spacing: .7px; text-transform: uppercase; color: var(--side-muted); margin-top: 5px; font-weight: 500; }
.ed-sel { padding: 0 16px 14px; }
.ed-sel select { width: 100%; background: var(--side-2); color: #fff; border: 1px solid var(--side-3); }
.ed-name { padding: 0 20px 14px; color: #fff; }
/* menu lateral: ícone + texto, itens arredondados (mesmo desenho do Software Central, com as cores do tema escolhido) */
.side nav { display: grid; gap: 2px; padding: 0 10px; }
.side nav a, .nav-form button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
  font-size: 14px; line-height: 1.25; text-decoration: none; }
.side nav a:hover, .nav-form button:hover { background: var(--side-2); text-decoration: none; color: #fff; }
.side nav a.on { background: var(--side-3); color: #fff; font-weight: 600; }
.side nav a.on .ico { color: var(--side-accent); opacity: 1; }
.side .ico { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.side .nav-txt { flex: 1; min-width: 0; }
.side nav .sec { padding: 14px 10px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--side-muted); }
/* edição do DOMUS no topo do menu */
.side-edicao { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 16px 14px; padding: 7px 10px; border-radius: 10px;
  background: var(--side-2); border: 1px solid var(--side-3); color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; }
.side-edicao:hover { text-decoration: none; filter: brightness(1.12); }
.side-edicao .ico { width: 15px; height: 15px; color: var(--side-accent); opacity: 1; }
.side-edicao small { flex-basis: 100%; margin-left: 23px; font-weight: 500; font-size: 11px; color: var(--side-muted); letter-spacing: 0; }
.side-edicao.ed-pro { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-color: transparent; }
.side-edicao.ed-pro .ico, .side-edicao.ed-enterprise .ico { color: #fff; }
.side-edicao.ed-enterprise { background: linear-gradient(135deg, #b45309, #d97706 55%, #f59e0b); border-color: transparent; }
.side-edicao.on { outline: 2px solid var(--side-accent); outline-offset: 1px; }
main { padding: 28px 32px 60px; max-width: 1240px; }
main.with-side { margin-left: 248px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top .sub { margin-bottom: 0; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid > *, .kpis > *, .planos3 > * { min-width: 0; }   /* conteúdo largo desliza dentro do cartão em vez de alargar a grelha */
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--th-bg); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 650; border-top: 2px solid var(--line); }

/* badges */
.b { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--chip-text); white-space: nowrap; }
.b.ok { background: var(--ok-soft); color: var(--ok); }
.b.warn { background: var(--warn-soft); color: var(--warn); }
.b.bad { background: var(--bad-soft); color: var(--bad); }
.b.info { background: var(--accent-soft); color: var(--link); }

/* forms */
form.f, div.f { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; align-items: end; }
form.f .full, div.f .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--label); }
label input, label select, label textarea { margin-top: 4px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--input-line); border-radius: 7px; font: inherit; background: var(--input-bg); color: inherit; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.sec { background: var(--card); color: var(--accent); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* misc */
.flash { padding: 10px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); margin-bottom: 14px; border: 1px solid var(--ok); }
.flash.erro { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.note { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; color: var(--note-text); font-size: 13px; }
.aviso { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.aviso.urg { border-left-color: var(--bad); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.steps span { padding: 4px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; }
.steps span.done { background: var(--accent-soft); color: var(--accent); }
.steps span.cur { background: var(--accent); color: #fff; }
.com { border-bottom: 1px solid var(--line); padding: 10px 0; }
.com:last-child { border-bottom: 0; }
.photo { max-width: 100%; max-height: 380px; border-radius: 8px; border: 1px solid var(--line); }
.stars { color: #f59e0b; letter-spacing: 1px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), var(--bg) 70%); }
.login { width: 100%; max-width: 400px; }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .logo { margin: 0 auto 14px; }
.login-head .wordmark { font-size: 34px; color: var(--logo-line); letter-spacing: 8px; padding-left: 8px; }
.login-head p { margin: 8px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.login .card { padding: 26px 26px 22px; box-shadow: 0 10px 30px rgba(11, 22, 80, .08); }
.login .btn { width: 100%; padding: 10px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 18px; }
.empty { color: var(--muted); padding: 10px 0; }

@media (max-width: 860px) {
  .side { position: static; width: auto; }
  main.with-side { margin-left: 0; }
  main { padding: 20px 16px 50px; }
  .side.recolhe { position: sticky; top: 0; z-index: 45; padding: 0; }
  .side.recolhe:not(.aberto) > *:not(.side-topo) { display: none; }
  .side.recolhe.aberto { position: fixed; inset: 0; padding-bottom: 80px; }
  .side.recolhe .side-topo { position: sticky; top: 0; z-index: 1; padding: 8px 8px 8px 16px; background: var(--side); border-bottom: 1px solid var(--side-3); margin-bottom: 0; }
  .side.recolhe.aberto .side-topo { margin-bottom: 14px; }
  .side-topo .brand { padding: 2px 0; margin: 0; border: 0; min-width: 0; flex: 1; }
  .side-topo .brand .logo { height: 30px !important; }
  .side-topo .brand .wordmark { font-size: 17px; }
  .side-topo .brand small { font-size: 8.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
  .menu-abrir { display: grid; }
  body:has(> .barra-baixo) main { padding-bottom: 96px; }
  body:has(> .barra-baixo) .menu-abrir { display: none; }
  .barra-baixo { display: flex; position: fixed; inset: auto 0 0 0; z-index: 48; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  body:has(> .barra-baixo) .chat { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 14px; z-index: 44; }
  body:has(> .barra-baixo) .chat-abrir { padding: 12px; }
  body:has(> .barra-baixo) .chat-abrir span { display: none; }
}
.side-topo { display: flex; align-items: center; }
.side-topo .brand { flex: 1; }
.menu-abrir { display: none; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; }
.menu-abrir svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.barra-baixo a, .barra-baixo button { position: relative; flex: 1; min-width: 0; min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; text-decoration: none; cursor: pointer; }
.barra-baixo a.on { color: var(--link); font-weight: 600; }
.barra-baixo .ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.barra-baixo .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
@media print { .barra-baixo { display: none; } }
@media (min-width: 861px) { .barra-baixo { display: none; } }

/* créditos */
.login-foot .credito { display: inline-block; margin-top: 6px; }
.login-foot a { display: inline-flex; align-items: center; gap: 4px; color: #1f9d55; font-weight: 600; }
.login-foot .wa { width: 14px; height: 14px; }
.side-cred { margin: 18px 20px 4px; padding-top: 12px; border-top: 1px solid var(--side-3); font-size: 11px; color: var(--side-muted); line-height: 1.6; }
.side-cred a { color: var(--side-text); }

/* botão "Sair" (formulário POST) com aspeto de link do menu */
.nav-form { margin: 0; }
.nav-form button { width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }

/* ---- Assistente (chat) ---- */
.chat { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50; font-size: 14px; }
.chat-abrir { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--side); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(11,22,80,.25); }
.chat-abrir svg { width: 22px; height: 22px; }
.chat-abrir:hover { filter: brightness(1.15); }
.chat-painel { position: absolute; right: 0; bottom: 64px; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(11,22,80,.22); overflow: hidden; }
.chat-painel[hidden] { display: none !important; }
.chat-painel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--side); color: #fff; }
.chat-fechar { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.chat-msg.bot { align-self: flex-start; background: var(--chip); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.eu { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.aguarde { color: var(--muted); font-style: italic; }
.chat-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-sug button { border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.chat-nota { margin: 0; padding: 0 12px 10px; font-size: 11px; color: var(--muted); }

/* ---- Mural público ---- */
body.publico { background: var(--bg); }
.pub-wrap { max-width: 820px; margin: 0 auto; padding-inline: 16px; }
.pub-top { background: var(--side); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.pub-head { display: flex; align-items: center; gap: 14px; padding-block: 14px; }
.pub-head .logo { --logo-line: #fff; --logo-fill: var(--side-muted); }
.pub-head .logo .ln { stroke-width: 30px; }
.pub-head .wordmark { font-size: 22px; }
.pub-head small { color: var(--side-muted); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.pub-login { margin-left: auto; }
.pub-aviso { border-left: 4px solid var(--accent); }
.pub-aviso.urg { border-left-color: var(--bad); }
.pub-aviso h2 { font-size: 18px; margin: 6px 0 8px; }
.pub-aviso p { margin: 0; white-space: pre-line; }
.pub-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
@media print { .chat { display: none; } }

.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: auto; border-radius: 99px; background: #f59e0b; color: #1a1300; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }

/* ================================================================ Mural de avisos (moderno, ao vivo) */
.mural-lista { display: grid; gap: 14px; }
.av { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; background: var(--card);
      border: 1px solid var(--line); border-left: 5px solid var(--av-cor, var(--accent)); border-radius: 14px;
      padding: 16px 18px; box-shadow: 0 1px 2px rgba(11,22,80,.04); transition: transform .25s ease, box-shadow .25s ease; }
.av:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(11,22,80,.09); }
.av-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
          background: color-mix(in srgb, var(--av-cor, var(--accent)) 14%, transparent); color: var(--av-cor, var(--accent)); }
.av-ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.av-corpo { min-width: 0; }
.av-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.av-cat { color: var(--av-cor, var(--accent)); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }
.av h3 { margin: 5px 0 6px; font-size: 17px; line-height: 1.35; }
.av p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.av-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.av.urgente { --av-cor: #dc2626; background: linear-gradient(90deg, color-mix(in srgb, #dc2626 6%, var(--card)), var(--card) 60%);
              animation: av-pulso 2.6s ease-in-out infinite; }
.av.expirado { opacity: .55; filter: grayscale(.6); }
.av.aparecer { animation: av-aparecer .55s ease-out both; }
.av.urgente.aparecer { animation: av-aparecer .55s ease-out both, av-pulso 2.6s ease-in-out .6s infinite; }
.av.novo { box-shadow: 0 0 0 2px color-mix(in srgb, var(--av-cor) 35%, transparent), 0 8px 24px rgba(11,22,80,.08); }
.av.entrar { animation: av-entrar .75s cubic-bezier(.2,.9,.3,1.25) both, av-brilho 1.6s ease-out .75s 3; }
.av.sair { animation: av-sair .45s ease-in both; }
.selo-novo { background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; font-weight: 800; font-size: 10.5px;
             letter-spacing: .8px; padding: 2px 8px; border-radius: 99px; animation: av-selo 1.8s ease-in-out infinite; }
@keyframes av-aparecer { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes av-entrar { 0% { opacity: 0; transform: translateY(-28px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes av-brilho { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--av-cor) 60%, transparent); } 100% { box-shadow: 0 0 0 20px transparent; } }
@keyframes av-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.28); } 50% { box-shadow: 0 0 0 9px rgba(220,38,38,0); } }
@keyframes av-sair { to { opacity: 0; transform: translateX(40px) scale(.97); } }
@keyframes av-selo { 50% { filter: brightness(1.2); transform: scale(1.07); } }
.ao-vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ok);
           background: var(--ok-soft); padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .6px; }
.ao-vivo.claro { color: #fff; background: rgba(255,255,255,.14); }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: av-vivo 1.6s infinite; }
@keyframes av-vivo { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.7); } 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }
.toast-aviso { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 70; max-width: min(560px, calc(100vw - 32px));
               transform: translate(-50%, -160%); background: var(--side); color: #fff; padding: 12px 18px; border-radius: 12px;
               box-shadow: 0 14px 34px rgba(11,22,80,.3); transition: transform .55s cubic-bezier(.2,.9,.3,1.25); }
.toast-aviso.mostrar { transform: translate(-50%, 0); }
.lbl-txt { display: block; font-size: 12px; font-weight: 600; color: var(--label); margin-bottom: 6px; }
.cat-escolha { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-op input { position: absolute; opacity: 0; }
.cat-op span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line);
               cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); background: var(--card); transition: all .15s; }
.cat-op span svg { width: 16px; height: 16px; fill: none; stroke: var(--av-cor); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cat-op input:checked + span { border-color: var(--av-cor); background: color-mix(in srgb, var(--av-cor) 12%, var(--card)); color: var(--av-cor); }
.cat-op input:focus-visible + span { outline: 2px solid var(--av-cor); outline-offset: 2px; }

/* ---- mural público: cabeçalho em destaque */
.pub-hero { background: linear-gradient(135deg, var(--side) 0%, var(--side-2) 55%, color-mix(in srgb, var(--accent) 70%, var(--side)) 100%);
            color: #fff; padding: calc(4px + env(safe-area-inset-top, 0px)) 0 64px; }
.pub-hero .pub-head { padding-block: 14px; }
.hero-linha { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-top: 18px; }
.hero-linha h1 { color: #fff; font-size: clamp(22px, 4vw, 32px); margin: 0; }
.hero-linha p { margin: 4px 0 0; color: rgba(255,255,255,.75); }
.hero-relogio { text-align: right; }
.relogio { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.relogio-data { font-size: 13px; color: rgba(255,255,255,.75); margin: 4px 0 8px; }
.pub-corpo { margin-top: -40px; position: relative; }

/* ---- modo TV (ecrã na entrada) */
body.tv { margin: 0; height: 100vh; overflow: hidden; color: #fff;
          background: radial-gradient(1200px 700px at 15% 0%, #1e2b6e 0%, #0b1650 45%, #060b2c 100%); }
body.tv #mural { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.tv-topo { display: flex; justify-content: space-between; align-items: center; padding: 2.2vh 3.5vw; }
.tv-marca { display: flex; align-items: center; gap: 16px; }
.tv-marca .logo { --logo-line: #fff; --logo-fill: #8a9bad; }
.tv-marca .logo .ln { stroke-width: 28px; }
.tv-marca .wordmark { font-size: 2.6vh; color: #fff; }
.tv-marca small { color: #a9bdd6; font-size: 2vh; }
.tv-relogio { text-align: right; }
.tv-relogio .relogio { font-size: 6.5vh; }
.tv-relogio .relogio-data { font-size: 2.2vh; color: #a9bdd6; }
.tv-palco { display: grid; place-items: center; padding: 0 5vw; min-height: 0; }
.tv-aviso { width: 100%; max-width: 1500px; }
.tv-cartao { --av-cor: #60a5fa; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
             border-left: 1.2vh solid var(--av-cor); border-radius: 3vh; padding: 5vh 4vw;
             animation: tv-entrar .8s cubic-bezier(.2,.9,.3,1.1) both; }
.tv-cartao.urgente { --av-cor: #ef4444; background: linear-gradient(120deg, rgba(239,68,68,.22), rgba(255,255,255,.05) 55%);
                     animation: tv-entrar .8s cubic-bezier(.2,.9,.3,1.1) both, tv-urg 2.4s ease-in-out .8s infinite; }
.tv-cartao.destaque { animation: tv-entrar .9s cubic-bezier(.2,.9,.3,1.25) both, tv-brilho 1.8s ease-out .9s 3; }
.tv-cab { display: flex; align-items: center; gap: 1.6vw; margin-bottom: 2.5vh; }
.tv-cab .av-ico { width: 8vh; height: 8vh; border-radius: 2vh; background: color-mix(in srgb, var(--av-cor) 25%, transparent); color: var(--av-cor); }
.tv-cab .av-ico svg { width: 4.6vh; height: 4.6vh; }
.tv-cat { font-size: 2.6vh; font-weight: 800; text-transform: uppercase; letter-spacing: .3vh; color: var(--av-cor); }
.tv-quando { margin-left: auto; font-size: 2.4vh; color: #a9bdd6; }
.tv-cartao h2 { font-size: clamp(28px, 6.2vh, 84px); line-height: 1.12; margin: 0 0 2.5vh; color: #fff; }
.tv-cartao p { font-size: clamp(18px, 3.4vh, 44px); line-height: 1.45; margin: 0; color: #dbe4f3; white-space: pre-line;
               display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.tv-vazio { text-align: center; color: #a9bdd6; font-size: 3vh; }
.tv-vazio .logo { margin: 0 auto 2vh; --logo-line: #fff; --logo-fill: #8a9bad; opacity: .7; }
.tv-rodape { padding: 0 3.5vw 2.5vh; }
.tv-progresso { height: .6vh; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; margin-bottom: 2vh; }
.tv-progresso i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #a78bfa); border-radius: 99px; }
.tv-rodape-in { display: flex; justify-content: space-between; align-items: center; }
.tv-pontos { display: flex; gap: 1vh; }
.tv-pontos i { width: 1.4vh; height: 1.4vh; border-radius: 50%; background: rgba(255,255,255,.25); transition: all .3s; }
.tv-pontos i.on { background: #fff; transform: scale(1.3); }
.tv-pontos i.urg { background: #ef4444; }
.tv-qr { display: flex; align-items: center; gap: 1.2vw; color: #a9bdd6; font-size: 2vh; }
.tv-qr-img { width: 11vh; height: 11vh; background: #fff; padding: .6vh; border-radius: 1.2vh; }
.tv-qr-img svg { width: 100%; height: 100%; display: block; }
.tv-alerta { position: fixed; inset: 0; display: grid; place-items: center; z-index: 80;
             background: radial-gradient(circle, rgba(245,158,11,.35), rgba(6,11,44,.92) 70%); }
.tv-alerta[hidden] { display: none !important; }
.tv-alerta-in span { display: inline-block; font-size: clamp(40px, 11vh, 150px); font-weight: 900; letter-spacing: 1vh; color: #fff;
                     text-shadow: 0 0 4vh rgba(245,158,11,.9); }
.tv-alerta.ativo .tv-alerta-in span { animation: tv-alerta 2.6s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes tv-entrar { from { opacity: 0; transform: translateY(5vh) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes tv-brilho { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--av-cor) 70%, transparent); } 100% { box-shadow: 0 0 0 5vh transparent; } }
@keyframes tv-urg { 50% { box-shadow: 0 0 6vh rgba(239,68,68,.45); } }
@keyframes tv-alerta { 0% { opacity: 0; transform: scale(.4) rotate(-4deg); } 18% { opacity: 1; transform: scale(1.12) rotate(1deg); }
                       30% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }

@media (prefers-reduced-motion: reduce) {
  .av, .av.aparecer, .av.entrar, .av.sair, .av.urgente, .selo-novo, .ao-vivo i, .toast-aviso,
  .tv-cartao, .tv-alerta-in span { animation: none !important; transition: none !important; }
}

/* Créditos do programador — usado por todas as páginas (também incluído em style.css) */
.domus-credito { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 12px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #6b7385; text-align: center; }
.domus-credito a { display: inline-flex; align-items: center; gap: 5px; color: #1f9d55; font-weight: 600; text-decoration: none; }
.domus-credito a:hover { text-decoration: underline; }
.domus-credito .wa { width: 14px; height: 14px; flex: none; }
.domus-credito.escuro { color: rgba(255,255,255,.72); }
.domus-credito.escuro a { color: #4ade80; }
.domus-credito.linha { flex-direction: row; justify-content: center; gap: 8px; }
.rodape-credito { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.domus-credito { color: var(--muted); }
.tv-rodape-in .domus-credito { font-size: 1.7vh; }
.tv-rodape-in .domus-credito .wa { width: 1.9vh; height: 1.9vh; }

.side-cred .domus-credito { align-items: flex-start; text-align: left; font-size: 11px; }
.side-cred .domus-credito.escuro { color: var(--side-muted); }
.login-creditos { margin-top: 18px; }
.side-cred .domus-credito .wa { width: 13px; height: 13px; }

/* assinatura digitalizada (A minha conta) */
.assin-pad { width: 100%; max-width: 600px; height: 180px; background: #fff; border: 1px dashed #94a3b8; border-radius: 8px; touch-action: none; cursor: crosshair; display: block; }
.assin-atual { display: flex; gap: 16px; align-items: center; margin: 0 0 14px; padding: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.assin-atual img { max-height: 70px; max-width: 260px; }
.assin-atual div { color: #111; }

/* alerta de quotas do condómino e correções de decisões */
.alerta-quota { border-radius: 14px; box-shadow: var(--sombra); border: 1px solid var(--warn, #d97706); background: var(--warn-soft, #fef3c7); color: var(--text); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: grid; gap: 4px; }
.alerta-quota.bad { border-color: var(--bad, #dc2626); }
details.correcao { margin-top: 8px; }
details.correcao summary { cursor: pointer; color: var(--muted, #64748b); font-size: 13px; }
details.correcao form { margin-top: 8px; }

/* ocorrências no mural público */
.ocp { margin-top: 26px; }
.ocp h2 { font-size: 18px; margin: 0 0 10px; }
.ocp h2 small { font-size: 12px; font-weight: 400; }
.ocp-lista { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ocp-item { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.ocp-item.feita { opacity: .75; }
.ocp-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ocp-passos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ocp-passos i { height: 5px; border-radius: 3px; background: var(--line); }
.ocp-passos i.on { background: var(--accent); }
.ocp-item.feita .ocp-passos i.on { background: var(--ok, #15803d); }

/* edições DomusOne / DomusPro */
.b-pro { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; background: #6250d6; color: #fff; vertical-align: middle; }
.nav-pro { opacity: .75; }
.plano-lista { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; }
.plano-pro { font-weight: 600; color: #6250d6; }
.plano-atual { outline: 2px solid var(--accent); }

/* painel analítico — paleta validada (CVD-safe); variante escura no modo escuro */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-7: #6250d6; --viz-grade: #e7e5e0; --viz-txt: #52514e; --viz-forte: #0b0b0b; --viz-fundo: #fff; }
[data-modo="escuro"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-7: #9085e9; --viz-grade: #34332f; --viz-txt: #c3c2b7; --viz-forte: #f0efec; --viz-fundo: #1a1a19; }
.viz { width: 100%; height: auto; display: block; font: 11px system-ui, sans-serif; }
.viz-scroll { overflow-x: auto; }
.viz-largo .viz { min-width: 560px; }
.viz-s1 { fill: var(--viz-1); background: var(--viz-1); }
.viz-s2 { fill: var(--viz-2); background: var(--viz-2); }
.viz-s3 { fill: var(--viz-3); background: var(--viz-3); }
.viz-s7 { fill: var(--viz-7); background: var(--viz-7); }
.viz-s7-linha { fill: none; stroke: var(--viz-7); stroke-width: 2; stroke-linejoin: round; }
.viz-area { opacity: .12; }
.viz-ponto { stroke: var(--viz-fundo); stroke-width: 2; }
.viz path:not(.viz-area) { stroke: var(--viz-fundo); stroke-width: 1; }
.viz-grade { stroke: var(--viz-grade); stroke-width: 1; }
.viz-base { stroke: var(--viz-txt); stroke-width: 1; opacity: .5; }
.viz-eixo { fill: var(--viz-txt); }
.viz-valor { fill: var(--viz-forte); font-weight: 600; }
.viz-alvo { fill: transparent; }
.viz-alvo:hover { fill: currentColor; opacity: .05; }
.viz-legenda { display: flex; gap: 16px; font-size: 12px; margin: -4px 0 8px; color: var(--viz-txt); }
.viz-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-sub { margin: -6px 0 10px; font-size: 12px; }
.viz-mini td { padding: 4px 6px; }
.orc-barra { position: relative; height: 14px; border-radius: 7px; background: var(--viz-grade); margin: 6px 0 12px; overflow: hidden; }
.orc-real { height: 100%; background: var(--viz-1); border-radius: 7px; }
.orc-real.acima { background: var(--viz-2); }
.mini-barra { height: 6px; border-radius: 3px; background: var(--viz-grade); width: 110px; display: inline-block; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.mini-barra i { display: block; height: 100%; border-radius: 3px; }
tr.linha-atual td { background: rgba(42, 120, 214, .06); }

.planos-grelha { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* equipa: perfis e condomínios */
.perfis { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.perfil-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 400; cursor: pointer; }
.perfil-opt span { display: grid; gap: 2px; }
.eds-grelha { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* carteira, pesquisa e ações em massa */
.atencao-lista { display: grid; gap: 6px; margin-top: 10px; }
.atencao { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: inherit; }
.atencao:hover { background: rgba(42, 120, 214, .05); }
.atencao .ponto-a { width: 8px; height: 8px; border-radius: 50%; background: var(--warn, #d97706); flex: none; }
.atencao.bad .ponto-a { background: var(--bad, #dc2626); }
.atencao .seta { margin-left: auto; opacity: .5; font-size: 18px; }
.resultado { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.resultado:hover { background: rgba(42, 120, 214, .04); }
.resultado .b { min-width: 96px; text-align: center; }
.acoes-grelha { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.side-pesquisa { padding: 0 16px 10px; }
.side-pesquisa input { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: inherit; font: inherit; font-size: 13px; }
.side-pesquisa input::placeholder { color: rgba(255,255,255,.55); }

/* marca própria */
.marca-logo { object-fit: contain; }
.marca-prev { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.marca-prev-side { background: var(--side); color: var(--side-text); padding: 14px; display: flex; gap: 10px; align-items: center; }
.marca-prev-side small { color: var(--side-muted); }
.marca-prev-corpo { padding: 14px; display: flex; gap: 12px; align-items: center; }
.marca-link { color: var(--accent); text-decoration: underline; }

.linha-tempo { border-left: 2px solid var(--line); padding-left: 12px; display: grid; gap: 8px; margin: 6px 0 0 4px; }

.rel-grelha { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 14px; }
.card.rel { display: grid; gap: 6px; text-decoration: none; color: inherit; }
.card.rel:hover { outline: 2px solid var(--accent); }

/* assembleias */
.ot { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.votos-grelha { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.votos-grelha label { display: grid; gap: 3px; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.voto-ponto { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* IA do gestor */
.ia-fatura { margin-bottom: 12px; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.ia-redigir { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ia-redigir input { flex: 1; min-width: 220px; }
.ia-resposta { white-space: pre-wrap; line-height: 1.6; }
.ia-exemplos { display: flex; flex-wrap: wrap; gap: 6px; }

.pag-ed { border-top: 1px solid var(--line); padding: 10px 0; }
.pag-ed summary { cursor: pointer; }

/* cofre de backups (consola de backup e Software Central): barra de espaço usado */
.cofre-barra { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.cofre-barra > span { display: block; height: 100%; border-radius: 4px; background: var(--ok, #15803d); }
.cofre-barra.excedida > span { background: var(--bad, #b91c1c); }
.cofre-chave-form details > summary { list-style: none; cursor: pointer; }
.cofre-chave-form details > summary::-webkit-details-marker { display: none; }

/* pedidos ao DOMUS: conversa com a equipa DOMUS; atualização disponível */
.dev-msg { border-left: 3px solid var(--line); padding: 6px 10px; margin: 8px 0; }
.dev-msg-domus { border-left-color: var(--accent, #2563eb); background: var(--chip); border-radius: 0 8px 8px 0; }
.atualizacao-nova { border-color: var(--ok); }

/* assembleias: reunião online (Jitsi Meet / Google Meet / Zoom) */
.reuniao-opcoes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.reuniao-opcao { border: 1px solid var(--line); border-top: 4px solid var(--plat, var(--accent)); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.reuniao-opcao p { margin: 0; font-size: 13px; }
.reuniao-criar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.reuniao-criar label { font-size: 12px; }
.reuniao-plat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.reuniao-plat::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--plat, var(--accent)); }
.reuniao-link { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--chip); border-radius: 10px; padding: 10px 12px; }
.reuniao-link code { word-break: break-all; font-size: 13px; }
.reuniao-passos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.reuniao-passos .passo { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px 4px 4px; }
.reuniao-passos .passo span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); font-weight: 700; font-size: 12px; }
.reuniao-passos .passo.ok { color: var(--ok); border-color: var(--ok); }
.reuniao-passos .passo.ok span { background: var(--ok); color: #fff; }
.reuniao-convite { white-space: pre-wrap; background: var(--chip); border-radius: 10px; padding: 12px; font-size: 13px; }
.campo-info { display: block; padding: 8px 0; font-weight: 400; }
.guia { background: var(--chip); border-radius: 10px; padding: 4px 14px; font-size: 13px; }
.guia ol { margin: 8px 0; padding-left: 20px; line-height: 1.7; }
.guia code.copiavel { word-break: break-all; }
.reuniao-entrar { border: 2px solid var(--plat, var(--accent)); }


/* bot Telegram: lista de funções */
.bot-funcao { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bot-funcao input { margin-top: 3px; }

/* =====================================================================================================================
   Interface temática: modo claro/escuro/automático, temas de cor portugueses e padrão de azulejo
   ===================================================================================================================== */
:root {
  --azulejo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='white' stroke-width='1.3'%3E%3Crect x='.5' y='.5' width='71' height='71'/%3E%3Ccircle cx='36' cy='36' r='9'/%3E%3Ccircle cx='36' cy='36' r='3'/%3E%3Cpath d='M36 5c7 9 7 17 0 22-7-5-7-13 0-22zM36 67c7-9 7-17 0-22-7 5-7 13 0 22zM5 36c9-7 17-7 22 0-5 7-13 7-22 0zM67 36c-9-7-17-7-22 0 5 7 13 7 22 0z'/%3E%3Cpath d='M0 14A14 14 0 0 0 14 0M58 0a14 14 0 0 0 14 14M72 58a14 14 0 0 0-14 14M14 72A14 14 0 0 0 0 58'/%3E%3C/svg%3E");
}
body, .card, .kpi, .side, input, select, textarea { transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) { body, .card, .kpi, .side, input, select, textarea { transition: none; } }
.side { background-image: linear-gradient(180deg, color-mix(in srgb, var(--side) 90%, transparent) 0, var(--side) 240px), var(--azulejo);
  background-size: auto, 72px 72px; background-repeat: no-repeat, repeat; }

/* seletor rápido de modo no menu lateral */
.side-modo { display: flex; gap: 4px; margin: 14px 16px 0; padding: 4px; border-radius: 10px; background: var(--side-2); border: 1px solid var(--side-3); }
.side-modo button { flex: 1; display: grid; place-items: center; padding: 6px 0; border: 0; border-radius: 7px; background: none; color: var(--side-muted); cursor: pointer; }
.side-modo button:hover { color: #fff; }
.side-modo button.on { background: var(--side-3); color: var(--side-accent); }
.side-modo svg, .ent-modo svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* página Aparência (Conta) */
.modos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.modo-opt { position: relative; display: block; cursor: pointer; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.modo-opt input { position: absolute; opacity: 0; }
.modo-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modo-opt:has(input:focus-visible), .skin-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.modo-opt .pv { display: flex; height: 64px; }
.modo-opt .pv i { flex: 1; position: relative; }
.modo-opt .pv i::before { content: ""; position: absolute; left: 14%; top: 22%; width: 22%; height: 56%; border-radius: 4px; background: var(--side); }
.modo-opt .pv i::after { content: ""; position: absolute; left: 44%; top: 22%; right: 12%; height: 22%; border-radius: 4px; background: var(--accent); }
.modo-opt .pv .cl { background: #f4f6f9; }
.modo-opt .pv .es { background: #0f1218; }
.modo-opt .nm { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-weight: 600; color: var(--text); font-size: 13px; }
.modo-opt .nm svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modo-opt .nm small { margin-left: auto; font-weight: 400; }
.skin-opt { position: relative; }
.skin-opt .sw { position: relative; background-image: var(--azulejo); background-size: 36px 36px; }
.skin-opt .sw i { opacity: .96; }
.aparencia-sec { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 4px 0 8px; font-weight: 600; }

/* =====================================================================================================================
   Ecrã de entrada (DOMUS e consola de backup): arte temática à esquerda, formulário à direita
   ===================================================================================================================== */
main:has(.ent-ecra), main.bk:has(.ent-ecra) { padding: 0; max-width: none; margin-left: 0; }
.ent-ecra { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) 1fr; background: var(--bg); }
.ent-arte { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
  background: radial-gradient(900px 520px at 8% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 62%),
              radial-gradient(700px 520px at 100% 100%, color-mix(in srgb, var(--side-accent) 32%, transparent), transparent 60%),
              linear-gradient(150deg, var(--side-3), var(--side) 70%); }
.ent-arte::before { content: ""; position: absolute; inset: 0; opacity: .11; background-image: var(--azulejo); background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 35%, #000 15%, transparent 78%); mask-image: radial-gradient(ellipse at 30% 35%, #000 15%, transparent 78%); }
.ent-arte > * { position: relative; }
.ent-marca { display: flex; align-items: center; gap: 14px; color: #fff; }
.ent-marca .logo { --logo-line: #fff; --logo-fill: var(--side-muted); flex: none; }
.ent-marca .logo .ln { stroke-width: 30px; }
.ent-marca .wordmark { font-size: 22px; }
.ent-marca small { display: block; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; opacity: .72; margin-top: 5px; font-family: system-ui, sans-serif; }
.ent-titulo { margin: auto 0 0; padding-top: 48px; max-width: 540px; }
.ent-titulo h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -1px; margin: 0 0 14px; color: #fff; font-weight: 750; }
.ent-titulo p { font-size: 16px; line-height: 1.6; opacity: .86; margin: 0; }
.ent-lista { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; max-width: 560px; grid-template-columns: 1fr 1fr; }
.ent-lista li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.4;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(4px); }
.ent-lista b { display: block; font-size: 14px; }
.ent-lista li span { opacity: .8; }
.ent-lista svg { width: 20px; height: 20px; flex: none; stroke: var(--side-accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.ent-rodape { margin-top: 36px; font-size: 12px; opacity: .62; }
.ent-form { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.ent-caixa { width: 100%; max-width: 400px; }
.ent-caixa.larga { max-width: 640px; }
.ent-caixa > .ent-marca { display: none; color: var(--text); margin-bottom: 26px; }
.ent-caixa > .ent-marca .logo { --logo-line: inherit; --logo-fill: inherit; }
.ent-caixa > .ent-marca .wordmark { color: var(--logo-line); }
.ent-caixa h2 { font-size: 26px; letter-spacing: -.5px; margin: 0 0 6px; color: var(--text); }
.ent-caixa > p.sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; line-height: 1.5; }
.ent-campo { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--label); }
.ent-campo .caixa { position: relative; display: block; margin-top: 6px; }
.ent-campo .caixa > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ent-campo input { width: 100%; box-sizing: border-box; padding: 12px 44px 12px 42px; border: 1px solid var(--input-line); border-radius: 11px;
  background: var(--input-bg); color: var(--text); font: inherit; font-size: 15px; font-weight: 400; outline: none; transition: border-color .15s, box-shadow .15s; }
.ent-campo input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.ent-campo input.codigo { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 10px; text-align: center; }
.ent-campo .ver { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 6px; cursor: pointer; color: var(--muted); border-radius: 8px; }
.ent-campo .ver:hover { color: var(--accent); background: var(--accent-soft); }
.ent-campo .ver svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ent-caps { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--warn); }
.ent-caps[hidden] { display: none; }
.ent-entrar { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; padding: 12px 16px; border: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--side))); color: #fff; font: inherit; font-size: 15px; font-weight: 650;
  cursor: pointer; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .12s, box-shadow .12s, filter .12s; }
.ent-entrar:hover { filter: brightness(1.07); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.ent-entrar:active { transform: translateY(1px); }
.ent-entrar svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ent-flash { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; background: var(--accent-soft); color: var(--note-text); }
.ent-flash.erro { background: var(--bad-soft); color: var(--bad); }
.ent-modo { position: absolute; top: 18px; right: 18px; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ent-modo button { border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.ent-modo button:hover { color: var(--text); }
.ent-modo button.on { background: var(--accent-soft); color: var(--link); }
.ent-selos { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 22px 0 0; font-size: 12px; color: var(--muted); }
.ent-selos span { display: inline-flex; align-items: center; gap: 5px; }
.ent-selos svg { width: 14px; height: 14px; stroke: var(--ok); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ent-demo { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); }
.ent-demo b { color: var(--text); }
.ent-esqueci { display: block; text-align: right; margin: -6px 0 14px; font-size: 13px; color: var(--link); }
.ent-esqueci-centro { text-align: center; margin: 14px 0 0; }
.ent-so-form { grid-template-columns: 1fr; }
.ent-so-form .ent-caixa > .ent-marca { display: flex; }
.ent-creditos { margin-top: 26px; text-align: center; }
.ent-caixa .f { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .ent-ecra { grid-template-columns: 1fr; }
  .ent-arte { display: none; }
  .ent-caixa > .ent-marca { display: flex; }
  .ent-form { padding-top: 72px; }
}
/* ecrãs de entrada antigos (configuração, suspensão…): fundo temático */
.login-wrap { background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), var(--bg) 70%); }
.ent-arte .ent-marca small, .ent-arte .ent-marca .wordmark { color: #fff; }

/* =====================================================================================================================
   Interior temático: profundidade, cabeçalho de página, indicadores com ícone, tabelas, botões e campos
   (peças em templates/_ui.html). Tudo por variáveis do tema, por isso funciona nos 8 temas em claro e escuro.
   ===================================================================================================================== */
:root { --sombra: 0 1px 2px rgb(16 24 40 / .04), 0 8px 22px -12px rgb(16 24 40 / .16); --sombra-alta: 0 2px 4px rgb(16 24 40 / .05), 0 16px 34px -14px rgb(16 24 40 / .24);
  --raio: 14px; --tinta-th: color-mix(in srgb, var(--accent) 6%, var(--card)); --linha-hover: color-mix(in srgb, var(--accent) 5%, transparent); }
[data-modo="escuro"] { --sombra: 0 1px 2px rgb(0 0 0 / .35), 0 10px 26px -12px rgb(0 0 0 / .6); --sombra-alta: 0 2px 4px rgb(0 0 0 / .4), 0 18px 38px -14px rgb(0 0 0 / .7);
  --tinta-th: color-mix(in srgb, var(--accent) 14%, var(--card)); --linha-hover: color-mix(in srgb, var(--accent) 12%, transparent); }

/* fundo: faixa com a cor do tema e azulejo esbatido no topo da área de trabalho */
body:has(> main.with-side)::before, body:has(> main.bk)::before,
body:has(> main.with-side)::after, body:has(> main.bk)::after { content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 340px; pointer-events: none; }
body:has(> main.with-side)::before, body:has(> main.bk)::before {
  background: radial-gradient(900px 320px at 25% -30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
              linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)), var(--bg)); }
body:has(> main.with-side)::after, body:has(> main.bk)::after { background: var(--accent); opacity: .07;
  -webkit-mask: var(--azulejo) 0 0 / 72px 72px repeat, linear-gradient(#000, transparent); -webkit-mask-composite: source-in;
  mask: var(--azulejo) 0 0 / 72px 72px repeat, linear-gradient(#000, transparent); mask-composite: intersect; }
[data-modo="escuro"] body:has(> main.with-side)::after, [data-modo="escuro"] body:has(> main.bk)::after { opacity: .1; }

main > h1, main > .top h1 { font-size: 25px; letter-spacing: -.5px; font-weight: 750; }

/* cartões */
.card { border-radius: var(--raio); box-shadow: var(--sombra); }
.card h2 { font-weight: 680; letter-spacing: -.1px; }
.card-t { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; }
.card-t h2 { margin: 0; flex: 1; min-width: 0; }
.card-t > a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.card-ico, .kpi-ico, .alerta-ico, .pg-ico { display: grid; place-items: center; flex: none; }
.card-ico { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--link); }
.ui-ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* cabeçalho de página */
.pg-head { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px 28px; margin: 0 0 22px;
  border-radius: 18px; color: #fff; box-shadow: 0 16px 36px -18px color-mix(in srgb, var(--side) 80%, transparent);
  background: radial-gradient(620px 260px at 0% 0%, color-mix(in srgb, var(--accent) 62%, transparent), transparent 70%),
              radial-gradient(520px 260px at 100% 120%, color-mix(in srgb, var(--side-accent) 30%, transparent), transparent 65%),
              linear-gradient(135deg, var(--side-3), var(--side) 75%); }
.pg-head::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12; background-image: var(--azulejo); background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(90deg, transparent 10%, #000 70%); mask-image: linear-gradient(90deg, transparent 10%, #000 70%); }
.pg-ico { width: 54px; height: 54px; border-radius: 15px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: var(--side-accent); }
.pg-ico .ui-ico { width: 26px; height: 26px; }
.pg-txt { flex: 1; min-width: 220px; }
.pg-head h1 { margin: 0; color: #fff; font-size: 26px; line-height: 1.2; letter-spacing: -.5px; font-weight: 750; }
.pg-head p { margin: 4px 0 0; color: rgba(255, 255, 255, .8); }
.pg-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-head .btn { display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26); color: #fff; box-shadow: none; }
.pg-head .btn:hover { background: rgba(255, 255, 255, .2); }
.pg-head .btn.claro { background: #fff; border-color: #fff; color: var(--side); }
.pg-head .btn .ui-ico { width: 16px; height: 16px; }

/* indicadores */
.kpis { gap: 16px; margin-bottom: 22px; }
.kpi { --kpi-c: var(--link); position: relative; overflow: hidden; border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px 18px;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s, border-color .2s; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-c); opacity: .85; }
.kpi.bad { --kpi-c: var(--bad); } .kpi.ok { --kpi-c: var(--ok); } .kpi.warn { --kpi-c: var(--warn); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sombra-alta); }
.kpi:has(> .kpi-ico) .l { padding-right: 46px; min-height: 36px; }
.kpi-ico { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 11px; color: var(--kpi-c); background: color-mix(in srgb, var(--kpi-c) 13%, transparent); }
.kpi-ico .ui-ico { width: 20px; height: 20px; }
.kpi-c { min-width: 0; }
.kpi .l { font-size: 12.5px; font-weight: 500; }
.kpi .v { font-size: clamp(19px, 1.7vw, 24px); font-weight: 720; letter-spacing: -.4px; line-height: 1.25; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v.peq { font-size: 16px; letter-spacing: 0; }
.kpi-n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.warn .v { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .kpi, .kpi:hover { transition: none; transform: none; } }

/* tabelas */
th { background: var(--tinta-th); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
td { transition: background-color .12s; }
tr:hover > td { background: var(--linha-hover); }
tfoot tr:hover > td, table.sem-hover tr:hover > td { background: none; }

/* botões e campos (mesmo desenho do ecrã de entrada) */
.btn { border-radius: 9px; padding: 8px 15px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--side)));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent); transition: filter .12s, box-shadow .12s, transform .12s; }
.btn:hover { box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn:active { transform: translateY(1px); }
.btn.sec, .btn.danger { box-shadow: none; }
.btn.sec:hover { background: var(--accent-soft); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { border-radius: 7px; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
input, select, textarea { border-radius: 9px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s, background-color .2s; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.side input:focus, .side select:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--side-accent) 30%, transparent); }

/* etiquetas, avisos, mensagens */
.b { padding: 2px 9px; font-weight: 650; letter-spacing: .1px; }
.flash { border-radius: 11px; border: 0; border-left: 4px solid var(--ok); box-shadow: var(--sombra); }
.flash.erro { border-left-color: var(--bad); }
.note { border-radius: 11px; border-left: 3px solid var(--accent); }
.aviso { border-left-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--text) 2.5%, transparent);
  border-radius: 0 10px 10px 0; padding: 9px 12px 9px 13px; margin-bottom: 10px; }
.aviso:last-child { margin-bottom: 0; }
.aviso.urg { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.empty { text-align: center; padding: 18px 0; }

/* alerta em cartão */
.alerta { --al: var(--link); display: flex; align-items: center; gap: 14px; padding: 13px 16px; margin-bottom: 18px; border-radius: var(--raio);
  background: color-mix(in srgb, var(--al) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--al) 26%, transparent); box-shadow: var(--sombra); }
.alerta.warn { --al: var(--warn); } .alerta.bad { --al: var(--bad); } .alerta.ok { --al: var(--ok); }
.alerta-ico { width: 38px; height: 38px; border-radius: 11px; background: color-mix(in srgb, var(--al) 16%, transparent); color: var(--al); }
.alerta-c { flex: 1; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.alerta-c > b:first-child { color: var(--text); }
.alerta-c .btn { margin-left: auto; }

/* avatar com iniciais e barra de proporção */
.avt { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  background: var(--accent-soft); color: var(--link); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.pessoa { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pessoa > span:last-child { min-width: 0; }
.pessoa b, .pessoa a { display: block; }
.pessoa small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra { display: block; height: 4px; margin-top: 5px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: inherit; background: var(--bad); }
.lista-val td { vertical-align: middle; }

/* células de ações nas tabelas: continuam a ser células (linhas de separação alinhadas), botões lado a lado */
td.actions { display: table-cell; white-space: normal; vertical-align: middle; }   /* os botões passam à linha seguinte se faltar espaço */
td.actions form { display: inline; }
td.actions > * { display: inline-block; margin: 2px 6px 2px 0; vertical-align: middle; }
td.actions > *:last-child { margin-right: 0; }
td.actions[style*="flex-end"] { text-align: right; }
/* textos sem espaços (emails, referências, nomes de ficheiros) partem quando falta espaço, em vez de empurrar a tabela para fora do cartão */
td:not(.n):not(.actions) { overflow-wrap: anywhere; }
@media (max-width: 860px) { td:not(.n):not(.actions) { overflow-wrap: break-word; } }

@media (max-width: 860px) {
  body:has(> main.with-side)::before, body:has(> main.with-side)::after { display: none; }
  .pg-head { padding: 18px; border-radius: 14px; }
  .pg-head h1 { font-size: 21px; }
  .pg-ico { width: 44px; height: 44px; }
}

/* página de edições (planos): cartões incrementais e tabela de comparação */
.planos3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-bottom: 4px; align-items: start; }
.plano3 { --pc: var(--link); position: relative; padding-top: 22px; border-top: 4px solid var(--pc); }
.plano3-pro { --pc: var(--ed-pro); } .plano3-enterprise { --pc: var(--ed-enterprise); }
.plano3.atual { box-shadow: 0 0 0 2px var(--pc), var(--sombra-alta); }
.plano3-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plano3-topo h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; color: var(--pc); }
.plano3-para { color: var(--muted); margin: 6px 0 12px; min-height: 42px; }
.plano3-limite { display: inline-block; font-weight: 700; padding: 5px 12px; border-radius: 99px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--pc) 12%, transparent); color: var(--pc); }
.plano3-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.plano3-lista li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.45; }
.plano3-lista .ui-ico { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--ok); }
.plano3-lista .plano3-novo { font-weight: 600; }
.plano3-lista .plano3-novo .ui-ico { color: var(--pc); }
.plano3-lista .plano3-tudo { color: var(--muted); padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.plano3-lista .plano3-cofre { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; }
.plano3-lista .plano3-cofre .ui-ico { color: var(--link); }
.plano3-tabela td.c, .plano3-tabela th.c { text-align: center; white-space: nowrap; }
.plano3-tabela th.atual { color: var(--link); }
.plano3-tabela td.sim { color: var(--ok); font-weight: 700; }
.plano3-tabela td.nao { color: var(--muted); }

/* formulário da fração: secções e 2.º proprietário */
.form-sec { margin: 6px 0 -4px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.form-sec2 { border: 1px dashed var(--line); border-radius: 11px; padding: 10px 14px; }
.form-sec2 > summary { cursor: pointer; }
.form-sec2 .f { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; align-items: end; }
.form-sec2 .f .full { grid-column: 1 / -1; }
.ia-exemplos .b { white-space: normal; text-align: left; }   /* sugestões longas partem em vez de sair do cartão */

/* declaração de consentimento: rever dados lidos do PDF */
.rever-tab td, .rever-tab th { vertical-align: middle; }
.rever-tab td.c, .rever-tab th.c { text-align: center; width: 90px; }
.rever-tab tr.muda > td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.rever-tab input[type=checkbox] { width: 18px; height: 18px; }
.consent-linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn > .ui-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }

/* janela de progresso da instalação de uma atualização */
body.inst-ativa { overflow: hidden; }
.inst-janela { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--side) 72%, transparent); backdrop-filter: blur(3px); }
.inst-janela[hidden] { display: none; }
.inst-caixa { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 20px; box-shadow: var(--sombra-alta); }
.inst-titulo { margin: 0 0 6px; font-size: 20px; }
.inst-sub { margin: 0 0 16px; color: var(--muted); }
.inst-barra { height: 10px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.inst-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--link)); transition: width .6s ease; }
.inst-pct { text-align: right; font-size: 12px; color: var(--muted); margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.inst-passos { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.inst-passos li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.inst-marca { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: var(--chip); color: var(--muted); }
.inst-passos .p-feito { color: var(--text); }
.inst-passos .p-feito .inst-marca { background: var(--ok-soft); color: var(--ok); }
.inst-passos .p-atual { color: var(--text); font-weight: 650; }
.inst-passos .p-atual .inst-marca { background: var(--accent); color: #fff; animation: inst-pulso 1.2s ease-in-out infinite; }
.inst-passos .p-erro .inst-marca { background: var(--bad-soft); color: var(--bad); }
@keyframes inst-pulso { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .inst-passos .p-atual .inst-marca { animation: none; } .inst-barra i { transition: none; } }
.inst-det { margin-top: 14px; }
.inst-det summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.inst-registo { margin: 8px 0 0; max-height: 160px; overflow: auto; font-size: 12px; background: var(--th-bg); padding: 10px; border-radius: 8px; white-space: pre-wrap; }
.inst-fim, .inst-erro { margin-top: 16px; }

/* anulações com motivo e listas de escolha */
tr.anulado td { color: var(--muted); }
details.anular { display: inline-block; }
details.anular > summary { list-style: none; cursor: pointer; }
details.anular > summary::-webkit-details-marker { display: none; }
details.anular form { display: grid; gap: 8px; margin-top: 8px; min-width: 200px; max-width: 280px; text-align: left; }
.escolhas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.escolhas label { font-weight: 400; }
.pilha > * + * { margin-top: 14px; }

/* menu por áreas */
.side .area > summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; list-style: none; }
.side .area > summary::-webkit-details-marker { display: none; }
.side .area > summary::after { content: '›'; margin-left: auto; opacity: .6; transition: transform .15s; }
.side .area[open] > summary::after { transform: rotate(90deg); }
.side .area > summary .nav-badge + ::after { margin-left: 8px; }
.side .area > summary:hover { background: var(--side-2); }
.side .area[open] > .area-in { display: grid; gap: 1px; padding: 2px 0 8px 8px; margin-left: 10px; border-left: 1px solid var(--side-3); }
.side .area-in a { padding: 7px 10px; font-size: 13.5px; }
/* separadores */
.abas { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.abas a { padding: 9px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px; }
.abas a:hover { color: var(--text); }
.abas a.on { color: var(--accent); border-bottom-color: var(--accent); }
.abas .nav-badge { margin-left: 6px; }
/* passos numerados */
.passos { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; counter-reset: p; padding: 0; margin: 4px 0 16px; }
.passos li { counter-increment: p; }
.passos li > * { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--chip); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.passos li > *::before { content: counter(p); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--text); font-size: 12px; }
.passos li.done > * { background: var(--ok-soft, var(--accent-soft)); color: var(--ok); }
.passos li.done > *::before { content: '✓'; color: var(--ok); }
.passos li.cur > * { background: var(--accent); color: #fff; }
/* tarefas */
.tarefa { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tarefa:last-child { border-bottom: 0; }
.tarefa .ponto-a { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.tarefa.warn .ponto-a { background: var(--warn); }
.tarefa.bad .ponto-a { background: var(--bad); }
.tarefa-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tarefa-d { flex: none; min-width: 42px; font-variant-numeric: tabular-nums; font-weight: 650; }
.meses { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.meses .card { margin: 0; }
.mes-atual { border-color: var(--accent); }
.tab-edit td { padding: 4px 6px; }
.tab-edit input:not([type=hidden]) { width: 100%; min-width: 64px; }
/* ajuda da página */
.ajuda-pag { position: absolute; z-index: 5; top: 8px; right: 32px; }
.ajuda-pag > summary { list-style: none; cursor: pointer; padding: 4px 12px; border-radius: 99px; background: var(--chip); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ajuda-pag > summary::-webkit-details-marker { display: none; }
.ajuda-pag[open] > summary { background: var(--accent); color: #fff; }
.ajuda-cx { position: absolute; right: 0; top: 34px; width: min(360px, 82vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font-size: 14px; }
.ajuda-cx ol { padding-left: 20px; margin: 8px 0; }
.pg-head { clear: both; }
.tema-ajuda { border-bottom: 1px solid var(--line); padding: 8px 0; }
.tema-ajuda summary { cursor: pointer; }
.glossario dt { font-weight: 650; margin-top: 10px; }
.glossario dd { margin: 2px 0 0; color: var(--muted); }
@media print { .ajuda-pag, .abas { display: none; } }
td.nw { white-space: nowrap; }

/* cabeçalho das páginas: igual em todas (a ajuda cabe na margem de cima, sem empurrar a faixa) */
main.with-side { position: relative; padding-top: 44px; }
.pg-head .sub { color: rgba(255, 255, 255, .8); margin-bottom: 0; }
.pg-head a:not(.btn) { color: #fff; text-decoration: underline; }
.pg-head .muted, .pg-head small { color: rgba(255, 255, 255, .72); }
.pg-head code { background: rgba(255, 255, 255, .14); color: #fff; }
.pg-head label { color: rgba(255, 255, 255, .85); }
.pg-acoes { align-items: center; }
.pg-acoes select, .pg-acoes input:not([type=checkbox]):not([type=hidden]) { width: auto; }
.abas + .sub { margin-top: -4px; }
@media (max-width: 800px) { .ajuda-pag { right: 16px; } }

.sms-ex { margin: 8px 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--bg); color: var(--text); max-width: 520px; white-space: pre-wrap; }

/* ---- aplicação Android: página de instalação e ecrãs dentro da app */
.app-pag { max-width: 460px; }
.app-passos { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: p; }
.app-passos > li { counter-increment: p; position: relative; padding: 0 0 18px 40px; }
.app-passos > li::before { content: counter(p); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.app-passos p { margin: 6px 0 8px; }
.app-passos a.ent-entrar { display: flex; text-decoration: none; justify-content: center; }
.app-qr { background: #fff; border-radius: 12px; padding: 10px; width: 190px; margin: 4px auto 8px; border: 1px solid var(--line); }
.app-qr svg { display: block; width: 100%; height: auto; }
.app-nota { font-size: 12px; color: var(--muted); }
.app-codigo textarea { width: 100%; font-size: 11px; word-break: break-all; margin-top: 6px; }
.app-codigo summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.app-convite { text-align: center; margin: 14px 0 0; font-size: 13px; }
.app-entrada { display: grid; gap: 10px; margin-top: 12px; justify-items: center; }
.app-entrada [hidden] { display: none !important; }
.app-entrada .btn { width: 100%; justify-content: center; }
.app-entrada .ent-esqueci { background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; margin: 0; }
@media (hover: none) and (pointer: coarse) { .so-pc { display: none; } }
@media (hover: hover) { .so-tlm { display: none; } }

/* ---- telemóvel: zonas de toque, indicadores a dois e menos espaço perdido */
@media (max-width: 860px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }        /* abaixo disto o telemóvel amplia a página ao escrever */
  .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .btn.sm { min-height: 36px; padding: 5px 12px; font-size: 13px; }
  .btn[hidden] { display: none; }
  .ent-modo button { min-width: 42px; min-height: 38px; display: grid; place-items: center; }
  .ajuda-pag { top: 8px; right: 16px; }
  .ajuda-pag > summary { padding: 8px 14px; }
  .ajuda-cx { top: 42px; }
  main.with-side { padding-top: 14px; }
  main.with-side:has(> .ajuda-pag) { padding-top: 50px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
  .g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
  .app-codigo summary { padding: 8px 0; }
}

/* tabelas em cartões (classes postas por app.js) */
@media (max-width: 700px) {
  .tb-movel, .tb-movel tbody { display: block; width: 100%; min-width: 0; }
  .tb-movel thead:not(:has(input)), .tb-movel .tb-cab:not(:has(input)), .tb-movel .tb-cab:has(input) th:not(:has(input)) { display: none; }
  .tb-movel thead, .tb-movel .tb-cab:has(input), .tb-movel .tb-cab th { display: block; padding: 4px 0; background: none; border: 0; }
  .tb-movel tr { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tb-movel tr[hidden] { display: none; }
  .tb-movel tr:last-child { border-bottom: 0; }
  .tb-movel td { display: block; position: relative; width: auto; min-height: 30px; padding: 4px 0 4px 42%; border: 0; text-align: right; overflow-wrap: anywhere; white-space: normal; }
  .tb-movel td[data-rot]::before { content: attr(data-rot); position: absolute; left: 0; top: 6px; width: 40%; color: var(--muted); font-size: 12px; text-align: left; overflow-wrap: anywhere; }
  .tb-movel td.tb-titulo { order: -1; padding: 0 0 6px; text-align: left; font-weight: 650; }
  .tb-movel td.tb-larga, .tb-movel td.tb-sem { padding: 6px 0 0; text-align: left; min-height: 0; }
  .tb-movel td.empty, .tb-movel td.tb-larga.empty { text-align: center; padding: 14px 0; }
  .tb-movel td.tb-sem, .tb-movel td.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 0; text-align: left; }
  .tb-movel td.tb-vazia { display: none; }
  .tb-movel td form { display: inline-flex; flex-wrap: wrap; gap: 6px; }
  main.with-side .grid[style*="grid-template-columns"], main.with-side form[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  main.with-side .card table:not(.tb-movel):not(.viz-mini) td { padding-left: 4px; padding-right: 4px; }
  .viz-scroll svg { min-width: 460px; }
}
input[type=color] { height: 42px; padding: 4px; }
.marca-prev-side .logo { --logo-line: #fff; --logo-fill: rgba(255, 255, 255, .55); flex: none; }
.pg-head select, .pg-head input:not([type=checkbox]):not([type=hidden]) { color: var(--text); background-color: var(--input-bg); }
[data-modo="escuro"] .btn.sec:not(.pg-acoes .btn):not(.pg-head .btn) { color: var(--link); border-color: color-mix(in srgb, var(--link) 55%, transparent); }

/* verificação em dois passos */
.dp-codigos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dp-codigos code, .dp-chave { padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); text-align: center; font-size: 15px; letter-spacing: 1px; overflow-wrap: anywhere; }
.ent-confiar { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13.5px; }
.ent-confiar input { margin: 0; }
.dp-opt { font-weight: 400; }
.dp-repor > summary { list-style: none; cursor: pointer; display: inline-flex; }
.dp-repor > summary::-webkit-details-marker { display: none; }
.dp-repor[open] .f { margin: 8px 0; grid-template-columns: 1fr; text-align: left; }

/* barra de progresso (consola de backup) */
.pr-nativo { width: 100%; height: 12px; accent-color: var(--accent); }

/* telemóvel: nada sai do seu cartão, mesmo com a letra do sistema grande (a aplicação Android respeita-a) */
@media (max-width: 860px) {
  .btn, .ent-entrar { white-space: normal; max-width: 100%; text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
  .btn.sm { line-height: 1.2; }
  .b, .pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
  .card, .kpi, .card > *, .pg-head > *, .card-t > * { min-width: 0; }
  .card h2, .card h3, .pg-head h1 { overflow-wrap: anywhere; }
  .kpi { container-type: inline-size; }
  .kpi .v { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: clamp(15px, 13cqw, 19px); }
  .kpi .v.peq { font-size: clamp(14px, 10cqw, 16px); }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }                             /* um indicador sozinho ocupa a linha */
  .pg-head { align-items: flex-start; gap: 14px; }
  .pg-head .pg-txt { flex: 1 1 0; }
  .pg-acoes { flex: 1 1 100%; }
  .abas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: -16px; padding-inline: 16px; }
  .abas::-webkit-scrollbar { display: none; }
  .abas a { flex: none; white-space: nowrap; }
  .plano3-topo { flex-wrap: wrap; }
  form.f > div > .btn:only-child:not(.sm), form.f > .full > .btn:only-child:not(.sm) { width: 100%; }
  .modos, .skins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input[type=file] { max-width: 100%; }
  code, .card p, .card li { overflow-wrap: anywhere; }
  .card table td, .card table th { overflow-wrap: anywhere; }
  .viz-card > * { min-width: 0; } .viz-card .b, .viz-card td.n, .viz-card th { white-space: normal; }
}
@media (max-width: 700px) {
  .tb-movel td[data-rot] { display: flow-root; padding-left: 0; }                              /* o rótulo ocupa o seu lugar: nunca fica por cima da linha seguinte */
  .tb-movel td[data-rot]::before { position: static; float: left; width: 40%; padding-right: 8px; line-height: 1.6; }
  .tb-movel td.tb-vazia, .tb-movel td.tb-vazia[data-rot] { display: none; }
  .tb-lista, .tb-lista tbody { display: block; width: 100%; }
  .tb-lista tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tb-lista tr:last-child { border-bottom: 0; }
  .tb-lista td { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  .tb-lista td:first-child { flex: 1 1 60%; }
  .tb-lista td:empty { display: none; }
}
@media (max-width: 380px) { .modos { grid-template-columns: 1fr; } }
