/* Identidade visual do CHC: menu lateral, topo, conteúdo e componentes.
   Responsivo (desktop e tablet). Só CSS próprio sobre o Bootstrap 5, sem dependências externas.
   As cores ficam em variáveis no :root para se poderem ajustar num só sítio. */
:root {
  --chc-sidebar: 15.5rem;
  --chc-azul: #0d6efd;
  --chc-oceano: #0e7490;        /* cor de marca (oxigénio / água) */
  --chc-oceano-claro: #e0f2f7;
  --chc-noite: #0f1d33;         /* fundo do menu lateral */
  --chc-noite-2: #16294a;
  --chc-fundo: #f3f6fa;
  --chc-linha: #e3e8ef;
  --chc-texto-suave: #64748b;
  --chc-raio: .75rem;
  --chc-sombra: 0 1px 2px rgba(15, 29, 51, .06), 0 2px 8px rgba(15, 29, 51, .05);
  --chc-sombra-hover: 0 4px 16px rgba(15, 29, 51, .10);
  --bs-primary: var(--chc-azul);
  --bs-border-radius: .5rem;
  --bs-body-color: #1e293b;
}
body { background: var(--chc-fundo); color: var(--bs-body-color); }
.layout { display: flex; min-height: 100vh; }

/* ---------- Menu lateral ---------- */
.sidebar {
  width: var(--chc-sidebar); flex-shrink: 0; color: #fff; padding: 0 0 1rem;
  background: linear-gradient(180deg, var(--chc-noite-2) 0%, var(--chc-noite) 60%);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar-marca {
  padding: 1.1rem 1.25rem; display: flex; gap: .7rem; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: .6rem;
}
.sidebar-marca .logo { width: 2.3rem; height: 2.3rem; flex-shrink: 0; }
/* Selo da clínica (imagem carregada na configuração): recortado em círculo e ligeiramente ampliado para esconder a margem branca. */
.sidebar-marca .logo-selo { width: 3.4rem; height: 3.4rem; border-radius: 50%; overflow: hidden; display: block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.25); background: #fff; }
.sidebar-marca .logo-selo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); display: block; }
.sidebar-marca .nome { font-weight: 600; font-size: 1rem; line-height: 1.15; }
.sidebar-marca .sub { font-size: .7rem; color: #8fb3c9; text-transform: uppercase; letter-spacing: .06em; }
.sidebar .nav { padding: 0 .6rem; gap: 2px; }
.btn-menu { color: #fff; border: 1px solid rgba(255,255,255,.25); font-size: 1.5rem; width: 3rem; height: 3rem; padding: 0;
  display: inline-grid; place-items: center; border-radius: .6rem; }
.btn-menu:hover, .btn-menu:focus-visible { color: #fff; background: rgba(255,255,255,.1); }
.sidebar .nav-link {
  color: #b6c3d4; padding: .55rem .8rem; display: flex; gap: .7rem; align-items: center;
  border-radius: .5rem; font-size: .93rem; transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(34,170,204,.28), rgba(34,170,204,.08));
  color: #fff; box-shadow: inset 3px 0 0 #38bdf8;
}
.sidebar .nav-link.active i { opacity: 1; color: #7dd3fc; }

/* ---------- Topo ---------- */
.conteudo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topo {
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--chc-linha); padding: .6rem 1.5rem;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020;
}
.topo .pesquisa { flex: 1; max-width: 34rem; position: relative; }
.topo .pesquisa i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--chc-texto-suave); pointer-events: none; }
.topo .pesquisa input { padding-left: 2.4rem; background: var(--chc-fundo); border-color: transparent; border-radius: 2rem; }
.topo .pesquisa input:focus { background: #fff; border-color: #86b7fe; }
.utilizador { display: flex; gap: .75rem; align-items: center; }
.utilizador .perfil { display: flex; gap: .55rem; align-items: center; color: inherit; text-decoration: none; font-weight: 500; }
.avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #22d3ee, var(--chc-oceano)); color: #fff; font-size: .8rem; font-weight: 600;
}
.btn-icone { width: 2.3rem; height: 2.3rem; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }

.principal { padding: 1.5rem; flex: 1; }
.rodape { padding: .6rem 1.5rem; color: var(--chc-texto-suave); font-size: .8rem; border-top: 1px solid var(--chc-linha); }

