/* ============================================================
   GOA · goa.css · v0.2 · Corporate Moderno + sidebar
   Normas: 1 fonte (Carlito) · 1 tamanho (--fs) · bold única variação
   Botões: 2 variantes fixas (.btn / .btn.sec) + ação de tabela (.acao)
   Cabeçalhos de TABELA: centrados + bold (norma)
   Títulos de ecrã: à esquerda (exceção assentida 12-06)
   Ficha: painel lateral (padrão único) · Exceção: logótipo
   ============================================================ */
:root {
  --fs: 14px;
  --azul: #1F4E79;
  --azul-hover: #173A5B;
  --azul-suave: #EAF1F8;
  --fundo: #F6F8FB;
  --branco: #FFFFFF;
  --linha: #E5E9F0;
  --texto: #1C2530;
  --cinza: #5F6B7A;
  --ok-bg: #E1F5EE;  --ok-tx: #0F6E56;
  --nok-bg: #FCEBEB; --nok-tx: #A32D2D;
  --raio: 12px;
  --sombra: 0 16px 48px rgba(16, 35, 60, .14);
  --trans: .18s ease;
  --sidebar: 240px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Carlito', Calibri, sans-serif;
  font-size: var(--fs);
  color: var(--texto);
  background: var(--fundo);
}
b, th, .bold { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Botões (2 variantes fixas) ---------- */
.btn {
  font-family: inherit; font-size: var(--fs); font-weight: 700;
  background: var(--azul); color: var(--branco);
  border: 1px solid var(--azul); border-radius: 10px;
  height: 38px; padding: 0 16px;
  cursor: pointer; white-space: nowrap;
  transition: background var(--trans), border-color var(--trans), transform var(--trans);
}
.btn:hover { background: var(--azul-hover); border-color: var(--azul-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sec { background: #EEF1F5; color: #344256; border-color: #EEF1F5; }
.btn.sec:hover { background: #E2E7EE; border-color: #E2E7EE; }

.acao {
  font-family: inherit; font-size: var(--fs); font-weight: 700;
  background: none; border: none; border-radius: 8px;
  color: var(--azul); cursor: pointer; padding: 6px 10px;
  transition: background var(--trans);
}
.acao:hover { background: var(--azul-suave); }

/* ---------- Estrutura: sidebar + conteúdo ---------- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: none;
  background: var(--branco); border-right: 1px solid var(--linha);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-topo { padding: 18px 16px 10px; display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 700; font-size: 22px; letter-spacing: 3px; color: var(--azul); }
.versao {
  background: var(--azul-suave); color: var(--azul);
  border-radius: 999px; padding: 2px 10px; font-weight: 700;
}
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.nav-seccao { color: var(--cinza); font-weight: 700; padding: 12px 8px 4px; }
.nav-item {
  display: block; width: 100%; text-align: left;
  font: inherit; color: var(--texto);
  background: none; border: none; border-radius: 10px;
  padding: 9px 12px; margin: 2px 0; cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.nav-item:hover { background: var(--fundo); }
.nav-item.ativa { background: var(--azul-suave); color: var(--azul); font-weight: 700; }
.nav-item.desativado { opacity: .45; cursor: default; }
.nav-item.desativado:hover { background: none; }

.sidebar-fundo { border-top: 1px solid var(--linha); padding: 12px; }
.cartao-eu { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cartao-eu .info { min-width: 0; }
.cartao-eu .info div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-eu .sub { color: var(--cinza); }
.sidebar-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.sidebar-botoes .btn { flex: 1; padding: 0 10px; }

/* Barra de topo só em telemóvel */
.topo-movel {
  display: none;
  background: var(--branco); border-bottom: 1px solid var(--linha);
  padding: 10px 12px; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
}

.principal { flex: 1; min-width: 0; }
.conteudo { max-width: 1100px; margin: 0 auto; padding: 22px 20px 48px; }

/* Títulos de ecrã (à esquerda — exceção assentida) */
.titulo-ecra { font-weight: 700; }
.subtitulo-ecra { color: var(--cinza); margin: 2px 0 16px; }
.linha-titulo { display: flex; align-items: flex-start; gap: 12px; }
.linha-titulo .espaco { flex: 1; }

.barra-acoes { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.barra-acoes input[type="search"] { flex: 1; min-width: 180px; max-width: 360px; }

.cartao {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 6px 16px;
  box-shadow: 0 2px 10px rgba(16, 35, 60, .04);
}

/* ---------- Formulários ---------- */
label { display: block; font-weight: 700; margin: 12px 0 5px; }
input, select {
  font-family: inherit; font-size: var(--fs); color: var(--texto);
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid #D9DCE3; border-radius: 10px; background: var(--branco);
  transition: border-color var(--trans), box-shadow var(--trans);
}
input:focus, select:focus {
  outline: none; border-color: var(--azul);
  box-shadow: 0 0 0 3px var(--azul-suave);
}
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .duas-colunas { grid-template-columns: 1fr; } }

/* ---------- Switch ---------- */
.switch-linha { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.switch-linha label { margin: 0; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .pista { position: absolute; inset: 0; border-radius: 999px; background: #CBD3DD; transition: background var(--trans); }
.switch .pista::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--branco);
  transition: transform var(--trans);
}
.switch input:checked + .pista { background: var(--azul); }
.switch input:checked + .pista::after { transform: translateX(20px); }

/* ---------- Pills ---------- */
.pill { display: inline-block; border-radius: 999px; padding: 3px 12px; font-weight: 700; }
.pill.on  { background: var(--ok-bg);  color: var(--ok-tx); }
.pill.off { background: var(--nok-bg); color: var(--nok-tx); }

/* ---------- Tabela (desktop) ---------- */
.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--linha); }
thead th { text-align: center; color: var(--cinza); }
tbody tr { transition: background var(--trans); }
tbody tr:hover { background: var(--fundo); }
tbody tr:last-child td { border-bottom: none; }
td.c, th.c { text-align: center; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--azul); color: var(--branco); font-weight: 700; flex: none;
}

/* ---------- Cartões (telemóvel) ---------- */
.lista-movel { display: none; }
.cartao-utz {
  background: var(--branco); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 12px 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 10px rgba(16, 35, 60, .04);
}
.cartao-utz .info { flex: 1; min-width: 0; }
.cartao-utz .info div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-utz .sub { color: var(--cinza); }
.cartao-utz .lado { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ---------- Painel lateral (padrão único) ---------- */
.painel-fundo {
  position: fixed; inset: 0; background: rgba(16, 35, 60, .35);
  display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity var(--trans); z-index: 50;
}
.painel-fundo.aberto { opacity: 1; pointer-events: auto; }
.painel {
  background: var(--branco); width: 420px; max-width: 100%;
  height: 100%; overflow-y: auto; padding: 20px;
  box-shadow: var(--sombra);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
}
.painel-fundo.aberto .painel { transform: translateX(0); }
.painel-titulo { text-align: center; font-weight: 700; margin-bottom: 4px; }
.painel-corpo { flex: 1; }
.painel-rodape {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--linha);
}

/* ---------- Login ---------- */
.ecra-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ecra-login .caixa {
  background: var(--branco); border: 1px solid var(--linha); border-radius: 16px;
  box-shadow: var(--sombra); padding: 28px; width: 100%; max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 2px; }
.login-sub { text-align: center; color: var(--cinza); margin-bottom: 12px; }
.login-rodape { text-align: center; margin-top: 14px; }
.ligacao { color: var(--azul); cursor: pointer; text-decoration: underline; background: none; border: none; font: inherit; font-weight: 700; }
.rodape-botoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Deploy ---------- */
.zona-ficheiros {
  border: 2px dashed #C9D2DD; border-radius: var(--raio);
  padding: 18px; text-align: center; color: var(--cinza);
  margin-top: 12px; transition: border-color var(--trans), background var(--trans);
}
.zona-ficheiros:hover { border-color: var(--azul); background: var(--azul-suave); }
.lista-ficheiros { margin-top: 10px; max-height: 220px; overflow-y: auto; text-align: left; }
.lista-ficheiros div { padding: 4px 0; border-bottom: 1px solid var(--linha); }

/* ---------- Mensagens ---------- */
.aviso { margin-top: 12px; text-align: center; }
.aviso.ok  { color: var(--ok-tx); font-weight: 700; }
.aviso.nok { color: var(--nok-tx); font-weight: 700; }
.oculto { display: none !important; }

/* ---------- Telemóvel ---------- */
@media (max-width: 860px) {
  .topo-movel { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--sombra);
  }
  .sidebar.aberta { transform: translateX(0); }
  .fundo-movel {
    position: fixed; inset: 0; background: rgba(16, 35, 60, .35); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity var(--trans);
  }
  .fundo-movel.aberto { opacity: 1; pointer-events: auto; }
}
@media (max-width: 700px) {
  .so-desktop { display: none; }
  .lista-movel { display: block; }
  .conteudo { padding: 16px 12px 40px; }
}
