/* Decyra360 - sistema visual
   Paleta derivada do logotipo e da direcao visual da Decyra (Business
   Advisory): azul-marinho Decyra (#152b3d -> #2f5677) como cor de marca
   (menu lateral, login, cabecalhos), teal Decyra (#2a6665) como cor de acento
   (botoes de acao, item ativo, separadores), cobre (#b58059) como destaque
   pontual (canto do simbolo, sobretitulos, graficos) e um creme quente
   (#f5f2ec) como fundo. Os nomes historicos dos tokens (--navy-* = tons da
   marca, --teal = acento, --teal-dark = acento para texto/sucesso) mantem-se
   para nao ser preciso mexer em todas as paginas herdadas do Comunilog360.
   Sobre o acento usa-se texto branco. */

:root {
  --navy-900: #152b3d;
  --navy-800: #1c3850;
  --navy-700: #244663;
  --navy-600: #2f5677;
  --teal: #2a6665;
  --teal-dark: #24605e;
  --copper: #b58059;
  --cream: #f5f2ec;
  --orange: #f5a623;
  --red: #e8483f;

  --bg: #f5f2ec;
  --card-bg: #ffffff;
  --text: #1b2733;
  --text-muted: #64748b;
  --border: #e4dfd5;
  --heading: var(--navy-900);
  --hover-bg: #efebe3;
  --shadow: 0 1px 2px rgba(21, 43, 61, 0.06), 0 4px 14px rgba(21, 43, 61, 0.06);
  --shadow-lg: 0 10px 30px rgba(21, 43, 61, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 258px;

  --quad-fazer-bg: #fdeceb;
  --quad-agendar-bg: #e6efee;
  --quad-delegar-bg: #fdf3e0;
  --quad-eliminar-bg: #f1f3f5;

  --disc-d-bg: #fdeceb;
  --disc-i-bg: #fdf3e0;
  --disc-s-bg: #e6efee;
  --disc-c-bg: #e8edf3;
}

/* Dark mode - alterna via [data-theme] no <html>, definido em cada pagina
   por um pequeno script inline no <head> (antes do 1o paint, para nao haver
   flash de tema claro) e mudado em runtime pelo seletor no topo (shell.js).
   So os tokens semanticos mudam - os tons de marca (--navy-*, --teal, etc.)
   mantêm-se, por isso a sidebar/login continuam com o mesmo azul em ambos. */
:root[data-theme="dark"] {
  --bg: #0d1824;
  --card-bg: #142231;
  --text: #dbe4ec;
  --text-muted: #8b9aab;
  --border: #253647;
  --heading: #f1f5f9;
  --hover-bg: #1b2c3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  --quad-fazer-bg: rgba(232, 72, 63, 0.14);
  --quad-agendar-bg: rgba(63, 143, 139, 0.14);
  --quad-delegar-bg: rgba(245, 166, 35, 0.14);
  --quad-eliminar-bg: rgba(255, 255, 255, 0.05);

  --disc-d-bg: rgba(232, 72, 63, 0.14);
  --disc-i-bg: rgba(245, 166, 35, 0.14);
  --disc-s-bg: rgba(63, 143, 139, 0.14);
  --disc-c-bg: rgba(47, 86, 119, 0.22);

  /* Acento um pouco mais claro para continuar legivel sobre fundos escuros */
  --teal: #34807d;
  --teal-dark: #7fbdb8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--navy-700); text-decoration: none; }
:where(:root[data-theme="dark"]) a { color: #8fc9c5; }
h1, h2, h3 { font-family: inherit; }
button { font-family: inherit; }

/* =================== Ecra de carregamento inicial =================== */
/* Cobre a pagina enquanto o menu lateral/topo ainda nao foi construido
   (initShell em shell.js) - sem isto, numa ligacao lenta, via-se por alguns
   segundos a pagina "a meio" (sem menu, titulo generico "Ola!", cartoes
   escondidos). Marcado no HTML de cada pagina autenticada, mesmo antes de
   ".app-shell"; removido pelo initShell assim que o menu estiver pronto. */
.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  transition: opacity .25s ease;
}
.app-loading-overlay--hide { opacity: 0; pointer-events: none; }
.app-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: app-loading-spin .8s linear infinite;
}
.app-loading-overlay p { margin: 0; font-size: .9rem; font-weight: 600; color: var(--heading); }
@keyframes app-loading-spin { to { transform: rotate(360deg); } }

/* =================== Logo mark (reutilizado no header/sidebar/login) =================== */
.brand-mark { display: flex; align-items: center; gap: .6rem; }
.brand-mark__blocks { flex-shrink: 0; }
.brand-mark__text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.brand-mark--on-dark .brand-mark__text { color: #fff; }
.brand-mark__sub {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}
.brand-mark--on-dark .brand-mark__sub { color: rgba(255,255,255,.55); }

/* =================== Auth / login =================== */
.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-visual {
  flex: 1.1;
  position: relative;
  background: linear-gradient(155deg, var(--navy-900) 0%, var(--navy-700) 65%, var(--navy-600) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem;
  overflow: hidden;
}
.auth-visual--imagem { background-size: cover; background-position: center; }
.auth-visual--imagem .auth-visual__shapes { display: none; }
.auth-visual__shapes { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.auth-visual__content { position: relative; z-index: 1; max-width: 460px; }
.auth-visual__content .brand-mark__text { font-size: 2rem; }
.auth-visual__tagline {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255,255,255,.82);
}
.auth-visual__apps { margin-top: 2.5rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.auth-visual__app-chip {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  padding: .4rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  color: rgba(255,255,255,.85);
}

.auth-form-panel {
  width: 440px;
  flex-shrink: 0;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-form-panel__inner { width: 100%; max-width: 320px; }
.auth-form-panel .brand-mark { margin-bottom: 2.2rem; }
.auth-form-panel h1 { margin: 0 0 .3rem; font-size: 1.4rem; color: var(--heading); }
.auth-form-panel p.subtitle { margin: 0 0 1.75rem; color: var(--text-muted); font-size: .9rem; }

@media (max-width: 880px) {
  .auth-visual { display: none; }
  .auth-form-panel { width: 100%; }
}

/* =================== Forms =================== */
.field { margin-bottom: 1.1rem; }
/* Grelha de checkboxes para listas de selecao multipla mais longas (ex.:
   distritos/areas de formacao em Formadores) - evita uma coluna unica alta. */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .3rem .8rem; max-height: 180px; overflow-y: auto; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checkbox-grid label { display: flex; align-items: center; gap: .4rem; font-weight: 400; font-size: .85rem; margin: 0; }
.checkbox-grid label input[type="checkbox"] { width: auto; }
.checkbox-grid--2col { grid-template-columns: repeat(2, 1fr); }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.field .hint { display: block; font-size: .75rem; color: var(--text-muted); margin-top: .3rem; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .62rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 143, 139, 0.15);
}

button, .btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: .62rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  background: var(--navy-800);
  color: #fff;
  transition: background .15s, transform .05s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
button:hover, .btn:hover { background: var(--navy-900); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--hover-bg); color: var(--text); }
button.secondary:hover { background: #e6e1d7; }
button.danger { background: var(--red); }
button.danger:hover { background: #c9362e; }
button.accent { background: var(--teal); color: #fff; }
button.accent:hover { background: var(--teal); color: #fff; filter: brightness(.9); }
button[disabled] { opacity: .55; cursor: not-allowed; }
button.icon-btn { padding: .4rem .55rem; background: transparent; color: var(--text-muted); }
button.icon-btn:hover { background: var(--hover-bg); color: var(--text); }

.error-msg { color: var(--red); font-size: .85rem; margin-top: .8rem; min-height: 1.1em; }
.success-msg { color: var(--teal-dark); font-size: .85rem; margin-top: .8rem; min-height: 1.1em; }

/* =================== App shell (sidebar) =================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform .2s ease;
}
.sidebar-logo { padding: 1.5rem 1.5rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .9rem .8rem; }
.sidebar-section-label {
  text-transform: uppercase; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.38); margin: 1.2rem .7rem .5rem;
}
.sidebar-section-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem .8rem; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.72); font-size: .89rem; font-weight: 500;
  margin-bottom: .18rem; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--teal); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--copper); }
.nav-item .nav-icon { width: 1.2rem; text-align: center; flex-shrink: 0; }
.nav-item .nav-ext { margin-left: auto; opacity: .55; font-size: .75rem; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { border: 2px solid var(--teal); }

/* Menu expandido (ex.: "Configuracoes" agrupando Utilizadores/
   Departamentos/Equipas/Opcoes) - o botao que abre/fecha reutiliza o
   proprio estilo .nav-item, so lhe reset os defaults de <button>. */
.nav-group-toggle {
  width: 100%; background: none; border: none; font: inherit; text-align: left;
}
.nav-group-chevron { margin-left: auto; font-size: .7rem; opacity: .55; transition: transform .15s ease; }
.nav-group--aberto .nav-group-chevron { transform: rotate(90deg); }
.nav-subitems { display: none; }
.nav-group--aberto .nav-subitems { display: block; }
.nav-subitem { padding-left: 2.3rem; font-size: .85rem; }

.sidebar-footer { padding: 1rem 1.5rem 1.3rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .65rem; margin-bottom: .8rem; }
.sidebar-user .user-name { color: #fff; font-size: .86rem; font-weight: 600; line-height: 1.2; }
.sidebar-user .user-nivel { color: rgba(255,255,255,.5); font-size: .74rem; }
.sidebar-versao { color: rgba(255,255,255,.32); font-size: .68rem; margin-left: auto; white-space: nowrap; }
.sidebar-footer button { width: 100%; justify-content: center; background: rgba(255,255,255,.08); color: #fff; }
.sidebar-footer button:hover { background: rgba(255,255,255,.16); }
.sidebar-powered-by { text-align: center; font-size: .7rem; color: rgba(255,255,255,.32); margin-top: .7rem; }
.sidebar-powered-by a { color: rgba(255,255,255,.55); font-weight: 600; }
.sidebar-powered-by a:hover { color: #fff; }

.main-area { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin-left .2s ease; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: var(--card-bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 1.15rem; color: var(--heading); }
.topbar .topbar-actions { display: flex; align-items: center; gap: .8rem; }

/* Visivel sempre (nao so em mobile) - em ecra largo alterna
   .sidebar-collapsed em .app-shell (esconde a sidebar fixa e recupera o
   espaco); em ecra estreito continua a alternar .open (sidebar sobreposta,
   ver initSidebarToggle em shell.js). */
.sidebar-toggle-btn { display: inline-flex; margin-right: .3rem; flex-shrink: 0; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(21, 43, 61, .45);
  z-index: 15;
}
.sidebar-backdrop.visible { display: block; }

main.content { padding: 2rem; max-width: 1180px; width: 100%; margin: 0 auto; }

@media (min-width: 881px) {
  .app-shell.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .app-shell.sidebar-collapsed .main-area { margin-left: 0; }
}

@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .main-area { margin-left: 0; }
  .topbar { padding: 1rem 1.2rem; }
  main.content { padding: 1.2rem; }
}

/* =================== Avatar =================== */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--navy-700); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
}
.avatar.sm { width: 28px; height: 28px; font-size: .72rem; }
.avatar.lg { width: 88px; height: 88px; font-size: 1.8rem; border: 3px solid var(--card-bg); box-shadow: var(--shadow); }

/* =================== Cards / tiles =================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
}
.card h2 { margin: 0 0 .3rem; font-size: 1.05rem; color: var(--heading); }
.card .muted { color: var(--text-muted); font-size: .85rem; }
.inline-form { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.inline-form .field { margin-bottom: 0; }

.mensagem-dia-card {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(120deg, var(--navy-800) 0%, var(--navy-600) 100%);
  color: #fff;
}
.mensagem-dia-icon { font-size: 1.4rem; color: var(--teal); flex-shrink: 0; }
.mensagem-dia-card p { margin: 0; font-size: 1rem; font-weight: 600; font-style: italic; line-height: 1.5; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .8rem; }
.page-header h1 { margin: 0 0 .25rem; font-size: 1.5rem; color: var(--heading); }
.page-header p { margin: 0; color: var(--text-muted); font-size: .92rem; }
/* O texto (titulo+descricao) encolhe e quebra dentro de si proprio em vez
   de forcar a linha toda a quebrar - sem isto, um <p> mais comprido empurra
   a largura total para alem do container e o botao cai sozinho numa 2a
   linha, alinhado a esquerda (unico item nessa linha, "space-between" nao
   tem com que o distribuir). O botao fica sempre fixo a direita.
   flex-basis:0 (nao "auto") e de proposito: a decisao de quebrar linha no
   flexbox usa o tamanho NAO encolhido de cada item - com basis:auto o
   texto continua a contar a sua largura de conteudo nessa decisao e ainda
   empurra o botao para a linha de baixo mesmo por poucos pixeis; com
   basis:0 o texto conta como 0 nessa decisao (fica tudo numa linha) e so
   depois cresce (flex-grow:1) para ocupar o espaco livre. */
.page-header > div:first-child { flex: 1 1 0; min-width: 0; }
.page-header > button, .page-header > a.btn { flex-shrink: 0; }

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}
.tile {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  border-left: 4px solid var(--teal);
  transition: transform .12s, box-shadow .12s;
  display: block;
  color: var(--text);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile .tile-icon { font-size: 1.7rem; margin-bottom: .7rem; display: block; }
.tile h3 { margin: 0 0 .3rem; font-size: 1.02rem; color: var(--heading); }
.tile p { margin: 0; font-size: .84rem; color: var(--text-muted); }
.tile .tile-open { margin-top: .9rem; font-size: .78rem; font-weight: 700; color: var(--teal-dark); }

.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* =================== Links uteis =================== */
.link-tile {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.link-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.link-tile > a {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .6rem; padding: 1.6rem 1rem; color: var(--text);
}
.link-tile i { font-size: 1.9rem; color: var(--teal-dark); }
.link-tile span { font-size: .88rem; font-weight: 600; word-break: break-word; }
.link-tile--inativo { opacity: .5; }
.link-tile-actions {
  position: absolute; top: .5rem; right: .5rem; display: flex; gap: .2rem;
}
.link-tile-actions .icon-btn { background: var(--card-bg); box-shadow: var(--shadow); }
.link-tile-ordem {
  display: flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--card-bg); box-shadow: var(--shadow);
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
}

.icon-picker-preview { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.icon-picker-preview i { font-size: 1.6rem; color: var(--teal-dark); width: 1.8rem; text-align: center; }
.icon-picker-preview input { flex: 1; }
.icon-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .35rem;
  max-height: 160px; overflow-y: auto; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.icon-picker-btn {
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .45rem; cursor: pointer; color: var(--text);
}
.icon-picker-btn:hover { background: #f5f2ec; border-color: var(--teal); }

/* =================== Medalhas =================== */
.minhas-medalhas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem;
}
.minha-medalha {
  background: var(--bg); border-radius: var(--radius); padding: 1.1rem .9rem; text-align: center;
}
.minha-medalha i { font-size: 1.8rem; margin-bottom: .5rem; display: block; }
.minha-medalha-nome { font-size: .86rem; font-weight: 700; }
.minha-medalha-meta { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.minha-medalha-msg { font-size: .76rem; color: var(--text-muted); font-style: italic; margin-top: .4rem; }

/* =================== RH / Ponto =================== */

.ponto-widget { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .7rem; }
.ponto-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem .6rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}
.ponto-card i { font-size: 1.3rem; color: var(--navy-800); }
.ponto-card-label { font-size: .76rem; color: var(--text-muted); font-weight: 600; }
.ponto-card--pendente:hover { border-color: var(--teal); background: #edf4f3; }
.ponto-card--pendente:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.ponto-card--a-processar { opacity: .55; pointer-events: none; }
.ponto-card-hora {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .8rem; text-align: center; background: var(--card-bg); color: var(--text);
  padding: .3rem .4rem; width: 100%;
}
.ponto-card--feito {
  background: #e1f5ee; cursor: default;
}
.ponto-card--feito i { color: var(--teal-dark); }
.ponto-card--feito .ponto-card-label { color: var(--teal-dark); }
.ponto-card-time { font-size: 1rem; font-weight: 700; color: var(--teal-dark); }
.ponto-card--bloqueado { background: #eef1f5; cursor: default; }
.ponto-card--bloqueado i { color: var(--text-muted); }
.ponto-card--bloqueado .ponto-card-label { color: var(--text-muted); }
.ponto-card-bloqueio-motivo { font-size: .74rem; color: var(--text-muted); font-weight: 600; }

.rh-topo-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.2fr); gap: 1.5rem; align-items: stretch; margin-bottom: 1.4rem; }
.rh-topo-grid > .card { margin-bottom: 0; display: flex; flex-direction: column; }
.rh-topo-grid > .card > div:last-child { display: flex; flex-direction: column; justify-content: center; flex: 1; }
@media (max-width: 860px) { .rh-topo-grid { grid-template-columns: 1fr; } }

.rh-tabs { display: flex; gap: .3rem; margin: -.5rem 0 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
/* background/border-radius: 0 - o reset generico de <button> (ver "button, .btn")
   preenche a navy solida por omissao; .rh-tab era so usado em <a> ate agora
   (navegacao entre paginas do RH), que nunca precisou destas por nao ser afetado
   por esse seletor - agora tambem usado em <button> para separadores dentro da
   mesma pagina (ver recursos.html), por isso tem de anular esse reset aqui. */
.rh-tab { padding: .6rem 1rem; font-size: .85rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-radius: 0; }
.rh-tab:hover { color: var(--navy-800); background: none; }
.rh-tab.active { color: var(--teal-dark); border-bottom-color: var(--teal-dark); }

/* Contagem por separador - mais discreta que .nav-badge (usada no menu
   lateral): inline junto ao texto, sem cor de alarme, so para indicar a que
   separador uma contagem do menu diz respeito. */
.rh-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: .4rem;
  background: var(--hover-bg); color: var(--text-muted); font-size: .65rem; font-weight: 700;
  border-radius: 8px; vertical-align: middle;
}
.rh-tab.active .rh-tab-badge { background: var(--teal); color: #fff; }

.rh-cal-topo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.rh-cal-topo h2 { margin: 0; text-align: center; }
.rh-cal-topo .icon-btn { font-size: .85rem; padding: .4rem .7rem; }
.rh-cal-topo .icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.rh-cal-cabecalho { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; margin: 0 0 .4rem; width: 100%; }
.rh-cal-cabecalho span { text-align: center; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.rh-calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; width: 100%; }
.rh-cal-vazia { visibility: hidden; }
.rh-cal-dia {
  aspect-ratio: 1; max-height: 52px; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: .88rem; font-weight: 700; cursor: default;
}
.rh-cal-dia--clicavel { cursor: pointer; transition: transform .1s; }
.rh-cal-dia--clicavel:hover { transform: scale(1.08); box-shadow: 0 0 0 1px rgba(21, 43, 61,.15); }
.rh-cal-dia--futuro { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); font-weight: 400; }
.rh-cal-dia--fim-semana { background: #eef1f5; color: var(--text-muted); font-weight: 400; }
.rh-cal-dia--feriado { background: #f5c6c2; color: #a3372c; font-weight: 600; }
.rh-cal-dia--ausente { background: #fce1c3; color: #c1720d; }
.rh-cal-dia--completo { background: #dcebe9; color: var(--teal-dark); }
.rh-cal-dia--incompleto { background: #fdf3e0; color: var(--orange); }
.rh-cal-dia--pendente { background: #fdeeee; color: var(--red); }
.rh-cal-dia--hoje { box-shadow: 0 0 0 2px var(--navy-700) inset; }
.rh-cal-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem .9rem; margin-top: .9rem; width: 100%; }
.rh-cal-legenda-item { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--text-muted); }
.rh-cal-legenda-cor { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* Matriz de assiduidade da equipa (grelha utilizador x dia do mes) */
.rh-matriz-scroll { overflow-x: auto; width: 100%; }
.rh-matriz-tabela { border-collapse: separate; border-spacing: 3px; }
.rh-matriz-tabela th { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-align: center; padding-bottom: .3rem; }
.rh-matriz-tabela th.rh-matriz-dia-cabecalho--fds { color: var(--navy-600); }
.rh-matriz-utilizador-col {
  position: sticky; left: 0; background: var(--card-bg); z-index: 1;
  text-align: left !important; padding: 0 .8rem 0 0 !important; font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.rh-matriz-dia { width: 20px; height: 20px; border-radius: 4px; padding: 0; cursor: default; }
.rh-matriz-tooltip {
  display: none; position: fixed; z-index: 200; pointer-events: none;
  background: var(--navy-900); color: #fff; font-size: .75rem; font-weight: 600;
  padding: .35rem .6rem; border-radius: 6px; box-shadow: var(--shadow-lg); white-space: nowrap;
}
.rh-matriz-dia--futuro { background: transparent; border: 1px dashed var(--border); }
.rh-matriz-dia--fim-semana { background: #eef1f5; }
.rh-matriz-dia--ausente { background: #fce1c3; }
.rh-matriz-dia--feriado { background: #f5c6c2; }
.rh-matriz-dia--completo { background: #dcebe9; }
.rh-matriz-dia--incompleto { background: #fdf3e0; }
.rh-matriz-dia--pendente { background: #fdeeee; }
.rh-matriz-acoes-col {
  position: sticky; right: 0; background: var(--card-bg); z-index: 1;
  padding: 0 0 0 .6rem !important; text-align: left !important;
}
.rh-matriz-alerta-btn { padding: .25rem .5rem; font-size: .8rem; white-space: nowrap; }
.rh-matriz-alerta-btn:disabled { opacity: .5; cursor: default; }

/* Ausencias e ferias por dia (RH > Ausencia e Ferias) */
.rh-ausencias-mes-dia { white-space: nowrap; font-weight: 700; width: 1%; }
.rh-ausencias-mes-fds { background: var(--hover-bg); }
.rh-ausencias-mes-feriado { background: #f5c6c2; }
#ausencias-mes-container .ausencia-badge { margin: .15rem .35rem .15rem 0; }

.ausencia-badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.ausencia-badge--ferias { background: #e8edf3; color: var(--navy-600); }
.ausencia-badge--ausencia { background: #fdeeee; color: var(--red); }
.ausencia-badge--pendente { background: #fdf3e0; color: var(--orange); }
.ausencia-badge--aprovada { background: #e9f2f1; color: var(--teal-dark); }
.ausencia-badge--rejeitada { background: #fdeeee; color: var(--red); }

.ausentes-list { display: flex; flex-direction: column; gap: .1rem; }
.ausentes-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.ausentes-item:last-child { border-bottom: none; }
.ausentes-item-nome { font-size: .89rem; font-weight: 600; }
.aniversario-item-info { display: flex; align-items: center; gap: .6rem; }

/* =================== Tables =================== */
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th, td { text-align: left; padding: .7rem .65rem; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--hover-bg); }
td.actions-col { text-align: right; white-space: nowrap; }
.row-user { display: flex; align-items: center; gap: .6rem; }

/* =================== Documentos (RH) =================== */
.doc-categorias-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.doc-categoria-card { margin-bottom: 0; }
.doc-lista { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.doc-lista li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.doc-lista li a { color: var(--text); display: flex; align-items: center; gap: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doc-lista li .icon-btn { padding: .2rem .4rem; flex-shrink: 0; }

/* =================== Informacoes (RH) =================== */
.info-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.25rem; }
.info-form-grid .field { margin-bottom: 1rem; }

/* =================== Badges =================== */
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-nivel-Administrador { background: #fde7e6; color: #b1362c; }
.badge-nivel-Gestor { background: #fdf0dc; color: #a5620a; }
.badge-nivel-Utilizador { background: #e2f5f2; color: #0f766e; }
.badge-ativo { background: #e2f5f2; color: #0f766e; }
.badge-inativo { background: #f1f2f4; color: #6b7280; }
.badge-onboarding { background: #e8edf3; color: var(--navy-600); }
.badge-offboarding { background: #fdf0dc; color: #a5620a; }
.badge-op-INSERT { background: #e2f5f2; color: #0f766e; }
.badge-op-UPDATE { background: #fdf0dc; color: #a5620a; }
.badge-op-DELETE { background: #fde7e6; color: #b1362c; }
.badge-op-REPLACE { background: #e8edf3; color: var(--navy-600); }
.badge-op-ACESSO_CRITICO { background: #f1e9fb; color: #6b3fa0; }
.badge-estado-nova { background: #e8edf3; color: var(--navy-600); }
.badge-estado-em_analise { background: #fdf0dc; color: #a5620a; }
.badge-estado-aprovada { background: #e2f5f2; color: #0f766e; }
.badge-estado-rejeitada { background: #fde7e6; color: #b1362c; }
.badge-estado-implementada { background: #f1ebfc; color: #6d28d9; }
.badge-estado-reportada { background: #fde7e6; color: #b1362c; }
.badge-estado-resolvida { background: #e2f5f2; color: #0f766e; }
.badge-estado-criado { background: #e8edf3; color: var(--navy-600); }
.badge-estado-contactado { background: #fdf0dc; color: #a5620a; }
.badge-estado-fechado { background: #e2f5f2; color: #0f766e; }
.badge-estado-nao_fechado { background: #fde7e6; color: #b1362c; }

/* Separador de secao dentro de um formulario (ex.: modal de regra de evento
   do Calendario, ou mudar estado de uma TUI) */
.form-section-label {
  text-transform: uppercase; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); margin: 1.3rem 0 .6rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
}
.form-section-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* =================== Pagina TUI (ideias.html) =================== */
.ideia-timeline-item { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.ideia-timeline-item:last-child { border-bottom: none; }
.ideia-timeline-item-estado { font-size: .88rem; font-weight: 700; color: var(--heading); }
.ideia-timeline-item-meta { font-size: .76rem; color: var(--text-muted); margin-top: .1rem; }
.ideia-timeline-item-comentario { font-size: .85rem; color: var(--text); margin-top: .4rem; background: var(--hover-bg); border-radius: var(--radius-sm); padding: .6rem .75rem; }

/* =================== Pagina Mural (mural.html) =================== */
.anuncio-card { margin-bottom: 1rem; }
.anuncio-card--novo { border-left: 3px solid var(--teal); }
.anuncio-card--afixado { background: #fff8e6; border: 1px solid #f5d98b; }
.anuncio-afixado-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #a86a00; background: #fdebbf; padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; margin-right: .3rem; }
.anuncio-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.anuncio-card-header h2 { margin: 0; font-size: 1.05rem; color: var(--heading); }
.anuncio-card-actions { flex-shrink: 0; display: flex; gap: .3rem; }
.anuncio-card-meta { font-size: .78rem; color: var(--text-muted); margin: .3rem 0 .8rem; }
.anuncio-card-audiencia { font-style: italic; margin-top: -0.5rem; }
.anuncio-card-conteudo { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.anuncio-card-url { margin: .6rem 0 0; overflow-wrap: anywhere; }
.anuncio-card-url a { color: var(--teal); }
.anuncio-card-anexos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.anuncio-card-anexo {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600;
  color: var(--teal-dark); background: var(--hover-bg); border-radius: 20px; padding: .3rem .75rem .3rem .6rem;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anuncio-card-anexo:hover { background: #e3e9ef; }

/* =================== Pagina Recursos (recursos.html) =================== */
.recurso-campo-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .89rem; }
.recurso-campo-row:last-child { border-bottom: none; }
.recurso-campo-row .recurso-campo-label { color: var(--text-muted); }
.tipo-campo-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; padding: .7rem; background: var(--hover-bg); border-radius: var(--radius-sm); margin-bottom: .6rem; }
.tipo-campo-row .field { margin-bottom: 0; flex: 1; min-width: 140px; }
.tipo-campo-row .tipo-campo-obrigatorio { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 400; white-space: nowrap; padding-top: 1.6rem; }

/* Resumo do Mural no Dashboard - so pre-visualizacao, nunca marca como lido */
.mural-dashboard-item { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.mural-dashboard-item:last-child { border-bottom: none; }
.mural-dashboard-item-titulo { font-weight: 700; color: var(--heading); font-size: .92rem; }
.mural-dashboard-item-conteudo { margin: .3rem 0; color: var(--text); font-size: .88rem; }
.mural-dashboard-item-meta { font-size: .76rem; color: var(--text-muted); }
.mural-dashboard-ver-todos { display: inline-block; margin-top: .8rem; font-size: .85rem; font-weight: 600; color: var(--teal-dark); }

/* =================== Modal =================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(21, 43, 61, .45);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 100;
}
.modal {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 1.05rem; color: var(--heading); }
.modal-body { padding: 1.5rem; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }

/* =================== Logs de auditoria =================== */
.log-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }
.log-detalhes-pre {
  white-space: pre-wrap; word-break: break-word; font-size: .82rem;
  background: var(--bg); color: var(--text); padding: 1rem; border-radius: var(--radius-sm);
  max-height: 60vh; overflow: auto; margin: 0;
}

/* =================== Utils =================== */
.muted { color: var(--text-muted); font-size: .85rem; }
.text-right { text-align: right; }
.flex-row { display: flex; align-items: center; gap: .6rem; }
.avatar-upload-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== Sub-tabs (dentro de um modulo, ex.: STVendas) =================== */
.subtabs { display: flex; gap: .4rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.subtab-btn {
  background: none; color: var(--text-muted); padding: .6rem 1rem;
  border-radius: 8px 8px 0 0; font-weight: 600; font-size: .88rem;
}
.subtab-btn:hover { background: var(--hover-bg); color: var(--text); }
.subtab-btn--active, .subtab-btn--active:hover { background: var(--card-bg); color: var(--navy-800); box-shadow: 0 -1px 0 var(--card-bg), 0 2px 0 var(--teal); }

/* =================== Filtros =================== */
.filters {
  display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end;
  background: var(--card-bg); padding: 1.1rem 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.filters .field { margin-bottom: 0; min-width: 150px; }
.month-year-pair { display: flex; gap: .4rem; }
.month-year-pair select { flex: 1; min-width: 0; }
.list-link-row { margin-bottom: 1.25rem; }

/* =================== KPIs =================== */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.kpi-card .label { color: var(--text-muted); font-size: .8rem; margin-bottom: .35rem; }
.kpi-card .value { font-size: 1.6rem; font-weight: 700; color: var(--heading); }

/* =================== Graficos =================== */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.25rem; }
.chart-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.chart-card h3 { margin: 0 0 .8rem; font-size: 1rem; color: var(--heading); }
.chart-card canvas { max-height: 320px; }
.chart-tall-wrap { position: relative; height: 640px; }
.chart-tall-wrap canvas { max-height: none; }

/* Lista de pendencias (Mentoria > Progresso) */
.pendente-lista { display: flex; flex-direction: column; gap: .5rem; }
.pendente-item {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem;
  border-radius: var(--radius-sm); background: var(--hover-bg); cursor: pointer;
  transition: background .15s, transform .1s;
}
.pendente-item:hover { background: var(--border); transform: translateX(2px); }
.pendente-icone {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.pendente-texto { font-size: .88rem; color: var(--text); flex: 1; }
.pendente-chevron { color: var(--text-muted); font-size: .75rem; }
.pendente-vazio {
  display: flex; align-items: center; gap: .6rem; padding: .6rem 0;
  color: var(--teal-dark); font-size: .92rem; font-weight: 600;
}
.pendente-vazio i { font-size: 1.3rem; }

/* =================== Badges de role (modulos com permissoes proprias) =================== */
.badge-role-admin { background: #fde7e6; color: #b1362c; }
.badge-role-gestor { background: #e6ecfd; color: #3546c9; }
.badge-role-responsavel { background: #fdf0dc; color: #a5620a; }
.badge-role-comercial { background: #e2f5f2; color: #0f766e; }

/* =================== Notificacoes (sino no topo, todas as paginas) =================== */
.notif-bell-wrap { position: relative; }
.notif-bell-btn { position: relative; font-size: 1.05rem; padding: .45rem .55rem; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card-bg);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.notif-dropdown-header .icon-btn { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.notif-item {
  display: flex; align-items: flex-start; gap: .3rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text); transition: background .12s;
}
.notif-item:hover { background: var(--hover-bg); }
.notif-item:last-child { border-bottom: none; }
.notif-item--unread { background: #f0faf8; }
.notif-item--unread:hover { background: #e7f6f3; }
.notif-item-link { display: block; flex: 1; min-width: 0; color: inherit; }
.notif-item-title { font-size: .87rem; font-weight: 600; margin-bottom: .15rem; }
.notif-item--unread .notif-item-title::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); margin-right: .4rem;
}
.notif-item-msg { font-size: .8rem; color: var(--text-muted); margin-bottom: .3rem; }
.notif-item-time { font-size: .72rem; color: var(--text-muted); }
.notif-item-remove {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: .7rem; line-height: 1; padding: .3rem;
  border-radius: 4px;
}
.notif-item-remove:hover { color: var(--red); background: #fdeeee; }

/* =================== Check-in de bem-estar (escala de smileys) =================== */
.humor-emoji-row { display: flex; justify-content: center; gap: .5rem; margin-top: 1.5rem; }
.humor-emoji-btn {
  background: none; border: 2px solid transparent; border-radius: 50%;
  font-size: 2rem; line-height: 1; padding: .5rem; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, border-color .12s, background .12s;
}
.humor-emoji-btn:hover { transform: scale(1.15); background: #f5f2ec; border-color: var(--teal); }
.humor-emoji-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* =================== Widget flutuante de tarefas (canto inferior direito) =================== */
/* "right" e sempre definido em JS (ver reposicionarWidgets em shell.js) -
   os widgets so ocupam o espaco dos que estao mesmo visiveis, em vez de
   cada um ter uma posicao fixa (o que deixava buracos vazios quando so
   um estava ativo). */
.tarefas-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.tarefas-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.tarefas-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.tarefas-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.tarefas-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.tarefas-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.tarefas-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.tarefa-widget-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--border);
}
.tarefa-widget-item:last-child { border-bottom: none; }
.tarefa-widget-item-info { min-width: 0; }
.tarefa-widget-item-titulo { font-size: .85rem; font-weight: 600; color: var(--text); }
.tarefa-widget-item [data-concluir-tarefa] { flex-shrink: 0; color: var(--teal-dark); font-weight: 700; }
.tarefa-widget-item [data-concluir-tarefa]:hover { background: #e7f6f3; }
.tarefa-prazo { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.tarefa-prazo--atrasada { color: var(--red); font-weight: 600; }

/* =================== Widget flutuante de eventos de hoje (canto inferior direito, ao lado do de tarefas) =================== */
.eventos-hoje-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.eventos-hoje-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.eventos-hoje-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.eventos-hoje-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--teal-dark); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.eventos-hoje-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.eventos-hoje-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.eventos-hoje-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.evento-hoje-widget-item { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.evento-hoje-widget-item:last-child { border-bottom: none; }
.evento-hoje-widget-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: .3rem; }
.evento-hoje-widget-info { min-width: 0; }
.evento-hoje-widget-titulo { font-size: .85rem; font-weight: 600; color: var(--text); }
.evento-hoje-hora { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* =================== Widget flutuante de anuncios do Mural por ler (qualquer utilizador) =================== */
.mural-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.mural-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.mural-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.mural-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.mural-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.mural-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.mural-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.mural-widget-item { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.mural-widget-item:last-child { border-bottom: none; }
.mural-widget-item-titulo { font-size: .85rem; font-weight: 600; color: var(--text); }
.mural-widget-item-meta { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* =================== Widget flutuante de ferias pendentes (canto inferior direito, ao lado do de eventos - so admin) =================== */
.ferias-pendentes-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.ferias-pendentes-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.ferias-pendentes-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.ferias-pendentes-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.ferias-pendentes-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.ferias-pendentes-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.ferias-pendentes-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.ferias-pendente-widget-item { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.ferias-pendente-widget-item:last-child { border-bottom: none; }
.ferias-pendente-widget-info { min-width: 0; }
.ferias-pendente-widget-nome { font-size: .85rem; font-weight: 600; color: var(--text); }
.ferias-pendente-widget-data { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* =================== Widget flutuante de indicacoes de negocio por fechar (canto inferior direito - quem tem acesso ao modulo) =================== */
.indicacoes-pendentes-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.indicacoes-pendentes-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: #ca8a04; color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.indicacoes-pendentes-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.indicacoes-pendentes-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.indicacoes-pendentes-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.indicacoes-pendentes-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.indicacoes-pendentes-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }

/* =================== Widget flutuante de TUIs por decidir (canto inferior direito, ao lado do de ferias - so admin) =================== */
.ideias-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.ideias-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.ideias-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.ideias-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.ideias-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.ideias-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.ideias-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }
.ideia-widget-item { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.ideia-widget-item:last-child { border-bottom: none; }
.ideia-widget-item-info { min-width: 0; }
.ideia-widget-item-titulo { font-size: .85rem; font-weight: 600; color: var(--text); }
.ideia-widget-item-meta { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* Widget de ocorrencias de Recursos - mesmo padrao visual do de TUIs, os
   itens da lista reutilizam diretamente .ideia-widget-item (identico). */
.ocorrencias-widget { position: fixed; bottom: 1.5rem; z-index: 60; transition: right .15s ease; }
.ocorrencias-widget-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .78; transition: transform .12s, opacity .12s;
}
.ocorrencias-widget-btn:hover { transform: scale(1.06); opacity: 1; }
.ocorrencias-widget-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.ocorrencias-widget-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.ocorrencias-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .88rem; color: var(--heading);
  position: sticky; top: 0; background: var(--card-bg);
}
.ocorrencias-widget-header a { font-size: .75rem; font-weight: 600; color: var(--teal-dark); }

/* =================== Pagina Tarefas =================== */
.tarefa-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--border);
}
.tarefa-item:last-child { border-bottom: none; }
.tarefa-item--concluida .tarefa-item-titulo { text-decoration: line-through; color: var(--text-muted); }
.tarefa-item-titulo { font-weight: 600; color: var(--text); }
.tarefa-item-descricao { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }
.tarefa-item-meta { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.tarefa-item-actions { flex-shrink: 0; display: flex; align-items: center; gap: .5rem; }
.tarefa-concluida-badge { font-size: .78rem; color: var(--teal-dark); font-weight: 600; white-space: nowrap; }
.tarefa-progresso-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: .4rem; }
.tarefa-progresso-fill { height: 100%; background: var(--teal); border-radius: 3px; }
.tarefa-criada-card { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.tarefa-criada-card:last-child { border-bottom: none; }
.tarefa-criada-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.tarefa-criada-progresso-texto { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.tarefa-destinatarios-list { margin-top: .7rem; display: none; }
.tarefa-destinatarios-list.aberto { display: block; }
.tarefa-destinatario-row { display: flex; align-items: center; justify-content: space-between; padding: .35rem 0; font-size: .83rem; }
.tarefa-destinatario-pendente { color: var(--text-muted); }
.tarefa-destinatario-concluida { color: var(--teal-dark); font-weight: 600; }

.table-scroll { overflow-x: auto; }

/* Classificacao da matriz de Mentoria (NA/1-4) - escala de cor vermelho a
   verde para ler o estado de relance, sem abrir cada linha. */
.classificacao-botoes { display: flex; gap: .25rem; flex-wrap: nowrap; }
.classificacao-btn {
  min-width: 28px; padding: .3rem .4rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text-muted); font-size: .74rem; font-weight: 700;
  cursor: pointer; transition: transform .1s, background .1s, color .1s, border-color .1s;
}
.classificacao-btn:hover { transform: scale(1.08); }
.classificacao-btn:disabled { cursor: default; opacity: .55; }
.classificacao-btn:disabled:hover { transform: none; }
.classificacao-btn[data-valor="NA"].ativo { background: var(--hover-bg); color: var(--text); border-color: var(--border); }
.classificacao-btn[data-valor="1"].ativo { background: var(--red); color: #fff; border-color: var(--red); }
.classificacao-btn[data-valor="2"].ativo { background: var(--orange); color: #fff; border-color: var(--orange); }
.classificacao-btn[data-valor="3"].ativo { background: #8bc34a; color: #1e3a0f; border-color: #8bc34a; }
.classificacao-btn[data-valor="4"].ativo { background: #3fb950; color: #fff; border-color: #3fb950; }

/* ---- Matriz de Eisenhower ---- */
.eisenhower-matriz { width: 100%; border-collapse: collapse; min-width: 640px; }
.eisenhower-matriz thead th {
  padding: .5rem .8rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border);
}
.eisenhower-matriz tbody th {
  padding: .8rem; font-size: .78rem; font-weight: 700; color: var(--text-muted);
  text-align: right; white-space: nowrap; vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.eisenhower-matriz td.quadrante {
  width: 50%; min-width: 260px; padding: .8rem; vertical-align: top;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.quadrante-fazer { background: var(--quad-fazer-bg); }
.quadrante-agendar { background: var(--quad-agendar-bg); }
.quadrante-delegar { background: var(--quad-delegar-bg); }
.quadrante-eliminar { background: var(--quad-eliminar-bg); }
.quadrante-sem-categoria { background: var(--hover-bg); }
.eisenhower-matriz tfoot td.quadrante-label {
  padding: .6rem .8rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); vertical-align: middle; white-space: nowrap;
}
.matriz-vazio { font-size: .8rem; color: var(--text-muted); margin: 0; }
.matriz-tarefa-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem;
  background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: .55rem .7rem; margin-bottom: .5rem;
}
.matriz-tarefa-card:last-child { margin-bottom: 0; }
.matriz-tarefa-titulo { font-size: .84rem; font-weight: 600; color: var(--text); }
.matriz-tarefa-acoes { display: flex; align-items: center; gap: .1rem; flex-shrink: 0; }
.matriz-tarefa-card [data-concluir-minha],
.matriz-tarefa-card [data-editar-minha] {
  flex-shrink: 0; border: none; background: none; cursor: pointer; color: var(--teal-dark);
  font-weight: 700; font-size: .9rem; line-height: 1; padding: .1rem .3rem; border-radius: 4px;
}
.matriz-tarefa-card [data-editar-minha] { color: var(--text-muted); }
.matriz-tarefa-card [data-concluir-minha]:hover,
.matriz-tarefa-card [data-editar-minha]:hover { background: var(--hover-bg); }

@media (max-width: 640px) {
  .eisenhower-matriz { min-width: 520px; }
}

/* ---- Modal explicativo da Matriz de Eisenhower ---- */
.eisenhower-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.eisenhower-info-card { border-radius: var(--radius-sm); padding: .8rem .9rem; }
.eisenhower-info-card h3 { margin: 0 0 .15rem; font-size: .92rem; color: var(--heading); }
.eisenhower-info-sub { margin: 0 0 .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.eisenhower-info-card p:last-child { margin: 0; font-size: .82rem; color: var(--text); }
.eisenhower-info-card.fazer { background: var(--quad-fazer-bg); }
.eisenhower-info-card.agendar { background: var(--quad-agendar-bg); }
.eisenhower-info-card.delegar { background: var(--quad-delegar-bg); }
.eisenhower-info-card.eliminar { background: var(--quad-eliminar-bg); }

@media (max-width: 480px) {
  .eisenhower-info-grid { grid-template-columns: 1fr; }
}

/* ---- Modal explicativo do DISC ---- */
.disc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.disc-info-card { border-radius: var(--radius-sm); padding: .8rem .9rem; }
.disc-info-card h3 { margin: 0 0 .15rem; font-size: .92rem; color: var(--heading); }
.disc-info-sub { margin: 0 0 .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.disc-info-card p:last-child { margin: 0; font-size: .82rem; color: var(--text); }
.disc-info-card.d { background: var(--disc-d-bg); }
.disc-info-card.i { background: var(--disc-i-bg); }
.disc-info-card.s { background: var(--disc-s-bg); }
.disc-info-card.c { background: var(--disc-c-bg); }

@media (max-width: 480px) {
  .disc-info-grid { grid-template-columns: 1fr; }
}

/* ---- Bloco de caracteristicas do resultado DISC ---- */
.disc-caract-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.disc-caract-item { background: var(--hover-bg); border-radius: var(--radius-sm); border-left: 4px solid var(--disc-accent, var(--teal)); padding: .9rem 1.1rem; }
.disc-caract-item-head { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .9rem; color: var(--heading); margin-bottom: .7rem; }
.disc-caract-item-head i { color: var(--disc-accent, var(--teal)); font-size: .85rem; width: 1em; text-align: center; }
.disc-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.disc-tag { background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px; padding: .28rem .7rem; font-size: .78rem; color: var(--text); line-height: 1.2; }

/* ---- Teste DISC: grupos de afirmações com botoes numerados ---- */
.disc-grupo-card { margin-bottom: 1rem; }
.disc-grupo-prompt { font-weight: 600; margin-bottom: .7rem; }
.disc-grupo-linha { display: flex; align-items: center; gap: .9rem; padding: .5rem 0; }
.disc-grupo-linha + .disc-grupo-linha { border-top: 1px solid var(--border); }
.disc-num-btns { display: flex; gap: .35rem; flex-shrink: 0; }
.disc-num-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--hover-bg); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.disc-num-btn:hover { background: var(--hover-bg); border-color: var(--teal); color: var(--text); }
.disc-num-btn.selected { background: var(--teal); border-color: var(--teal); color: #fff; }
.disc-num-btn.selected:hover { background: var(--teal); color: #fff; }

/* ---- RH > Relatorios > Analise de metricas e indicadores ---- */
.kpi-card.met-alerta { background: #fdeceb; }
.kpi-card .value small { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-left: .15rem; }
.met-kpi-aviso { font-size: .72rem; color: var(--red); font-weight: 700; }
.met-delta { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.met-delta b { padding: .05rem .4rem; border-radius: 999px; margin-right: .3rem; font-weight: 700; }
.met-delta b.bom { background: #e3f6ee; color: #1d7a4d; }
.met-delta b.mau { background: #fdeceb; color: var(--red); }
.met-delta b.neutro { background: var(--hover-bg); color: var(--text-muted); }
.met-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.met-card-head h3 { margin: 0 0 .8rem; }
.met-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-bottom: .8rem; }
.met-toggle button { background: transparent; color: var(--text-muted); border: 0; border-radius: 0; padding: .25rem .7rem; font-size: .75rem; }
.met-toggle button.active { background: var(--navy-800); color: #fff; }

/* ---- RH > Avaliacao de desempenho ---- */
.avs-competencia { flex-direction: column; align-items: stretch; }
.aval-escala { display: flex; gap: .4rem; flex-wrap: wrap; }
.aval-escala label { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-weight: 400; min-width: 2.4rem; padding: .3rem .4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.aval-escala input { width: auto; }
.aval-escala label:has(input:checked) { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.aval-competencia { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; margin-bottom: .8rem; }
.aval-pergunta { margin: .6rem 0; }
.aval-resultados-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.aval-resultados-grid canvas { max-height: 320px; }
@media (max-width: 900px) { .aval-resultados-grid { grid-template-columns: 1fr; } }

/* ---- Opcoes > Imagens do ecra de login ---- */
.login-imagens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin: 1rem 0; }
.login-imagem { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--hover-bg); }
.login-imagem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-imagem button { position: absolute; top: .3rem; right: .3rem; padding: .1rem .45rem; background: rgba(21, 43, 61,.75); color: #fff; }
:root[data-theme="dark"] .anuncio-card--afixado { background: #2d2914; border-color: #5c4f1a; }
:root[data-theme="dark"] .anuncio-afixado-tag { background: #4a3d10; color: #f5d98b; }

/* Widgets flutuantes mais compactos (ocupam menos espaco no canto) */
[class$="-widget"] { bottom: 1.1rem !important; }
[class$="-widget-btn"] { padding: 0 !important; }
[class$="-widget-btn"] svg { width: 17px; height: 17px; flex: none; }
[class$="-widget-badge"] { min-width: 16px !important; height: 16px !important; font-size: .6rem !important; top: -3px !important; right: -3px !important; border-width: 1.5px !important; }

/* =================== Formulario publico de registo (Formadores) =================== */
.registo-publico { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.registo-publico .brand-mark { margin-bottom: 1.4rem; }
.registo-publico h1 { margin: 0 0 .3rem; font-size: 1.5rem; color: var(--heading); }
.registo-publico .subtitle { margin: 0 0 1.5rem; color: var(--text-muted); font-size: .92rem; line-height: 1.5; }
.registo-publico .campos-duplos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .registo-publico .campos-duplos { grid-template-columns: 1fr; } }
.registo-publico .rgpd { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.registo-publico .rgpd label { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.registo-publico .rgpd input { width: auto; margin-top: .2rem; }
.registo-publico .armadilha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.registo-publico .sucesso { text-align: center; padding: 2rem 1rem; }
.registo-publico .sucesso h2 { color: var(--heading); margin-bottom: .5rem; }

/* =================== Modo de manutencao =================== */
.manutencao-pill {
  display: inline-flex; align-items: center; gap: .35rem; margin-left: .8rem;
  padding: .3rem .75rem; border-radius: 999px; background: var(--red); color: #fff;
  font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.manutencao-pill:hover { background: #c9362e; color: #fff; }
.aviso-manutencao {
  margin: 0 0 1.2rem; padding: .75rem .9rem; border-radius: var(--radius-sm);
  background: #fdf3e0; color: #8a5a00; border: 1px solid #f5d9a6; font-size: .85rem; line-height: 1.45;
}
:root[data-theme="dark"] .aviso-manutencao { background: #3a2c10; color: #f5c96b; border-color: #5c4519; }
.pagina-manutencao { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.pagina-manutencao .cartao { max-width: 520px; width: 100%; text-align: center; padding: 2.5rem 2rem; }
.pagina-manutencao .brand-mark { justify-content: center; margin-bottom: 1.6rem; }
.pagina-manutencao h1 { margin: 0 0 .6rem; font-size: 1.5rem; color: var(--heading); }
.pagina-manutencao .mensagem { margin: 0 0 1rem; color: var(--text); line-height: 1.55; white-space: pre-wrap; }
.pagina-manutencao .previsao { margin: 0 0 1.4rem; font-weight: 600; color: var(--heading); }
.pagina-manutencao .nota { margin: 1.4rem 0 0; font-size: .8rem; color: var(--text-muted); }