/* ---------- Títulos de página ---------- */
.principal > h1, .principal > .d-flex > h1, .principal > .d-flex > div > h1 { font-weight: 600; letter-spacing: -.01em; }
.principal h2.h5 { font-weight: 600; }

/* ---------- Cartões ---------- */
.card { border: 1px solid var(--chc-linha); border-radius: var(--chc-raio); box-shadow: var(--chc-sombra); }
.card-header { background: #fff; border-bottom-color: var(--chc-linha); font-weight: 600; }
.card-header:first-child { border-radius: var(--chc-raio) var(--chc-raio) 0 0; }

/* ---------- Tabelas ---------- */
.table-responsive {
  background: #fff; border: 1px solid var(--chc-linha); border-radius: var(--chc-raio);
  box-shadow: var(--chc-sombra); margin-bottom: 1rem;
}
.table-responsive > .table { margin-bottom: 0; }
.table > thead th {
  background: #f8fafc; color: var(--chc-texto-suave); font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--chc-linha); white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .7rem .85rem; border-color: #eef2f6; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f2f8fb; }
.card .table-responsive { border: 0; box-shadow: none; border-radius: 0; }

/* ---------- Separadores ---------- */
.nav-tabs { border-bottom: 1px solid var(--chc-linha); gap: .25rem; }
.nav-tabs .nav-link { border: 0; color: var(--chc-texto-suave); font-weight: 500; padding: .6rem 1rem; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link:hover { color: var(--bs-body-color); border-bottom-color: #cbd5e1; }
.nav-tabs .nav-link.active { color: var(--chc-oceano); background: transparent; border-bottom-color: var(--chc-oceano); }

/* ---------- Estados (badges) em tons suaves ---------- */
.badge { font-weight: 500; padding: .38em .65em; }
.badge.text-bg-success { background: #dcfce7 !important; color: #166534 !important; }
.badge.text-bg-danger { background: #fee2e2 !important; color: #991b1b !important; }
.badge.text-bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.badge.text-bg-info { background: #e0f2fe !important; color: #075985 !important; }
.badge.text-bg-primary { background: #dbeafe !important; color: #1e40af !important; }
.badge.text-bg-secondary { background: #eef2f6 !important; color: #475569 !important; }
.badge.rounded-pill.bg-danger { box-shadow: 0 0 0 2px #fff; }

/* ---------- Formulários, alertas e paginação ---------- */
.form-control, .form-select { border-color: #d5dde7; }
.form-label { font-weight: 500; font-size: .92rem; }
.alert { border-radius: var(--chc-raio); border-width: 0 0 0 4px; }
.alert-light.border { border-width: 1px !important; }
.pagination .page-link { border-color: var(--chc-linha); }
dl.row dt { color: var(--chc-texto-suave); font-weight: 500; }

/* ---------- Dashboard ---------- */
.saudacao { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.saudacao h1 { margin: 0; font-weight: 600; }
.saudacao .data { color: var(--chc-texto-suave); }
.widget { position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.widget:hover { box-shadow: var(--chc-sombra-hover); transform: translateY(-1px); }
.widget .card-body { display: flex; flex-direction: column; gap: .35rem; }
.widget-topo { display: flex; justify-content: space-between; align-items: start; gap: .75rem; }
.widget-titulo { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--chc-texto-suave); margin: 0; }
.widget-titulo a { color: inherit; text-decoration: none; }
.widget-titulo a:hover { color: var(--chc-oceano); }
.widget-icone {
  width: 2.75rem; height: 2.75rem; border-radius: .7rem; display: grid; place-items: center; flex-shrink: 0;
  font-size: 1.3rem; background: var(--chc-oceano-claro); color: var(--chc-oceano);
}
.widget-valor { font-size: 2.2rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.widget-detalhe { font-size: .85rem; color: var(--chc-texto-suave); }
.widget .progress { height: .45rem; background: #edf1f6; border-radius: 1rem; margin-top: .35rem; }
.widget .progress-bar { border-radius: 1rem; background: linear-gradient(90deg, #22d3ee, var(--chc-oceano)); }
.widget-linhas { list-style: none; padding: 0; margin: .4rem 0 0; font-size: .85rem; }
.widget-linhas li { padding: .3rem 0; border-top: 1px dashed var(--chc-linha); }
/* Faixa de cor à esquerda e ícone por tom (cor indicada pelo módulo) */
.widget::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--widget-cor, transparent); }
.widget-cor-danger { --widget-cor: #ef4444; } .widget-cor-danger .widget-icone { background: #fee2e2; color: #dc2626; }
.widget-cor-warning { --widget-cor: #f59e0b; } .widget-cor-warning .widget-icone { background: #fef3c7; color: #b45309; }
.widget-cor-success { --widget-cor: #22c55e; } .widget-cor-success .widget-icone { background: #dcfce7; color: #15803d; }
.widget-cor-info { --widget-cor: #0ea5e9; }
.widget-cor-danger .widget-valor { color: #dc2626; } .widget-cor-warning .widget-valor { color: #b45309; }

/* ---------- Ecrãs públicos (entrar, recuperar) ---------- */
.publico {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(60rem 30rem at 110% -10%, rgba(34,211,238,.25), transparent 60%),
    radial-gradient(50rem 30rem at -10% 110%, rgba(14,116,144,.35), transparent 60%),
    linear-gradient(160deg, var(--chc-noite-2), var(--chc-noite));
}
.publico-caixa { width: 100%; max-width: 440px; }
.publico-marca { text-align: center; color: #fff; margin-bottom: 1.5rem; }
.publico-marca .logo { width: 4rem; height: 4rem; margin-bottom: .6rem; }
/* Selo da clínica no ecrã de entrada (mesmo recorte circular da barra lateral). */
.publico-marca .logo-selo { width: 6rem; height: 6rem; border-radius: 50%; overflow: hidden; display: block; margin: 0 auto .8rem;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25); background: #fff; }
.publico-marca .logo-selo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); display: block; }
.publico-marca .nome { font-size: 1.35rem; font-weight: 600; }
.publico-marca .sub { color: #8fb3c9; font-size: .85rem; }
.publico-direitos { text-align: center; color: #8fb3c9; font-size: .8rem; margin-top: 1rem; }
.publico .card { border: 0; box-shadow: 0 20px 50px rgba(0,0,0,.30); border-radius: 1rem; }

/* Botões grandes nos ecrãs de enfermagem */
.btn-tablet { padding: 1rem 1.5rem; font-size: 1.25rem; min-height: 3.5rem; border-radius: .7rem; }

@media (max-width: 991.98px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 0 0 .5rem; }
  .sidebar-marca { padding: .7rem 1rem; margin-bottom: 0; border-bottom: 0; }
  .sidebar-topo { display: flex; align-items: center; justify-content: space-between; padding-right: .75rem; }
  #menu-principal.show, #menu-principal.collapsing { border-top: 1px solid rgba(255,255,255,.07); padding-top: .5rem; }
  .sidebar .nav { flex-direction: row !important; flex-wrap: wrap; }
  .sidebar .nav-link { padding: .45rem .75rem; }
  .sidebar .nav-link.active { box-shadow: inset 0 -2px 0 #38bdf8; }
  .topo { padding: .6rem 1rem; }
  .principal { padding: 1rem; }
  .utilizador .perfil span.nome { display: none; }
}
@media print {
  .sidebar, .topo, .rodape { display: none !important; }
  body { background: #fff; }
  .card, .table-responsive { box-shadow: none; }
}
.publico-caixa.larga { max-width: 760px; }
.input-group-text { background: #f8fafc; color: var(--chc-texto-suave); border-color: #d5dde7; }
.erro-icone { font-size: 3rem; color: var(--chc-oceano); opacity: .8; }
/* Ligações sem sublinhado em tabelas e indicadores (sublinham ao passar o rato) */
.table a:not(.btn), .widget-linhas a { text-decoration: none; font-weight: 500; }
.table a:not(.btn):hover, .widget-linhas a:hover { text-decoration: underline; }
code { color: #0e7490; background: var(--chc-oceano-claro); padding: .1em .4em; border-radius: .3rem; font-size: .82em; }
pre code { background: none; padding: 0; }
.card :is(h1, h2, h3, h4, h5, h6, .h5, .h6) a { text-decoration: none; }
.card :is(h1, h2, h3, h4, h5, h6, .h5, .h6) a:hover { text-decoration: underline; }
.card .badge { white-space: nowrap; }

/* ---------- Mini-gráfico de barras (dashboard) ----------
   Uma série, cor validada (#0891b2: luminosidade, croma e contraste >= 3:1); hoje no passo mais escuro da mesma cor e com valor visível.
   Barras finas com topo arredondado assente na linha de base; grelha implícita, sem eixos. */
.mini-grafico { display: flex; align-items: stretch; gap: 6px; height: 7.5rem; margin-top: .5rem; padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--chc-linha); position: relative; }
.mg-coluna { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.mg-coluna:hover { background: #f1f7fa; border-radius: .4rem .4rem 0 0; }
.mg-barra { width: min(70%, 1.6rem); background: #0891b2; border-radius: 4px 4px 0 0; transition: background .15s; }
.mg-coluna:hover .mg-barra { background: #0e7490; }
.mg-coluna.hoje .mg-barra { background: #155e75; }
.mg-valor { font-size: .75rem; font-weight: 600; color: var(--bs-body-color); min-height: 1.1rem; }
.mg-rotulo { position: absolute; bottom: -1.3rem; font-size: .72rem; color: var(--chc-texto-suave); }
.mg-coluna.hoje .mg-rotulo { color: var(--bs-body-color); font-weight: 600; }

/* ---------- Mapa das câmaras ----------
   Cores de estado validadas (luminosidade, croma, contraste >= 3:1, separação em visão normal):
   livre #16a34a · em utilização #0284c7 · reservada #d97706 · manutenção #7c3aed · indisponível cinzento neutro.
   O par livre/reservada fica no limite para daltonismo, por isso o estado leva sempre ícone e texto. */
.estado-disponivel { --estado: #16a34a; --estado-fundo: #dcfce7; --estado-texto: #166534; }
.estado-em_utilizacao { --estado: #0284c7; --estado-fundo: #e0f2fe; --estado-texto: #075985; }
.estado-reservada { --estado: #d97706; --estado-fundo: #fef3c7; --estado-texto: #92400e; }
.estado-manutencao { --estado: #7c3aed; --estado-fundo: #ede9fe; --estado-texto: #5b21b6; }
.estado-indisponivel { --estado: #64748b; --estado-fundo: #eef2f6; --estado-texto: #334155; }
.estados-resumo { display: flex; flex-wrap: wrap; gap: .5rem; }
.estado-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 2rem; font-size: .85rem;
  font-weight: 500; background: var(--estado-fundo); color: var(--estado-texto); white-space: nowrap; }
.estado-chip strong { font-weight: 700; }
.estado-chip.vazio { opacity: .55; }
.camara-cartao { overflow: hidden; border-top: 4px solid var(--estado); }
.camara-cartao.inativa { opacity: .7; }
.camara-ilustracao { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .9rem 1rem .25rem;
  background: linear-gradient(180deg, var(--estado-fundo), #fff); }
.camara-ilustracao .estado-chip { flex-shrink: 0; box-shadow: 0 1px 3px rgba(15,29,51,.12); background: #fff; }
.camara-svg { flex: 1; min-width: 0; max-width: 13rem; height: auto; display: block; margin-top: .4rem; }
.camara-svg .cs-corpo { fill: #fff; }
.camara-svg .cs-contorno { fill: none; stroke: var(--estado); stroke-width: 3; }
.camara-svg .cs-linha { stroke: var(--estado); stroke-width: 2; opacity: .45; fill: none; }
.camara-svg .cs-base { fill: #cbd5e1; }
.camara-svg .cs-vigia { fill: var(--estado-fundo); stroke: var(--estado); stroke-width: 2.5; }
.camara-svg .cs-janela { fill: var(--estado-fundo); stroke: var(--estado); stroke-width: 1.5; opacity: .9; }
.camara-svg .cs-luz { fill: var(--estado); }
.estado-em_utilizacao .camara-svg .cs-janela { fill: #bae6fd; }
@media (prefers-reduced-motion: no-preference) {
  .estado-em_utilizacao .camara-svg .cs-luz { animation: chc-pulsar 1.6s ease-in-out infinite; }
}
@keyframes chc-pulsar { 50% { opacity: .25; } }
.camara-agora { background: var(--estado-fundo); border-radius: .6rem; padding: .6rem .75rem; margin-bottom: .75rem; }
.camara-agora a { color: var(--estado-texto); }
.camara-agora .progress { height: .45rem; background: rgba(255,255,255,.8); }
.camara-agora .progress-bar { background: var(--estado); }
.camara-agora .progress-bar.excedida { background: #dc2626; }
.camara-factos { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .83rem; color: var(--chc-texto-suave);
  border-top: 1px dashed var(--chc-linha); padding-top: .6rem; }
.camara-factos i { margin-right: .2rem; }

/* ---------- Registo de enfermagem (tablet) ----------
   Alvos de toque grandes (>= 3.5rem), barra da sessão fixa com cronómetro e ações de estado, registo rápido em mosaicos. */
.btn-tablet { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-tablet-xl { min-height: 4.5rem; font-size: 1.35rem; font-weight: 600; }
.registo-enfermagem .form-control-lg, .registo-enfermagem .form-select-lg { min-height: 3.5rem; }
.registo-enfermagem textarea.form-control-lg { min-height: 5rem; }
.registo-enfermagem .card h2.h5 i { color: var(--chc-oceano); margin-right: .3rem; }
.registo-enfermagem #linha-temporal-titulo i { color: var(--chc-oceano); margin-right: .3rem; }

.sessao-barra {
  position: sticky; top: 3.6rem; z-index: 1010; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center;
  background: #fff; border: 1px solid var(--chc-linha); border-left: 6px solid var(--sb-cor, #94a3b8);
  border-radius: var(--chc-raio); box-shadow: var(--chc-sombra-hover); padding: .85rem 1rem; margin-bottom: 1rem;
}
.sessao-em_curso { --sb-cor: #0284c7; }
.sessao-interrompida { --sb-cor: #d97706; background: #fffbeb; }
.sessao-agendada { --sb-cor: #16a34a; }
.sb-paciente { flex: 1 1 18rem; min-width: 0; }
.sb-camara { font-size: .95rem; font-weight: 600; background: var(--chc-oceano-claro); color: var(--chc-oceano);
  padding: .15em .55em; border-radius: .4rem; vertical-align: middle; }
.sb-cronometro { display: flex; align-items: center; gap: .7rem; --sb-tempo-cor: var(--sb-cor); }
.sb-cronometro.excedida { --sb-tempo-cor: #dc2626; }
.sb-anel { width: 4rem; height: 4rem; flex-shrink: 0; }
.sb-anel circle { fill: none; stroke-width: 5; }
.sb-anel-fundo { stroke: #e5eaf0; }
.sb-anel-arco { stroke: var(--sb-tempo-cor); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dasharray .9s linear; }
.sb-anel-pct { font-size: 11px; font-weight: 700; fill: var(--bs-body-color); text-anchor: middle; dominant-baseline: central; }
.sb-tempo { font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.01em; }
.sb-cronometro.excedida .sb-tempo { color: #dc2626; }
.sb-previsto { color: var(--chc-texto-suave); font-size: .85rem; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.sb-cronometro.excedida .sb-previsto { color: #dc2626; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .sb-anel-arco { transition: none; } }
.sb-acoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.sb-interromper { flex-basis: 100%; }
.sb-interromper form { padding-top: .5rem; border-top: 1px dashed var(--chc-linha); }

/* Mosaicos do registo rápido: texto escuro sobre branco e faixa na cor configurada, legível com qualquer cor escolhida. */
.eventos-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); grid-auto-flow: dense; gap: .75rem; }
.evento-mosaico { display: flex; flex-direction: column; gap: .5rem; padding: .5rem; border-radius: .8rem;
  background: color-mix(in srgb, var(--evento-cor) 8%, #fff); border: 1px solid color-mix(in srgb, var(--evento-cor) 30%, #fff); }
.evento-mosaico.com-campos { grid-column: span 2; }
.evento-botao {
  flex: 1; min-height: 5.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  border: 0; border-radius: .6rem; background: #fff; color: var(--bs-body-color); font-size: 1.15rem; font-weight: 600;
  box-shadow: inset 0 -4px 0 var(--evento-cor), 0 1px 2px rgba(15,29,51,.08); transition: transform .08s, box-shadow .15s;
  touch-action: manipulation; padding: .6rem;
}
.evento-botao i { font-size: 1.8rem; color: var(--evento-cor); }
.evento-botao:hover { box-shadow: inset 0 -6px 0 var(--evento-cor), 0 4px 12px rgba(15,29,51,.12); }
.evento-botao:active { transform: scale(.97); }
.evento-botao:disabled { opacity: .55; }
.evento-botao:focus-visible { outline: 3px solid var(--evento-cor); outline-offset: 2px; }
.gravidades { display: flex; flex-wrap: wrap; gap: .35rem; }
.gravidades .btn { flex: 1; min-height: 3rem; font-weight: 500; }
.checklist-linha { padding: .6rem 0; border-bottom: 1px solid var(--chc-linha); }
.cartao-terminar { border-top: 4px solid #16a34a; }

/* Linha temporal: hora em destaque e o registo acabado de criar realçado por instantes. */
#lista-eventos .list-group-item { padding: .8rem 1rem; }
#lista-eventos .evento-novo { animation: chc-novo 2.5s ease-out; }
@keyframes chc-novo { from { background: #d1fae5; } to { background: inherit; } }
@media (prefers-reduced-motion: reduce) { #lista-eventos .evento-novo { animation: none; outline: 2px solid #16a34a; } }
@media (max-width: 991.98px) {
  .sessao-barra { top: 3.4rem; }
}

/* Resumo da sessão no topo do registo de enfermagem (paciente, prescrição, parâmetros, câmara, próximas sessões). */
.resumo-sessao .resumo-titulo { text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; color: var(--chc-texto-suave); font-weight: 700; }
.resumo-sessao .resumo-titulo i { color: var(--chc-oceano); margin-right: .25rem; }
.resumo-dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; margin: 0; }
.resumo-dl dt { font-weight: 500; color: var(--chc-texto-suave); }
.resumo-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.resumo-valor { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.resumo-proximas { border-top: 1px dashed var(--chc-linha); padding-top: .75rem; }
.resumo-chip { display: inline-block; margin: 0 .35rem .35rem 0; padding: .35rem .7rem; border-radius: 999px; background: var(--chc-oceano-claro);
  color: var(--chc-oceano); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.resumo-chip:hover { filter: brightness(.95); }

/* Consultas de hoje no dashboard: quem já chegou em destaque; o resto do dia esbatido (o estado lê-se sempre por texto). */
.dia-consultas { margin-top: .75rem; display: flex; flex-direction: column; gap: .3rem; }
.dc-titulo { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #15803d; margin-top: .25rem; }
.dc-titulo-resto { color: var(--chc-texto-suave); margin-top: .6rem; }
.dc-linha { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .6rem; align-items: center; padding: .45rem .7rem; border-radius: .5rem;
  color: inherit; text-decoration: none; border: 1px solid transparent; }
.dc-linha:hover { background: var(--chc-oceano-claro); }
.dc-hora { font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-quem { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-sub { display: block; font-size: .8rem; color: var(--chc-texto-suave); overflow: hidden; text-overflow: ellipsis; }
.dc-estado { font-size: .8rem; text-align: right; white-space: nowrap; }
.dc-presente { background: #ecfdf3; border-color: #86efac; border-left: 5px solid #16a34a; font-size: 1.05rem; }
.dc-presente .dc-estado { color: #15803d; font-weight: 600; display: flex; flex-direction: column; align-items: flex-end; }
.dc-espera { font-weight: 500; color: var(--chc-texto-suave); }
.dc-espera.longa { color: #b45309; font-weight: 700; }
.dc-reservada, .dc-confirmada { opacity: .62; }
.dc-concluida, .dc-falta { opacity: .4; }
.dc-falta .dc-quem { text-decoration: line-through; }
.dc-linha:not(.dc-presente):hover { opacity: 1; }
.table tr.consulta-presente > td { background: #ecfdf3; font-weight: 600; }
.table tr.consulta-presente > td:first-child { box-shadow: inset 5px 0 0 #16a34a; }
.table tr.consulta-esbatida > td { opacity: .5; }

/* Filtros dinâmicos (js/filtros.js): sem botão de submeter e indicação discreta enquanto a lista atualiza. */
.filtro-botao-oculto { display: none !important; }
main.principal.a-filtrar .table, main.principal.a-filtrar .list-group, main.principal.a-filtrar .card { opacity: .55; transition: opacity .15s; }

/* Registo clínico: cabeçalho, separadores com indicação de preenchimento, cartão único e painel lateral fixo. */
.rc-cabecalho { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.rc-tipo { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--chc-oceano); }
.rc-estado { font-size: .78rem; }
.rc-estado-rascunho { background: #fef3c7; color: #92400e; }
.rc-estado-finalizado { background: #dcfce7; color: #166534; }
.rc-estado-anulado { background: #e5e7eb; color: #374151; }
.rc-separadores { gap: .25rem; border-bottom: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.rc-separadores .nav-link { display: flex; align-items: center; gap: .4rem; white-space: nowrap; border: 1px solid var(--chc-linha);
  border-bottom: 0; border-radius: .6rem .6rem 0 0; background: #f6f9fb; color: var(--chc-texto-suave); font-weight: 600; padding: .6rem 1rem; }
.rc-separadores .nav-link.active { background: #fff; color: var(--chc-oceano); box-shadow: inset 0 3px 0 var(--chc-oceano); }
.rc-cheio { width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid #cbd5e1; }
.rc-cheio.sim { background: #16a34a; border-color: #16a34a; }
.rc-cartao { border-top-left-radius: 0; }
.rc-cartao .card-body { padding: 1.4rem; }
/* Filtros do histórico do paciente: chips com o aspeto dos separadores principais. */
.rc-filtros { gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.rc-filtros .nav-link { display: flex; align-items: center; gap: .3rem; white-space: nowrap; border: 1px solid var(--chc-linha); border-radius: 2rem;
  background: #f6f9fb; color: var(--chc-texto-suave); font-weight: 600; font-size: .78rem; padding: .2rem .6rem; }
.rc-filtros .nav-link:hover { background: #eef4f8; }
.rc-filtros .nav-link.active { background: var(--chc-oceano); border-color: var(--chc-oceano); color: #fff; }
.rc-n { font-size: .68rem; font-weight: 700; background: rgba(15, 23, 42, .08); border-radius: 1rem; padding: 0 .45rem; }
.rc-filtros .nav-link.active .rc-n { background: rgba(255, 255, 255, .25); }
.historico .hist-passado { background: #fbfcfd; }
.historico .hist-hoje { border-left: 3px solid #16a34a; }
.historico .hist-futuro { border-left: 3px solid #0dcaf0; }
/* Conta do paciente (separador «Faturação»): vistas e documentos com cabeçalho e linhas. */
.conta-vistas { gap: .35rem; }
.conta-vistas .nav-link { font-weight: 600; color: var(--chc-texto-suave); border-radius: .6rem; padding: .5rem 1rem; }
.conta-vistas .nav-link.active { background: var(--chc-oceano); color: #fff; }
.doc-titulo { width: 100%; padding: .8rem 1rem; border: 0; border-radius: inherit; }
.doc-titulo:hover { background: #f6f9fb; }
.doc-seta { transition: transform .15s ease; color: var(--chc-texto-suave); }
.doc-titulo[aria-expanded="true"] .doc-seta { transform: rotate(90deg); }
.doc-linhas thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--chc-texto-suave); }
.rc-campo { margin-bottom: 1rem; }
.rc-campo textarea, textarea.rc-auto { resize: vertical; min-height: 2.6rem; overflow: hidden; }
.rc-subtitulo { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--chc-texto-suave); margin: 1.25rem 0 .6rem; }
.rc-diagnosticos { display: grid; gap: .4rem; }
.rc-diag, .rc-diag-cabecalho { display: grid; grid-template-columns: 1fr; gap: .4rem; }
@media (min-width: 768px) { .rc-diag, .rc-diag-cabecalho { grid-template-columns: 3fr 1.3fr; } }
.rc-diag-cabecalho span { font-size: .75rem; color: var(--chc-texto-suave); padding-left: .2rem; }
.rc-bloco { border: 1px solid var(--chc-linha); border-radius: .6rem; padding: .9rem 1rem; height: 100%; background: #fbfcfd; }
.rc-bloco-sim { border-color: #86efac; background: #f0fdf4; }
.rc-bloco-alerta { border-color: #fca5a5; background: #fef2f2; }
.rc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.rc-lateral { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: 1rem; }
.rc-lateral .card-body { padding: 1rem 1.1rem; }
.rc-acoes { border-color: var(--chc-oceano); }
.rc-dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0 0 .4rem; font-size: .92rem; }
.rc-dl dt { color: var(--chc-texto-suave); font-weight: 500; }
.rc-dl dd { margin: 0; overflow-wrap: anywhere; }
.rc-anterior { display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; padding: .45rem .5rem; border-radius: .4rem; color: inherit; text-decoration: none; }
.rc-ato { display: block; padding: .45rem .5rem; border-radius: .4rem; color: inherit; text-decoration: none; }
.rc-ato:hover { background: var(--chc-oceano-claro); }
.rc-anterior:hover { background: var(--chc-oceano-claro); }
.rc-anterior-motivo { grid-column: 1 / -1; font-size: .85rem; color: var(--chc-texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-anular summary { cursor: pointer; }
@media (max-width: 991.98px) { .rc-lateral { position: static; } }
.sb-efetiva .sb-tempo { color: #15803d; }
