/* =========================================================
   Cores da Arcofrigo, tiradas do logótipo.
   Um dia isto vem de uma tabela na base de dados — por agora
   está aqui, num sítio só. Muda-se aqui e muda em todo o lado.
   ========================================================= */
:root {
  --azul: #283078;          /* o azul do logótipo */
  --azul-escuro: #1C2256;   /* versão mais escura, para o hover */
  --azul-noite: #12163A;    /* fundo do ecrã de entrada */
  --azul-claro: #E6E8F4;    /* fundos e realces */
  --verde: #009048;         /* o verde do logótipo */
  --verde-claro: #E3F4EB;

  --fundo: #F3F5FA;
  --branco: #FFFFFF;
  --linha: #E1E4EE;
  --texto: #161A33;
  --texto-suave: #666B82;
  --erro: #B42342;

  --sombra: 0 1px 2px rgba(18, 22, 58, 0.06), 0 8px 24px rgba(18, 22, 58, 0.08);
  --sombra-forte: 0 24px 60px rgba(8, 10, 32, 0.45);

  --letra: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--letra);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   ECRÃ DE ENTRADA (index.html)
   ========================================================= */

.pagina-entrada {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 144, 72, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(64, 80, 200, 0.45), transparent 60%),
    linear-gradient(160deg, var(--azul) 0%, var(--azul-noite) 100%);
  background-attachment: fixed;
}

.ecra {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 8vw, 120px);
  padding: 48px 40px;
  overflow: hidden;
}

/* texto de apresentação, à esquerda (só no PC) */
.apresentacao {
  position: relative;
  max-width: 460px;
  color: var(--branco);
  animation: subir 0.5s ease-out both;
}

.apresentacao h1 {
  margin: 0 0 16px;
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.apresentacao p {
  margin: 0 0 32px;
  font-size: 19px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.apresentacao ul {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.apresentacao li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.apresentacao li::before {
  content: "✓";
  flex: 0 0 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--branco);
  background: var(--verde);
  border-radius: 50%;
}

/* as linhas de ar do logótipo, em ponto grande, lá atrás */
.ecra::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='white' stroke-opacity='0.07' stroke-width='2'%3E%3Cpath d='M-50 200 C 300 120, 500 420, 1250 300'/%3E%3Cpath d='M-50 260 C 300 180, 500 480, 1250 360'/%3E%3Cpath d='M-50 320 C 300 240, 500 540, 1250 420'/%3E%3Cpath d='M-50 380 C 300 300, 500 600, 1250 480'/%3E%3Cpath d='M-50 440 C 300 360, 500 660, 1250 540'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
  pointer-events: none;
}

.cartao {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--branco);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--sombra-forte);
  animation: subir 0.5s ease-out both;
}

@keyframes subir {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.logo {
  display: block;
  margin: 0 auto 28px;
  height: 72px;
  width: auto;
}

/* ---------- campos ---------- */

.campo { margin-bottom: 18px; }

.campo label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
}

.campo input {
  width: 100%;
  height: 52px;              /* alto: usa-se com luvas */
  padding: 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--texto);
  background: var(--fundo);
  border: 1.5px solid transparent;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.campo input::placeholder { color: #A3A8BC; }

.campo input:hover { border-color: var(--linha); }

.campo input:focus {
  outline: none;
  background: var(--branco);
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

/* campo com botão olho à direita */
.campo-com-olho { position: relative; }
.campo-com-olho input { padding-right: 52px; }
.campo-com-olho .olho-passe {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #8A90A6;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.campo-com-olho .olho-passe svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.campo-com-olho .olho-passe:hover { color: var(--azul); background: rgba(40,48,120,0.07); }
.campo-com-olho .olho-passe:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* ---------- botão, erro e rodapé ---------- */

.botao {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  color: var(--branco);
  background: linear-gradient(135deg, var(--azul) 0%, #3A44A8 100%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(40, 48, 120, 0.35);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.botao:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(40, 48, 120, 0.45); }
.botao:active { transform: translateY(1px); }
.botao:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; }
.botao:disabled { background: #AFB5C9; box-shadow: none; cursor: default; filter: none; }

.erro {
  margin: 0 0 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--erro);
  background: #FCEEF1;
  border-radius: 10px;
}

/* "deu certo" na entrada (email confirmado, palavra-passe mudada) */
.feito {
  margin: 0 0 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--verde);
  background: var(--verde-claro);
  border-radius: 10px;
}

/* "Esqueci-me da palavra-passe", por baixo dos campos */
.esqueci { margin: -6px 0 16px; text-align: center; font-size: 13px; }

.rodape {
  margin: 28px 0 0;
  font-size: 12px;
  color: var(--texto-suave);
  text-align: center;
}


/* =========================================================
   MENU INICIAL (hoje.html)
   ========================================================= */

.pagina-app {
  display: block;
  min-height: 100vh;
}

.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linha);
}

.logo-pequeno {
  height: 40px;
  width: auto;
}

.relogio {
  margin-left: auto;
  text-align: right;
  line-height: 1.2;
}

.relogio .horas {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--azul);
}

.relogio .data {
  display: block;
  font-size: 12px;
  color: var(--texto-suave);
}

.conteudo {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* cartão de boas-vindas, com as cores da marca */
.barra-pessoa {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px 24px;
  margin-bottom: 12px;
  color: var(--branco);
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(0, 144, 72, 0.55), transparent 70%),
    linear-gradient(135deg, var(--azul) 0%, var(--azul-noite) 100%);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(28, 34, 86, 0.25);
}

.saudacao {
  margin: 0 0 2px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.pessoa-nome {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.etiqueta-nivel {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.etiqueta-nivel:empty { display: none; }

.botao-sair {
  margin-left: auto;
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.botao-sair:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- grupos de funções ---------- */

.grupo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.grupo::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--cor-grupo, var(--azul));
}

.grupo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--linha);
}

/* cada grupo com a sua cor */
[data-grupo="obra"]     { --cor-grupo: #009048; --cor-grupo-claro: #E3F4EB; }
[data-grupo="execucao"] { --cor-grupo: #0E7FA8; --cor-grupo-claro: #E1F1F8; }
[data-grupo="tecnico"]  { --cor-grupo: #283078; --cor-grupo-claro: #E6E8F4; }
[data-grupo="gestao"]   { --cor-grupo: #B7651A; --cor-grupo-claro: #FAEEDF; }

.funcoes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 12px;
}

.funcoes button {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--texto);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(18, 22, 58, 0.04);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.funcoes button::after {
  content: "›";
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  color: #B8BCCC;
  transition: transform 0.15s, color 0.15s;
}

.funcoes button:hover {
  transform: translateY(-2px);
  border-color: var(--cor-grupo, var(--azul));
  box-shadow: var(--sombra);
}

.funcoes button:hover::after {
  color: var(--cor-grupo, var(--azul));
  transform: translateX(3px);
}

.funcoes button:focus-visible {
  outline: 3px solid var(--cor-grupo, var(--azul));
  outline-offset: 2px;
}

.marca {
  flex: 0 0 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--cor-grupo, var(--azul));
  background: var(--cor-grupo-claro, var(--azul-claro));
  border-radius: 10px;
}

.aviso {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--branco);
  border: 1px dashed #C9CDDC;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 36px;
  font-size: 14px;
  color: var(--texto-suave);
}

.aviso p { margin: 0; }

/* ---------- telemóvel ---------- */

@media (max-width: 520px) {
  .cartao { padding: 28px 22px 22px; border-radius: 18px; }
  .logo { height: 60px; }

  .barra-pessoa { flex-wrap: wrap; padding: 22px 18px; }
  .pessoa-nome { font-size: 22px; }
  .botao-sair { margin-left: 0; width: 100%; }

  .relogio .horas { font-size: 18px; }
  .logo-pequeno { height: 34px; }
}


/* =========================================================
   APP DO AJUDANTE
   Pensada para o PC: menu à esquerda e conteúdo em colunas.
   No telemóvel (fim deste ficheiro) muda sozinha de formato:
   o menu passa para uma barra em baixo e tudo fica numa coluna.
   ========================================================= */

.ecra-app {
  margin: 0;
  min-height: 100vh;
  background: var(--fundo);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "lateral barra"
    "lateral corpo";
}

/* ---------- menu lateral (criado pelo js/sessao.js) ---------- */

.lateral {
  grid-area: lateral;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  color: var(--branco);
  background:
    radial-gradient(400px 300px at 0% 100%, rgba(0, 144, 72, 0.35), transparent 70%),
    linear-gradient(180deg, var(--azul) 0%, var(--azul-noite) 100%);
}

.lateral-logo {
  display: block;
  background: var(--branco);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 18px;
  text-align: center;
}

.lateral-logo img { height: 52px; width: auto; display: inline-block; }

.lateral-menu { display: flex; flex-direction: column; gap: 4px; }

.lateral-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.lateral-menu a:hover { background: rgba(255, 255, 255, 0.08); color: var(--branco); }

.lateral-menu a.ativo {
  background: rgba(255, 255, 255, 0.14);
  color: var(--branco);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--verde);
}

.lateral-menu svg {
  flex: 0 0 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lateral-fundo {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lateral-quem {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lateral-sair {
  height: 38px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  cursor: pointer;
}

.lateral-sair:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- cabeçalho de cada ecrã ---------- */

.barra-app {
  grid-area: barra;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 40px 8px;
  color: var(--texto);
}

.barra-app .voltar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--branco);
  border: 1px solid var(--linha);
  color: var(--azul);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}

.barra-app .voltar:hover { border-color: var(--azul); }

.barra-app .tit { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.barra-app .sub { font-size: 15px; color: var(--texto-suave); margin-top: 2px; }
.barra-app .logo-barra { display: none; }   /* no PC o logo está no menu */

/* ---------- conteúdo: em colunas no PC ---------- */

.corpo-app {
  grid-area: corpo;
  width: 100%;
  max-width: 1180px;
  padding: 20px 40px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
  align-content: start;
}

/* por defeito cada bloco ocupa a linha toda... */
.corpo-app > * { grid-column: 1 / -1; }

/* ...mas os cartões arrumam-se lado a lado */
.corpo-app > .item,
.corpo-app > .verificacao,
.corpo-app > .relogio-linha { grid-column: auto; }

/* no PC, botões com o tamanho do texto, não da largura toda */
.corpo-app > .botao-app {
  justify-self: start;
  width: auto;
  min-width: 240px;
  padding: 14px 32px;
}

.corpo-app > .nota-pequena { text-align: left; }

/* o Sair do ecrã já está no menu lateral */
.corpo-app > #sair { display: none; }

.titulo-seccao {
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

/* ---------- cartão de linha (trabalho, equipamento) ---------- */

.item {
  display: block;
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--texto);
}

a.item:hover { border-color: var(--azul); }

.item .hora {
  font-size: 13px;
  font-weight: 600;
  color: var(--azul);
}

.item .nome {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin-top: 2px;
}

.item .meta { font-size: 14px; color: var(--texto-suave); margin-top: 2px; }

/* ---------- selos de estado ---------- */

.selo {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
}

.selo-curso  { background: #DEF1E6; color: #00713A; }
.selo-tipo   { background: var(--azul-claro); color: var(--azul); }
.selo-espera { background: #FAF0DA; color: #7E5306; }

/* ---------- separadores ---------- */

.abas { display: flex; gap: 6px; }

.aba {
  flex: 1;
  text-align: center;
  font-size: 13px;
  padding: 10px 4px;
  border-radius: 8px;
  background: var(--branco);
  border: 1px solid var(--linha);
  color: var(--texto-suave);
  text-decoration: none;
}

.aba.ativa {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--branco);
  font-weight: 600;
}

/* ---------- progresso ---------- */

.progresso {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 12px 14px;
}

.progresso .texto {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.progresso .barra {
  height: 8px;
  border-radius: 5px;
  background: var(--linha);
  margin-top: 8px;
  overflow: hidden;
}

.progresso .barra i { display: block; height: 100%; background: var(--verde); }

/* ---------- checklist ---------- */

.verificacao {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 52px;
  font-size: 16px;
  cursor: pointer;
}

.verificacao input { position: absolute; opacity: 0; width: 0; }

.caixa {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--linha);
  background: var(--branco);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--branco);
  font-size: 15px;
}

.verificacao input:checked + .caixa {
  background: var(--verde);
  border-color: var(--verde);
}

.verificacao input:focus-visible + .caixa {
  box-shadow: 0 0 0 3px rgba(40, 48, 120, 0.2);
}

/* ---------- botões da app ---------- */

.botao-app {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  margin-top: 4px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: var(--azul);
  color: var(--branco);
}

.botao-app:hover { background: var(--azul-escuro); }

.botao-linha {
  background: var(--branco);
  color: var(--azul);
  border: 1px solid var(--linha);
}
.botao-linha:hover { background: var(--azul-claro); }

.botao-desligado {
  background: #C9CEDC;
  color: #7A8095;
  cursor: not-allowed;
}
.botao-desligado:hover { background: #C9CEDC; }

/* ---------- especificações do equipamento ---------- */

.especificacoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 14px;
}

.especificacoes .rotulo {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.especificacoes .valor { font-size: 16px; }

/* ---------- histórico do equipamento ---------- */

.historico {
  position: relative;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.historico::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--linha);
}

.evento { position: relative; }

.evento::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--azul);
  border: 3px solid var(--fundo);
}

.evento .data {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.evento .feito { font-size: 16px; font-weight: 600; margin-top: 1px; }
.evento .quem { font-size: 14px; color: var(--texto-suave); }

/* ---------- fotos ---------- */

.camara {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 84px;
  background: var(--azul);
  color: var(--branco);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.grelha-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.foto {
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--azul-claro);
  display: flex;
  align-items: flex-end;
  padding: 6px;
  font-size: 12px;
  color: var(--azul);
}

/* ---------- escolhas rápidas (em vez de escrever) ---------- */

.escolhas { display: flex; flex-wrap: wrap; gap: 8px; }

.escolha {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--texto-suave);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 24px;
  cursor: pointer;
}

.escolha.marcada {
  background: var(--azul-claro);
  border-color: var(--azul);
  color: var(--azul);
  font-weight: 600;
}

.campo-livre {
  width: 100%;
  min-height: 84px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--texto);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  resize: vertical;
}

/* ---------- horas ---------- */

.relogio-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 14px;
}

.relogio-linha .rotulo { font-size: 13px; color: var(--texto-suave); }

.relogio-linha .valor {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.relogio-linha .vazio { color: var(--texto-suave); }

/* ---------- avisos e notas ---------- */

.sem-rede {
  background: #FAF0DA;
  border: 1px solid #E0BE76;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  color: #7E5306;
}

.nota-pequena {
  font-size: 13px;
  color: var(--texto-suave);
  text-align: center;
  margin: 6px 0 0;
}

/* ---------- no PC há espaço: mais colunas ---------- */

.corpo-app > .grelha-fotos { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.corpo-app > .especificacoes { grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); }


/* =========================================================
   MUDANÇA AUTOMÁTICA DE FORMATO
   Abaixo de 900px (tablet ao alto e telemóvel) a página
   reorganiza-se sozinha. Não é preciso outro site.
   ========================================================= */

/* o ecrã de entrada: só o cartão no telemóvel */
@media (max-width: 600px) {
  .apresentacao { display: none; }
  .ecra { padding: 32px 16px; }
}

/* o menu fixo à esquerda só a partir de 1024 px (PC, iPad deitado); abaixo,
   o menu ☰ do telemóvel e a página com a largura toda — com o menu de 300 px
   a página ficava mais apertada que num telemóvel */
@media (max-width: 1023px) {

  /* --- app: uma coluna só --- */
  .ecra-app {
    display: block;
    padding-bottom: 84px;          /* espaço para a barra de baixo */
  }

  /* o menu lateral passa a barra de separadores em baixo */
  .lateral {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    height: auto;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--azul-noite);
    box-shadow: 0 -4px 20px rgba(18, 22, 58, 0.2);
  }

  .lateral-logo,
  .lateral-fundo { display: none; }

  .lateral-menu { flex-direction: row; gap: 2px; }

  .lateral-menu a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
  }

  .lateral-menu a.ativo { box-shadow: inset 0 3px 0 var(--verde); }

  /* cabeçalho volta a ser a barra azul de cima */
  .barra-app {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
    padding: 12px 16px;
    color: var(--branco);
    background: var(--azul);
  }

  .barra-app .voltar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--branco);
  }

  .barra-app .tit { font-size: 18px; font-weight: 600; letter-spacing: 0; }
  .barra-app .sub { font-size: 13px; color: rgba(255, 255, 255, 0.8); }
  .barra-app .logo-barra {
    display: block;
    height: 32px;
    width: auto;
    margin-left: auto;
    background: var(--branco);
    border-radius: 6px;
    padding: 2px 4px;
  }

  /* conteúdo empilhado, botões à largura toda (bons para o dedo) */
  .corpo-app {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 24px;
  }

  .corpo-app > .botao-app { width: 100%; min-width: 0; padding: 14px; }
  .corpo-app > .nota-pequena { text-align: center; }
  .corpo-app > #sair { display: block; }

  .corpo-app > .grelha-fotos { grid-template-columns: repeat(3, 1fr); }
  .corpo-app > .especificacoes { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   FOTO DE QUEM ENTROU (no sítio do logótipo)
   Sem foto, aparecem as iniciais num círculo.
   ========================================================= */

.lateral-logo.com-avatar {
  background: transparent;
  padding: 4px 0 8px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: var(--branco);
  background: var(--verde);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.avatar-barra { display: none; }   /* no PC a foto está no menu */

@media (max-width: 1023px) {
  .avatar-barra {
    display: inline-flex;
    width: 38px;
    height: 38px;
    margin-left: auto;
    font-size: 14px;
    border-width: 2px;
    box-shadow: none;
  }
}

/* carregar na foto muda-a */
.avatar { cursor: pointer; transition: filter 0.15s, opacity 0.15s; }
.avatar:hover { filter: brightness(0.7); }
.avatar.a-enviar { opacity: 0.4; pointer-events: none; }

.lateral-logo.com-avatar { position: relative; display: flex; justify-content: center; }



/* =========================================================
   O MEU PERFIL (perfil.html)
   PC: fichas em duas colunas. Telemóvel: uma coluna.
   ========================================================= */

.perfil {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.ficha {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  padding: 22px 22px 8px;
}

.ficha h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 700;
}

.sub-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  font-size: 14px;
  font-weight: 600;
}

/* etiqueta "A equipa vê" / "Privado" */
.quem-ve {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--verde);
  background: var(--verde-claro);
  border-radius: 999px;
}

.quem-ve.privado { color: var(--azul); background: var(--azul-claro); }

/* cabeçalho com a foto, a toda a largura */
.ficha-cabeca {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  color: var(--branco);
  border: none;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(0, 144, 72, 0.5), transparent 70%),
    linear-gradient(135deg, var(--azul) 0%, var(--azul-noite) 100%);
}

.foto-perfil {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.9);
  background: var(--verde);
  color: var(--branco);
  font-family: inherit;
  font-size: 40px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: filter 0.15s;
}

.foto-perfil:hover { filter: brightness(0.7); }
.foto-perfil img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cabeca-texto h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.cabeca-email { margin: 4px 0 0; color: rgba(255, 255, 255, 0.75); font-size: 15px; }
.cabeca-idade { margin: 2px 0 0; color: rgba(255, 255, 255, 0.75); font-size: 15px; }
.cabeca-idade:empty { display: none; }

.ligacao {
  margin-top: 12px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
}

.ligacao:hover { background: rgba(255, 255, 255, 0.22); }

/* campos lado a lado dentro de uma ficha */
.linha-campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.linha-campos.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ficha select,
.ficha textarea { font-family: inherit; }

.ficha select {
  width: 100%;
  height: 52px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--texto);
  background: var(--fundo);
  border: 1.5px solid transparent;
  border-radius: 12px;
}

.ficha select:focus,
.ficha textarea:focus {
  outline: none;
  background: var(--branco);
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

.ficha .campo-livre { background: var(--fundo); border: 1.5px solid transparent; border-radius: 12px; }

.ficha .escolha.marcada::before { content: "✓ "; }

/* Aviso de validade no "O meu perfil": o mesmo balão da ficha da pessoa
   (.pessoa-balao) — cartão branco, risco colorido à esquerda e uma setinha
   a apontar para a data. Só aparece quando há alguma coisa a dizer, por
   isso fica vazio (e sem desenho nenhum) enquanto o documento está bom. */
.aviso-validade:empty { display: none; }
.aviso-validade {
  position: relative; display: block; margin: 10px 0 2px; padding: 8px 12px;
  background: #FFFFFF; color: #2A3247;
  border: 1px solid #E3E7F0; border-left: 4px solid var(--cor-balao, #E8930C);
  border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 8px 22px rgba(35, 43, 83, .12);
}
.aviso-validade::before {
  content: ""; position: absolute; top: -6px; left: 18px; width: 10px; height: 10px;
  background: #FFFFFF; border-left: 1px solid #E3E7F0; border-top: 1px solid #E3E7F0;
  transform: rotate(45deg);
}
.aviso-validade.quase { --cor-balao: #E8930C; color: #9A5A00; }
.aviso-validade.caducado { --cor-balao: #D63B3B; color: #B32424; }

/* botão guardar, a toda a largura da grelha */
.perfil-guardar {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.perfil-guardar .erro,
.perfil-guardar .guardado { margin: 0; }

.guardado {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #00713A;
  background: var(--verde-claro);
  border-radius: 10px;
}

.perfil-guardar .botao-app { width: auto; min-width: 240px; padding: 14px 32px; }

@media (max-width: 600px) {
  .perfil { grid-template-columns: 1fr; gap: 12px; }
  .ficha { padding: 18px 16px 4px; }

  .ficha-cabeca { flex-direction: column; text-align: center; gap: 14px; }
  .cabeca-texto h2 { font-size: 22px; }

  .linha-campos,
  .linha-campos.tres { grid-template-columns: 1fr; }

  .perfil-guardar { align-items: stretch; }
  .perfil-guardar .botao-app { width: 100%; min-width: 0; }
}

/* =========================================================
   HORAS NO CANTO SUPERIOR DIREITO + NOME E CARGO NA FOTO
   ========================================================= */

.relogio-app {
  margin-left: auto;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--azul);
}

/* no telemóvel, a foto pequena fica à direita das horas */
.barra-app .logo-barra,
.barra-app .avatar-barra { order: 3; margin-left: 0; }

/* nome e cargo por baixo da foto, no menu */
.lateral-pessoa {
  text-align: center;
  margin: -6px 0 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);   /* linha antes do menu */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lateral-pessoa .lateral-quem {
  font-size: 16px;
  font-weight: 700;
  white-space: normal;
}

.lateral-cargo {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.lateral-sair { width: 100%; }

/* o nome na barra de cima só é preciso no telemóvel (no PC está no menu) */
.so-telemovel { display: none; }

@media (max-width: 1023px) {
  .so-telemovel { display: block; }
  .barra-hoje + .corpo-app > #sair { display: none; }
  .relogio-app { font-size: 18px; font-weight: 600; color: var(--branco); }
  .lateral-pessoa { display: none; }
}

/* =========================================================
   PERFIL EM LISTA (perfil.html)
   Foto ao centro; opções em linhas que abrem devagar.
   ========================================================= */

.definicoes {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- foto, nome e balão "Editar" ---------- */

.def-cabeca {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 16px 8px;       /* espaço por cima para o balão */
}

.foto-caixa { position: relative; }

.def-cabeca .foto-perfil {
  width: 132px;
  height: 132px;
  flex: none;
  border: none;
  box-shadow: 0 8px 24px rgba(18, 22, 58, 0.18);
  font-size: 44px;
}

.foto-perfil span { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }

.foto-balao {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: var(--branco);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(18, 22, 58, 0.18);
  animation: balao-entra 0.18s ease-out;
  display: flex;
}

/* bolinhas do balão, como nos balões de pensamento */
.foto-balao::before,
.foto-balao::after {
  content: "";
  position: absolute;
  background: var(--branco);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(18, 22, 58, 0.15);
}
.foto-balao::before { width: 12px; height: 12px; left: 38%; bottom: -10px; }
.foto-balao::after  { width: 6px;  height: 6px;  left: 34%; bottom: -18px; }

.foto-balao[hidden] { display: none; }

.foto-balao button {
  position: relative;
  z-index: 1;
  padding: 10px 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto);
  background: var(--branco);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.foto-balao button:hover { color: var(--azul); background: var(--fundo); }

@keyframes balao-entra {
  from { opacity: 0; transform: translate(-50%, 6px) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.def-cabeca h2 { margin: 18px 0 0; font-size: 24px; font-weight: 700; }
.cabeca-linha { margin: 4px 0 0; font-size: 14px; color: var(--texto-suave); }

/* ---------- lista de opções ---------- */

.def-lista {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  overflow: hidden;
}

.opcao + .opcao { border-top: 1px solid var(--linha); }

.opcao-topo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  text-align: left;
  font-family: inherit;
  color: var(--texto);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

/* Só onde há rato. No telemóvel e no tablet o "passar por cima" cola-se ao
   último sítio tocado e fica lá, como se aquilo continuasse escolhido. */
@media (hover: hover) {
  .opcao-topo:hover { background: var(--fundo); }
}
.opcao-topo:focus-visible { outline: 3px solid var(--azul); outline-offset: -3px; }

.opcao-topo svg {
  flex: 0 0 24px;
  height: 24px;
  fill: none;
  stroke: var(--texto-suave);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.opcao-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opcao-titulo { font-size: 16px; font-weight: 500; }
.opcao-resumo { font-size: 13px; color: var(--texto-suave); }

/* setinha que roda quando abre */
.opcao-seta {
  width: 9px;
  height: 9px;
  border-right: 2px solid #9AA0B4;
  border-bottom: 2px solid #9AA0B4;
  transform: rotate(45deg);
  transition: transform 0.35s ease;
  margin-right: 4px;
}

.opcao.aberta .opcao-seta { transform: rotate(-135deg); }
.opcao.aberta .opcao-topo svg { stroke: var(--azul); }
.opcao.aberta .opcao-titulo { font-weight: 600; }

/* abrir devagar: a altura passa de 0 para o tamanho do conteúdo */
.opcao-corpo {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
}

.opcao.aberta .opcao-corpo { grid-template-rows: 1fr; }

.opcao-dentro {
  overflow: hidden;
  min-height: 0;
  padding: 0 22px 0 64px;       /* alinhado com o texto, não com o ícone */
  opacity: 0;
  transition: opacity 0.3s ease, padding 0.45s ease;
}

.opcao.aberta .opcao-dentro { opacity: 1; padding-top: 6px; padding-bottom: 22px; }

.opcao-dentro .campo-livre,
.opcao-dentro select { background: var(--fundo); border: 1.5px solid transparent; border-radius: 12px; }

.opcao-dentro select {
  width: 100%;
  height: 52px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--texto);
}

.opcao-dentro select:focus,
.opcao-dentro .campo-livre:focus {
  outline: none;
  background: var(--branco);
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

.opcao-dentro .escolha.marcada::before { content: "✓ "; }
.opcao-dentro .campo label .quem-ve { margin-left: 8px; }

.opcao-dentro .botao-app { width: auto; min-width: 160px; padding: 12px 28px; margin-top: 4px; }

.definicoes > .erro,
.definicoes > .guardado { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .opcao-corpo, .opcao-dentro, .opcao-seta, .foto-balao { transition: none; animation: none; }
}

@media (max-width: 600px) {
  .def-cabeca { padding-top: 52px; }
  .def-cabeca .foto-perfil { width: 112px; height: 112px; }
  .opcao-topo { padding: 14px 16px; gap: 14px; }
  .opcao-dentro { padding-left: 16px; padding-right: 16px; }
  .opcao-dentro .botao-app { width: 100%; }
}

/* a lista do perfil fica ao centro no PC */
.corpo-app > .definicoes { justify-self: center; }

/* marca de dados de exemplo (ainda não vêm da base de dados) */
.selo-exemplo {
  background: transparent;
  color: #9A5B00;
  border: 1px dashed #D9A55A;
}

/* cada linha de detalhe do cartão numa linha própria */
.item .meta { display: block; }

/* =========================================================
   DADOS DE EXEMPLO
   Tudo o que tem a classe "exemplo" ainda é inventado.
   Quando passar a vir da base de dados, tira-se a classe.
   ========================================================= */

.faixa-exemplo {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  color: #7E5306;
  background: #FFF6E5;
  border: 1px dashed #D9A55A;
  border-radius: 10px;
}

.exemplo { position: relative; }

.exemplo::after {
  content: "Exemplo";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9A5B00;
  background: #FFF6E5;
  border: 1px dashed #D9A55A;
  border-radius: 999px;
  pointer-events: none;
}

/* na linha do tempo e nas fotos a etiqueta fica noutro sítio */
.evento.exemplo::after { top: 0; right: 0; }
.foto.exemplo::after { top: 6px; right: 6px; font-size: 9px; }

/* as horas já têm "A contar" à direita: a etiqueta vai para cima */
.relogio-linha.exemplo::after,
.progresso.exemplo::after { top: -9px; right: 12px; }

/* círculo vazio enquanto a foto ainda não chegou (em vez do logotipo) */
.avatar-vazio {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
  cursor: default;
}

/* o logotipo da barra do telemóvel nunca chega a aparecer: é trocado pela foto */
.barra-app .logo-barra { visibility: hidden; }

/* =========================================================
   FOTO QUE LEVANTA + "EDITAR FOTO" QUE DESLIZA POR BAIXO
   (substitui o balão de pensamento)
   ========================================================= */

.def-cabeca { padding-top: 28px; }

.foto-caixa {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0;
  transition: padding-bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* abre espaço por baixo para o botão, empurrando o nome devagar */
.foto-caixa.levantada { padding-bottom: 56px; }

/* a foto: sobe com um pequeno ressalto e a sombra cresce */
.def-cabeca .foto-perfil {
  position: relative;
  z-index: 2;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.45s ease,
    filter 0.15s;
}

.def-cabeca .foto-perfil:hover { filter: none; transform: translateY(-3px); }
.def-cabeca .foto-perfil:focus { outline: none; }
.def-cabeca .foto-perfil:focus-visible { outline: 3px solid var(--azul); outline-offset: 4px; }

.foto-caixa.levantada .foto-perfil {
  transform: translateY(-12px) scale(1.04);
  box-shadow: 0 22px 40px rgba(18, 22, 58, 0.28);
}

/* o botão: está escondido atrás da foto e desliza para baixo */
.foto-balao {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 50%;
  z-index: 1;
  background: none;
  box-shadow: none;
  border-radius: 999px;
  animation: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50px) scale(0.85);
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s,
    opacity 0.25s ease 0.05s;
}

.foto-balao::before,
.foto-balao::after { display: none; }   /* sem as bolinhas do balão */

.foto-caixa.levantada .foto-balao {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.foto-balao button {
  padding: 10px 22px;
  font-size: 14px;
  color: var(--branco);
  background: var(--azul);
  box-shadow: 0 6px 16px rgba(40, 48, 120, 0.3);
}

.foto-balao button:hover { color: var(--branco); background: var(--azul-escuro); }
.foto-balao button:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .foto-caixa, .def-cabeca .foto-perfil, .foto-balao { transition: opacity 0.15s; }
}

/* =========================================================
   MOVIMENTO DE "LEVANTAR" EM TUDO O QUE É CLICÁVEL
   O mesmo da foto do perfil:
   - rato por cima  -> levanta um pouco, a sombra cresce
   - ao carregar    -> afunda, como um botão a sério
   - marcado/ativo  -> fica levantado
   ========================================================= */

:root {
  --mola: cubic-bezier(0.34, 1.56, 0.64, 1);   /* sobe com um pequeno ressalto */
  --sombra-levantada: 0 12px 24px rgba(18, 22, 58, 0.14);
}

/* os cartões e botões que levantam */
a.item,
.botao,
.botao-app:not(.botao-desligado),
.camara,
.escolha,
.aba,
.verificacao,
.funcoes button,
.barra-app .voltar,
.botao-sair,
.lateral-sair,
.ligacao,
.foto-balao button {
  transition:
    transform 0.4s var(--mola),
    box-shadow 0.4s ease,
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    filter 0.15s;
}

a.item:hover,
.camara:hover,
.verificacao:hover,
.funcoes button:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-levantada);
}

.botao:hover,
.botao-app:not(.botao-desligado):hover,
.escolha:hover,
.aba:hover,
.barra-app .voltar:hover,
.botao-sair:hover,
.lateral-sair:hover,
.ligacao:hover,
.foto-balao button:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-levantada);
}

/* ao carregar: afunda depressa (sem ressalto) */
a.item:active,
.botao:active,
.botao-app:not(.botao-desligado):active,
.camara:active,
.escolha:active,
.aba:active,
.verificacao:active,
.funcoes button:active,
.barra-app .voltar:active,
.botao-sair:active,
.lateral-sair:active,
.ligacao:active,
.foto-balao button:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 6px rgba(18, 22, 58, 0.12);
  transition-duration: 0.08s;
}

/* o que está escolhido fica levantado */
.escolha.marcada,
.aba.ativa,
.verificacao:has(input:checked) {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(40, 48, 120, 0.18);
}

/* menu lateral: no PC desliza um pouco para a direita (fica no sítio da coluna) */
.lateral-menu a { transition: transform 0.4s var(--mola), background 0.15s, color 0.15s; }
.lateral-menu a:hover { transform: translateX(4px); }
.lateral-menu a:active { transform: translateX(2px) scale(0.97); transition-duration: 0.08s; }

/* linhas do perfil: a setinha e o ícone mexem-se, a linha não sai da lista */
.opcao-topo svg { transition: transform 0.4s var(--mola), stroke 0.15s; }
@media (hover: hover) {
  .opcao-topo:hover svg { transform: translateY(-3px) scale(1.08); }
}
.opcao-topo:active svg { transform: scale(0.92); transition-duration: 0.08s; }

/* os avatares pequenos (menu e barra) também levantam */
.avatar:not(.avatar-vazio) { transition: transform 0.4s var(--mola), box-shadow 0.4s ease, filter 0.15s; }
.avatar:not(.avatar-vazio):hover { transform: translateY(-4px) scale(1.04); }
.avatar:not(.avatar-vazio):active { transform: scale(0.96); transition-duration: 0.08s; }

/* no telemóvel, a barra de baixo: o ícone salta, não o separador todo */
@media (max-width: 1023px) {
  .lateral-menu a:hover,
  .lateral-menu a:active { transform: none; }
  .lateral-menu svg { transition: transform 0.4s var(--mola); }
  .lateral-menu a:active svg { transform: translateY(-4px) scale(1.1); }
  .lateral-menu a.ativo svg { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* =========================================================
   ECRÃ VAZIO: quando ainda não há nada para mostrar
   ========================================================= */

.vazio-caixa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
  background: var(--branco);
  border: 1.5px dashed #C9CDDC;
  border-radius: 16px;
}

.vazio-caixa strong { font-size: 16px; font-weight: 600; color: var(--texto); }
.vazio-caixa span { max-width: 420px; font-size: 14px; line-height: 1.5; color: var(--texto-suave); }

/* =========================================================
   SUBMENU DO "O MEU DIA" (menu lateral)
   ========================================================= */

.lateral-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 25px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.lateral-menu .lateral-sub a {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.lateral-menu .lateral-sub a.ativo {
  color: var(--branco);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--verde);
}

/* o "pai" com um filho aberto fica marcado mas mais discreto */
.lateral-menu > a.ativo:has(+ .lateral-sub a.ativo) {
  background: transparent;
  box-shadow: none;
}

/* separadores do submenu: só no telemóvel (no PC está no menu) */
.abas-sub { display: none; }

@media (max-width: 1023px) {
  .lateral-sub { display: none; }
  .abas-sub { display: flex; }
  .abas-sub .aba { text-decoration: none; }
}

/* =========================================================
   CALENDÁRIO (calendario.html)
   PC: mês à esquerda, dia à direita. Telemóvel: um por baixo do outro.
   ========================================================= */

.cal-grelha {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.cal-mes,
.cal-dia {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  padding: 18px;
}

.cal-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-topo h2 { margin: 0; font-size: 18px; font-weight: 700; }

.cal-seta {
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: var(--azul);
  background: var(--fundo);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), background 0.15s;
}

.cal-seta:hover { background: var(--azul-claro); transform: translateY(-2px); }
.cal-seta:active { transform: scale(0.94); transition-duration: 0.08s; }

.cal-semana,
.cal-dias {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-semana span {
  padding: 4px 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--texto-suave);
}

.cal-d {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
  color: var(--texto);
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), background 0.15s;
}

.cal-d:hover { background: var(--fundo); transform: translateY(-2px); }
.cal-d:active { transform: scale(0.94); transition-duration: 0.08s; }

.cal-d.hoje span {
  font-weight: 700;
  color: var(--azul);
}

.cal-d.hoje::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid var(--azul);
  border-radius: 10px;
}

.cal-d.escolhido { background: var(--azul); }
.cal-d.escolhido span { color: var(--branco); font-weight: 700; }
.cal-d.escolhido::before { display: none; }

.cal-ponto {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--verde);
}

.cal-d.escolhido .cal-ponto { background: var(--branco); }

.ligacao-simples {
  margin-top: 12px;
  padding: 6px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: none;
  border: none;
  cursor: pointer;
}

.ligacao-simples:hover { text-decoration: underline; }

.cal-dia-titulo { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.cal-nada { text-align: left; margin: 0 0 6px; }

.cal-evento {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--linha);
}

.cal-evento:first-child { border-top: none; padding-top: 0; }

.cal-hora {
  flex: 0 0 78px;
  font-size: 14px;
  font-weight: 700;
  color: var(--azul);
  font-variant-numeric: tabular-nums;
}

.cal-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cal-texto strong { font-size: 15px; font-weight: 600; }
.cal-texto span { font-size: 14px; color: var(--texto-suave); white-space: pre-line; }

.cal-novo {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--linha);
}

.cal-novo h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.cal-novo .campo-livre,
.lemb-novo .campo-livre { background: var(--fundo); border: 1.5px solid transparent; border-radius: 12px; }

/* botões pequenos de Apagar e Repor (calendário e lembretes) */
.botao-apagar,
.botao-repor {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), background 0.15s, color 0.15s;
}

.botao-apagar { color: var(--texto-suave); background: none; border: 1px solid var(--linha); }
.botao-apagar:hover { color: var(--erro); border-color: #F0C2CC; background: #FCEEF1; transform: translateY(-2px); }

.botao-repor { color: var(--azul); background: var(--azul-claro); border: none; }
.botao-repor:hover { background: #D6D9EC; transform: translateY(-2px); }

.botao-apagar:active,
.botao-repor:active { transform: scale(0.95); transition-duration: 0.08s; }

/* =========================================================
   LEMBRETES (lembretes.html)
   ========================================================= */

.lemb-grelha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.lemb-novo,
.lemb-lista {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  padding: 18px;
}

.lemb-novo .botao-app { width: 100%; }

.lemb-lista .abas { margin-bottom: 12px; }
.lemb-lista .aba { font-family: inherit; cursor: pointer; }

.contador {
  display: inline-block;
  min-width: 20px;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.contador:empty { display: none; }
.aba.ativa .contador { background: rgba(255, 255, 255, 0.25); }

.lemb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--linha);
}

.lemb:first-child { border-top: none; }

.lemb-marcar { display: flex; cursor: pointer; }
.lemb-marcar input { position: absolute; opacity: 0; width: 0; }
.lemb-marcar input:checked + .caixa { background: var(--verde); border-color: var(--verde); }
.lemb-marcar input:focus-visible + .caixa { box-shadow: 0 0 0 3px rgba(40, 48, 120, 0.2); }

.lemb-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lemb-texto span { font-size: 15px; overflow-wrap: anywhere; }
.lemb-texto small { font-size: 13px; color: var(--texto-suave); }
.lemb-texto small.atrasado { color: var(--erro); font-weight: 600; }

.lemb.feito .lemb-texto span { text-decoration: line-through; color: var(--texto-suave); }
.lemb.apagado .lemb-texto span { color: var(--texto-suave); }

/* telemóvel: tudo numa coluna */
@media (max-width: 600px) {
  .cal-grelha,
  .lemb-grelha { grid-template-columns: 1fr; gap: 12px; }
  .cal-mes, .cal-dia, .lemb-novo, .lemb-lista { padding: 14px; }
  .cal-hora { flex-basis: 64px; }
}

/* =========================================================
   "O MEU DIA": RESUMO DO CALENDÁRIO E DOS LEMBRETES
   PC: lado a lado. Telemóvel: um por baixo do outro.
   ========================================================= */

.resumo-grelha {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 10px;
}

.resumo {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  padding: 18px;
}

.resumo-topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.resumo-topo h2 { margin: 0; font-size: 17px; font-weight: 700; }
.resumo-topo .ligacao-simples { margin: 0; text-decoration: none; }

.resumo-vazio { margin: 6px 0 4px; font-size: 14px; color: var(--texto-suave); }

/* próximas marcações */
.resumo-evento {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 12px;
  color: var(--texto);
  text-decoration: none;
  transition: transform 0.4s var(--mola), background 0.15s;
}

.resumo-evento:hover { background: var(--fundo); transform: translateY(-2px); }

.resumo-data {
  flex: 0 0 48px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--azul-claro);
  color: var(--azul);
  line-height: 1.1;
}

.resumo-data strong { font-size: 19px; font-weight: 700; }
.resumo-data small { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.resumo-data.hoje { background: var(--azul); color: var(--branco); }

.resumo-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.resumo-texto strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.resumo-texto small { font-size: 13px; color: var(--texto-suave); }

/* lembrete rápido */
.resumo-novo { display: flex; gap: 8px; margin-bottom: 6px; }

.resumo-novo input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--fundo);
  border: 1.5px solid transparent;
  border-radius: 12px;
}

.resumo-novo input:focus {
  outline: none;
  background: var(--branco);
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

.corpo-app .resumo-novo .botao-app {
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 18px;
  margin: 0;
}

.resumo .lemb { transition: opacity 0.3s; }
.resumo .lemb.feito { opacity: 0.5; }
.resumo .lemb.feito .lemb-texto span { text-decoration: line-through; }

.resumo-mais { display: inline-block; margin-top: 6px; text-decoration: none; }

@media (max-width: 600px) {
  .resumo-grelha { grid-template-columns: 1fr; gap: 12px; }
  .resumo { padding: 14px; }
}

/* =========================================================
   "O MEU DIA" COM O CALENDÁRIO A SÉRIO
   PC: mês à esquerda; dia + lembretes à direita.
   Telemóvel: tudo numa coluna.
   ========================================================= */

.hoje-grelha {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.hoje-lado { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 600px) {
  .hoje-grelha { grid-template-columns: 1fr; gap: 12px; }
  .hoje-lado { gap: 12px; }
}

/* =========================================================
   "O MEU DIA": CALENDÁRIO NUM SÓ CARTÃO + LEMBRETES POR BAIXO
   PC: dentro do cartão, mês à esquerda e dia à direita.
   Telemóvel: o dia passa para baixo do mês.
   ========================================================= */

.hoje-coluna { display: flex; flex-direction: column; gap: 16px; }

.cal-cartao {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 16px;
  overflow: hidden;
}

.cal-parte-mes { padding: 18px; }

.cal-parte-dia {
  padding: 18px 20px;
  border-left: 1px solid var(--linha);
  background: #FAFBFD;
}

.cal-parte-dia .cal-novo { border-top-color: var(--linha); }

@media (max-width: 600px) {
  .hoje-coluna { gap: 12px; }
  .cal-cartao { grid-template-columns: minmax(0, 1fr); }
  .cal-parte-mes { padding: 14px; }
  .cal-parte-dia {
    padding: 14px;
    border-left: none;
    border-top: 1px solid var(--linha);
  }
}

/* calendário compacto: os dias têm altura fixa (não crescem com o ecrã) */
.cal-d {
  aspect-ratio: auto;
  height: 42px;
}

.cal-d.hoje::before { inset: 3px 6px; }
.cal-ponto { bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; }
.cal-semana span { padding-bottom: 4px; }
.cal-topo { margin-bottom: 8px; }

/* o "O meu dia" não ocupa a largura toda no PC */
.hoje-coluna { width: 100%; max-width: 980px; }
.corpo-app > .hoje-coluna { justify-self: start; }

/* topo do calendário: mês à esquerda, "Hoje ‹ ›" à direita */
.cal-navegar { display: flex; align-items: center; gap: 6px; }

.cal-hoje {
  height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), background 0.15s, border-color 0.15s;
}

.cal-hoje:hover { border-color: var(--azul); transform: translateY(-2px); }
.cal-hoje:active { transform: scale(0.95); transition-duration: 0.08s; }

/* =========================================================
   CALENDÁRIO — ESTILO NOVO (mesmas cores)
   Faixa azul no topo, dias em círculos, data grande no dia
   escolhido, marcações em cartões e formulário que abre.
   ========================================================= */

.cal-cartao {
  border: none;
  border-radius: 20px;
  box-shadow: var(--sombra);
}

.cal-pagina { width: 100%; max-width: 980px; }
.corpo-app > .cal-pagina { justify-self: start; }

/* A página Calendário usa o mesmo conjunto de calendário + histórico do "O meu dia".
   A largura útil, e não apenas a largura da janela, decide quando as duas partes empilham. */
.calendario-pagina-app .corpo-app { container-type: inline-size; }
.calendario-pagina-app .cal-pagina,
.calendario-pagina-app .cal-historico { max-width: none; }

@container (max-width: 860px) {
  .calendario-pagina-app .cal-pagina { grid-template-columns: minmax(0, 1fr); }
  .calendario-pagina-app .cal-parte-dia {
    border-top: 1px solid var(--linha);
    border-left: none;
  }
}

/* ---------- faixa do mês ---------- */

.cal-parte-mes { padding: 0 0 16px; }

.cal-parte-mes .cal-topo {
  margin: 0 0 12px;
  padding: 20px 20px 18px;
  color: var(--branco);
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(0, 144, 72, 0.45), transparent 70%),
    linear-gradient(135deg, var(--azul) 0%, var(--azul-noite) 100%);
}

.cal-parte-mes .cal-topo h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.cal-parte-mes .cal-seta,
.cal-parte-mes .cal-hoje {
  height: 38px;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.cal-parte-mes .cal-seta { width: 38px; font-size: 22px; }

.cal-parte-mes .cal-seta:hover,
.cal-parte-mes .cal-hoje:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
}

.cal-parte-mes .cal-semana,
.cal-parte-mes .cal-dias { padding: 0 14px; }

.cal-semana span { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.cal-semana span:nth-child(n+6) { color: #A3A8BC; }

/* ---------- dias em círculos ---------- */

.cal-d,
.cal-d:hover,
.cal-d.escolhido { background: none; transform: none; }

.cal-d { height: 44px; }

.cal-d > span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.4s var(--mola), background 0.15s, color 0.15s, box-shadow 0.2s;
}

.cal-d:hover > span { background: var(--fundo); transform: translateY(-2px); }
.cal-d:active > span { transform: scale(0.9); transition-duration: 0.08s; }

.cal-d.fim-semana > span { color: var(--texto-suave); }

.cal-d.fora { cursor: default; }
.cal-d.fora > span { color: #C9CDDC; }
.cal-d.fora:hover > span { background: none; transform: none; }

/* hoje: anel verde */
.cal-d.hoje::before { display: none; }
.cal-d.hoje > span {
  color: var(--verde);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--verde);
}

/* escolhido: círculo azul cheio */
.cal-d.escolhido > span,
.cal-d.escolhido:hover > span {
  color: var(--branco);
  font-weight: 700;
  background: var(--azul);
  box-shadow: 0 6px 14px rgba(40, 48, 120, 0.35);
}

.cal-d.escolhido.hoje > span { box-shadow: 0 0 0 3px var(--verde-claro), 0 6px 14px rgba(40, 48, 120, 0.35); }

.cal-ponto { bottom: 1px; background: var(--verde); }
.cal-d.escolhido .cal-ponto { background: var(--azul); }

/* ---------- dia escolhido ---------- */

.cal-parte-dia {
  padding: 22px;
  background: var(--fundo);
  border-left: none;
}

.cal-dia-titulo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.cal-dia-num {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--azul);
}

.cal-dia-resto { display: flex; flex-direction: column; gap: 2px; }
.cal-dia-resto strong { font-size: 17px; font-weight: 700; }
.cal-dia-resto small { font-size: 13px; color: var(--texto-suave); }

.cal-nada {
  margin: 0 0 4px;
  padding: 14px;
  text-align: center;
  background: var(--branco);
  border: 1.5px dashed #D3D7E3;
  border-radius: 12px;
}

/* marcações em cartões, com barra azul à esquerda */
.cal-evento,
.cal-evento:first-child {
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 12px 12px 14px;
  background: var(--branco);
  border: none;
  border-radius: 12px;
  box-shadow: inset 4px 0 0 var(--azul), 0 1px 3px rgba(18, 22, 58, 0.06);
}

.cal-hora {
  flex: 0 0 auto;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--azul);
  background: var(--azul-claro);
  border-radius: 999px;
}

/* ---------- "+ Nova marcação" que abre devagar ---------- */

.cal-novo { margin-top: 12px; padding-top: 0; border-top: none; }

.cal-novo-abrir {
  width: 100%;
  height: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: var(--branco);
  border: 1.5px dashed #B9BFE0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), border-color 0.15s, background 0.15s;
}

.cal-novo-abrir:hover { border-color: var(--azul); transform: translateY(-2px); }
.cal-novo-abrir:active { transform: scale(0.97); transition-duration: 0.08s; }

.cal-novo.aberto .cal-novo-abrir {
  color: var(--texto-suave);
  border-style: solid;
  border-color: var(--linha);
}

.cal-novo-corpo {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
}

.cal-novo.aberto .cal-novo-corpo { grid-template-rows: 1fr; }

.cal-novo-dentro {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, padding 0.45s ease;
}

.cal-novo.aberto .cal-novo-dentro { opacity: 1; padding-top: 14px; }

.cal-novo-dentro input,
.cal-novo-dentro .campo-livre { background: var(--branco); }

.cal-novo-dentro .botao-app { width: 100%; }

/* ---------- lembretes com o mesmo ar ---------- */

.hoje-coluna .resumo {
  border: none;
  border-radius: 20px;
  box-shadow: var(--sombra);
  padding: 20px 22px;
}

.hoje-coluna .resumo-topo h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.hoje-coluna .resumo-topo h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--verde);
}

@media (prefers-reduced-motion: reduce) {
  .cal-novo-corpo, .cal-novo-dentro { transition: none; }
}

@media (max-width: 600px) {
  .cal-parte-mes .cal-topo { padding: 16px; }
  .cal-parte-mes .cal-semana,
  .cal-parte-mes .cal-dias { padding: 0 8px; }
  .cal-d > span { width: 34px; height: 34px; }
  .cal-parte-dia { padding: 16px; border-top: none; }
  .cal-dia-num { font-size: 38px; }
}

/* =========================================================
   SEM PISCAR AO MUDAR DE ECRÃ
   A página da app fica invisível até o menu, o calendário e
   os lembretes estarem desenhados (o js/sessao.js põe a
   classe "pronto"). Segurança: se algum script falhar, a
   página aparece na mesma ao fim de 1,2 s.
   ========================================================= */

.ecra-app {
  opacity: 0;
  animation: mostrar-na-mesma 0.15s ease 1.2s forwards;
}

.ecra-app.pronto {
  opacity: 1;
  animation: none;
}

@keyframes mostrar-na-mesma { to { opacity: 1; } }

/* "O meu dia": sem data nem horas. No PC a barra de cima desaparece;
   no telemóvel fica só o nome, o cargo e a foto. */
.barra-hoje { display: none; }

@media (max-width: 1023px) {
  .barra-hoje { display: flex; }
  .barra-hoje .sub { font-size: 15px; font-weight: 600; color: var(--branco); }
}

/* sem a barra de cima, o conteúdo sobe um pouco no PC */
@media (min-width: 1024px) {
  .barra-hoje + .corpo-app { padding-top: 32px; }
}

/* =========================================================
   PÁGINA LEMBRETES com o mesmo cartão do "O meu dia"
   ========================================================= */

.lemb-pagina .resumo-topo { margin-bottom: 14px; }

/* texto a crescer; dia e hora pequenos ao lado */
.lemb-linha { margin-bottom: 16px; }
.lemb-linha #lemb-dia  { flex: 0 0 150px; }
.lemb-linha #lemb-hora { flex: 0 0 110px; }
.lemb-linha #lemb-dia,
.lemb-linha #lemb-hora { color: var(--texto-suave); cursor: pointer; }

.lemb-pagina .abas { margin-bottom: 12px; }
.lemb-pagina .aba { font-family: inherit; cursor: pointer; }

/* a lista vazia fica mais discreta dentro do cartão */
.lemb-pagina .vazio-caixa { padding: 26px 16px; }

@media (max-width: 600px) {
  .lemb-linha { flex-wrap: wrap; }
  .lemb-linha #lemb-texto { flex: 1 0 100%; }
  .lemb-linha #lemb-dia,
  .lemb-linha #lemb-hora { flex: 1 1 0; }
  .lemb-linha .botao-app { flex: 1 0 100%; }
}

/* sem dia e hora, a linha de adicionar fica igual à do "O meu dia", também no telemóvel */
@media (max-width: 600px) {
  .lemb-linha { flex-wrap: nowrap; }
  .lemb-linha #lemb-texto { flex: 1 1 auto; }
  .lemb-linha .botao-app { flex: 0 0 auto; }
}

/* =========================================================
   LINHA DE LEMBRETE — arrumada em colunas
   [ círculo ] [ texto / prazo ] [ relógio  data/hora ] [ lixo ]
   ========================================================= */

.lemb,
.lemb:first-child {
  gap: 14px;
  margin: 0 -10px;
  padding: 12px 10px;
  border-top: none;
  border-radius: 12px;
  transition: background 0.15s, opacity 0.3s;
}

.lemb + .lemb { box-shadow: 0 -1px 0 var(--linha); }
.lemb:hover { background: var(--fundo); box-shadow: none; }
.lemb:hover + .lemb { box-shadow: none; }

/* marcar como feito: círculo em vez de quadrado */
.lemb .caixa {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #C9CDDC;
  font-size: 12px;
  transition: transform 0.4s var(--mola), background 0.15s, border-color 0.15s;
}

.lemb-marcar:hover .caixa { border-color: var(--verde); transform: scale(1.1); }

.lemb-texto span { font-size: 15px; font-weight: 500; line-height: 1.35; }
.lemb-texto small { font-size: 12px; }

/* "Criado a 29/09, 17:59": linha pequena por baixo do texto,
   igual ao "Apagado a ..." do Histórico */
.lemb-texto .criado-em { color: var(--texto-suave); }

/* texto mais legível, separado da linha de baixo */
.lemb .lemb-texto { gap: 5px; }
.lemb .lemb-texto span {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--texto);
}
.lemb .lemb-texto small { font-size: 12.5px; line-height: 1.2; }
.lemb.feito .lemb-texto span { font-weight: 500; color: var(--texto-suave); }

/* no Histórico o texto fica tão legível como nos ativos */
.lemb.apagado .lemb-texto span { font-weight: 600; color: var(--texto); }
.lemb-texto .criado-em:empty { display: none; }

/* o caixote do lixo vai sempre para a ponta direita */
.lemb .botao-lixo { margin-left: auto; }

/* apagar: só o ícone do caixote, discreto até passar o rato */
.botao-lixo {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #A3A8BC;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), color 0.15s, background 0.15s;
}

.botao-lixo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.botao-lixo:hover { color: var(--erro); background: #FCEEF1; transform: translateY(-2px); }
.botao-lixo:active { transform: scale(0.92); transition-duration: 0.08s; }
.botao-lixo:focus-visible { outline: 3px solid var(--azul); outline-offset: 1px; }

/* histórico: o "Repor" alinha com o resto */
.lemb.apagado .botao-repor { height: 32px; }

@media (max-width: 520px) {
  .lemb,
  .lemb:first-child { gap: 10px; }
}

/* =========================================================
   "NOVA MARCAÇÃO" — FORMULÁRIO SIMPLES, EM LINHAS COM ÍCONES
   (estilo Google Calendar)
   ========================================================= */

/* o título: grande, sem rótulo, só "O que vai acontecer?" */
.ev-titulo {
  width: 100%;
  height: 52px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  color: var(--texto);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--linha);
  border-radius: 0;
  transition: border-color 0.15s;
}

.ev-titulo::placeholder { color: #A3A8BC; font-weight: 500; }
.ev-titulo:focus { outline: none; border-bottom-color: var(--azul); }

/* as linhas: ícone | o que é | campo */
.ev-linhas {
  margin: 12px 0 14px;
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 14px;
  overflow: hidden;
}

.ev-linha {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.ev-linha + .ev-linha { border-top: 1px solid var(--linha); }
.ev-linha:hover { background: var(--fundo); }
.ev-linha:focus-within { background: var(--azul-claro); }

.ev-linha svg {
  flex: 0 0 20px;
  height: 20px;
  fill: none;
  stroke: var(--azul);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ev-rotulo {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto);
}

.ev-rotulo small { font-size: 12px; font-weight: 400; color: var(--texto-suave); }

/* o campo fica à direita, sem caixa à volta */
.ev-linha input[type="date"],
.ev-linha input[type="time"] {
  width: auto;
  height: 38px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--azul);
  background: var(--fundo);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.ev-linha input:focus { outline: 2px solid var(--azul); outline-offset: 1px; }

/* a nota: o texto ocupa a linha toda */
.ev-linha-nota { align-items: flex-start; padding-top: 14px; }
.ev-linha-nota svg { margin-top: 1px; }

.ev-linha textarea {
  flex: 1;
  min-height: 24px;
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--texto);
  background: transparent;
  border: none;
  resize: vertical;
}

.ev-linha textarea::placeholder { color: var(--texto-suave); }
.ev-linha textarea:focus { outline: none; }

@media (max-width: 520px) {
  .ev-linha { padding: 8px 12px; gap: 10px; }
  .ev-linha input[type="date"],
  .ev-linha input[type="time"] { font-size: 14px; padding: 0 8px; }
}

/* ganhar às regras antigas do formulário */
.cal-novo-dentro .ev-titulo { background: transparent; }
.cal-novo-dentro .ev-linha input[type="date"],
.cal-novo-dentro .ev-linha input[type="time"] { background: var(--fundo); }
.cal-novo-dentro .ev-linha textarea { background: transparent; }

/* =========================================================
   MENU ☰ E LOGOTIPO NO TOPO
   Escondidos no PC e no tablet; o painel não altera nada lá.
   No telemóvel voltam a aparecer (ver "VOLTA O MENU ☰", no fim).
   ========================================================= */
.menu-botao { display: none; }
.menu-logo { display: none; }
.lateral-painel { display: contents; }

/* =========================================================
   TABLET E TELEMÓVEL (até 900px): o mesmo menu — barra de
   ícones em baixo, sem foto, com "O meu dia" ao centro; sem a
   barra "Nome · Cargo" e sem os separadores.
   ========================================================= */
@media (max-width: 1023px) {
  .barra-hoje { display: none; }
  .abas-sub { display: none; }

  .lateral .lateral-logo,
  .lateral .lateral-logo.com-avatar { display: none; }

  /* sem a barra de cima, o conteúdo não fica colado ao topo */
  .barra-hoje + .corpo-app { padding-top: 20px; }
}

/* tablet e telemóvel: o menu fica pela ordem em que é escrito (js/sessao.js, MENU),
   cada submenu logo a seguir à sua opção — sem números de ordem fixos */

/* =========================================================
   AVISOS NO FORMULÁRIO "NOVA MARCAÇÃO"
   vermelho = falta (não guarda) · laranja = só aviso
   ========================================================= */

.ev-aviso {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--erro);
  animation: aviso-entra 0.25s ease-out;
}

.ev-aviso::before {
  content: "!";
  flex: 0 0 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--branco);
  background: var(--erro);
  border-radius: 50%;
}

.ev-aviso.laranja { color: #9A5B00; }
.ev-aviso.laranja::before { background: #D98A1C; }

/* dentro da lista de linhas o aviso fica com o mesmo recuo do texto */
.ev-linhas .ev-aviso { margin: 0; padding: 0 14px 10px 46px; }

/* o campo em falta fica marcado */
.ev-titulo.com-erro { border-bottom-color: var(--erro); }
.ev-linha.com-erro { background: #FCEEF1; }
.ev-linha.com-erro svg { stroke: var(--erro); }
.ev-linha.com-aviso { background: #FFF6E5; }
.ev-linha.com-aviso svg { stroke: #D98A1C; }

/* o botão, quando pede confirmação do "todo o dia" */
.botao-app.com-aviso,
.botao-app.com-erro { box-shadow: none; }

@keyframes aviso-entra {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* a linha a seguir a um aviso mantém o separador */
.ev-aviso + .ev-linha { border-top: 1px solid var(--linha); }

/* =========================================================
   CALENDÁRIO: "PARA QUEM", "CRIADO POR" E HISTÓRICO
   ========================================================= */

/* bolinha com a foto ou as iniciais de uma pessoa */
.pessoa-bolinha {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  font-size: 9px;
  font-weight: 700;
  color: var(--branco);
  background: var(--verde);
}

/* ---------- formulário: linha "Para quem" ---------- */

.ev-linha-para { align-items: flex-start; padding-top: 14px; padding-bottom: 12px; cursor: default; }
.ev-linha-para svg { margin-top: 1px; }
.ev-linha-para:hover { background: none; }

.ev-para-caixa { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-para-caixa .escolhas { gap: 6px; }

.ev-para-caixa .escolha {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  gap: 6px;
}

.escolha-pessoa { padding-left: 5px; }
.ev-para-caixa .escolha.marcada::before { content: none; }
.escolha-pessoa.marcada .pessoa-bolinha { box-shadow: 0 0 0 2px var(--branco); }

/* ---------- na marcação: para quem, "Para ti", criado por ---------- */

.cal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cal-para { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.cal-para-pessoa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--azul);
  background: var(--azul-claro);
  border-radius: 999px;
}

.cal-para-pessoa .pessoa-bolinha { flex-basis: 18px; width: 18px; height: 18px; font-size: 8px; }
.cal-para-pessoa.todos { padding: 2px 9px; color: var(--texto-suave); background: var(--fundo); }

.cal-para-ti {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--branco);
  background: var(--verde);
  border-radius: 999px;
}

.cal-criado { font-size: 12px; color: var(--texto-suave); }

/* a marcação que é para mim: barra verde em vez de azul */
.cal-evento.para-mim { box-shadow: inset 4px 0 0 var(--verde), 0 1px 3px rgba(18, 22, 58, 0.06); }

/* ---------- histórico do calendário ---------- */

.cal-historico {
  width: 100%;
  max-width: 980px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
  overflow: hidden;
}

.corpo-app > .cal-historico { justify-self: start; }

.hist-abrir {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.hist-abrir:hover { background: var(--fundo); }
.hist-abrir span:not(.opcao-seta) { flex: 1; }

.hist-abrir svg {
  flex: 0 0 20px;
  height: 20px;
  fill: none;
  stroke: var(--azul);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-historico.aberto .opcao-seta { transform: rotate(-135deg); }

/* abre devagar, como as secções do perfil */
.hist-corpo {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
}

.cal-historico.aberto .hist-corpo { grid-template-rows: 1fr; }
.hist-lista { min-height: 0; overflow: hidden; padding: 0 20px; }
.cal-historico.aberto .hist-lista { padding-bottom: 16px; }

.hist-linha {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--linha);
}

.hist-topo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.hist-topo strong { font-size: 15px; font-weight: 600; }
.hist-topo span { font-size: 13px; color: var(--texto-suave); }

.hist-linha small { font-size: 12.5px; color: var(--texto-suave); }
.hist-linha .hist-apagou { color: var(--erro); font-weight: 600; }
.hist-linha .cal-para { margin: 2px 0; }
.cal-hist-acoes { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
/* repor e lixo: o mesmo tamanho, sem margens próprias, na mesma linha */
.cal-hist .cal-hist-acoes > button { flex: 0 0 34px; width: 34px; height: 34px; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.cal-hist-acoes .botao-lixo { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.cal-hist-acoes .botao-lixo svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 600px) {
  .hist-abrir { padding: 14px 16px; }
  .hist-lista { padding: 0 16px; }
}

/* =========================================================
   CALENDÁRIO: ALTERAR MARCAÇÕES + HISTÓRICO COMPLETO
   ========================================================= */

/* lápis e caixote lado a lado, na marcação */
.cal-acoes { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }

.botao-lapis {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #A3A8BC;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), color 0.15s, background 0.15s;
}

.botao-lapis svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.botao-lapis:hover { color: var(--azul); background: var(--azul-claro); transform: translateY(-2px); }
.botao-lapis:active { transform: scale(0.92); transition-duration: 0.08s; }
.botao-lapis:focus-visible { outline: 3px solid var(--azul); outline-offset: 1px; }

/* o formulário, quando está a alterar uma marcação que já existe */
.cal-novo.a-alterar .cal-novo-dentro {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.cal-novo.a-alterar .cal-novo-dentro::before {
  content: "A alterar uma marcação";
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--azul);
}

/* ---------- histórico: uma cor por ação ---------- */

.hist-linha { gap: 6px; }

.hist-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hist-acao {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

.acao-criou   .hist-acao { color: #00713A; background: var(--verde-claro); }
.acao-alterou .hist-acao { color: var(--azul); background: var(--azul-claro); }
.acao-apagou  .hist-acao { color: var(--erro); background: #FCEEF1; }

.hist-frase { flex: 1; min-width: 0; font-size: 14px; color: var(--texto); overflow-wrap: anywhere; }
.hist-frase strong { font-weight: 700; }

.hist-quando {
  font-size: 12px;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hist-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
}

.hist-info small { font-size: 12.5px; color: var(--texto-suave); }

/* o que mudou: antes riscado → depois a carregado */
.hist-mudancas {
  list-style: none;
  margin: 2px 0 0;
  padding: 8px 12px;
  background: var(--fundo);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hist-mudancas li { font-size: 13px; color: var(--texto-suave); overflow-wrap: anywhere; }
.hist-mudancas s { color: #A3A8BC; }
.hist-mudancas strong { color: var(--texto); font-weight: 600; }

/* ganhar à regra antiga ".hist-topo span" */
.hist-topo .hist-frase { font-size: 14px; color: var(--texto); }
.hist-topo .hist-acao { font-size: 11px; }
.acao-criou   .hist-topo .hist-acao { color: #00713A; }
.acao-alterou .hist-topo .hist-acao { color: var(--azul); }
.acao-apagou  .hist-topo .hist-acao { color: var(--erro); }

/* =========================================================
   CAMPO "O QUE VAI ACONTECER?" — uma caixa a sério, com título
   por cima e um lápis, para se perceber que é para escrever
   ========================================================= */

.ev-titulo-rotulo {
  display: block;
  margin: 2px 2px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--texto);
}

.cal-novo-dentro .ev-titulo,
.ev-titulo {
  height: 52px;
  padding: 0 14px 0 44px;
  font-size: 16px;
  font-weight: 500;
  color: var(--texto);
  /* lápis à esquerda */
  background: var(--branco)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23283078' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13 7l4 4'/%3E%3C/svg%3E")
    no-repeat 14px center / 20px 20px;
  border: 1.5px solid #C9CDDC;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(18, 22, 58, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ev-titulo::placeholder { color: #A3A8BC; font-weight: 400; }
.ev-titulo:hover { border-color: #A9AFC8; }

.ev-titulo:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

/* quando falta, fica vermelho à volta toda */
.ev-titulo.com-erro { border-color: var(--erro); box-shadow: 0 0 0 4px rgba(180, 35, 66, 0.1); }

/* =========================================================
   PC: "NOVA MARCAÇÃO" POR BAIXO DO CALENDÁRIO, A TODA A LARGURA
   (o js/calendario.js muda o formulário de sítio e põe "largo")
   ========================================================= */

@media (min-width: 601px) {

  .cal-novo.largo {
    grid-column: 1 / -1;          /* ocupa as duas colunas do cartão */
    margin: 0;
    padding: 14px 22px 18px;
    background: var(--fundo);
    border-top: 1px solid var(--linha);
  }

  /* Alterar não cria nenhuma superfície atrás dos campos. */
  .cal-novo.largo.a-alterar { background: transparent; }

  .cal-novo.largo .cal-novo-abrir { max-width: 320px; }
  .cal-novo.largo.aberto .cal-novo-abrir { max-width: 200px; }

  /* os campos em duas colunas: Dia | Hora e Para quem | Nota */
  .cal-novo.largo .ev-linhas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--linha);     /* as linhas entre caixas */
  }

  .cal-novo.largo .ev-linha,
  .cal-novo.largo .ev-linha + .ev-linha,
  .cal-novo.largo .ev-aviso + .ev-linha {
    border-top: none;
    background: var(--branco);
  }

  .cal-novo.largo .ev-linha:hover { background: var(--fundo); }
  .cal-novo.largo .ev-linha:focus-within { background: var(--azul-claro); }
  .cal-novo.largo .ev-linha.com-erro { background: #FCEEF1; }
  .cal-novo.largo .ev-linha.com-aviso { background: #FFF6E5; }

  /* os avisos ocupam a largura toda, por baixo do par de campos */
  .cal-novo.largo .ev-linhas .ev-aviso {
    grid-column: 1 / -1;
    padding: 6px 14px;
    background: var(--branco);
  }

  /* o botão Adicionar à direita, do tamanho do texto */
  .cal-novo.largo .cal-novo-dentro { display: flex; flex-direction: column; }
  .cal-novo.largo .cal-novo-dentro .botao-app {
    align-self: flex-end;
    width: auto;
    min-width: 220px;
    padding: 0 28px;
  }
}

/* =========================================================
   BOTÕES DA "NOVA MARCAÇÃO"
   PC: "+ Nova marcação" no canto de cima da coluna do dia;
   "Cancelar" ao lado do "Adicionar". Tablet e telemóvel:
   fica como estava (sem o Cancelar, que lá é o "Fechar").
   ========================================================= */

.ev-botoes { display: flex; gap: 10px; margin-top: 4px; }
.ev-botoes .botao-app { flex: 1; }
.botao-cancelar { display: none; }

@media (min-width: 601px) {

  /* a coluna do dia guarda o canto de cima para o botão */
  .cal-parte-dia { position: relative; }
  .cal-parte-dia .cal-dia-titulo { padding-right: 170px; }

  .cal-novo-abrir.no-canto {
    position: absolute;
    top: 22px;
    right: 22px;
    width: auto;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--branco);
    background: var(--azul);
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(40, 48, 120, 0.3);
  }

  .cal-novo-abrir.no-canto:hover { background: var(--azul-escuro); border: none; }

  /* com o formulário aberto já não é preciso */
  .cal-novo-abrir.no-canto.aberto { display: none; }

  /* Cancelar e Adicionar juntos, à direita */
  .cal-novo.largo .ev-botoes { justify-content: flex-end; }
  .cal-novo.largo .ev-botoes .botao-app { flex: 0 0 auto; }

  .cal-novo.largo .botao-cancelar {
    display: block;
    min-height: 52px;
    padding: 0 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--texto-suave);
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.4s var(--mola), color 0.15s, border-color 0.15s;
  }

  .cal-novo.largo .botao-cancelar:hover { color: var(--texto); border-color: #A9AFC8; transform: translateY(-2px); }
  .cal-novo.largo .botao-cancelar:active { transform: scale(0.97); transition-duration: 0.08s; }

  /* o formulário aberto já não tem botão por cima: sobe um pouco */
  .cal-novo.largo .cal-novo-dentro { padding-top: 0; }
  /* fechado: a faixa de baixo não ocupa espaço (e continua a abrir devagar) */
  .cal-novo.largo { transition: padding 0.45s ease; }
  .cal-novo.largo:not(.aberto) { padding-top: 0; padding-bottom: 0; border-top-color: transparent; }
}

/* =========================================================
   MARCAÇÃO DO CALENDÁRIO — cada informação com ícone e nome
   (telemóvel, tablet e PC)
   ========================================================= */

.cal-evento .cal-texto { gap: 8px; }

/* título + "Para ti" */
.cal-evento .cal-titulo-linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cal-evento .cal-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--texto);
  overflow-wrap: anywhere;
}

.cal-evento .cal-para-ti {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--branco);
  background: var(--verde);
  border-radius: 999px;
}

/* linha de informação: ícone | nome | valor */
.cal-evento .cal-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.4;
}

.cal-evento .cal-info svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: var(--azul);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-evento .cal-info-rotulo {
  flex: 0 0 auto;
  min-width: 36px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--texto-suave);
  padding-top: 1px;
  white-space: nowrap;
}

.cal-evento .cal-info-valor {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--texto);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* a nota numa caixinha, para se ver que é um texto escrito */
.cal-evento .cal-info-nota {
  padding: 8px 10px;
  background: var(--fundo);
  border-radius: 10px;
}

/* "Para": as etiquetas das pessoas */
.cal-evento .cal-info .cal-para { flex: 1; min-width: 0; }
.cal-evento .cal-para-pessoa { color: var(--azul); font-size: 12px; }
.cal-evento .cal-para-pessoa.todos { color: var(--texto-suave); }

/* "Criado por": mais discreto */
.cal-evento .cal-info-discreta svg { stroke: #A3A8BC; }
.cal-evento .cal-info-discreta .cal-info-valor { color: var(--texto-suave); font-size: 12.5px; }

/* a hora fica alinhada com o título */
.cal-evento { align-items: flex-start; }
.cal-evento .cal-hora { margin-top: 1px; white-space: nowrap; }

@media (max-width: 600px) {
  .cal-evento { flex-wrap: wrap; }
  .cal-evento .cal-texto { flex-basis: calc(100% - 110px); }
  .cal-evento .cal-titulo { font-size: 15px; }
}

/* =========================================================
   MARCAÇÃO DO CALENDÁRIO — mais arrumada e centrada
   hora na linha do título; nomes com a mesma largura, para
   os valores ficarem todos alinhados na mesma coluna
   ========================================================= */

.cal-evento,
.cal-evento:first-child {
  align-items: flex-start;
  padding: 14px 12px 14px 18px;
}

.cal-evento .cal-texto { gap: 10px; }

/* hora + título + "Para ti", centrados na mesma linha */
.cal-evento .cal-titulo-linha { align-items: center; gap: 10px; }
.cal-evento .cal-hora { margin-top: 0; }

/* cada linha: ícone | nome (largura fixa) | valor — tudo ao centro */
.cal-evento .cal-info { align-items: center; gap: 10px; }
.cal-evento .cal-info svg { margin-top: 0; }

.cal-evento .cal-info-rotulo {
  flex: 0 0 76px;
  min-width: 76px;
  padding-top: 0;
}

/* a nota ocupa a largura toda da coluna do conteúdo */
.cal-evento .cal-info-nota { padding: 9px 12px; }

/* as ações ao centro da primeira linha */
.cal-evento .cal-acoes { align-self: flex-start; margin-top: -4px; }

/* as iniciais na bolinha verde, a branco */
.cal-evento .pessoa-bolinha,
.cal-evento .cal-para-pessoa .pessoa-bolinha {
  color: var(--branco);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .cal-evento { flex-wrap: nowrap; padding: 12px 10px 12px 14px; }
  .cal-evento .cal-texto { flex-basis: auto; }
  .cal-evento .cal-info-rotulo { flex-basis: 64px; min-width: 64px; }
}

/* Nota, Para e Criado por com a mesma margem: ícones, nomes e
   valores todos na mesma coluna (só a Nota tem fundo) */
.cal-evento .cal-info,
.cal-evento .cal-info-nota { padding-left: 12px; padding-right: 12px; }
.cal-evento .cal-info-nota { padding-top: 9px; padding-bottom: 9px; }

/* "Criado por": a mesma etiqueta do "Para", num tom mais neutro */
.cal-evento .cal-info-discreta .cal-para-pessoa {
  color: var(--texto-suave);
  background: var(--fundo);
}

/* =========================================================
   MARCAÇÃO EM "FICHA": nome pequeno em cima, valor por baixo
   ========================================================= */

.cal-evento,
.cal-evento:first-child { padding: 16px 14px 16px 20px; }

.cal-evento .cal-texto { gap: 12px; }

/* quando + "Para ti" */
.cal-evento .marcacao-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.cal-evento .ficha-quando {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--azul);
  background: var(--azul-claro);
  border-radius: 999px;
}

.cal-evento .ficha-quando svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* o título em grande */
.cal-evento .ficha-titulo {
  display: block;
  margin-top: -4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--texto);
  overflow-wrap: anywhere;
}

/* cada campo: NOME em cima, valor por baixo */
.cal-evento .ficha-campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.cal-evento .ficha-nome {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8A90A6;
}

.cal-evento .ficha-valor {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--texto);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* a nota numa caixa com barra de lado, como um recado */
.cal-evento .ficha-nota {
  padding: 10px 14px;
  background: var(--fundo);
  border-left: 3px solid #C9CDDC;
  border-radius: 4px 10px 10px 4px;
}

/* para quem e criado por, lado a lado, separados por uma linha fina */
.cal-evento .ficha-rodape {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--linha);
}

.cal-evento .ficha-rodape .cal-para { flex-wrap: wrap; }

/* "Criado por" mais neutro que o "Para quem" */
.cal-evento .ficha-criado .cal-para-pessoa { color: var(--texto-suave); background: var(--fundo); }

/* as ações no topo, à direita */
.cal-evento .cal-acoes { margin-top: -6px; }

@media (max-width: 600px) {
  .cal-evento,
  .cal-evento:first-child { padding: 14px 10px 14px 16px; }
  .cal-evento .ficha-titulo { font-size: 17px; }
}

/* linhas finas a separar: horário | título | nota (igual à de "Para quem") */
.cal-evento .marcacao-topo,
.cal-evento .ficha-titulo {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--linha);
}

.cal-evento .ficha-titulo { margin-top: 0; }

/* o conteúdo vai até ao fim da caixa; lápis e lixo ficam por cima, no canto */
.cal-evento { position: relative; }
.cal-evento .cal-texto { flex: 1 1 100%; width: 100%; }

.cal-evento .cal-acoes {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

/* a linha da hora deixa espaço para os dois botões do canto */
.cal-evento .marcacao-topo { padding-right: 80px; }

/* linha fina na vertical entre "Para quem" e "Criado por" */
.cal-evento .ficha-rodape { gap: 0; }
.cal-evento .ficha-rodape .ficha-campo + .ficha-campo {
  padding-left: 14px;
  margin-left: 14px;
  border-left: 1px solid var(--linha);
}

/* o título numa caixa como a da nota, mas num cinzento mais escuro;
   sai a linha entre o título e a nota */
.cal-evento .ficha-titulo {
  padding: 10px 14px;
  border-bottom: none;
  background: #E4E7EF;
  border-left: 3px solid #A9AFC8;
  border-radius: 4px 10px 10px 4px;
}

/* caixa do título a azul escuro, com letra branca */
.cal-evento .ficha-titulo {
  color: var(--branco);
  background: var(--azul);
  border-left-color: var(--azul-noite);
}

/* título: azul menos escuro */
.cal-evento .ficha-titulo {
  background: #4A55B5;
  border-left-color: var(--azul);
}

/* título: o mesmo azul do botão "+ Nova marcação" */
.cal-evento .ficha-titulo {
  background: var(--azul);
  border-left-color: var(--azul);
}

/* título com letra mais pequena */
.cal-evento .ficha-titulo { font-size: 15px; font-weight: 600; }

@media (max-width: 600px) {
  .cal-evento .ficha-titulo { font-size: 14.5px; }
}

/* barra à esquerda do título, como na nota, num azul mais escuro */
.cal-evento .ficha-titulo { border-left: 3px solid var(--azul-noite); }

/* ícones do formulário, agora também na marcação */

/* lápis branco no título */
.cal-evento .ficha-titulo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cal-evento .ficha-titulo svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

/* o texto do título não herda o cinzento das regras antigas */
.cal-evento .ficha-titulo span {
  font-size: inherit;
  color: inherit;
  white-space: normal;
}

/* ícone azul ao lado de NOTA, PARA QUEM e CRIADO POR */
.cal-evento .ficha-nome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-evento .ficha-nome svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--azul);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   PC: A COLUNA DO DIA TEM SEMPRE A ALTURA DO MÊS
   A data e o "+ Nova marcação" ficam fixos em cima;
   só a lista das marcações desliza quando há muitas.
   ========================================================= */

@media (min-width: 601px) {

  /* a coluna do dia não puxa o cartão para baixo:
     quem manda na altura é o mês */
  .cal-cartao { align-items: stretch; }

  .cal-parte-dia {
    contain: size;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .cal-parte-dia .cal-dia-titulo { flex: 0 0 auto; }

  /* a lista desliza por dentro */
  .cal-parte-dia #dia-eventos {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-right: -10px;          /* a barra de deslizar fica encostada à margem */
    padding-right: 10px;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #C9CDDC transparent;
  }

  .cal-parte-dia #dia-eventos::-webkit-scrollbar { width: 6px; }
  .cal-parte-dia #dia-eventos::-webkit-scrollbar-thumb { background: #C9CDDC; border-radius: 3px; }
}

/* =========================================================
   PC: TUDO ATÉ AO FIM DO ECRÃ, SEJA QUAL FOR O MONITOR
   (sem larguras máximas; acompanha a janela)
   ========================================================= */

@media (min-width: 601px) {
  .corpo-app { max-width: none; }

  .hoje-coluna,
  .cal-pagina,
  .cal-historico {
    width: 100%;
    max-width: none;
  }

  .corpo-app > .hoje-coluna,
  .corpo-app > .cal-pagina,
  .corpo-app > .cal-historico { justify-self: stretch; }
}

/* =========================================================
   REGRA DO SITE (PC): nenhuma página da app fica presa a uma
   largura máxima — tudo estica até ao fim do ecrã, seja qual
   for o monitor. Excepção de propósito: o cartão de entrar
   (login), que fica pequeno e ao centro.
   ========================================================= */

@media (min-width: 601px) {
  .definicoes { max-width: none; }
  .corpo-app > .definicoes { justify-self: stretch; }
}

/* =========================================================
   PC: SEM BARRA DE DESLIZAR NA COLUNA DO DIA
   Mostram-se as marcações que cabem; o botão "Ver todas"
   abre uma janela com todas as do dia.
   ========================================================= */

@media (min-width: 601px) {
  .cal-parte-dia #dia-eventos {
    position: relative;           /* para contar o que cabe */
    overflow: hidden;
    margin-right: 0;
    padding-right: 0;
  }
}

.cal-evento[hidden] { display: none; }

.ver-todas {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: var(--branco);
  border: 1.5px solid #B9BFE0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), border-color 0.15s, background 0.15s;
}

.ver-todas:hover { border-color: var(--azul); background: var(--azul-claro); transform: translateY(-2px); }
.ver-todas:active { transform: scale(0.97); transition-duration: 0.08s; }

/* ---------- a janela com todas as marcações ---------- */

.janela-dia {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: none;
  border-radius: 20px;
  background: var(--fundo);
  box-shadow: 0 30px 80px rgba(8, 10, 32, 0.45);
  overflow: hidden;
  font-family: var(--letra);
}

.janela-dia[open] { display: flex; flex-direction: column; animation: janela-entra 0.25s var(--mola); }

.janela-dia::backdrop { background: rgba(18, 22, 58, 0.45); backdrop-filter: blur(2px); }

.janela-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  color: var(--branco);
  background:
    radial-gradient(360px 140px at 100% 0%, rgba(0, 144, 72, 0.45), transparent 70%),
    linear-gradient(135deg, var(--azul) 0%, var(--azul-noite) 100%);
}

.janela-topo h2 { margin: 0; font-size: 18px; font-weight: 700; }

.janela-fechar {
  width: 38px;
  height: 38px;
  font-size: 24px;
  line-height: 1;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  cursor: pointer;
}

.janela-fechar:hover { background: rgba(255, 255, 255, 0.24); }

/* a lista desliza dentro da janela, se for comprida */
.janela-lista {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.janela-lista .cal-evento { margin-bottom: 0; }

@keyframes janela-entra {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* a janela no telemóvel: quase o ecrã todo */
@media (max-width: 600px) {
  .janela-dia { width: calc(100vw - 16px); max-height: calc(100vh - 32px); border-radius: 16px; }
  .janela-topo { padding: 14px 16px; }
  .janela-topo h2 { font-size: 16px; }
  .janela-lista { padding: 12px; }
}

/* o "Ver todas" fica fora da lista, sempre visível no fundo da coluna do dia */
.cal-parte-dia > .ver-todas { flex: 0 0 auto; margin-top: 10px; }

/* "Ver todas": sempre com fundo azul claro e contorno azul
   (igual no PC, tablet e telemóvel — não depende do rato) */
.ver-todas {
  background: var(--azul-claro);
  border-color: var(--azul);
}

.ver-todas:hover { background: #D6D9EC; }

/* PC: o cartão cresce para baixo o que for preciso para a marcação
   aparecer inteira (como só se mostra uma, nunca fica enorme) */
@media (min-width: 601px) {
  .cal-parte-dia { contain: none; }
  .cal-parte-dia #dia-eventos { overflow: visible; }
}

/* PC: o mês cresce com números maiores e linhas mais altas,
   para acompanhar a altura da coluna do dia (sem espaço vazio) */
@media (min-width: 601px) {
  .cal-parte-mes .cal-d { height: 58px; }

  .cal-parte-mes .cal-d > span {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .cal-parte-mes .cal-semana span { font-size: 12px; padding-bottom: 8px; }
  .cal-parte-mes .cal-ponto { bottom: 2px; width: 6px; height: 6px; margin-left: -3px; }
}

/* o pontinho das marcações um pouco mais abaixo, afastado do círculo */
.cal-parte-mes .cal-ponto { bottom: -3px; }

@media (min-width: 601px) {
  .cal-parte-mes .cal-ponto { bottom: -2px; }
}

/* pontinho sempre ao centro exato do dia, e por cima da sombra do
   círculo escolhido (a sombra fazia o azul parecer mais acima) */
.cal-parte-mes .cal-ponto {
  left: 50%;
  margin-left: 0;
  transform: translateX(-50%);
  z-index: 1;
}

/* =========================================================
   LEMBRETES "PARA QUEM"
   ========================================================= */

/* a escolha, entre o texto e o Adicionar */
.lemb-para {
  flex: 0 0 auto;
  max-width: 200px;
  height: 44px;
  padding: 0 34px 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: var(--azul-claro)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23283078' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center / 14px 14px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
}

.lemb-para:hover { border-color: #B9BFE0; }
.lemb-para:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12); }

/* no lembrete: "Para Otavio" (enviado) e "De Adrian" (recebido) */
.lemb-texto .lemb-quem {
  align-self: flex-start;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

.lemb-texto .lemb-quem.enviado  { color: var(--azul); background: var(--azul-claro); }
.lemb-texto .lemb-quem.recebido { color: #00713A; background: var(--verde-claro); }

/* telemóvel e tablet: texto em cima; "Para quem" e Adicionar por baixo */
@media (max-width: 600px) {
  .resumo-novo,
  .lemb-linha { flex-wrap: wrap; }
  .resumo-novo > input,
  .lemb-linha #lemb-texto { flex: 1 0 100%; }
  .lemb-para { flex: 1 1 0; max-width: none; }
}

/* =========================================================
   ESCOLHA "PARA QUEM" BONITA (botão com foto + cartão)
   ========================================================= */

.eb { position: relative; flex: 0 0 auto; }

/* o <select> fica escondido por trás, só guarda o valor */
.eb-escondida {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.eb-botao {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  max-width: 220px;
  padding: 0 12px 0 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: var(--azul-claro);
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.eb-botao:hover { border-color: #B9BFE0; }
.eb-botao:focus-visible,
.eb.aberta .eb-botao { outline: none; border-color: var(--azul); background: var(--branco); }

.eb-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eb-botao svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.eb.aberta .eb-botao svg { transform: rotate(180deg); }

/* foto ou iniciais */
.eb-foto {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  font-size: 11px;
  font-weight: 700;
  color: var(--branco);
  background: var(--verde);
  border: 2px solid var(--branco);
}

/* o cartão com a equipa */
.eb-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 240px;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--branco);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(18, 22, 58, 0.2), 0 2px 6px rgba(18, 22, 58, 0.08);
  animation: eb-abre 0.18s ease-out;
}

.eb-menu[hidden] { display: none; }

.eb-opcao {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--texto);
  border-radius: 10px;
  cursor: pointer;
}

.eb-opcao:hover,
.eb-opcao:focus-visible { outline: none; background: var(--fundo); }

.eb-opcao span:last-child { flex: 1; }

/* a escolhida: fundo azul claro e ✓ verde */
.eb-opcao.escolhida { font-weight: 700; color: var(--azul); background: var(--azul-claro); }
.eb-opcao.escolhida::after { content: "✓"; font-weight: 700; color: var(--verde); }

@keyframes eb-abre {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* telemóvel e tablet: ocupa o espaço ao lado do Adicionar */
@media (max-width: 600px) {
  .eb { flex: 1 1 0; }
  .eb-botao { width: 100%; max-width: none; }
  .eb-menu { left: 0; right: 0; min-width: 0; }
}


/* =========================================================
   SETA DE VOLTAR — novo desenho (em todos os ecrãs)
   círculo azul claro com seta fina; ao passar o rato fica
   azul cheio e a seta desliza para a esquerda
   ========================================================= */

.barra-app .voltar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--azul);
  background: var(--azul-claro);
  border: none;
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.4s var(--mola), box-shadow 0.2s;
}

.barra-app .voltar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--mola);
}

.barra-app .voltar:hover {
  color: var(--branco);
  background: var(--azul);
  box-shadow: 0 6px 16px rgba(40, 48, 120, 0.3);
  transform: none;
}

.barra-app .voltar:hover svg { transform: translateX(-3px); }
.barra-app .voltar:active { transform: scale(0.92); transition-duration: 0.08s; }
.barra-app .voltar:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }

/* tablet e telemóvel: a barra é azul, por isso o círculo fica translúcido */
@media (max-width: 1023px) {
  .barra-app .voltar {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    color: var(--branco);
    background: rgba(255, 255, 255, 0.14);
  }

  .barra-app .voltar:hover { background: rgba(255, 255, 255, 0.28); box-shadow: none; }
}

/* =========================================================
   TABLET E TELEMÓVEL: DESTAQUE QUE DESLIZA NA BARRA DE BAIXO
   (a "pílula" é posta e movida pelo js/sessao.js)
   ========================================================= */

.menu-indicador { display: none; }

@media (max-width: 1023px) {
  .lateral-menu { position: relative; }

  .menu-indicador {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 3px 0 var(--verde);
    pointer-events: none;
    transition:
      transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1),
      width 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
  }

  /* as opções ficam por cima da pílula; o destaque antigo sai */
  .lateral-menu > a { position: relative; z-index: 1; }
  .lateral-menu > a.ativo { background: transparent; box-shadow: none; }

  /* o ícone da opção escolhida sobe um pouco, com o mesmo ressalto */
  .lateral-menu > a svg { transition: transform 0.38s var(--mola); }
  .lateral-menu > a.ativo svg { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .menu-indicador { transition: none; }
}

/* tablet e telemóvel: nenhuma caixa cinzenta nas opções da barra de baixo
   (nem a do toque do browser, nem a do "rato por cima") — só a pílula */
@media (max-width: 1023px) {
  .lateral-menu > a,
  .lateral-menu > a:hover,
  .lateral-menu > a:focus,
  .lateral-menu > a:active,
  .lateral-menu > a.ativo {
    background: transparent;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }

  .lateral-menu > a:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: -2px; }
}

/* =========================================================
   PC: A MESMA PÍLULA QUE DESLIZA, NO MENU LATERAL
   sobe e desce até à opção escolhida (também no submenu),
   com a linha verde do lado esquerdo
   ========================================================= */

@media (min-width: 1024px) {
  .lateral-menu { position: relative; }

  .menu-indicador {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 3px 0 0 var(--verde);
    pointer-events: none;
    transition:
      transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1),
      width 0.38s cubic-bezier(0.34, 1.4, 0.64, 1),
      height 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
  }

  /* as opções ficam por cima da pílula; sem caixa própria quando escolhidas */
  .lateral-menu a { position: relative; z-index: 1; -webkit-tap-highlight-color: transparent; }

  .lateral-menu a.ativo,
  .lateral-menu .lateral-sub a.ativo,
  .lateral-menu > a.ativo:has(+ .lateral-sub a.ativo) {
    background: transparent;
    box-shadow: none;
  }

  /* com o rato por cima: só um brilho muito leve nas outras opções */
  .lateral-menu a:not(.ativo):hover { background: rgba(255, 255, 255, 0.05); }
}

/* PC: a opção escolhida não foge da pílula ao passar o rato */
@media (min-width: 1024px) {
  .lateral-menu a.ativo:hover { transform: none; }
}

/* =========================================================
   PC: SETINHA PARA FECHAR/ABRIR O SUBMENU DO "O MEU DIA"
   ========================================================= */

.sub-seta { display: none; }

@media (min-width: 1024px) {
  .sub-seta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    margin-right: -6px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .sub-seta:hover { color: var(--branco); background: rgba(255, 255, 255, 0.14); }
  .sub-seta:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 1px; }

  .sub-seta svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
  }

  /* fechado: a setinha aponta para o lado */
  .sub-seta.fechado svg { transform: rotate(-90deg); }

  /* o submenu fecha e abre devagar */
  .lateral-sub {
    max-height: 200px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
  }

  .lateral-sub.fechado {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
  }

  .lateral-sub.sem-animacao { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lateral-sub, .sub-seta svg { transition: none; }
}

/* a setinha não herda o tamanho dos ícones do menu */
@media (min-width: 1024px) {
  .lateral-menu .sub-seta svg { flex: 0 0 16px; height: 16px; }
}

/* =========================================================
   TELEMÓVEL (até 600px): VOLTA O MENU ☰ NO TOPO
   barra fina com ☰ à esquerda e logótipo à direita; o menu
   desce ao carregar no ☰. O tablet continua com a barra de baixo.
   ========================================================= */

@media (max-width: 1023px) {

  /* espaço para a barra fina de cima; a de baixo deixa de existir */
  .ecra-app { padding-top: 56px; padding-bottom: 0; }

  /* a barra de cima: só o botão ☰ */
  .lateral {
    position: fixed;
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    z-index: 30;
    height: 56px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0 10px;
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-noite) 100%);
    box-shadow: 0 2px 12px rgba(18, 22, 58, 0.25);
  }

  /* sem foto, sem nome */
  .lateral .lateral-logo,
  .lateral .lateral-logo.com-avatar,
  .lateral .lateral-pessoa { display: none; }

  .menu-botao {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--branco);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.4s var(--mola), background 0.15s;
  }

  .menu-botao svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .menu-botao:active { transform: scale(0.92); transition-duration: 0.08s; }
  .lateral.aberto .menu-botao { background: rgba(255, 255, 255, 0.22); }

  /* o painel que desce */
  .lateral-painel {
    display: block;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 8px 12px 16px;
    background: var(--azul-noite);
    box-shadow: 0 16px 32px rgba(8, 10, 32, 0.4);
    border-radius: 0 0 18px 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.3s var(--mola), visibility 0.2s;
  }

  .lateral.aberto .lateral-painel {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* as opções em lista, com ícone e nome lado a lado */
  .lateral-menu { flex-direction: column; gap: 2px; }

  /* opções grandes (só as de primeiro nível; o submenu tem o seu tamanho) */
  .lateral-menu > a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    font-size: 15px;
    text-align: left;
  }

  /* com o cursor por cima nada muda de tamanho nem de sítio */
  .lateral-menu a:hover,
  .lateral-menu a:active { transform: none; }

  .lateral-menu .lateral-sub a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;   /* encostado à esquerda */
    text-align: left;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .lateral-menu a.ativo { box-shadow: inset 3px 0 0 var(--verde); }
  .lateral-menu a svg,
  .lateral-menu a.ativo svg,
  .lateral-menu a:active svg { transform: none; }

  /* o submenu (Calendário, Lembretes) também aparece */
  .lateral-sub { display: flex; }

  .lateral-fundo {
    display: block;
    margin-top: 10px;
    padding-top: 12px;
  }

  /* sai a barra "Nome · Cargo" com a foto */
  .barra-hoje { display: none; }

  /* os títulos dos outros ecrãs ficam simples, por baixo da barra ☰ */
  .barra-app {
    position: static;
    padding: 18px 16px 0;
    color: var(--texto);
    background: none;
  }

  .barra-app .tit { font-size: 22px; font-weight: 700; }
  .barra-app .sub { color: var(--texto-suave); }
  .barra-app .voltar {
    color: var(--azul);
    background: var(--branco);
    border-color: var(--linha);
  }

  .barra-app .logo-barra,
  .barra-app .avatar-barra { display: none; }
}

/* logótipo à direita da barra ☰ (leva ao "O meu dia") */
@media (max-width: 1023px) {
  .menu-logo {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 40px;
    padding: 3px 8px;
    background: var(--branco);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(8, 10, 32, 0.25);
    transition: transform 0.4s var(--mola);
  }

  .menu-logo img { height: 100%; width: auto; display: block; }
  .menu-logo:active { transform: scale(0.94); transition-duration: 0.08s; }
  .menu-logo:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }
}

/* no painel do ☰ as opções estão em coluna: a pílula que desliza
   anda para cima e para baixo (como no PC), com a linha verde à esquerda */
@media (max-width: 1023px) {
  .menu-indicador {
    top: 0;
    bottom: auto;
    box-shadow: inset 3px 0 0 var(--verde);
  }

  .lateral-menu a.ativo,
  .lateral-menu > a.ativo { background: transparent; box-shadow: none; }

  .lateral-menu > a.ativo svg { transform: none; }
}


/* =========================================================
   A OPÇÃO DO SUBMENU ONDE SE ESTÁ TEM A SUA PRÓPRIA CAIXA
   (a pílula fica no "O meu dia"; igual no PC e no telemóvel)
   ========================================================= */

.lateral-menu .lateral-sub a.ativo,
.lateral-menu .lateral-sub a.ativo:hover {
  color: var(--branco);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--verde);
}

/* =========================================================
   OBRAS: lista em cartões + página de cada obra
   ========================================================= */

.obras-grelha {
  display: grid;
  /* cartões largos: nomes compridos cabem em 1-2 linhas */
  grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
  gap: 14px;
}

.obra-cartao {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--texto);
  text-decoration: none;
  background: var(--branco);
  border-radius: 18px;
  box-shadow: var(--sombra);
  transition: transform 0.4s var(--mola), box-shadow 0.2s;
}

.obra-cartao:hover { transform: translateY(-3px); box-shadow: var(--sombra-levantada); }
.obra-cartao:active { transform: scale(0.98); transition-duration: 0.08s; }

.obra-icone {
  flex: 0 0 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  background: var(--azul-claro);
  border-radius: 14px;
}

.obra-icone svg,
.obra-seta svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.obra-icone svg { width: 24px; height: 24px; }

.obra-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.obra-texto strong { font-size: 16px; font-weight: 700; }
.obra-texto small { font-size: 13px; color: var(--texto-suave); }

.obra-seta { color: #A3A8BC; display: flex; }
.obra-seta svg { width: 18px; height: 18px; stroke-width: 2.2; }
.obra-cartao:hover .obra-seta { color: var(--azul); }

/* a página de uma obra */
.obra-ficha {
  padding: 22px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
}

.obra-ficha-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.obra-ficha-topo h2 { margin: 0; font-size: 20px; font-weight: 700; }

.obra-campos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 14px 20px;
  margin: 0;
}

.obra-campos dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8A90A6;
}

.obra-campos dd { margin: 4px 0 0; font-size: 15px; color: var(--texto); }
.obra-nota { text-align: left; margin-top: 18px; }


/* telemóvel: a seta de voltar com o mesmo desenho do PC
   (círculo azul claro, seta azul) — a barra de cima é clara */
@media (max-width: 1023px) {
  .barra-app .voltar {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    color: var(--azul);
    background: var(--azul-claro);
    border: none;
  }

  .barra-app .voltar:hover,
  .barra-app .voltar:active {
    color: var(--branco);
    background: var(--azul);
  }
}

/* =========================================================
   PÁGINA DE UMA OBRA: progresso + secções que abrem e fecham
   ========================================================= */

.obra-progresso { margin-top: 20px; }
.obra-progresso-texto { display: flex; justify-content: space-between; font-size: 13px; color: var(--texto-suave); }
.obra-progresso-texto strong { color: var(--texto); }

.obra-progresso-barra {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  background: var(--fundo);
  border-radius: 999px;
}

.obra-progresso-barra i { display: block; width: 0; height: 100%; background: var(--verde); border-radius: 999px; }

.obra-grupo { margin-top: 22px; }

.obra-seccoes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 10px;
  align-items: start;
}

.obra-sec {
  background: var(--branco);
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
}

.obra-sec-topo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font-family: inherit;
  text-align: left;
  color: var(--texto);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.obra-sec-topo:hover { background: var(--fundo); }
.obra-sec-topo:focus-visible { outline: 3px solid var(--azul); outline-offset: -3px; }

.obra-sec-icone {
  flex: 0 0 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  background: var(--azul-claro);
  border-radius: 12px;
}

.obra-sec-icone svg,
.obra-categorias > li > svg, .obra-pasta-topo svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.obra-sec-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.obra-sec-texto strong { font-size: 15px; font-weight: 600; }
.obra-so-gestao { font-size: 11px; font-weight: 700; color: #9A5B00; }

.obra-sec-contagem {
  min-width: 26px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--texto-suave);
  background: var(--fundo);
  border-radius: 999px;
}

.obra-sec.aberta .opcao-seta { transform: rotate(-135deg); }
/* Abrir a secção não deve alterar o aspeto do respetivo cabeçalho.
   Isto também evita que, ao carregar em Editar (que abre a secção),
   o título pareça mudar de caixa. */
.obra-sec.aberta .obra-sec-topo { background: var(--branco); }

/* abre devagar */
.obra-sec-corpo { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s ease; }
.obra-sec.aberta .obra-sec-corpo { grid-template-rows: 1fr; }
.obra-sec-dentro { min-height: 0; overflow: hidden; padding: 0 16px; }
.obra-sec.aberta .obra-sec-dentro { padding: 12px 16px 16px; }

.obra-sec-explica { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--texto-suave); }

/* manuais: as categorias */
.obra-categorias { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.obra-categorias > li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--texto);
  background: var(--fundo);
  border-radius: 10px;
}

.obra-categorias > li > svg, .obra-pasta-topo > svg { color: var(--azul); flex: 0 0 18px; width: 18px; height: 18px; }
.obra-categorias > li > span { flex: 1; }
.obra-pasta-topo small, .obra-categorias > li > small { font-size: 12px; color: var(--texto-suave); }

/* mapa de quantidades: a tabela */
.obra-tabela-caixa { overflow-x: auto; border: 1px solid var(--linha); border-radius: 12px; }

.obra-tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.obra-tabela th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: #8A90A6;
  background: var(--fundo);
  white-space: nowrap;
}

.obra-tabela td { padding: 10px 12px; border-top: 1px solid var(--linha); }
.obra-tabela-vazia { text-align: center; color: var(--texto-suave); }

@media (max-width: 600px) {
  .obra-seccoes { grid-template-columns: 1fr; }
  .obra-sec-topo { padding: 12px 14px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .obra-sec-corpo { transition: none; }
}

/* histórico: o nome de quem fez, antes da etiqueta */
.hist-topo .hist-quem { font-size: 14px; font-weight: 700; color: var(--texto); }

/* telemóvel: o logótipo da barra ☰ é o logo-construction2.png —
   o logótipo dentro de uma forma branca em seta, com o resto
   transparente. Mostra-se inteiro, sobre a barra azul, sem caixa. */
@media (max-width: 1023px) {
  .menu-logo {
    height: 50px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }

  .menu-logo img {
    height: 100%;
    width: auto;
    margin: 0;
  }
}

/* =========================================================
   ENTRADA (login): SEMPRE AO CENTRO, EM QUALQUER ECRÃ
   ========================================================= */

.ecra {
  min-height: 100vh;
  min-height: 100dvh;                 /* altura real no telemóvel (barras do browser) */
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;                   /* ecrãs muito baixos: deixa deslizar em vez de cortar */
}

/* "safe": se não couber, encosta em cima em vez de ficar cortado */
@supports (align-items: safe center) {
  .ecra { align-items: safe center; justify-content: safe center; }
}

/* PC: texto e cartão com a mesma largura -> o conjunto fica simétrico
   e o meio do ecrã cai exatamente no espaço entre os dois */
@media (min-width: 601px) {
  .apresentacao {
    flex: 0 1 400px;
    max-width: 400px;
  }

  .cartao {
    flex: 0 1 400px;
    max-width: 400px;
  }
}

/* tablet e telemóvel: só o cartão, ao centro */
@media (max-width: 600px) {
  .cartao { margin-left: auto; margin-right: auto; }
}


/* =========================================================
   MANUTENÇÕES
   Uma caixa por manutenção, só com o nome. O resto
   (periodicidade do contrato e o que vai dentro de cada uma)
   fica para quando estiver decidido.
   ========================================================= */

/* "+ Adicionar manutenção": é sempre o último item da lista,
   logo por baixo da última manutenção. Só o escritório e a
   gerência o veem. */
/* dentro da grelha fica igual ao "Adicionar obra" (sem margem, o mesmo +) */
.obras-grelha #abrir-nova { margin-top: 0; }

/* o formulário de criar, que abre no lugar do próprio botão */
.manut-nova {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-top: 12px;
  background: var(--fundo);
  border: 1px solid var(--linha);
  border-radius: 12px;
}

.manut-nova input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--linha);
  border-radius: 9px;
  background: var(--branco);
  color: var(--texto);
}

.manut-nova input[type="text"]:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 1px;
}

.manut-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.manut-acoes .botao-app,
.manut-acoes .botao-linha {
  width: auto;
  padding-left: 22px;
  padding-right: 22px;
}

/* a caixa de cada manutenção: por agora, só o nome */
.manut {
  padding: 16px 18px;
  border: 1px solid var(--linha);
  border-radius: 12px;
  background: var(--branco);
  margin-bottom: 10px;
}

.manut:last-child { margin-bottom: 0; }

.manut-nome {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--texto);
}



/* =========================================================
   LEMBRETES: NOTA (opcional)
   ========================================================= */

/* o campo da nota fica numa linha só para ele, por baixo */
.resumo-novo,
.lemb-linha { flex-wrap: wrap; }

.lemb-nota-campo {
  flex: 1 0 100%;
  order: 10;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--texto);
  background: var(--fundo);
  border: 1.5px solid transparent;
  border-radius: 12px;
  resize: vertical;
}

.lemb-nota-campo::placeholder { color: #A3A8BC; }

.lemb-nota-campo:focus {
  outline: none;
  background: var(--branco);
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

/* a nota dentro do lembrete: caixinha clara com o ícone */
.lemb-texto .lemb-nota {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--texto);
  background: var(--fundo);
  border-left: 3px solid #C9CDDC;
  border-radius: 4px 8px 8px 4px;
}

.lemb-texto .lemb-nota span {
  font-size: 13px;
  font-weight: 400;
  color: var(--texto);
  white-space: pre-line;
}

.lemb-texto .lemb-nota svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  fill: none;
  stroke: var(--azul);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   NOVIDADES — "RADAR"
   ponto verde com ondas a sair; some quando se carrega
   ========================================================= */

.radar {
  position: relative;
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--verde);
}

/* as duas ondas do radar */
.radar::before,
.radar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--verde);
  animation: radar-onda 1.8s ease-out infinite;
}

.radar::after { animation-delay: 0.9s; }

@keyframes radar-onda {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(3.2); opacity: 0; }
}

/* no menu: à direita da opção */
.lateral-menu a .radar { margin-left: auto; margin-right: 4px; }

/* no menu do PC, o "O meu dia" já tem o submenu: o radar fica antes dele */
.lateral-menu > a .radar { margin-left: auto; }



/* a etiqueta "NOVO" (marcação ou lembrete) */
.etiqueta-novo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #00713A;
  background: var(--verde-claro);
  border-radius: 999px;
  align-self: flex-start;
}

.etiqueta-novo .radar { width: 7px; height: 7px; flex-basis: 7px; }

/* a marcação ou o lembrete novo: contorno verde e mãozinha ao passar */
.cal-evento.novo,
.cal-evento.novo:first-child {
  cursor: pointer;
  box-shadow: inset 4px 0 0 var(--verde), 0 0 0 2px rgba(0, 144, 72, 0.35), 0 4px 14px rgba(0, 144, 72, 0.15);
}

.lemb.novo,
.lemb.novo:first-child {
  cursor: pointer;
  background: var(--verde-claro);
}

.lemb.novo:hover { background: #D3EEDF; }

/* no mês: o ponto do dia pulsa como um radar */
.cal-ponto.novo { background: var(--verde); }

.cal-ponto.novo::before,
.cal-ponto.novo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--verde);
  animation: radar-onda 1.8s ease-out infinite;
}

.cal-ponto.novo::after { animation-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
  .radar::before, .radar::after,
  .cal-ponto.novo::before, .cal-ponto.novo::after { animation: none; opacity: 0; }
}

/* a etiqueta NOVO ganha às regras antigas dos textos das marcações e dos lembretes */
.cal-evento .etiqueta-novo,
.lemb .lemb-texto .etiqueta-novo {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: #00713A;
  white-space: nowrap;
}

.lemb .lemb-texto .etiqueta-novo .radar,
.cal-evento .etiqueta-novo .radar { font-size: 0; }

/* =========================================================
   MARCAÇÕES BEM SEPARADAS (janela "Ver todas" e coluna do dia)
   cada uma é um cartão destacado, com espaço entre elas
   ========================================================= */

/* fundo mais escuro por trás da lista: os cartões brancos sobressaem */
.janela-lista {
  gap: 18px;
  padding: 18px;
  background: #E6E9F2;
}

#dia-eventos .cal-evento + .cal-evento { margin-top: 14px; }

/* cada marcação: contorno, cantos redondos e sombra */
.cal-evento,
.cal-evento:first-child {
  border: 1px solid #DCE0EB;
  border-radius: 16px;
  box-shadow: inset 4px 0 0 var(--azul), 0 4px 14px rgba(18, 22, 58, 0.08);
}

.cal-evento.para-mim { box-shadow: inset 4px 0 0 var(--verde), 0 4px 14px rgba(18, 22, 58, 0.08); }

/* a marcação nova continua com o contorno verde do radar */
.cal-evento.novo,
.cal-evento.novo:first-child {
  border-color: rgba(0, 144, 72, 0.45);
  box-shadow: inset 4px 0 0 var(--verde), 0 0 0 2px rgba(0, 144, 72, 0.25), 0 4px 14px rgba(0, 144, 72, 0.15);
}

/* ao passar o rato, a marcação levanta um pouco: vê-se qual é qual */
.cal-evento { transition: transform 0.3s var(--mola), box-shadow 0.2s; }
.cal-evento:hover { transform: translateY(-2px); }

@media (max-width: 600px) {
  .janela-lista { gap: 14px; padding: 12px; }
}

/* =========================================================
   LEMBRETES: o título numa caixa azul (como nas marcações)
   para se distinguir do "Para …", da nota e da data
   ========================================================= */

.lemb .lemb-texto { gap: 7px; }

.lemb .lemb-texto > span:first-child {
  align-self: stretch;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--branco);
  background: var(--azul);
  border-left: 3px solid var(--azul-noite);
  border-radius: 4px 10px 10px 4px;
}

/* feito: a caixa fica clara e riscada */
.lemb.feito .lemb-texto > span:first-child {
  color: var(--texto-suave);
  background: var(--fundo);
  border-left-color: #C9CDDC;
  text-decoration: line-through;
}

/* no histórico (apagados): caixa cinzenta */
.lemb.apagado .lemb-texto > span:first-child {
  color: var(--texto);
  background: #E4E7EF;
  border-left-color: #A9AFC8;
}

/* o círculo de "feito" e o lixo alinhados com a caixa do título */
.lemb { align-items: flex-start; }
.lemb .lemb-marcar,
.lemb .botao-lixo,
.lemb .botao-repor { margin-top: 6px; }

/* =========================================================
   CALENDÁRIO: MÊS EM CIMA, DIA POR BAIXO — TODAS AS MARCAÇÕES
   Sem lado a lado, nunca sobra espaço em branco: o mês ocupa
   a largura toda e as marcações do dia ficam numa grelha que
   cresce para baixo. (PC; no tablet/telemóvel já era assim.)
   ========================================================= */

@media (min-width: 601px) {
  .cal-cartao { grid-template-columns: minmax(0, 1fr); }

  /* o mês, a toda a largura (dias um pouco mais baixos) */
  .cal-parte-mes .cal-d { height: 50px; }

  /* o dia, por baixo do mês */
  .cal-parte-dia {
    padding: 22px 24px 24px;
    border-left: none;
    border-top: 1px solid var(--linha);
  }

  /* data à esquerda, "+ Nova marcação" à direita, na mesma linha */
  .cal-parte-dia .cal-dia-titulo { padding-right: 190px; margin-bottom: 18px; }

  /* Todas as marcações do dia, numa lista: os cartões nunca ficam apertados. */
  .cal-parte-dia #dia-eventos {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    overflow: visible;
  }

  #dia-eventos .cal-evento + .cal-evento { margin-top: 0; }
  #dia-eventos .cal-evento { margin-bottom: 0; }

  /* dia sem nada: a caixa tracejada ocupa a linha toda */
  #dia-eventos .cal-nada { grid-column: 1 / -1; }
}

/* o botão "Ver todas" já não é preciso */
.ver-todas { display: none; }

/* =========================================================
   "+ NOVA MARCAÇÃO" IGUAL EM TODOS OS FORMATOS
   botão azul no canto de cima do dia, ao lado da data;
   esconde-se enquanto o formulário está aberto
   ========================================================= */

.cal-parte-dia { position: relative; }

.cal-novo-abrir.no-canto {
  position: absolute;
  top: 22px;
  right: 22px;
  width: auto;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--branco);
  background: var(--azul);
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(40, 48, 120, 0.3);
}

.cal-novo-abrir.no-canto:hover { background: var(--azul-escuro); border: none; }
.cal-novo-abrir.no-canto.aberto { display: none; }

/* a data não fica por baixo do botão */
.cal-parte-dia .cal-dia-titulo { padding-right: 170px; }

/* tablet e telemóvel: um pouco mais pequeno, para caber ao lado da data */
@media (max-width: 600px) {
  .cal-novo-abrir.no-canto { top: 16px; right: 16px; height: 38px; padding: 0 14px; font-size: 13px; }
  .cal-parte-dia .cal-dia-titulo { padding-right: 150px; }
}

/* telemóvel muito estreito: botão mais justo, para não apertar a data */
@media (max-width: 380px) {
  .cal-novo-abrir.no-canto { position: static; width: 100%; margin: 0 0 12px; padding: 0 12px; }
  .cal-parte-dia .cal-dia-titulo { padding-right: 0; }
}
/* o mesmo quando é a coluna do dia que é estreita (menu aberto, O meu dia), não só o ecrã */
.cal-parte-dia { container: caldia / inline-size; }
@container caldia (max-width: 440px) {
  .cal-novo-abrir.no-canto { position: static; width: 100%; margin: 0 0 12px; padding: 0 12px; }
  .cal-parte-dia .cal-dia-titulo { padding-right: 0; }
}

/* =========================================================
   O DIA ESCOLHIDO: FOLHA DE CALENDÁRIO
   mês numa faixa azul (verde se for hoje) + o dia em grande;
   ao lado, o dia da semana e a data por extenso
   ========================================================= */

.cal-dia-titulo { align-items: center; gap: 16px; }

.dia-folha {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--branco);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(18, 22, 58, 0.12), 0 0 0 1px #DCE0EB;
  text-align: center;
}

.dia-folha-mes {
  padding: 4px 0 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--branco);
  background: var(--azul);
}

.dia-folha.hoje .dia-folha-mes { background: var(--verde); }

.dia-folha-num {
  padding: 4px 0 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--azul);
  font-variant-numeric: tabular-nums;
}

.dia-folha.hoje .dia-folha-num { color: var(--verde); }

.cal-dia-titulo .cal-dia-resto strong { font-size: 19px; font-weight: 700; color: var(--texto); }
.cal-dia-titulo .cal-dia-resto small { font-size: 13.5px; color: var(--texto-suave); }

@media (max-width: 600px) {
  .dia-folha { flex-basis: 56px; }
  .dia-folha-num { font-size: 24px; }
  .cal-dia-titulo .cal-dia-resto strong { font-size: 17px; }
  .cal-dia-titulo .cal-dia-resto small { font-size: 12.5px; }
}

/* =========================================================
   LEMBRETES EM CARTÃO (como as marcações do calendário)
   etiquetas em cima (NOVO, De/Para) · título · nota · criado
   ========================================================= */

/* cada lembrete: cartão branco separado dos outros */
.lemb,
.lemb:first-child {
  margin: 0 0 12px;
  padding: 14px 14px 14px 16px;
  background: var(--branco);
  border: 1px solid #DCE0EB;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(18, 22, 58, 0.06);
}

.lemb + .lemb { box-shadow: 0 4px 14px rgba(18, 22, 58, 0.06); }
.lemb:hover { background: var(--branco); box-shadow: 0 6px 18px rgba(18, 22, 58, 0.1); }
.lemb:hover + .lemb { box-shadow: 0 4px 14px rgba(18, 22, 58, 0.06); }

/* novo: branco com contorno verde (já não todo pintado) */
.lemb.novo,
.lemb.novo:first-child,
.lemb.novo:hover {
  background: var(--branco);
  border-color: rgba(0, 144, 72, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 144, 72, 0.2), 0 4px 14px rgba(0, 144, 72, 0.12);
}

/* arrumação por dentro: as etiquetas na primeira linha, o resto por baixo */
.lemb .lemb-texto {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lemb .lemb-texto .etiqueta-novo { order: 1; }
.lemb .lemb-texto .lemb-quem     { order: 2; }
.lemb .lemb-texto > span:first-child { order: 3; flex: 1 0 100%; }   /* o título */
.lemb .lemb-texto > small:not(.lemb-quem):not(.criado-em) { order: 4; flex: 1 0 100%; } /* prazo / apagado */
.lemb .lemb-texto .lemb-nota     { order: 5; flex: 1 0 100%; margin: 0; }
.lemb .lemb-texto .criado-em     { order: 6; flex: 1 0 100%; }

/* "De ..." / "Para ...": etiqueta com o ícone de pessoa */
.lemb .lemb-texto .lemb-quem {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

.lemb .lemb-texto .lemb-quem::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* sem etiquetas em cima (lembrete para mim, já visto): o título fica em cima */
.lemb .lemb-texto > span:first-child { margin-top: 0; }

/* o círculo de feito e o lixo alinhados com a primeira linha */
.lemb .lemb-marcar,
.lemb .botao-lixo,
.lemb .botao-repor { margin-top: 2px; }

/* =========================================================
   OBRAS: "+ ADICIONAR OBRA" (só Gestão e Gerência)
   ========================================================= */

.obra-adicionar { margin-top: 16px; }

.corpo-app .obra-adicionar-abrir {
  width: auto;
  min-width: 0;
  padding: 0 22px;
  min-height: 46px;
}

.obra-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 4px 16px;
  padding: 20px;
  background: var(--branco);
  border-radius: 18px;
  box-shadow: var(--sombra);
}

.obra-form[hidden] { display: none; }

.obra-form .campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.obra-form .campo span { font-size: 13px; font-weight: 600; color: var(--texto); }

.obra-form .erro,
.obra-form-botoes { grid-column: 1 / -1; }

.obra-form-botoes { display: flex; justify-content: flex-end; gap: 10px; }
.corpo-app .obra-form-botoes .botao-app { width: auto; min-width: 140px; padding: 0 22px; margin: 0; }

@media (max-width: 600px) {
  .corpo-app .obra-adicionar-abrir { width: 100%; }
  .obra-form-botoes .botao-app { flex: 1; }
}

/* =========================================================
   RADAR TAMBÉM NAS OBRAS E NAS MANUTENÇÕES
   ========================================================= */

/* cartão novo: contorno verde (como as marcações e os lembretes novos) */
.obra-cartao.novo,
.manut.novo {
  box-shadow: 0 0 0 2px rgba(0, 144, 72, 0.4), 0 4px 14px rgba(0, 144, 72, 0.15);
}

.manut.novo { cursor: pointer; }

.obra-texto .etiqueta-novo { margin-top: 4px; }

.manut .etiqueta-novo { margin-left: auto; }
.manut.novo { display: flex; align-items: center; gap: 10px; }

/* =========================================================
   "ADICIONAR OBRA" COM O MESMO DESENHO DA "NOVA MARCAÇÃO"
   ========================================================= */

/* o botão "+ Adicionar obra" esconde-se mesmo enquanto o formulário está aberto */
.obra-adicionar-abrir[hidden] { display: none !important; }

.obra-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}

/* as linhas Local / Cliente: o campo de texto à direita, sem caixa */
.obra-linha input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--fundo);
  border: none;
  border-radius: 10px;
}

.obra-linha input[type="text"]::placeholder { color: #A3A8BC; }
.obra-linha input[type="text"]:focus { outline: 2px solid var(--azul); outline-offset: 1px; }
.obra-linha .ev-rotulo { flex: 0 0 80px; }

/* Cancelar e Adicionar lado a lado, à direita (o Cancelar também aparece aqui) */
.obra-form .ev-botoes { justify-content: flex-end; margin-top: 2px; }
.obra-form .botao-cancelar {
  display: block;
  min-height: 48px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto-suave);
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
}

.obra-form .botao-cancelar:hover { color: var(--texto); border-color: #A9AFC8; }
.corpo-app .obra-form .ev-botoes .botao-app { flex: 0 0 auto; width: auto; min-width: 160px; }

@media (max-width: 600px) {
  .obra-form .ev-botoes .botao-cancelar,
  .corpo-app .obra-form .ev-botoes .botao-app { flex: 1; min-width: 0; }
}

/* =========================================================
   OBRA: BOTÃO "ABRIR NO GOOGLE MAPS"
   ========================================================= */

.obra-mapa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  text-decoration: none;
  background: var(--azul-claro);
  border-radius: 12px;
  transition: transform 0.4s var(--mola), background 0.15s, color 0.15s;
}

.obra-mapa:hover { color: var(--branco); background: var(--azul); transform: translateY(-2px); }

.obra-mapa svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.obra-linha .ev-rotulo { flex-basis: 80px; }

/* "+ Adicionar obra": a caixa abre a crescer a partir do botão
   (e fecha ao contrário ao carregar em Cancelar) */
.obra-form:not([hidden]) {
  transform-origin: top left;
  animation: obra-form-abre 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.obra-form.a-fechar { animation: obra-form-fecha 0.22s ease-in forwards; }

@keyframes obra-form-abre {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes obra-form-fecha {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .obra-form:not([hidden]), .obra-form.a-fechar { animation: none; }
}

/* =========================================================
   AVISOS IGUAIS EM TODO O SITE (js/avisos.js)
   o (!) vermelho por baixo do campo + o campo marcado
   ========================================================= */

/* qualquer campo em falta fica com o contorno vermelho */
input.com-erro,
textarea.com-erro,
select.com-erro,
.campo input.com-erro,
.resumo-novo input.com-erro,
.lemb-nota-campo.com-erro {
  border: 1.5px solid var(--erro);
  box-shadow: 0 0 0 4px rgba(180, 35, 66, 0.1);
}

/* o aviso de um botão (erro da base de dados) não muda o botão */
button.com-erro { border: none; box-shadow: none; }
.ev-botoes.com-erro, .obra-form-botoes.com-erro { box-shadow: none; }

/* nos formulários numa linha (lembretes), o aviso fica numa linha só para ele,
   logo por baixo da linha de escrever (antes da nota) */
.resumo-novo > .ev-aviso,
.lemb-linha > .ev-aviso { flex: 1 0 100%; order: 5; margin: 0 2px; }

/* no ecrã de entrada e nos formulários com rótulos: logo por baixo do campo */
.campo .ev-aviso { margin-top: 6px; }
.cartao .ev-aviso { margin: 8px 2px 0; }

/* o aviso de uma linha com ícone (Dia, Hora, Local...) fica DENTRO dessa
   linha, por baixo do campo — assim vê-se de que campo é */
.ev-linha { flex-wrap: wrap; }

.ev-linhas .ev-linha > .ev-aviso,
.cal-novo.largo .ev-linhas .ev-linha > .ev-aviso {
  flex: 1 0 100%;
  margin: 0;
  padding: 2px 0 2px 32px;      /* alinhado com o texto, depois do ícone */
  background: transparent;
}

/* =========================================================
   RADAR NO CAMPO QUE FALTA PREENCHER (todo o site)
   ondas a sair do campo: vermelhas (erro) ou laranja (aviso);
   param quando se escreve (o aviso é tirado pelo js/avisos.js)
   ========================================================= */

/* campo com erro: o próprio campo, ou o campo dentro da linha (Dia, Hora, Local...) */
input.com-erro,
textarea.com-erro,
select.com-erro,
.ev-linha.com-erro input,
.ev-linha.com-erro textarea,
.ev-linha.com-erro select {
  animation: radar-campo-erro 1.6s ease-out infinite;
}

.ev-linha.com-aviso input,
.ev-linha.com-aviso textarea,
.ev-linha.com-aviso select,
input.com-aviso {
  animation: radar-campo-aviso 1.6s ease-out infinite;
}

@keyframes radar-campo-erro {
  0%   { box-shadow: 0 0 0 0 rgba(180, 35, 66, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(180, 35, 66, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 35, 66, 0); }
}

@keyframes radar-campo-aviso {
  0%   { box-shadow: 0 0 0 0 rgba(217, 138, 28, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(217, 138, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 138, 28, 0); }
}

/* os campos dentro das linhas ficam também com o contorno da cor */
.ev-linha.com-erro input,
.ev-linha.com-erro textarea { outline: 1.5px solid var(--erro); outline-offset: 0; }
.ev-linha.com-aviso input,
.ev-linha.com-aviso textarea { outline: 1.5px solid #D98A1C; outline-offset: 0; }

/* os botões (erro da base de dados) não pulsam */
button.com-erro { animation: none; }

@media (prefers-reduced-motion: reduce) {
  input.com-erro, textarea.com-erro, select.com-erro,
  .ev-linha.com-erro input, .ev-linha.com-erro textarea, .ev-linha.com-erro select,
  .ev-linha.com-aviso input, .ev-linha.com-aviso textarea, .ev-linha.com-aviso select,
  input.com-aviso { animation: none; }
}

/* =========================================================
   OBRA: VISÍVEL / OCULTO À EQUIPA (só a Gestão e a Gerência)
   ========================================================= */

/* a linha com o interruptor */
.interruptor-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--fundo);
  border-radius: 12px;
  cursor: pointer;
}

.obra-ficha .interruptor-linha { margin: 18px 0 0; }

.interruptor-texto { font-size: 13.5px; font-weight: 600; color: var(--texto); }

/* o interruptor (liga/desliga) */
.interruptor {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  margin: 0;
  background: #C9CDDC;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.interruptor::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--branco);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--mola);
}

.interruptor:checked { background: var(--verde); }
.interruptor:checked::after { transform: translateX(18px); }
.interruptor:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.interruptor:disabled { opacity: 0.6; cursor: wait; }

/* secção (ou ficha) oculta: só quem gere a vê, mais apagada e com a etiqueta */
.obra-sec.oculta,
.obra-ficha.oculta {
  background: #F7F8FB;
  outline: 1.5px dashed #C9CDDC;
  outline-offset: -1.5px;
}

.obra-sec.oculta .obra-sec-icone { color: #8A90A6; background: #E9EBF2; }
.obra-sec.oculta .obra-sec-texto strong { color: var(--texto-suave); }

.obra-oculta-etiqueta {
  font-size: 11px;
  font-weight: 700;
  color: #8A90A6;
}

/* =========================================================
   OBRA: OLHO VISÍVEL / OCULTO (só a Gestão e a Gerência)
   👁 aberto = a equipa vê · 👁 riscado = só quem gere vê
   ========================================================= */

.olho {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--verde);
  background: var(--verde-claro);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), background 0.15s, color 0.15s;
}

.olho svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.olho:hover { transform: translateY(-2px); }
.olho:active { transform: scale(0.92); transition-duration: 0.08s; }
.olho:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.olho:disabled { opacity: 0.6; cursor: wait; }

/* riscado: cinzento */
.olho.fechado { color: #8A90A6; background: #E9EBF2; }

/* nas secções: no cabeçalho, à direita (fora do botão que abre a secção) */
.obra-sec { position: relative; }
.obra-sec.com-olho .obra-sec-topo { padding-right: 62px; }
.obra-sec > .olho { position: absolute; top: 16px; right: 14px; }

/* na ficha: ao lado do nome da obra, encostado à direita */
.obra-ficha-topo .olho { margin-left: auto; }

/* =========================================================
   OBRAS (LISTA): OLHO DA OBRA INTEIRA
   ========================================================= */

.obra-cartao-caixa { position: relative; }
.obra-cartao-caixa > .obra-cartao { height: 100%; }

/* o olho à direita do cartão, antes da seta (fora do link) */
.obra-cartao-caixa.com-olho > .obra-cartao { padding-right: 64px; }
.obra-cartao-caixa > .olho {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.obra-cartao-caixa > .olho:hover { transform: translateY(calc(-50% - 2px)); }
.obra-cartao-caixa > .olho:active { transform: translateY(-50%) scale(0.92); }

/* o "quem vê" no cartão: só o olho (a lista abre por baixo, encostada à direita) */
.obra-cartao-caixa > .quem-ve {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
}
.obra-cartao-caixa > .quem-ve .quem-ve-conta { display: none; }
.obra-cartao-caixa.com-lixo > .quem-ve { right: 58px; }
.obra-cartao-caixa:has(.quem-ve-lista) { z-index: 30; }

/* o lixo à direita, o olho passa para o lado dele */
.obra-cartao-caixa.com-lixo > .obra-cartao { padding-right: 108px; }
.obra-cartao-caixa.com-lixo > .olho { right: 58px; }
.obra-cartao-caixa > .botao-lixo {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--erro);
  background: #FCEEF1;
}
.obra-cartao-caixa > .botao-lixo:hover { transform: translateY(calc(-50% - 2px)); }
.obra-cartao-caixa > .botao-lixo:active { transform: translateY(-50%) scale(0.92); }

/* obra oculta: só quem gere a vê, mais apagada e tracejada */
.obra-cartao-caixa.oculta > .obra-cartao {
  background: #F7F8FB;
  outline: 1.5px dashed #C9CDDC;
  outline-offset: -1.5px;
}

.obra-cartao-caixa.oculta .obra-icone { color: #8A90A6; background: #E9EBF2; }
.obra-cartao-caixa.oculta .obra-texto strong { color: var(--texto-suave); }

/* =========================================================
   OBRAS: "+ ADICIONAR OBRA" COMO CARTÃO (o último da grelha)
   do mesmo tamanho das obras, tracejado, com o + grande
   ========================================================= */

.obra-cartao-novo {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 18px;
  font-family: inherit;
  text-align: left;
  color: var(--azul);
  background: transparent;
  border: 2px dashed #B9BFE0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.4s var(--mola), border-color 0.15s, background 0.15s;
}

.obra-cartao-novo .obra-icone {
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: var(--azul);
  background: var(--azul-claro);
}

.obra-cartao-novo strong { font-size: 16px; font-weight: 700; }

.obra-cartao-novo:hover {
  border-color: var(--azul);
  background: var(--branco);
  transform: translateY(-3px);
}

.obra-cartao-novo:active { transform: scale(0.98); transition-duration: 0.08s; }
.obra-cartao-novo:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.obra-cartao-novo[hidden] { display: none !important; }

/* o formulário abre por baixo da grelha */
.obra-adicionar { margin-top: 16px; }
.obra-adicionar:empty { display: none; }

/* ganhar à regra antiga do botão: o cartão ocupa a célula toda da grelha */
.corpo-app .obra-adicionar-abrir.obra-cartao-novo { width: 100%; min-width: 0; min-height: 84px; padding: 18px; }

/* o formulário "Adicionar obra" estica até ao fim do ecrã */
.obra-form { max-width: none; }

/* o cartão "Adicionar obra" nunca desaparece; com o formulário aberto fica destacado */
.obra-cartao-novo.aberto {
  border-style: solid;
  border-color: var(--azul);
  background: var(--branco);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.1);
}

/* =========================================================
   MANUTENÇÕES COM O MESMO ESTILO DAS OBRAS
   (ganha aos estilos antigos .manut e .manut-nova)
   ========================================================= */

/* cada manutenção: cartão igual ao das obras */
.manut.obra-cartao {
  margin: 0;
  padding: 18px;
  border: none;
  border-radius: 18px;
}

.manut.obra-cartao .manut-nome { font-size: 16px; font-weight: 700; }

/* o formulário: a caixa branca das obras (estica até ao fim do ecrã) */
.manut-nova.obra-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 20px;
  background: var(--branco);
  border: none;
  border-radius: 18px;
  box-shadow: var(--sombra);
}

.manut-nova.obra-form[hidden] { display: none; }

/* o nome: a caixa grande com o lápis, como "Nome da obra" */
.manut-nova input.ev-titulo {
  height: 52px;
  padding: 0 14px 0 44px;
  font-size: 16px;
  font-weight: 500;
  color: var(--texto);
  background: var(--branco)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23283078' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13 7l4 4'/%3E%3C/svg%3E")
    no-repeat 14px center / 20px 20px;
  border: 1.5px solid #C9CDDC;
  border-radius: 14px;
}

.manut-nova input.ev-titulo:focus,
.manut-nova input.ev-titulo:focus-visible {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(40, 48, 120, 0.12);
}

/* nome em falta: contorno vermelho (o radar já pulsa por cima) */
.manut-nova input.ev-titulo.com-erro { border-color: var(--erro); }

/* =========================================================
   OBRA: FICHA — cada nome alinhado com o seu valor, e a caneta
   ========================================================= */

.obra-campos .obra-campo { display: flex; flex-direction: column; min-width: 0; }
.obra-campos .obra-campo dd { margin: 4px 0 0; }

/* a caneta: o mesmo botao do olho, em azul, logo antes dele */
.obra-ficha-topo .olho.lapis { margin-left: auto; color: var(--azul); background: #E8EAF6; }
.obra-ficha-topo .olho.lapis + .olho { margin-left: 0; }

/* a editar: os campos no mesmo sitio, cada um com a sua caixa */
.obra-ficha.a-editar .obra-mapa { display: none; }
.obra-ficha-editar { margin-top: 4px; }
.obra-ficha-editar .ev-titulo { margin-bottom: 16px; }
.obra-ficha-editar .obra-campo input {
  margin-top: 6px;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
}
.obra-ficha-editar .obra-campo input:focus { outline: none; border-color: var(--azul); }
.obra-ficha-editar .obra-form-botoes { margin-top: 18px; }

/* =========================================================
   OBRA: CANETA EM CADA SECÇÃO (ao lado do olho)
   ========================================================= */

.obra-sec > .olho.lapis { right: 14px; color: var(--azul); background: #E8EAF6; }
.obra-sec.com-olho > .olho.lapis { right: 58px; }
.obra-sec.com-lapis .obra-sec-topo { padding-right: 62px; }
.obra-sec.com-lapis.com-olho .obra-sec-topo { padding-right: 106px; }

/* o texto escrito na secção */
.obra-sec-nota { margin: 0 0 12px; padding: 8px 12px; font-size: 14px; line-height: 1.55; color: var(--texto); white-space: pre-wrap;
  background: #fff8e1; border-left: 3px solid #f2b705; border-radius: 8px; }
.obra-sec-nota::before { content: "Notas"; display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #8a6d00; }

/* a escrever */
.obra-sec-editar { margin-top: 8px; }
.obra-sec-editar textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
  resize: vertical;
  background: #fff;
  color: var(--texto);
}
.obra-sec-editar textarea:focus { outline: none; border-color: var(--azul); }
.obra-sec-editar .obra-form-botoes { margin-top: 10px; }

/* secções da obra: uma por fila, em todos os ecrãs */
.obra-seccoes { grid-template-columns: minmax(0, 1fr); }   /* minmax: a secção encolhe com o ecrã em vez de sair dele */

/* =========================================================
   OBRA: FICHEIROS DE CADA SECÇÃO
   ========================================================= */

/* a zona de adicionar: grande, tracejada, com o ícone numa bola */
.obra-sec-adicionar-caixa { margin-top: 12px; }
.obra-sec-adicionar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  color: var(--azul);
  background: linear-gradient(180deg, #F7F8FD 0%, #EEF0FA 100%);
  border: 1.5px dashed #B8BEDF;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--mola, ease);
}
.obra-sec-adicionar:hover { border-color: var(--azul); background: #EEF0FA; }
.obra-sec-adicionar:hover .obra-sec-adicionar-icone { transform: translateY(-2px); }
.obra-sec-adicionar.por-cima {
  border-color: var(--verde);
  border-style: solid;
  background: #E9F7EF;
  transform: scale(1.01);
}
.obra-sec-adicionar.a-enviar { cursor: wait; opacity: .85; }
.obra-sec-adicionar.a-enviar .obra-sec-adicionar-icone { animation: subir-ficheiro 1s ease-in-out infinite; }

.obra-sec-adicionar-icone {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--azul);
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(40, 48, 120, .25);
  transition: transform .25s var(--mola, ease);
}
.obra-sec-adicionar-icone svg { width: 20px; height: 20px; }
.obra-sec-adicionar-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.obra-sec-adicionar-texto strong { font-size: 15px; font-weight: 700; }
.obra-sec-adicionar-texto small { font-size: 12.5px; color: #7A8099; }

@keyframes subir-ficheiro {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* a lista: um cartão por ficheiro */
.obra-ficheiros { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.obra-ficheiros button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  color: var(--texto);
  background: #fff;
  border: 1px solid #E3E6EF;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.obra-ficheiros button:hover {
  border-color: #C9CEE8;
  box-shadow: 0 6px 16px rgba(40, 48, 120, .08);
  transform: translateY(-1px);
}

.obra-ficheiro-tipo {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  border-radius: 10px;
}
.obra-ficheiro-tipo.t-pdf     { color: #C62828; background: #FDECEC; }
.obra-ficheiro-tipo.t-imagem  { color: #6A3FB5; background: #F1EBFB; }
.obra-ficheiro-tipo.t-folha   { color: var(--verde); background: #E6F5EC; }
.obra-ficheiro-tipo.t-texto   { color: #1E62C6; background: #E8F0FC; }
.obra-ficheiro-tipo.t-desenho { color: #B26A00; background: #FDF2E1; }
.obra-ficheiro-tipo.t-outro   { color: var(--azul); background: #E8EAF6; }

.obra-ficheiro-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.obra-ficheiro-info strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.obra-ficheiro-info small { font-size: 12px; color: #8A90A6; }

.obra-ficheiro-abrir { flex-shrink: 0; color: #A3A8BF; transition: color .2s; }
.obra-ficheiro-abrir svg { width: 18px; height: 18px; }
.obra-ficheiros button:hover .obra-ficheiro-abrir { color: var(--azul); }

@media (prefers-reduced-motion: reduce) {
  .obra-sec-adicionar, .obra-sec-adicionar-icone, .obra-ficheiros button { transition: none; }
  .obra-sec-adicionar.a-enviar .obra-sec-adicionar-icone { animation: none; }
}

/* o desenho dentro da bola azul: branco e parado */
.obra-sec-adicionar .obra-sec-adicionar-icone svg,
.obra-sec-adicionar .obra-sec-adicionar-icone svg * { color: #fff; stroke: #fff; fill: none; }
.obra-sec-adicionar .obra-sec-adicionar-icone,
.obra-sec-adicionar.a-enviar .obra-sec-adicionar-icone,
.obra-sec-adicionar:hover .obra-sec-adicionar-icone { animation: none; transform: none; }

/* =========================================================
   FICHEIROS: MINIATURA E PRÉ-VISUALIZAÇÃO
   ========================================================= */

/* miniatura das imagens no lugar da etiqueta */
.obra-ficheiro-tipo.com-miniatura { padding: 0; overflow: hidden; background: #F1EBFB; }
.obra-ficheiro-tipo.com-miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* o olho à direita de cada ficheiro: só contorno */
.obra-ficheiro-abrir svg, .obra-ficheiro-abrir svg * { fill: none; stroke: currentColor; }

body.sem-scroll { overflow: hidden; }

.previa-fundo {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 40, .72);
  backdrop-filter: blur(3px);
  animation: previa-entrar .2s ease;
}
.previa {
  width: min(1100px, 100%);
  height: min(85vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: previa-subir .25s var(--mola, ease);
}
.previa-topo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid #E3E6EF;
}
.previa-topo strong {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.previa-botao {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--azul);
  background: #E8EAF6;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.previa-botao:hover { background: #DDE1F3; }
.previa-botao svg { width: 18px; height: 18px; }
.previa-botao svg, .previa-botao svg * { fill: none; stroke: currentColor; }
.previa-botao.previa-repor svg { overflow: visible; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.previa-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F8;
}
.previa-corpo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.previa-corpo iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.previa-corpo video { max-width: 100%; max-height: 100%; }
.previa-sem { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: #6B7189; }
.previa-sem .obra-ficheiro-tipo { width: 64px; height: 64px; font-size: 14px; border-radius: 14px; }
.previa-sem p { margin: 0; }

@keyframes previa-entrar { from { opacity: 0; } to { opacity: 1; } }
@keyframes previa-subir { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
  .previa-fundo { padding: 0; }
  .previa { width: 100%; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .previa-fundo, .previa { animation: none; }
}

/* a moldura escondida usada para imprimir um ficheiro */
.moldura-imprimir { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }
.previa-botao:disabled { opacity: .55; cursor: wait; }

/* =========================================================
   JANELA "PARTILHAR" (como a do Instagram)
   ========================================================= */

.partilha-fundo { z-index: 1010; }
.partilha {
  width: min(540px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: previa-subir .25s var(--mola, ease);
}
.partilha-topo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 4px;
}
.partilha-topo strong { font-size: 17px; font-weight: 700; }
.partilha-fechar {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--texto);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.partilha-fechar:hover { background: #F0F1F6; }
.partilha-fechar svg { width: 24px; height: 24px; }
.partilha-ficheiro {
  margin: 0 20px 10px;
  text-align: center;
  font-size: 13px;
  color: #8A90A6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partilha-procura {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 10px 14px;
  background: #F0F1F6;
  border-radius: 12px;
  color: #8A90A6;
}
.partilha-procura svg { width: 18px; height: 18px; flex-shrink: 0; }
.partilha-procura input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: none;
  border: 0;
  outline: none;
}

/* as pessoas: fotos redondas grandes, 4 por fila */
.partilha-pessoas {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
  gap: 14px 6px;
  padding: 10px 14px 16px;
}
.partilha-pessoas .resumo-vazio { grid-column: 1 / -1; text-align: center; }
.partilha-pessoa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  font: inherit;
  background: none;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}
.partilha-pessoa:hover { background: #F6F7FB; }
.partilha-foto {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 50%;
  transition: transform .2s var(--mola, ease);
}
.partilha-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.partilha-pessoa.escolhida .partilha-foto { transform: scale(.94); }
.partilha-visto {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--azul);
  border: 3px solid #fff;
  border-radius: 50%;
}
.partilha-visto svg { width: 13px; height: 13px; }
.partilha-visto svg, .partilha-visto svg * { stroke: #fff; fill: none; stroke-width: 3; }
.partilha-pessoa.escolhida .partilha-visto { display: flex; }
.partilha-nome {
  max-width: 100%;
  font-size: 12.5px;
  line-height: 1.3;
  text-align: center;
  color: var(--texto);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* em baixo */
.partilha-baixo { border-top: 1px solid #E3E6EF; padding: 14px 16px 16px; }
.partilha-opcoes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.partilha-opcao {
  flex: 0 0 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.partilha-opcao span {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto);
  background: #F0F1F6;
  border-radius: 50%;
  transition: background .2s;
}
.partilha-opcao:hover span { background: #E3E5EE; }
.partilha-opcao.feito span { color: #fff; background: var(--verde); }
.partilha-opcao svg { width: 22px; height: 22px; }
.partilha-opcao svg, .partilha-opcao svg * { fill: none; stroke: currentColor; }
.partilha-opcao small { font-size: 12px; line-height: 1.25; text-align: center; color: var(--texto); }

.partilha-mensagem {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: #F0F1F6;
  border: 0;
  border-radius: 12px;
  outline: none;
}
.partilha-enviar { width: 100%; }
.partilha-ok { margin: 4px 0; text-align: center; font-weight: 600; color: var(--verde); }

@media (max-width: 600px) {
  .partilha { width: 100%; max-height: 92vh; margin-top: auto; border-radius: 22px 22px 0 0; }
  .partilha-fundo { align-items: flex-end; }
  .partilha-pessoas { grid-template-columns: repeat(3, 1fr); }
  .partilha-foto { width: 68px; height: 68px; }
}

/* a lupa da pesquisa (Partilhar): só o contorno, não uma bola cheia */
.partilha-procura svg, .partilha-procura svg * { fill: none; stroke: currentColor; }

/* =========================================================
   SECÇÕES DA OBRA: BOTÕES DO CABEÇALHO
   descarregar · imprimir · partilhar · caneta · olho
   ========================================================= */

.obra-sec-acoes {
  position: absolute;
  top: 16px;
  right: 14px;
  display: flex;
  gap: 8px;
}
.obra-sec-acoes .olho { position: static; }
/* descarregar, imprimir e partilhar: o mesmo botão da caneta */
.obra-sec-acoes .olho.sec-acao,
.obra-sec-acoes .olho.lapis { color: var(--azul); background: #E8EAF6; }
.obra-sec-acoes .olho.sec-acao:hover,
.obra-sec-acoes .olho.lapis:hover { background: #DDE1F3; }
.obra-sec-acoes svg, .obra-sec-acoes svg * { fill: none; stroke: currentColor; }

/* a lista para escolher o ficheiro (quando há vários) */
.sec-escolha {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 300px;
  max-width: calc(100vw - 40px);
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border: 1px solid #E3E6EF;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 24, 60, .18);
  animation: previa-subir .18s ease;
}
.sec-escolha > small {
  padding: 2px 6px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.sec-escolha button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--texto);
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.sec-escolha button:hover { background: #F3F4F9; }
.sec-escolha .obra-ficheiro-tipo { width: 34px; height: 34px; font-size: 9.5px; border-radius: 8px; }
.sec-escolha-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-escolha .sec-escolha-todos {
  justify-content: center;
  margin-top: 4px;
  font-weight: 600;
  color: var(--azul);
  background: #E8EAF6;
}
.sec-escolha .sec-escolha-todos:hover { background: #DDE1F3; }

/* telemóvel: botões mais pequenos para caberem */
@media (max-width: 600px) {
  .obra-sec-acoes { top: 12px; right: 10px; gap: 4px; }
  .obra-sec-acoes .olho { width: 32px; height: 32px; }
  .obra-sec-acoes svg { width: 16px; height: 16px; }
}

/* a lista de escolha pode sair da caixa da secção (sem ser cortada) */
.obra-sec { overflow: visible; }
.obra-sec-topo { border-radius: inherit; }
.obra-sec.aberta .obra-sec-topo { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.obra-sec:has(.sec-escolha) { z-index: 20; }

/* =========================================================
   SECÇÕES: EDITAR (caneta) — igual à ficha da obra
   ========================================================= */

/* a editar: o que está escrito sai, fica o formulário no lugar */
.obra-sec.a-editar .obra-sec-explica,
.obra-sec.a-editar .obra-sec-info,
.obra-sec.a-editar .obra-sec-nota,
.obra-sec.a-editar .resumo-vazio,
.obra-sec.a-editar .obra-sec-adicionar-caixa { display: none; }

.obra-sec-editar { margin: 4px 0 14px; }
.obra-ficha-editar .obra-campo.largo { grid-column: 1 / -1; }
.obra-ficha-editar .obra-campo select,
.obra-ficha-editar .obra-campo textarea {
  margin-top: 6px;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
}
.obra-ficha-editar .obra-campo textarea { resize: vertical; }
.obra-ficha-editar .obra-campo select:focus,
.obra-ficha-editar .obra-campo textarea:focus { outline: none; border-color: var(--azul); }

/* o que foi preenchido, mostrado dentro da secção */
.obra-sec-info { margin: 4px 0 12px; }
.obra-sec-estado { display: inline-block; padding: 2px 10px; font-size: 13px; font-weight: 600; border-radius: 999px; }
.obra-sec-estado.e-por_comecar { color: #6B7189; background: #EEF0F5; }
.obra-sec-estado.e-em_curso    { color: var(--azul); background: #E8EAF6; }
.obra-sec-estado.e-bloqueado   { color: #C62828; background: #FDECEC; }
.obra-sec-estado.e-concluido   { color: var(--verde); background: #E6F5EC; }

/* a foto de perfil (ou as iniciais): sempre redonda, sem sublinhado, nunca esmagada */
.lateral-logo, .lateral-logo:hover, .avatar { text-decoration: none; }
.avatar { flex-shrink: 0; aspect-ratio: 1 / 1; line-height: 1; overflow: hidden; }

/* =========================================================
   FICHA DA OBRA: EDITAR (caneta) — em blocos
   ========================================================= */

/* a editar, a ficha de leitura sai (não fica repetida por cima) */
.obra-campos[hidden] { display: none; }
.obra-ficha.a-editar .obra-progresso,
.obra-ficha.a-editar .obra-nota { display: none; }

.obra-ficha-editar { margin-top: 0; padding: 0; box-shadow: none; background: none; }
.obra-ficha-editar .ev-titulo { margin-bottom: 18px; }

.ficha-blocos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}
.ficha-bloco {
  margin: 0;
  padding: 14px 16px 6px;
  min-width: 0;
  background: #F7F8FC;
  border: 1px solid #E6E8F0;
  border-radius: 16px;
}
.ficha-bloco legend {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8A90A6;
}
.ficha-bloco .ev-linhas { clear: both; }
.ficha-bloco .ev-linha { background: none; }
.ficha-bloco .ev-linha + .ev-linha { border-top: 1px solid #E6E8F0; }
.ficha-bloco { padding-bottom: 14px; }
.ficha-bloco .ev-linhas { background: #fff; border: 1px solid #E6E8F0; border-radius: 12px; overflow: hidden; }
.ficha-bloco .ev-linha input { flex: 1; min-width: 0; }

/* a caixa de editar a obra: por baixo da caixa da obra, como uma caixa própria */
.obra-ficha + .obra-ficha-editar {
  margin-top: 14px;
  padding: 22px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
}

/* =========================================================
   GUARDAR EM RADAR (há mudanças por guardar) — site todo
   ========================================================= */
.por-guardar { position: relative; animation: radar-guardar 1.6s ease-out infinite; }
@keyframes radar-guardar {
  0%   { box-shadow: 0 0 0 0 rgba(0, 144, 72, .55); }
  70%  { box-shadow: 0 0 0 12px rgba(0, 144, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 144, 72, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .por-guardar { animation: none; box-shadow: 0 0 0 3px rgba(0, 144, 72, .45); }
}

/* ficha da obra: contactos por baixo do nome (carregar liga / abre o email) */
.ficha-contacto {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--azul);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.ficha-contacto:hover { text-decoration: underline; }
small.ficha-contacto { color: #6B7189; }
.ficha-contacto svg { width: 14px; height: 14px; flex-shrink: 0; }
.ficha-contacto svg, .ficha-contacto svg * { fill: none; stroke: currentColor; }
.ficha-contacto span { overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   FICHA DA OBRA: EDITAR — ARRUMADO E COM "QUEM VÊ"
   ========================================================= */

/* telemóvel, email e datas com o mesmo aspeto dos outros campos */
.obra-linha input[type="tel"],
.obra-linha input[type="email"],
.obra-linha input[type="date"] {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--fundo);
  border: none;
  border-radius: 10px;
}
.obra-linha input[type="tel"]::placeholder,
.obra-linha input[type="email"]::placeholder { color: #A3A8BC; }
.obra-linha input[type="tel"]:focus,
.obra-linha input[type="email"]:focus,
.obra-linha input[type="date"]:focus { outline: 2px solid var(--azul); outline-offset: 1px; }
.ficha-bloco .obra-linha .ev-rotulo { flex: 0 0 96px; }

/* os blocos em filas certinhas: 3 por fila, todos da mesma altura */
.ficha-blocos {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
@media (max-width: 1100px) { .ficha-blocos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .ficha-blocos { grid-template-columns: 1fr; } }
.ficha-bloco { display: flex; flex-direction: column; }
.ficha-bloco .ev-linhas { flex: 1; }

/* cabeça do bloco: o título à esquerda, "quem vê" e o olho à direita */
.ficha-bloco-cabeca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 36px;
}
.ficha-bloco-cabeca legend { float: none; width: auto; margin: 0; }

.quem-ve { position: relative; display: flex; align-items: center; gap: 8px; }
.quem-ve-conta { font-size: 12px; font-weight: 600; color: var(--verde); white-space: nowrap; }
.quem-ve-botao.fechado + .quem-ve-lista, .quem-ve:has(.fechado) .quem-ve-conta { color: #B26A00; }
.quem-ve-botao svg, .quem-ve-botao svg * { fill: none; stroke: currentColor; }

/* a lista de pessoas */
.quem-ve-lista {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 280px;
  max-width: calc(100vw - 40px);
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #E3E6EF;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 24, 60, .18);
  animation: previa-subir .18s ease;
}
.quem-ve-lista > small {
  display: block;
  padding: 2px 6px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.quem-ve-pessoa {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  font-size: 14px;
  color: var(--texto);
  border-radius: 10px;
  cursor: pointer;
}
.quem-ve-pessoa:hover { background: #F3F4F9; }
.quem-ve-pessoa input { width: 18px; height: 18px; accent-color: var(--azul); flex-shrink: 0; }
.quem-ve-todos { font-weight: 700; border-bottom: 1px solid #EEF0F5; border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.quem-ve-foto {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 50%;
  overflow: hidden;
}
.quem-ve-foto img { width: 100%; height: 100%; object-fit: cover; }
.quem-ve-nota { margin: 6px 8px 2px; font-size: 12px; color: #8A90A6; }

/* =========================================================
   SECÇÕES: BOTÕES NUM SÓ ÍCONE (⋯) NO TELEMÓVEL E NO TABLET
   ========================================================= */

.obra-sec .obra-sec-topo { padding-right: calc(var(--botoes, 0) * 44px + 14px); }
.sec-mais { display: none; }
.sec-mais svg, .sec-mais svg * { fill: currentColor; stroke: none; }
.sec-acoes-menu { position: relative; display: flex; gap: 8px; }

@media (max-width: 1024px) {
  .obra-sec .obra-sec-topo { padding-right: 62px; }
  .sec-mais { display: flex; color: var(--azul); background: #E8EAF6; }
  .obra-sec-acoes.aberto .sec-mais { color: #fff; background: var(--azul); }

  /* o menu que abre por baixo do ⋯ */
  .sec-acoes-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 200px;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: #fff;
    border: 1px solid #E3E6EF;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(20, 24, 60, .18);
    animation: previa-subir .18s ease;
  }
  .obra-sec-acoes.aberto .sec-acoes-menu { display: flex; }
  .obra-sec:has(.obra-sec-acoes.aberto) { z-index: 25; }

  .sec-acoes-menu .olho {
    width: 100%;
    height: 42px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    border-radius: 10px;
    background: none;
  }
  .sec-acoes-menu .olho:hover { background: #F3F4F9; }
  .sec-acoes-menu .olho::after {
    content: attr(data-rotulo);
    font-size: 14px;
    font-weight: 600;
    color: var(--texto);
  }
  /* a lista de ficheiros abre dentro do próprio menu */
  .sec-acoes-menu .sec-escolha {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 4px;
    padding: 6px 0 0;
    border: 0;
    border-top: 1px solid #EEF0F5;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }
}

/* =========================================================
   MENU ⋯ DAS SECÇÕES — MAIS BONITO
   ========================================================= */
@media (max-width: 1024px) {
  .obra-sec-acoes .sec-acoes-menu {
    min-width: 214px;
    padding: 8px;
    gap: 4px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(20, 24, 60, .2), 0 0 0 1px rgba(20, 24, 60, .05);
  }

  /* cada opção: fundo branco, o ícone numa bolinha */
  .obra-sec-acoes .sec-acoes-menu .olho {
    height: 46px;
    padding: 0 8px;
    gap: 12px;
    color: var(--azul);
    background: transparent;
    border-radius: 12px;
    transition: background .15s;
  }
  .obra-sec-acoes .sec-acoes-menu .olho:hover { background: #F3F4FA; }
  .obra-sec-acoes .sec-acoes-menu .olho svg {
    width: 32px;
    height: 32px;
    padding: 7px;
    flex-shrink: 0;
    background: #ECEEF8;
    border-radius: 10px;
  }
  .obra-sec-acoes .sec-acoes-menu .olho::after { font-weight: 600; color: var(--texto); }

  /* uma linha a separar o Editar e o olho do resto */
  .obra-sec-acoes .sec-acoes-menu .lapis { margin-top: 5px; position: relative; }
  .obra-sec-acoes .sec-acoes-menu .lapis::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 8px;
    right: 8px;
    border-top: 1px solid #EEF0F5;
  }

  /* visível = verde, oculto = vermelho */
  .obra-sec-acoes .sec-acoes-menu .olho:not(.sec-acao):not(.lapis) {
    margin-top: 2px;
    color: var(--verde);
    background: #E9F7EF;
  }
  .obra-sec-acoes .sec-acoes-menu .olho:not(.sec-acao):not(.lapis) svg { background: #fff; }
  .obra-sec-acoes .sec-acoes-menu .olho:not(.sec-acao):not(.lapis)::after { color: var(--verde); }
  .obra-sec-acoes .sec-acoes-menu .olho.fechado:not(.sec-acao):not(.lapis) { color: #C62828; background: #FDECEC; }
  .obra-sec-acoes .sec-acoes-menu .olho.fechado:not(.sec-acao):not(.lapis)::after { color: #C62828; }
}

/* blocos da ficha: 3 por fila só em ecrãs largos (senão os campos ficam cortados) */
.ficha-blocos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) { .ficha-blocos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .ficha-blocos { grid-template-columns: 1fr; } }
.ficha-bloco .obra-linha .ev-rotulo { flex: 0 0 104px; }
.ficha-bloco .obra-linha input { flex: 1 1 140px; }

/* "quem vê": restrito fica a laranja/vermelho, toda a equipa a verde */
.quem-ve:has(.fechado) .quem-ve-conta { color: #C62828; }

/* o "quem vê" da ficha não leva o estilo do "quem vê" do Perfil (mesmo nome) */
.ficha-bloco-cabeca .quem-ve {
  padding: 0;
  background: none;
  border: 0;
  font-size: inherit;
  text-transform: none;
  letter-spacing: normal;
}
/* a etiqueta: verde = toda a equipa, vermelho = não visível / só algumas pessoas */
.ficha-bloco-cabeca .quem-ve-conta {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--verde);
  background: #E6F5EC;
}
.ficha-bloco-cabeca .quem-ve:has(.fechado) .quem-ve-conta { color: #C62828; background: #FDECEC; }
.ficha-bloco-cabeca .quem-ve-botao.fechado { color: #C62828; background: #FDECEC; }

/* o olho de cada campo da ficha (verde = visível, vermelho = só Gerência e Gestão) */
.ficha-bloco .olho.olho-campo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  margin-left: 6px;
  border-radius: 8px;
}
.ficha-bloco .olho.olho-campo svg { width: 16px; height: 16px; }
.ficha-bloco .olho.olho-campo svg, .ficha-bloco .olho.olho-campo svg * { fill: none; stroke: currentColor; }
.ficha-bloco .olho.olho-campo.fechado { color: #C62828; background: #FDECEC; }

/* o olho de cada campo fica DENTRO da caixa de escrever, à direita (uma só linha) */
.ficha-bloco .obra-linha { position: relative; flex-wrap: nowrap; }
.ficha-bloco .obra-linha:has(.olho-campo) input { padding-right: 40px; }
.ficha-bloco .olho.olho-campo {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  margin: 0;
  background: transparent;
}
.ficha-bloco .olho.olho-campo:hover { background: #E6F5EC; }
.ficha-bloco .olho.olho-campo.fechado { background: #FDECEC; }

/* aviso num campo da ficha: vai para uma linha própria, por baixo do campo */
.ficha-bloco .obra-linha:has(.ev-aviso) { flex-wrap: wrap; row-gap: 6px; }
.ficha-bloco .obra-linha .ev-aviso { flex: 0 0 100%; order: 10; margin: 0; padding-left: 32px; }
/* o olho fica sempre na altura da caixa de escrever (não desce com o aviso) */
.ficha-bloco .olho.olho-campo { top: 27px; }
.ficha-bloco .obra-linha .ev-aviso { padding-left: 0; justify-content: center; text-align: center; }
/* aviso alinhado por baixo da caixa de escrever (ícone + nome = 148px) */
.ficha-bloco .obra-linha .ev-aviso { padding-left: 148px; justify-content: flex-start; text-align: left; }
@media (max-width: 600px) { .ficha-bloco .obra-linha .ev-aviso { padding-left: 0; } }

/* =========================================================
   FICHA DA OBRA (LEITURA) — MAIS BONITA
   números · pessoas em cartões · localização
   ========================================================= */

.obra-ficha-topo { gap: 12px; }
.ficha-estado {
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 999px;
}

.ficha-vista { display: flex; flex-direction: column; gap: 16px; }

/* os números da obra */
.ficha-numeros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}
.ficha-numero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  background: #F6F7FB;
  border-radius: 14px;
}
.ficha-numero small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.ficha-numero strong { font-size: 16px; font-weight: 700; color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha-numero.vazio strong { color: #B4B9CC; font-weight: 500; }

/* as pessoas */
.ficha-pessoas {
  display: grid;
  /* auto-fill: um só cartão (ex.: o Cliente da manutenção) fica do tamanho dos das obras */
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}
.ficha-pessoa {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #E8EAF1;
  border-radius: 16px;
}
.ficha-pessoa-roda {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3F4AA8, var(--azul));
  border-radius: 50%;
}
.ficha-pessoa.vazio .ficha-pessoa-roda { color: #A3A8BC; background: #EEF0F5; }
.ficha-pessoa-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ficha-pessoa-texto > small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.ficha-pessoa-texto > strong { font-size: 15.5px; font-weight: 700; color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha-pessoa.vazio .ficha-pessoa-texto > strong { color: #B4B9CC; font-weight: 500; }
.ficha-pessoa-nif { font-size: 12.5px; color: #8A90A6; }

/* ligar / email: botõezinhos */
.ficha-pessoa-botoes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ficha-pessoa-botoes .ficha-contacto {
  margin: 0;
  padding: 6px 10px;
  font-weight: 600;
  background: #F0F2FA;
  border-radius: 10px;
  transition: background .15s;
}
.ficha-pessoa-botoes .ficha-contacto:hover { background: #E3E7F7; text-decoration: none; }

/* a localização */
.ficha-local {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px;
  background: #F6F7FB;
  border-radius: 16px;
}
.ficha-local-icone {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  background: #fff;
  border-radius: 12px;
}
.ficha-local-icone svg { width: 20px; height: 20px; }
.ficha-local-texto { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.ficha-local-texto > small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.ficha-local-texto > strong { font-size: 15.5px; font-weight: 700; color: var(--texto); }
.ficha-local-acesso { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: #6B7189; }
.ficha-local-acesso svg { width: 14px; height: 14px; flex-shrink: 0; }
.ficha-local .obra-mapa { margin: 0; background: #fff; }

.ficha-vista svg, .ficha-vista svg * { fill: none; stroke: currentColor; }
.obra-ficha .obra-progresso { margin-top: 18px; }

/* pessoas da ficha: um ícone (como a localização), em vez das iniciais */
.ficha-pessoa-roda {
  width: 42px;
  height: 42px;
  color: var(--azul);
  background: #EEF0F8;
  border-radius: 12px;
}
.ficha-pessoa-roda svg { width: 20px; height: 20px; }
.ficha-pessoa.vazio .ficha-pessoa-roda { color: #A3A8BC; background: #F3F4F8; }

/* "Abrir no mapa": botão azul, letras brancas */
.ficha-local .obra-mapa { color: #fff; background: var(--azul); box-shadow: 0 6px 14px rgba(40, 48, 120, .22); }
.ficha-local .obra-mapa:hover { background: #343D92; }
.ficha-local .obra-mapa svg, .ficha-local .obra-mapa svg * { stroke: #fff; }

/* =========================================================
   PROGRESSO DA OBRA — CHECKLIST POR FASES
   ========================================================= */

.obra-progresso { cursor: pointer; }
.obra-progresso-barra i { transition: width .5s ease; }

.progresso-obra {
  margin-top: 16px;
  padding: 22px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
  scroll-margin-top: 16px;
}
.progresso-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.progresso-topo h2 { margin: 0; font-size: 18px; font-weight: 700; }
.progresso-resumo { font-size: 13px; font-weight: 600; color: #6B7189; }

/* a barra grande */
.progresso-barra {
  position: relative;
  height: 26px;
  margin: 14px 0 18px;
  background: #EEF0F6;
  border-radius: 999px;
  overflow: hidden;
}
.progresso-barra i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--azul), #3F4AA8);
  border-radius: 999px;
  transition: width .5s ease;
}
.progresso-obra.completo .progresso-barra i { background: linear-gradient(90deg, var(--verde), #18B06A); }
.progresso-pct {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
  color: var(--texto);
  mix-blend-mode: normal;
}

/* as fases */
.progresso-fases { display: flex; flex-direction: column; gap: 8px; }
.progresso-fase { border: 1px solid #E8EAF1; border-radius: 14px; overflow: hidden; }
.progresso-fase-cabeca {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  color: var(--texto);
  background: #fff;
  border: 0;
  cursor: pointer;
}
.progresso-fase-cabeca:hover { background: #F8F9FC; }
.progresso-fase.aberta .progresso-fase-cabeca { background: #F6F7FB; }
.progresso-fase-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 10px;
}
.progresso-fase.completa .progresso-fase-num { color: #fff; background: var(--verde); }
.progresso-fase-num svg { width: 16px; height: 16px; }
.progresso-fase-num svg, .progresso-fase-num svg * { fill: none; stroke: currentColor; stroke-width: 3; }
.progresso-fase-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.progresso-fase-nome strong { font-size: 15px; font-weight: 700; }
.progresso-fase-mini { display: block; height: 5px; background: #EEF0F6; border-radius: 999px; overflow: hidden; }
.progresso-fase-mini i { display: block; height: 100%; background: var(--azul); border-radius: 999px; transition: width .4s ease; }
.progresso-fase.completa .progresso-fase-mini i { background: var(--verde); }
.progresso-fase-conta {
  flex-shrink: 0;
  min-width: 44px;
  padding: 3px 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  color: #6B7189;
  background: #F0F1F6;
  border-radius: 999px;
}
.progresso-fase.completa .progresso-fase-conta { color: var(--verde); background: #E6F5EC; }
.progresso-fase .opcao-seta { flex-shrink: 0; }

/* as tarefas (só aparecem com a fase aberta) */
.progresso-tarefas { display: none; padding: 6px 10px 12px; border-top: 1px solid #EEF0F5; }
.progresso-fase.aberta .progresso-tarefas { display: block; }
.progresso-tarefa { display: flex; align-items: center; gap: 8px; border-radius: 12px; }
.progresso-tarefa:hover { background: #F8F9FC; }
.progresso-marca {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;              /* fácil de carregar com o dedo */
  padding: 8px 6px;
  cursor: pointer;
}
.progresso-marca input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.progresso-visto {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: #fff;
  border: 2px solid #C9CEE0;
  border-radius: 8px;
  transition: background .15s, border-color .15s, transform .15s;
}
.progresso-visto svg { width: 16px; height: 16px; }
.progresso-visto svg, .progresso-visto svg * { fill: none; stroke: currentColor; stroke-width: 3; }
.progresso-marca:hover .progresso-visto { border-color: var(--azul); }
.progresso-marca input:focus-visible + .progresso-visto { outline: 2px solid var(--azul); outline-offset: 2px; }
.progresso-tarefa.feita .progresso-visto { color: #fff; background: var(--verde); border-color: var(--verde); transform: scale(1.05); }
.progresso-tarefa-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14.5px; color: var(--texto); }
.progresso-tarefa-texto small { font-size: 12px; color: #8A90A6; }
.progresso-tarefa.feita .progresso-tarefa-texto > span { color: #6B7189; text-decoration: line-through; text-decoration-color: #B4B9CC; }
.progresso-tarefa.feita .progresso-tarefa-texto small { color: var(--verde); }
.progresso-tarefa.na { opacity: .55; }
.progresso-tarefa.na .progresso-marca { cursor: default; }
.progresso-tarefa.na .progresso-visto { background: #F0F1F6; border-style: dashed; }

/* apagar tarefas (Gerência e Gestão) */
.progresso-apagar {
  flex-shrink: 0;
  height: 30px;
  padding: 0 10px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: #8A90A6;
  background: #F0F1F6;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.progresso-apagar:hover { color: var(--texto); background: #E5E7EF; }
.progresso-apagar { width: 30px; padding: 0; display: flex; align-items: center; justify-content: center; }
.progresso-apagar svg { width: 14px; height: 14px; }
.progresso-apagar svg, .progresso-apagar svg * { fill: none; stroke: currentColor; }
.progresso-tarefa { padding-right: 6px; }

/* acrescentar uma tarefa */
.progresso-nova { display: flex; gap: 8px; margin-top: 8px; padding: 0 6px; }
.progresso-nova input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--texto);
  background: #F6F7FB;
  border: 1px dashed #C9CEE0;
  border-radius: 10px;
}
.progresso-nova input:focus { outline: none; border-style: solid; border-color: var(--azul); background: #fff; }
.corpo-app .progresso-nova .botao-app { width: auto; min-height: 42px; margin: 0; padding: 0 16px; }

@media (max-width: 600px) {
  .progresso-obra { padding: 16px; }
  .progresso-fase-cabeca { padding: 12px 10px; gap: 10px; }
  .progresso-tarefas { padding: 4px 4px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .progresso-barra i, .progresso-fase-mini i, .progresso-visto { transition: none; }
}

/* checklist: editar e remover tarefas (Gerência e Gestão) */
.progresso-botao {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--azul);
  background: #F0F1F6;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.progresso-botao:hover { background: #E3E6F3; }
.progresso-botao svg { width: 15px; height: 15px; }
.progresso-botao svg, .progresso-botao svg * { fill: none; stroke: currentColor; }
.progresso-remover { color: #C62828; }
.progresso-remover:hover { background: #FDECEC; }

/* a editar: a linha passa a ter a caixa de escrever e os botões */
.progresso-tarefa.a-editar { padding: 6px; background: #F6F7FB; }
.progresso-tarefa.a-editar > .progresso-botao { display: none; }
.progresso-editar { flex: 1; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.progresso-editar input {
  flex: 1 1 220px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--texto);
  background: #fff;
  border: 1px solid var(--azul);
  border-radius: 10px;
  outline: none;
}
.corpo-app .progresso-editar .botao-app { width: auto; min-height: 42px; margin: 0; padding: 0 16px; }
.progresso-editar .botao-cancelar {
  min-height: 42px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--texto-suave);
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
}

/* =========================================================
   CHECKLIST: OLHO EM CADA FASE, FICHEIROS E FOTOS EM CADA TAREFA
   ========================================================= */

/* a lista "quem vê" não pode ser cortada pela caixa da fase */
.progresso-fase { overflow: visible; }
.progresso-fase-topo { display: flex; align-items: center; gap: 8px; padding-right: 12px; background: #fff; border-radius: 14px; }
.progresso-fase.aberta .progresso-fase-topo { background: #F6F7FB; border-radius: 14px 14px 0 0; }
.progresso-fase-topo .progresso-fase-cabeca { flex: 1; min-width: 0; background: transparent; border-radius: 14px; }
.progresso-fase-topo .quem-ve { padding: 0; background: none; border: 0; text-transform: none; letter-spacing: normal; font-size: inherit; }
.progresso-fase-topo .quem-ve-conta { padding: 4px 10px; border-radius: 999px; color: var(--verde); background: #E6F5EC; }
.progresso-fase-topo .quem-ve:has(.fechado) .quem-ve-conta { color: #C62828; background: #FDECEC; }
.progresso-fase-topo .quem-ve-botao { width: 34px; height: 34px; }
.progresso-fase-topo .quem-ve-botao.fechado { color: #C62828; background: #FDECEC; }
.progresso-fase-topo .quem-ve-botao svg, .progresso-fase-topo .quem-ve-botao svg * { fill: none; stroke: currentColor; }
.progresso-fase:has(.quem-ve-lista) { position: relative; z-index: 30; }

/* a linha da tarefa pode ter uma segunda linha (as fotos) */
.progresso-tarefa { flex-wrap: wrap; }

/* o clipe: verde quando já tem ficheiros, com o número */
.progresso-clipe { width: auto; min-width: 30px; gap: 4px; padding: 0 8px; }
.progresso-clipe span { font-size: 12px; font-weight: 700; }
.progresso-clipe svg { flex-shrink: 0; }   /* com o número ao lado o clipe encolhia */
.progresso-clipe.com { color: var(--verde); background: #E6F5EC; }
.progresso-clipe.a-enviar { opacity: .5; cursor: wait; }

/* as fotos e ficheiros da tarefa, por baixo */
.progresso-ficheiros {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 6px 10px 44px;
}
.progresso-ficheiro {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 0;
  font: inherit;
  background: #fff;
  border: 1px solid #E3E6EF;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.progresso-ficheiro:hover { border-color: var(--azul); transform: translateY(-1px); }
.progresso-ficheiro img { width: 64px; height: 64px; object-fit: cover; display: block; }
.progresso-ficheiro .obra-ficheiro-tipo { width: 40px; height: 40px; margin: 6px 0 6px 6px; font-size: 10px; }
.progresso-ficheiro-nome {
  min-width: 0;
  padding-right: 10px;
  font-size: 13px;
  color: var(--texto);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .progresso-ficheiros { padding-left: 6px; }
  .progresso-fase-topo .quem-ve-conta { display: none; }   /* no telemóvel só o olho */
}

/* fases do progresso: ícone em vez de número */
.progresso-fase-num svg { width: 17px; height: 17px; }
.progresso-fase-num svg, .progresso-fase-num svg * { fill: none; stroke: currentColor; stroke-width: 2; }
.progresso-fase.completa .progresso-fase-num svg, .progresso-fase.completa .progresso-fase-num svg * { stroke-width: 3; }
.progresso-camara.a-enviar { opacity: .5; cursor: wait; }

/* as fotos da tarefa ficam sempre por baixo de tudo (os botões não descem) */
.progresso-tarefa > .progresso-ficheiros { order: 99; }

/* fases que só existem em algumas obras */
.progresso-fase-opcional {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  color: #B26A00;
  background: #FDF2E1;
  border-radius: 999px;
}
/* a nota explicativa no topo da fase */
.progresso-fase-nota {
  margin: 8px 6px 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #4A5068;
  background: #F4F6FC;
  border-left: 3px solid var(--azul);
  border-radius: 8px;
}

/* =========================================================
   MAPA DE QUANTIDADES: MATERIAIS
   ========================================================= */

.obra-tabela-caixa { overflow-x: auto; }
.obra-tabela td { vertical-align: middle; }
.obra-tabela .material-falta { font-weight: 700; color: #B26A00; }
.obra-tabela tr.material-completo .material-falta { color: var(--verde); }
.obra-tabela tr.material-completo td:first-child::before { content: "✓ "; color: var(--verde); font-weight: 700; }

/* o "aplicado" que a equipa muda logo na tabela */
.obra-tabela .material-aplicado {
  width: 90px;
  height: 34px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
  color: var(--texto);
  background: #F6F7FB;
  border: 1px solid #E3E6EF;
  border-radius: 8px;
}
.obra-tabela .material-aplicado:focus { outline: none; border-color: var(--azul); background: #fff; }

.obra-tabela .material-botoes { white-space: nowrap; text-align: right; }
.obra-tabela .material-botoes .progresso-botao { display: inline-flex; margin-left: 4px; }

/* a linha de escrever (acrescentar / editar) */
.obra-tabela tr.material-form td { padding-top: 8px; padding-bottom: 8px; background: #F6F7FB; }
.obra-tabela tr.material-form input {
  width: 100%;
  min-width: 70px;
  height: 36px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
  color: var(--texto);
  background: #fff;
  border: 1px solid #DDE0EA;
  border-radius: 8px;
}
.obra-tabela tr.material-form td:first-child input { min-width: 160px; }
.obra-tabela tr.material-form input:focus { outline: none; border-color: var(--azul); }
.corpo-app .obra-tabela tr.material-form .botao-app { width: auto; min-height: 36px; margin: 0 0 0 4px; padding: 0 14px; }
/* Adicionar e Cancelar lado a lado, sem saírem da linha */
.obra-tabela tr.material-form td:last-child { white-space: nowrap; width: 1%; }
.obra-tabela tr.material-form .botao-cancelar {
  min-height: 36px;
  margin-left: 4px;
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto-suave);
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
}

/* o botão "+ Adicionar material" */
.material-adicionar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  background: #E8EAF6;
  border: 1px dashed #B8BEDF;
  border-radius: 10px;
  cursor: pointer;
}
.material-adicionar:hover { background: #DDE1F3; }
.material-adicionar svg { width: 16px; height: 16px; }
.material-adicionar svg, .material-adicionar svg * { fill: none; stroke: currentColor; }

/* =========================================================
   UMA MANUTENÇÃO: FICHA E VISITAS
   ========================================================= */

/* os cartões da lista abrem a manutenção */
.manut.obra-cartao { cursor: pointer; }

.ficha-estado.atrasada { color: #C62828; background: #FDECEC; }
.ficha-estado.resolvida { color: #00713A; background: #E3F5EA; }   /* assistência resolvida */
.ficha-numero.atrasada { background: #FDECEC; }
.ficha-numero.atrasada strong { color: #C62828; }
.obra-ficha-topo .olho.lapis { margin-left: auto; }

.manut-notas {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--texto);
  white-space: pre-wrap;
  background: #F6F7FB;
  border-radius: 14px;
}

/* editar: a periodicidade "De [3] em 3 [meses]" e as notas */
.manut-periodicidade input,
.manut-periodicidade select {
  height: 38px;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--fundo);
  border: none;
  border-radius: 10px;
}
.manut-notas-editar {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--texto);
  background: #fff;
  border: 1px solid #DDE0EA;
  border-radius: 12px;
  resize: vertical;
}
.manut-notas-editar:focus { outline: none; border-color: var(--azul); }

/* as visitas */
.manut-visitas .progresso-topo { align-items: center; }
.manut-visitas .material-adicionar { margin: 0; }
.manut-visita-form { margin: 14px 0 6px; padding: 16px; background: #F6F7FB; border-radius: 16px; box-shadow: none; }
.manut-visitas-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.manut-visita {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #E8EAF1;
  border-radius: 14px;
}
.manut-visita .ficha-local-icone { background: #EEF0F8; }
.manut-visita-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.manut-visita-texto strong { font-size: 15px; }
.manut-visita-texto small { font-size: 12.5px; color: #8A90A6; }
.manut-visita-texto p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--texto); white-space: pre-wrap; }
.manut-visitas .resumo-vazio { margin-top: 12px; }

/* =========================================================
   PRÉ-VISUALIZAÇÃO: "EDITAR ▾" E O EDITOR DE FOTOS E PDF
   ========================================================= */

/* o botão "Editar ▾" (como no leitor de PDF) */
.editar-menu-caixa { position: relative; flex-shrink: 0; }
.editar-menu-botao {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--texto);
  background: #F0F1F6;
  border: 1px solid #DDE0EA;
  border-radius: 999px;
  cursor: pointer;
}
.editar-menu-botao:hover { background: #E6E8F0; }
.editar-menu-botao svg { width: 17px; height: 17px; }
.editar-menu-botao svg, .editar-menu-botao svg * { fill: none; stroke: currentColor; }
.editar-menu-seta { font-size: 11px; color: #6B7189; }

/* o menu */
.editar-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 230px;
  padding: 8px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 24, 60, .2), 0 0 0 1px rgba(20, 24, 60, .06);
  animation: previa-subir .16s ease;
}
.editar-menu[hidden] { display: none; }
.editar-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  color: var(--texto);
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.editar-menu button:hover, .editar-menu button:focus-visible { outline: none; border-color: var(--verde); background: #F6FBF8; }
.editar-menu svg { width: 20px; height: 20px; flex-shrink: 0; color: #4A5068; }
.editar-menu svg, .editar-menu svg * { fill: none; stroke: currentColor; }

/* a barra das ferramentas */
.editor-barra {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #F8F9FC;
  border-bottom: 1px solid #E3E6EF;
}
.editor-barra[hidden] { display: none; }
.editor-ferramentas, .editor-cores, .editor-acoes { display: flex; align-items: center; gap: 6px; }
.editor-acoes { margin-left: auto; }
.editor-ferr {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #4A5068;
  background: #fff;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
  cursor: pointer;
}
.editor-ferr:hover { border-color: var(--azul); color: var(--azul); }
.editor-ferr.ativa { color: #fff; background: var(--azul); border-color: var(--azul); }
.editor-ferr svg { width: 18px; height: 18px; }
.editor-ferr svg, .editor-ferr svg * { fill: none; stroke: currentColor; }
.editor-cores button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #C9CEE0;
  cursor: pointer;
}
.editor-cores button.ativa { box-shadow: 0 0 0 2px var(--azul); }
.corpo-app .editor-acoes .botao-app, .editor-acoes .botao-app { width: auto; min-height: 38px; margin: 0; padding: 0 16px; }
.editor-acoes .botao-cancelar {
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--texto-suave);
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
}

/* as folhas (páginas do PDF ou a foto) */
.previa.a-editar .previa-corpo { align-items: flex-start; overflow: auto; }
.editor-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.editor-folha {
  position: relative;
  width: min(100%, 900px);
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}
.editor-folha canvas { display: block; width: 100%; height: auto; }
.editor-folha .editor-marcas { position: absolute; inset: 0; height: 100%; cursor: crosshair; touch-action: none; }
.editor-texto {
  position: absolute;
  z-index: 2;
  min-width: 180px;
  padding: 4px 8px;
  font: 600 16px Inter, Arial, sans-serif;
  background: rgba(255, 255, 255, .95);
  border: 1px dashed var(--azul);
  border-radius: 6px;
  outline: none;
}

@media (max-width: 600px) {
  .editar-menu-botao span:not(.editar-menu-seta) { display: none; }   /* no telemóvel só o lápis ▾ */
  .editor-barra { gap: 8px; padding: 8px; }
  .editor-acoes { margin-left: 0; width: 100%; justify-content: flex-end; }
  .editor-area { padding: 8px; }
}

/* a folha escondida onde se desenha um Word / Excel / texto antes de o editar */
.editor-documento {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 820px;
  padding: 40px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #111;
  background: #fff;
}
.editor-documento pre { margin: 0; font: 13px/1.5 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.editor-documento h3 { margin: 18px 0 8px; font-size: 15px; }
.editor-documento table { border-collapse: collapse; }
.editor-documento td, .editor-documento th { padding: 3px 6px; border: 1px solid #C9CEE0; font-size: 12px; white-space: nowrap; }
.editor-documento section.docx { box-shadow: none !important; margin: 0 !important; padding: 0 !important; width: auto !important; min-height: 0 !important; }

/* =========================================================
   VERSÕES DOS FICHEIROS E DESENHOS AUTOCAD
   ========================================================= */

/* "v2" ao lado do nome do ficheiro */
.ficheiro-versao {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 999px;
}

/* o botão "v3 ▾" e a lista das versões */
.versoes-botao { height: 38px; padding: 0 12px; }
.editar-menu .versoes-titulo {
  display: block;
  padding: 4px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A90A6;
}
.editar-menu button strong { font-size: 14.5px; }
.editar-menu button span { margin-left: auto; font-size: 12.5px; color: #8A90A6; }
.editar-menu button.atual { background: #F3F4FA; }

/* painel dos desenhos AutoCAD */
.previa-cad {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--texto);
}
.previa-cad .obra-ficheiro-tipo { width: 72px; height: 72px; font-size: 16px; border-radius: 16px; }
.previa-cad > strong { font-size: 18px; }
.previa-cad ol { margin: 0; padding-left: 20px; text-align: left; font-size: 14.5px; line-height: 1.6; color: #4A5068; }
.previa-cad-botoes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.previa-cad-botoes .botao-app { width: auto; margin: 0; padding: 0 20px; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.previa-cad-botoes .botao-cancelar {
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--azul);
  background: #fff;
  border: 1px solid #B8BEDF;
  border-radius: 10px;
  cursor: pointer;
}

/* =========================================================
   PERFIL DE UMA PESSOA (Gerência e Gestão) — pessoa.html
   ========================================================= */

.ver-perfil {
  display: inline-block;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--azul);
  text-decoration: none;
}
.ver-perfil:hover { text-decoration: underline; }

.pessoa-topo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pessoa-foto {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  background: var(--verde);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}
.pessoa-foto img { width: 100%; height: 100%; object-fit: cover; }
.pessoa-topo-texto { flex: 1; min-width: 200px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pessoa-topo-texto h2 { margin: 0; font-size: 22px; }
.pessoa-contactos { flex-direction: row; flex-wrap: wrap; }

.pessoa-cartao {
  margin-top: 16px;
  padding: 18px;
  background: var(--branco);
  border-radius: 18px;
  box-shadow: var(--sombra);
}
.pessoa-sobre h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8A90A6; }
.pessoa-sobre h3 + p { margin: 0 0 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.pessoa-sem { color: #A3A8BC; font-style: italic; }

.pessoa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pessoa-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 999px;
}
.pessoa-chip.aviso { color: #B26A00; background: #FDF2E1; }

.pessoa-grelha {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
.pessoa-grelha .pessoa-cartao { margin-top: 16px; }
.pessoa-cartao-cabeca { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pessoa-cartao-cabeca h3 { margin: 0; font-size: 16px; }
.pessoa-cartao-cabeca svg, .pessoa-contactos svg { fill: none; stroke: currentColor; }
.pessoa-cartao-cabeca svg * { fill: none; stroke: currentColor; }
.pessoa-linhas { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.pessoa-linhas dt { font-size: 13px; color: #8A90A6; }
.pessoa-linhas dd { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--texto); min-width: 0; }
.pessoa-linhas dd.vazio { color: #B4B9CC; font-weight: 500; }
.pessoa-linhas dd a { color: var(--azul); text-decoration: none; }
.pessoa-validade { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .pessoa-topo { flex-direction: column; text-align: center; }
  .pessoa-topo-texto { align-items: center; }
}

/* =========================================================
   MENU "EDITAR ▾" — MAIS APRESENTÁVEL, E A CAIXA DE TEXTO
   ========================================================= */

.editar-menu { min-width: 290px; padding: 8px; }
.editar-menu .editar-opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
}
.editar-menu .editar-opcao:hover,
.editar-menu .editar-opcao:focus-visible { background: #F4F5FA; border-color: transparent; }
.editar-opcao-icone {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  border-radius: 12px;
}
.editar-opcao-icone svg { width: 20px; height: 20px; }
.editar-opcao-icone svg, .editar-opcao-icone svg * { fill: none; stroke: currentColor; stroke-width: 2; }
.tom-azul .editar-opcao-icone    { color: var(--azul); background: #E8EAF6; }
.tom-amarelo .editar-opcao-icone { color: #A87800; background: #FFF4CC; }
.tom-verde .editar-opcao-icone   { color: var(--verde); background: #E6F5EC; }
.tom-roxo .editar-opcao-icone    { color: #6A3FB5; background: #F1EBFB; }
.editar-opcao-texto { display: flex; flex-direction: column; gap: 2px; margin: 0 !important; text-align: left; }
.editar-menu .editar-opcao-texto strong { font-size: 15px; font-weight: 700; color: var(--texto); }
.editar-menu .editar-opcao-texto small { font-size: 12.5px; color: #8A90A6; }

/* a caixa de escrever texto */
.editor-caixa-texto {
  position: absolute;
  z-index: 3;
  width: 280px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20, 24, 60, .25), 0 0 0 1px rgba(20, 24, 60, .08);
  animation: previa-subir .15s ease;
}
.editor-caixa-texto textarea {
  width: 100%;
  min-height: 70px;
  padding: 8px 10px;
  font: 600 16px Inter, Arial, sans-serif;
  background: #F8F9FC;
  border: 1px solid #E3E6EF;
  border-radius: 10px;
  resize: vertical;
  outline: none;
}
.editor-caixa-texto textarea:focus { border-color: var(--azul); background: #fff; }
.editor-caixa-barra { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.editor-tamanhos { display: flex; gap: 2px; padding: 2px; margin-right: auto; background: #F0F1F6; border-radius: 9px; }
.editor-tamanhos button {
  width: 30px;
  height: 28px;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #6B7189;
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.editor-tamanhos button.ativo { color: var(--azul); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.editor-caixa-nao, .editor-caixa-sim {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.editor-caixa-nao { width: 32px; padding: 0; justify-content: center; color: #6B7189; background: #F0F1F6; }
.editor-caixa-sim { color: #fff; background: var(--azul); }
.editor-caixa-nao svg, .editor-caixa-sim svg { width: 15px; height: 15px; }
.editor-caixa-nao svg, .editor-caixa-nao svg *, .editor-caixa-sim svg, .editor-caixa-sim svg * { fill: none; stroke: currentColor; stroke-width: 2.5; }

/* =========================================================
   UTILIZADORES: "VER PERFIL" BEM VISÍVEL; PERFIL: EDITAR
   ========================================================= */

.utilizador-botoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.corpo-app .utilizador-botoes .botao-app { width: auto; min-height: 44px; margin: 0; padding: 0 22px; }
.botao-ver-perfil {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--azul);
  text-decoration: none;
  background: #E8EAF6;
  border: 1px solid #C9CEE8;
  border-radius: 10px;
  cursor: pointer;
}
.botao-ver-perfil:hover { background: #DDE1F3; }
.botao-ver-perfil svg { width: 18px; height: 18px; }
.botao-ver-perfil svg, .botao-ver-perfil svg * { fill: none; stroke: currentColor; }
.pessoa-topo .pessoa-editar { margin-left: auto; align-self: flex-start; }

/* a caixa de editar o perfil de outra pessoa */
.obra-ficha + .pessoa-form, .pessoa-topo + .pessoa-form {
  margin-top: 14px;
  padding: 22px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
}
.pessoa-form-campos { display: flex; flex-direction: column; gap: 12px; }
.pessoa-form-campo { display: flex; flex-direction: column; gap: 6px; }
.pessoa-form-campo > span { font-size: 12.5px; font-weight: 600; color: #6B7189; }
.pessoa-form-campo input, .pessoa-form-campo textarea, .pessoa-form-campo select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: #fff;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
}
.pessoa-form-campo textarea { resize: vertical; }
.pessoa-form-campo input:focus, .pessoa-form-campo textarea:focus, .pessoa-form-campo select:focus { outline: none; border-color: var(--azul); }
.pessoa-chip.escolher { border: 1px solid #DDE0EA; background: #fff; color: #4A5068; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.pessoa-chip.escolher.marcada { color: #fff; background: var(--azul); border-color: var(--azul); }
@media (max-width: 600px) {
  .pessoa-topo .pessoa-editar { margin-left: 0; align-self: center; }
}

/* editor: seletor de espessura (fina / média / grossa) */
.editor-espessura { display: flex; gap: 2px; padding: 3px; background: #EEF0F6; border-radius: 10px; }
.editor-espessura button {
  width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.editor-espessura button i { display: block; width: 20px; background: #4A5068; border-radius: 999px; }
.editor-espessura button.ativa { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.editor-espessura button.ativa i { background: var(--azul); }
/* a caixa de editar o perfil fica no fim da página */
.pessoa-form {
  margin-top: 16px;
  padding: 22px;
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
  scroll-margin-top: 16px;
}

/* avisos do editor e da pré-visualização: numa linha própria, por baixo dos botões */
.editor-acoes { flex-wrap: wrap; justify-content: flex-end; }
.editor-acoes > .ev-aviso { flex: 0 0 100%; order: 99; justify-content: flex-end; text-align: right; margin: 6px 0 0; }
.previa-topo { flex-wrap: wrap; }
.previa-topo > .ev-aviso { flex: 0 0 100%; order: 99; justify-content: flex-end; text-align: right; margin: 4px 0 0; }

/* =========================================================
   EDITOR: BARRA NUMA SÓ LINHA, ARRUMADA
   ferramentas | cores | espessura ............ desfazer · cancelar · guardar
   (o aviso, quando há, fica numa linha por baixo, de lado a lado)
   ========================================================= */

/* os "Cancelar" destes sítios aparecem (a regra antiga do calendário escondia-os) */
.editor-acoes .botao-cancelar,
.previa-cad-botoes .botao-cancelar,
.progresso-editar .botao-cancelar,
.obra-tabela tr.material-form .botao-cancelar { display: inline-flex; align-items: center; }

.editor-barra { flex-wrap: wrap; gap: 10px 0; padding: 10px 16px; }
.editor-ferramentas, .editor-cores, .editor-espessura { flex-shrink: 0; }
/* uma linha fina a separar cada grupo */
.editor-cores, .editor-espessura { margin-left: 14px; padding-left: 14px; border-left: 1px solid #E3E6EF; }
.editor-espessura { background: none; padding-top: 0; padding-bottom: 0; }
.editor-espessura button { background: #EEF0F6; }
.editor-espessura button:first-child { border-radius: 8px 0 0 8px; }
.editor-espessura button:last-child { border-radius: 0 8px 8px 0; }
.editor-espessura button.ativa { background: #fff; box-shadow: inset 0 0 0 2px var(--azul); }
.editor-espessura { gap: 0; }

/* as ações ficam na mesma linha, encostadas à direita */
.editor-acoes { display: contents; }
.editor-acoes > .editor-ferr:first-child { margin-left: auto; }
.editor-acoes > .botao-cancelar { margin-left: 8px; }
.editor-acoes > .botao-app { margin-left: 8px; }
.editor-acoes > .ev-aviso { flex: 0 0 100%; order: 99; justify-content: flex-end; margin: 2px 0 0; }

@media (max-width: 760px) {
  /* telemóvel: ferramentas em cima; cores e espessura a seguir; ações em baixo */
  .editor-cores { margin-left: auto; }
  .editor-espessura { margin-left: 0; border-left: 0; padding-left: 10px; }
  .editor-acoes > .editor-ferr:first-child { margin-left: 0; }
  .editor-acoes > .botao-app { flex: 1; }
}
/* o aviso do editor encostado à esquerda */
.editor-acoes > .ev-aviso { justify-content: flex-start; text-align: left; }

/* ficheiros: etiqueta "Editado" e original / editado nas versões */
.ficheiro-editado {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  color: #6A3FB5;
  background: #F1EBFB;
  border-radius: 999px;
}
.editar-menu button strong em {
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  border-radius: 999px;
}
.editar-menu .versao-original { color: var(--verde); background: #E6F5EC; }
.editar-menu .versao-editada { color: #6A3FB5; background: #F1EBFB; }

/* =========================================================
   FICHEIROS EM ESCADA: original em cima, cada alteração um
   degrau mais para dentro, ligado ao de cima
   ========================================================= */

.obra-ficheiros li.ficheiro-escada { display: flex; flex-direction: column; gap: 6px; }
.obra-ficheiros .ficheiro-degrau { position: relative; overflow: visible; }
.obra-ficheiros .ficheiro-degrau.sub {
  width: calc(100% - min(var(--nivel) * 28px, 45%));
  margin-left: min(calc(var(--nivel) * 28px), 45%);
}
/* a ligação em "L" ao degrau de cima */
.degrau-liga {
  position: absolute;
  left: -18px;
  top: -8px;
  width: 14px;
  height: calc(50% + 8px);
  border-left: 2px solid #C9CEE0;
  border-bottom: 2px solid #C9CEE0;
  border-bottom-left-radius: 8px;
  pointer-events: none;
}
.obra-ficheiros .ficheiro-degrau.sub .obra-ficheiro-tipo { width: 36px; height: 36px; font-size: 9.5px; }
/* a versão atual destaca-se */
.obra-ficheiros .ficheiro-escada .ficheiro-degrau.atual { border-color: #C9CEE8; box-shadow: 0 4px 12px rgba(40, 48, 120, .08); }
.obra-ficheiros .ficheiro-escada .ficheiro-degrau:not(.atual) { background: #FAFBFD; }

.ficheiro-original, .ficheiro-atual {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  border-radius: 999px;
}
.ficheiro-original { color: var(--verde); background: #E6F5EC; }
.ficheiro-atual { color: #fff; background: var(--azul); }

/* a seta das versões (no lugar do olho): abre e fecha a escada */
.obra-ficheiros li.ficheiro-escada:not(.aberta) .ficheiro-degrau.sub { display: none; }
.ficheiro-seta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 8px 6px 10px;
  color: var(--azul);
  background: #EEF0F8;
  border-radius: 999px;
  cursor: pointer;
}
.ficheiro-seta:hover { background: #E3E6F3; }
.ficheiro-seta small { font-size: 12px; font-weight: 700; }
.ficheiro-seta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.ficheiro-seta svg, .ficheiro-seta svg * { fill: none; stroke: currentColor; stroke-width: 2.5; }
.ficheiro-escada.aberta .ficheiro-seta svg { transform: rotate(180deg); }

/* checklist: os ficheiros da tarefa em escada, por baixo da tarefa, de lado a lado */
.progresso-tarefa > ul.progresso-ficheiros {
  flex: 0 0 100%;
  order: 99;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 6px 10px 44px;
}
@media (max-width: 600px) { .progresso-tarefa > ul.progresso-ficheiros { padding-left: 6px; } }

/* o caixote do lixo em cada ficheiro / versão (Gerência e Gestão) */
.ficheiro-lixo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: #C62828;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, background .15s;
}
.ficheiro-degrau:hover .ficheiro-lixo { opacity: 1; }
.ficheiro-lixo:hover { background: #FDECEC; }
.ficheiro-lixo svg { width: 17px; height: 17px; }
.ficheiro-lixo svg, .ficheiro-lixo svg * { fill: none; stroke: currentColor; stroke-width: 2; }
/* se houver caixote e seta, ficam lado a lado à direita */
.ficheiro-lixo + .ficheiro-seta { margin-left: 6px; }
@media (hover: none) { .ficheiro-lixo { opacity: 1; } }   /* telemóvel: sempre visível */

/* versões: a que se está a ver */
.editar-menu button.a-ver { background: #F3F4FA; }
.editar-menu .versao-a-ver {
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--azul);
  background: #E8EAF6;
  border-radius: 999px;
}
/* menu das versões: abre para a esquerda (alinhado à direita do botão), sem sair do ecrã */
.editar-menu.versoes-menu {
  left: auto;
  right: 0;
  width: 330px;
  min-width: 0;
  max-width: calc(100vw - 32px);
}
.versoes-menu button { flex-wrap: wrap; gap: 4px 10px; }
.versoes-menu button strong { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; white-space: nowrap; }
.versoes-menu button strong em, .versoes-menu .versao-a-ver { margin-left: 0; }
.editar-menu.versoes-menu button > span { margin-left: auto; white-space: nowrap; }
/* o caixote dentro da pré-visualização (Gerência e Gestão) */
.previa-botao.previa-lixo { color: #C62828; background: #FDECEC; }
.previa-botao.previa-lixo:hover { background: #F9D6D6; }
.previa-botao.previa-lixo svg, .previa-botao.previa-lixo svg * { fill: none; stroke: currentColor; }
/* miniatura de PDF: a primeira página, vista de cima, com moldura de folha */
.obra-ficheiro-tipo.com-miniatura.pdf { background: #fff; box-shadow: inset 0 0 0 1px #E3E6EF; }
.obra-ficheiro-tipo.com-miniatura.pdf img { object-fit: cover; object-position: top; }
/* miniaturas de documentos (PDF, Word, Excel, texto): moldura de folha, vistas de cima */
.obra-ficheiro-tipo.com-miniatura.folha { position: relative; background: #fff; box-shadow: inset 0 0 0 1px #E3E6EF; }
.obra-ficheiro-tipo.com-miniatura.folha img { object-fit: cover; object-position: top; }
/* vídeos: um ▶ por cima da imagem */
.obra-ficheiro-tipo.com-miniatura.video img { object-position: center; }
.obra-ficheiro-tipo.com-miniatura.video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, .28);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* =========================================================
   JANELA DE CONFIRMAÇÃO DO SITE (perguntar) — em vez da do browser
   ========================================================= */
.pergunta-fundo {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 18, 40, .55);
  backdrop-filter: blur(2px);
  animation: previa-entrar .15s ease;
}
.pergunta {
  width: min(420px, 100%);
  padding: 26px 24px 20px;
  text-align: center;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: previa-subir .2s var(--mola, ease);
}
.pergunta-icone {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #B26A00;
  background: #FDF2E1;
  border-radius: 50%;
}
.pergunta.pergunta-perigo .pergunta-icone { color: #C62828; background: #FDECEC; }
.pergunta-titulo { margin: 0 0 8px; font-size: 19px; font-weight: 700; color: var(--texto); word-break: break-word; }
.pergunta-texto { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: #5B6178; word-break: break-word; }
.pergunta-botoes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pergunta-botao {
  flex: 1 1 0;
  min-width: 110px;
  min-height: 46px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.pergunta-botao.neutro { color: var(--texto); background: #EEF0F6; }
.pergunta-botao.neutro:hover { background: #E3E6EF; }
.pergunta-botao.principal { color: #fff; background: var(--azul); }
.pergunta-botao.perigo { color: #fff; background: #D32F2F; }
.pergunta-botao.perigo:hover { background: #B71C1C; }
.pergunta-botao.perigo-leve { color: #C62828; background: #FDECEC; }
.pergunta-botao.perigo-leve:hover { background: #F9D6D6; }
.pergunta-botao:focus-visible { outline: 3px solid rgba(40, 48, 120, .35); outline-offset: 2px; }
@media (max-width: 480px) {
  .pergunta-botoes { flex-direction: column-reverse; }
  .pergunta-botao { width: 100%; }
}

/* =========================================================
   FICHEIROS APAGADOS (no fim da obra, Gerência e Gestão)
   ========================================================= */
.apagados { margin-top: 24px; background: var(--branco); border-radius: 16px; box-shadow: var(--sombra); }
.apagados-topo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  color: var(--texto);
  background: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
}
.apagados-topo:hover { background: #F8F9FC; }
.apagados-topo:focus { outline: none; }
.apagados-topo:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
.apagados.aberta .apagados-topo { border-radius: 16px 16px 0 0; background: #F6F7FB; }
.apagados-icone {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C62828;
  background: #FDECEC;
  border-radius: 12px;
}
.apagados-icone svg { width: 20px; height: 20px; }
.apagados-icone.historico { color: var(--azul); background: #EEF0F8; padding: 0; flex-direction: row; gap: 0; position: static; }
.apagados-icone.historico::before { content: none; }   /* a linha do tempo de .historico não entra aqui */   /* histórico, não lixo */
.apagados-icone svg, .apagados-icone svg * { fill: none; stroke: currentColor; }
.apagados-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.apagados-titulo strong { font-size: 15px; }
.apagados-titulo small { font-size: 12.5px; color: #8A90A6; }
.apagados.aberta .opcao-seta { transform: rotate(-135deg); }   /* aberta: seta para cima (como nas secções) */

.apagados-lista { display: none; padding: 10px 14px 14px; border-top: 1px solid #EEF0F5; }
.apagados.aberta .apagados-lista { display: flex; flex-direction: column; gap: 8px; }
.apagado {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #E8EAF1;
  border-radius: 12px;
}
.apagado .obra-ficheiro-tipo { flex-shrink: 0; opacity: .75; }
.apagado-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.apagado-texto strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apagado-texto small { font-size: 12.5px; color: #6B7189; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apagado-texto .apagado-quem { color: #C62828; }
/* histórico dos ficheiros: o que foi adicionado fica a verde */
.apagado.adicionado .apagado-texto .apagado-quem { color: #00713A; }
.apagado.adicionado.ja-apagado { opacity: 0.6; }
.apagado-repor {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--verde);
  background: #E6F5EC;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.apagado-repor:hover { background: #D3EEDD; }
.apagado-repor:disabled { opacity: .6; cursor: wait; }
.apagado-repor svg { width: 16px; height: 16px; }
.apagado-repor svg, .apagado-repor svg * { fill: none; stroke: currentColor; stroke-width: 2.2; }
@media (max-width: 600px) {
  .apagado { flex-wrap: wrap; }
  .apagado-repor { width: 100%; justify-content: center; }
}
/* fases da checklist: aberta = seta para cima (como nas secções) */
.progresso-fase.aberta .opcao-seta { transform: rotate(-135deg); }

/* =========================================================
   TAREFAS DA CHECKLIST: BOTÕES NUM SÓ ⋯ EM ECRÃS PEQUENOS
   ========================================================= */

/* PC: os botões lado a lado, como antes */
.tarefa-acoes, .tarefa-menu { display: contents; }
.tarefa-mais { display: none; }
.progresso-tarefa.a-editar .tarefa-acoes { display: none; }

@media (max-width: 1024px) {
  .tarefa-acoes { position: relative; display: block; flex-shrink: 0; }
  .tarefa-mais { display: flex; }
  .tarefa-mais svg, .tarefa-mais svg * { fill: currentColor; stroke: none; }
  .tarefa-acoes.aberto .tarefa-mais { color: #fff; background: var(--azul); }
  .tarefa-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 210px;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 24, 60, .2), 0 0 0 1px rgba(20, 24, 60, .06);
    animation: previa-subir .16s ease;
  }
  .tarefa-acoes.aberto .tarefa-menu { display: flex; }
  .progresso-tarefa:has(.tarefa-acoes.aberto) { position: relative; z-index: 35; }
  .progresso-fase:has(.tarefa-acoes.aberto) { position: relative; z-index: 35; }
  .tarefa-menu > button {
    width: 100%;
    height: 44px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    background: transparent;
    border-radius: 10px;
  }
  .tarefa-menu > button:hover { background: #F4F5FA; }
  .tarefa-menu > button::after {
    content: attr(data-rotulo);
    font-size: 14px;
    font-weight: 600;
    color: var(--texto);
  }
  .tarefa-menu > .progresso-remover::after { color: #C62828; }
  .tarefa-menu > .progresso-clipe span { order: 2; margin-left: auto; }

  /* a cabeça da fase: só o olho (a etiqueta "Toda a equipa" sai, para o título caber) */
  .progresso-fase-topo .quem-ve-conta { display: none; }
}

/* menu ⋯ das tarefas: todas as opções iguais (ícone, alinhamento e fundo) */
@media (max-width: 1024px) {
  .tarefa-menu > button,
  .tarefa-menu > button.com,
  .tarefa-menu > button.ativo {
    color: var(--azul);
    background: transparent;
    border: 0;
  }
  .tarefa-menu > button:hover { background: #F4F5FA; }
  .tarefa-menu > button svg { width: 18px; height: 18px; flex-shrink: 0; }
  .tarefa-menu > button::after { margin-right: auto; text-align: left; }
  /* o número de ficheiros do clipe: uma etiqueta discreta à direita */
  .tarefa-menu > .progresso-clipe span {
    order: 3;
    margin-left: 0;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--verde);
    background: #E6F5EC;
    border-radius: 999px;
  }
  .tarefa-menu > .progresso-remover { color: #C62828; }
}
/* menu ⋯ das tarefas: uma coluna para o símbolo (24px) e o texto sempre alinhado */
@media (max-width: 1024px) {
  .tarefa-menu > button { gap: 12px; padding: 0 12px; }
  .tarefa-menu > button svg,
  .tarefa-menu > button .so-menu {
    width: 24px;
    flex: 0 0 24px;
  }
  .tarefa-menu > button svg { height: 18px; }
}

/* menu ⋯ das tarefas: todas as opções numa só linha, alinhadas da mesma forma */
@media (max-width: 1024px) {
  .tarefa-menu { min-width: 240px; }
  .tarefa-menu > button {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 44px;
    min-width: 0;
    gap: 12px;
    padding: 0 12px;
    white-space: nowrap;
    text-align: left;
  }
  .tarefa-menu > button::after { flex: 1; white-space: nowrap; }
}
/* =========================================================
   HARMONIA — UM SÓ ESTILO PARA CADA TIPO DE BOTÃO (site todo)
   ---------------------------------------------------------
   · Ação com ícone (editar, câmara, clipe, imprimir…): azul,
     fundo lilás-claro, 34px, cantos de 10px
   · Apagar: o mesmo, mas a vermelho, fundo vermelho-claro
   · Guardar / Adicionar: azul cheio · Cancelar: branco com contorno
     — os dois com 44px de altura e cantos de 10px
   ========================================================= */

/* ações com ícone (nas linhas: tarefas, materiais, lembretes, calendário, visitas) */
.botao-lapis,
.botao-lixo,
.progresso-botao {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  transition: background .15s, color .15s, transform .15s;
}
.botao-lapis, .progresso-botao:not(.progresso-remover) { color: var(--azul); background: #EEF0F8; }
.botao-lapis:hover, .progresso-botao:not(.progresso-remover):hover { color: var(--azul); background: #E1E5F4; transform: none; }
.botao-lixo, .progresso-botao.progresso-remover { color: #C62828; background: #FDECEC; }
.botao-lixo:hover, .progresso-botao.progresso-remover:hover { color: #C62828; background: #F9D6D6; transform: none; }
.botao-lapis svg, .botao-lixo svg, .progresso-botao svg { width: 17px; height: 17px; }
.botao-lapis svg, .botao-lapis svg *, .botao-lixo svg, .botao-lixo svg *,
.progresso-botao svg, .progresso-botao svg * { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* o ⋯ das tarefas: pontos cheios (a regra de cima deixava-os só com o contorno) */
.progresso-botao.tarefa-mais svg, .progresso-botao.tarefa-mais svg * { fill: currentColor; stroke: none; }
.progresso-clipe.com { color: var(--verde) !important; background: #E6F5EC !important; }

/* ações com ícone nos cabeçalhos (fichas, secções, pré-visualização): o mesmo desenho */
.olho.lapis, .olho.sec-acao, .previa-botao { border-radius: 10px; }
.olho.lapis, .olho.sec-acao { color: var(--azul); background: #EEF0F8; }
.olho.lapis:hover, .olho.sec-acao:hover { background: #E1E5F4; }
.olho.sec-acao.sec-remover { color: #C62828; background: #FDECEC; }
.olho.sec-acao.sec-remover:hover { background: #F9D6D6; }
.previa-botao.previa-lixo { color: #C62828; background: #FDECEC; }
.previa-botao.previa-lixo:hover { background: #F9D6D6; }

/* nos menus ⋯ os botões continuam sem fundo, só com o nome (como já estavam) */
@media (max-width: 1024px) {
  .tarefa-menu > button, .tarefa-menu > button.com, .tarefa-menu > button.ativo,
  .obra-sec-acoes .sec-acoes-menu .olho { background: transparent !important; width: 100%; height: 44px; }
  .tarefa-menu > button:hover, .obra-sec-acoes .sec-acoes-menu .olho:hover { background: #F4F5FA !important; }
  .tarefa-menu > .progresso-remover, .tarefa-menu > .progresso-remover::after { color: #C62828; }
  .obra-sec-acoes .sec-acoes-menu .olho:not(.sec-acao):not(.lapis) { background: #E9F7EF !important; }
  .obra-sec-acoes .sec-acoes-menu .olho.fechado:not(.sec-acao):not(.lapis) { background: #FDECEC !important; }
}

/* Guardar / Adicionar e Cancelar: o mesmo tamanho e cantos em todos os formulários */
.obra-form .botao-app,
.ev-botoes .botao-app,
.editor-acoes .botao-app,
.progresso-nova .botao-app,
.progresso-editar .botao-app,
.material-form .botao-app,
.previa-cad-botoes .botao-app,
.utilizador-botoes .botao-app {
  min-height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}
.obra-form .botao-cancelar,
.ev-botoes .botao-cancelar,
.editor-acoes .botao-cancelar,
.progresso-editar .botao-cancelar,
.material-form .botao-cancelar,
.previa-cad-botoes .botao-cancelar {
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto-suave);
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 10px;
  cursor: pointer;
}
.obra-form .botao-cancelar:hover, .ev-botoes .botao-cancelar:hover, .editor-acoes .botao-cancelar:hover,
.progresso-editar .botao-cancelar:hover, .material-form .botao-cancelar:hover { color: var(--texto); border-color: #A9AFC8; }
/* nas linhas pequenas (tabela de materiais, editar tarefa) um pouco mais baixos */
.material-form .botao-app, .material-form .botao-cancelar,
.progresso-editar .botao-app, .progresso-editar .botao-cancelar,
.progresso-nova .botao-app { min-height: 40px; }

/* os botões "+ Adicionar …" pequenos (material, visita, versões): todos iguais */
.material-adicionar { min-height: 40px; border-radius: 10px; }
/* HARMONIA — cartões (caixas brancas): os mesmos cantos e a mesma sombra */
.obra-ficha,
.progresso-obra,
.obra-sec,
.apagados,
.pessoa-cartao,
.obra-ficha + .obra-ficha-editar,
.obra-ficha + .pessoa-form,
.pessoa-form,
.obra-adicionar .obra-form {
  border-radius: 18px;
  box-shadow: var(--sombra);
}

/* HARMONIA — menus que abrem (Editar, versões, ⋯, quem vê, escolher ficheiro):
   o mesmo fundo, cantos e sombra */
.editar-menu,
.sec-escolha,
.quem-ve-lista,
.tarefa-menu,
.obra-sec-acoes .sec-acoes-menu {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 24, 60, .2), 0 0 0 1px rgba(20, 24, 60, .06);
}
/* em ecrãs largos os botões das secções estão soltos na linha (não é um menu):
   sem sombra nem contorno por trás */
@media (min-width: 1025px) {
  .obra-sec-acoes .sec-acoes-menu { box-shadow: none; border-radius: 0; background: none; }
}

/* =========================================================
   FICHEIROS EM ESCADA NO TELEMÓVEL: tudo dentro do ecrã
   ========================================================= */
.obra-ficheiros, .obra-ficheiros li, .obra-ficheiros .ficheiro-degrau { min-width: 0; max-width: 100%; box-sizing: border-box; }
.obra-ficheiros .ficheiro-degrau .obra-ficheiro-info { flex: 1; min-width: 0; }
.ficheiro-seta small b { font-weight: 800; }

@media (max-width: 600px) {
  /* menos margem à esquerda e degraus menos recuados */
  .progresso-tarefa > ul.progresso-ficheiros { padding: 0 0 10px 8px; }
  .obra-ficheiros .ficheiro-degrau.sub {
    width: calc(100% - min(var(--nivel) * 16px, 30%));
    margin-left: min(calc(var(--nivel) * 16px), 30%);
  }
  .degrau-liga { left: -12px; width: 9px; }
  .obra-ficheiros .ficheiro-degrau { gap: 10px; padding: 8px 10px; }
  .obra-ficheiros .ficheiro-degrau .obra-ficheiro-tipo { width: 38px; height: 38px; }
  .obra-ficheiros .ficheiro-degrau.sub .obra-ficheiro-tipo { width: 32px; height: 32px; }
  /* o nome pode passar para a linha de baixo, sem empurrar nada para fora */
  .obra-ficheiros .ficheiro-degrau .obra-ficheiro-info strong {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13.5px;
    line-height: 1.3;
  }
  .obra-ficheiros .ficheiro-degrau .obra-ficheiro-info small { white-space: normal; font-size: 11.5px; }
  /* a seta das versões: só o número e a seta */
  .ficheiro-seta { padding: 5px 7px 5px 9px; gap: 3px; }
  .ficheiro-seta .seta-palavra { display: none; }
}

/* =========================================================
   PRÉ-VISUALIZAÇÃO NO TELEMÓVEL: barra em duas linhas
   em cima: o nome (inteiro) e o ✕ · por baixo: os botões
   ========================================================= */
@media (max-width: 600px) {
  .previa-topo { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .previa-topo > strong {
    order: 0;
    flex: 1 1 calc(100% - 50px);
    font-size: 14.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }
  .previa-topo > button.previa-botao:last-of-type { order: 1; }            /* o ✕ fica em cima, à direita */
  .previa-topo > .editar-menu-caixa,
  .previa-topo > .previa-botao:not(:last-of-type),
  .previa-topo > a.previa-botao { order: 2; }
  .previa-topo > .ev-aviso { order: 99; }
  /* o botão das versões mostra sempre o "v1", "v2"… */
  .editar-menu-botao.versoes-botao span:not(.editar-menu-seta) { display: inline; }
  /* os menus (Editar e versões) abrem para dentro do ecrã */
  .previa-topo .editar-menu,
  .previa-topo .editar-menu.versoes-menu { left: 0; right: auto; max-width: calc(100vw - 24px); }
}

/* =========================================================
   EDITOR: ZOOM (− 100% +), e as folhas podem ficar maiores do que a janela
   ========================================================= */
.editor-zoom { display: flex; align-items: center; gap: 4px; margin-left: 14px; padding-left: 14px; border-left: 1px solid #E3E6EF; }
.editor-zoom-valor {
  min-width: 56px;
  height: 38px;
  padding: 0 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--texto);
  background: #fff;
  border: 1px solid #DDE0EA;
  border-radius: 10px;
  cursor: pointer;
}
.editor-zoom-valor:hover { border-color: var(--azul); color: var(--azul); }

/* a área desliza nos dois sentidos quando a folha está maior do que a janela */
.previa.a-editar .previa-corpo { overflow: auto; display: block; }
.editor-area { width: max-content; min-width: 100%; align-items: flex-start; box-sizing: border-box; }
.editor-folha { max-width: none; margin: 0 auto; flex-shrink: 0; }
.editor-folha .editor-marcas { touch-action: none; }   /* um dedo desenha; dois fazem zoom (no site) */

@media (max-width: 760px) {
  .editor-zoom { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* pré-visualização: a imagem ocupa todo o espaço da janela (no iPhone ficava minúscula) */
.previa-corpo { position: relative; }
.previa-corpo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  touch-action: pinch-zoom;        /* ver: dá para fazer zoom com dois dedos */
}
.previa-corpo > video { width: 100%; max-height: 100%; }

/* =========================================================
   EDITOR NO TELEMÓVEL: a barra numa grelha de 3 linhas certas
   1) ferramentas ......... desfazer
   2) cores ............... espessura
   3) zoom ......... Cancelar · Guardar cópia
   ========================================================= */
@media (max-width: 600px) {
  .editor-barra {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "ferr  ferr  desf"
      "cores esp   esp"
      "zoom  canc  guard";
    align-items: center;
    gap: 10px 8px;
    padding: 10px 12px;
  }
  .editor-ferramentas { grid-area: ferr; }
  .editor-acoes > .editor-ferr:first-child { grid-area: desf; justify-self: end; margin: 0; }
  .editor-cores { grid-area: cores; margin: 0; padding: 0; border: 0; gap: 6px; }
  .editor-espessura { grid-area: esp; justify-self: end; margin: 0; padding: 0; border: 0; }
  .editor-zoom { grid-area: zoom; margin: 0; padding: 0; border: 0; }
  .editor-acoes > .botao-cancelar { grid-area: canc; margin: 0; min-height: 40px; padding: 0 12px; }
  .editor-acoes > .botao-app { grid-area: guard; margin: 0; min-height: 40px; padding: 0 14px; flex: none; }
  .editor-acoes > .ev-aviso { grid-column: 1 / -1; grid-row: 4; }
  .editor-cores button { width: 26px; height: 26px; }
  .editor-ferr { width: 38px; height: 38px; }
  .editor-espessura button { width: 34px; height: 32px; }
  .editor-zoom-valor { min-width: 52px; height: 38px; }
  /* a folha cabe na largura do ecrã */
  .editor-area { padding: 8px; }
}
@media (max-width: 380px) {
  /* ecrãs muito estreitos: o zoom tem a linha toda; os botões descem */
  .editor-barra {
    grid-template-areas:
      "ferr  ferr  desf"
      "cores esp   esp"
      "zoom  zoom  zoom"
      "canc  guard guard";
  }
  .editor-acoes > .ev-aviso { grid-row: 5; }
}

/* =========================================================
   EDITOR: ESPESSURA NUMA BARRA DE 1 A 100
   ========================================================= */
.editor-espessura.editor-espessura-barra {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 14px;
  background: none;
  cursor: pointer;
}
.editor-espessura-barra input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 6px;
  margin: 0;
  background: linear-gradient(to right, var(--azul) 0 var(--enchido, 20%), #DDE0EA var(--enchido, 20%) 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.editor-espessura-barra input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid var(--azul);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(40, 48, 120, .25);
}
.editor-espessura-barra input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid var(--azul);
  border-radius: 50%;
}
.editor-espessura-barra input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(40, 48, 120, .25); }
.editor-espessura-numero { min-width: 26px; font-size: 13px; font-weight: 700; color: var(--texto); text-align: right; }
.editor-espessura-caixa {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #E3E6EF;
  border-radius: 8px;
}
.editor-espessura-amostra { display: block; border-radius: 50%; }

@media (max-width: 600px) {
  /* telemóvel: a espessura ocupa a linha das cores, à direita, a encolher se for preciso */
  .editor-espessura.editor-espessura-barra { padding: 0; gap: 6px; }
  .editor-espessura-barra input[type="range"] { width: 90px; }
  .editor-espessura-caixa { width: 26px; height: 26px; }
  .editor-espessura-numero { min-width: 22px; font-size: 12px; }
}
@media (max-width: 420px) {
  /* muito estreito: a espessura tem uma linha só para ela */
  .editor-barra {
    grid-template-areas:
      "ferr  ferr  desf"
      "cores cores cores"
      "esp   esp   esp"
      "zoom  canc  guard";
  }
  .editor-espessura.editor-espessura-barra { justify-self: stretch; }
  .editor-espessura-barra input[type="range"] { flex: 1; width: auto; }
}
@media (max-width: 380px) {
  .editor-barra {
    grid-template-areas:
      "ferr  ferr  desf"
      "cores cores cores"
      "esp   esp   esp"
      "zoom  zoom  zoom"
      "canc  guard guard";
  }
}

/* =========================================================
   EDITOR NO TELEMÓVEL — ORGANIZADO COMO UMA APP
   em cima: ferramentas / cores / espessura (cada uma na sua linha, por igual)
   por cima da imagem: o zoom, numa pílula no canto
   no fundo, fixo: ↶ Desfazer · Cancelar · Guardar cópia
   ========================================================= */
@media (max-width: 600px) {
  .editor-barra,
  .editor-barra[hidden] { display: none; }
  .previa.a-editar .editor-barra:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 12px;
  }
  /* 1. ferramentas: 4 botões a ocupar a largura toda, por igual */
  .previa.a-editar .editor-ferramentas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
  .previa.a-editar .editor-ferramentas .editor-ferr { width: 100%; height: 42px; }
  /* 2. cores: as 5 espalhadas por igual */
  .previa.a-editar .editor-cores { display: flex; justify-content: space-between; margin: 0; padding: 0 6px; border: 0; }
  .previa.a-editar .editor-cores button { width: 32px; height: 32px; }
  /* 3. espessura: a barra a toda a largura */
  .previa.a-editar .editor-espessura.editor-espessura-barra { width: 100%; margin: 0; padding: 0; border: 0; gap: 10px; }
  .previa.a-editar .editor-espessura-barra input[type="range"] { flex: 1; width: auto; }

  /* o zoom: uma pílula por cima da imagem, em baixo à direita */
  .previa.a-editar .editor-zoom {
    position: fixed;
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    margin: 0;
    padding: 4px;
    gap: 2px;
    background: #fff;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(20, 24, 60, .22);
  }
  .previa.a-editar .editor-zoom .editor-ferr { width: 38px; height: 38px; border: 0; border-radius: 50%; }
  .previa.a-editar .editor-zoom-valor { min-width: 54px; height: 38px; border: 0; border-radius: 999px; background: #F3F4F9; }

  /* o fundo fixo: ↶ Desfazer · Cancelar · Guardar cópia */
  .previa.a-editar .editor-acoes {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #E3E6EF;
    box-shadow: 0 -6px 18px rgba(20, 24, 60, .08);
  }
  .previa.a-editar .editor-acoes > .editor-ferr:first-child { width: 48px; height: 48px; margin: 0; flex: none; }
  .previa.a-editar .editor-acoes > .botao-cancelar { flex: 1; min-height: 48px; margin: 0; padding: 0 10px; justify-content: center; }
  .previa.a-editar .editor-acoes > .botao-app { flex: 1.6; min-height: 48px; margin: 0; padding: 0 10px; }
  .previa.a-editar .editor-acoes > .ev-aviso { order: -1; flex: 0 0 100%; margin: 0 0 4px; }

  /* a imagem não fica escondida atrás do fundo fixo */
  .previa.a-editar .previa-corpo { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* =========================================================
   VISUALIZADOR (ver sem editar): zoom, arrastar, roda do rato
   ========================================================= */
.previa-corpo > .ver-caixa { position: absolute; inset: 0; }
.ver-palco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;              /* os gestos são do visualizador (zoom e arrastar) */
  cursor: grab;
  background: #EEF0F5;
  user-select: none;
  -webkit-user-select: none;
}
.ver-palco.a-arrastar { cursor: grabbing; }
.ver-conteudo {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: max-content;
  transform-origin: 0 0;
  will-change: transform;
}
.ver-pagina { display: block; max-width: none; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .14); pointer-events: none; }
.ver-espera { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; }

/* a pílula do zoom, em baixo à direita (como no editor) */
.ver-zoom {
  position: absolute;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(20, 24, 60, .22);
}
.ver-zoom .editor-ferr { width: 38px; height: 38px; border: 0; border-radius: 50%; }
.ver-zoom .editor-zoom-valor { min-width: 58px; height: 38px; border: 0; border-radius: 999px; background: #F3F4F9; }
/* editor: a mão (Mover) */
.editor-folha .editor-marcas.a-arrastar { cursor: grabbing !important; }
@media (max-width: 600px) {
  .previa.a-editar .editor-ferramentas { grid-template-columns: repeat(5, 1fr); }   /* desenhar · destacar · sublinhar · texto · mão */
}

/* editor (PC e tablet): ↶ · Cancelar · Guardar cópia sempre juntos, à direita,
   à altura das outras ferramentas */
@media (min-width: 601px) {
  .editor-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }
  .editor-acoes > .editor-ferr:first-child,
  .editor-acoes > .botao-cancelar,
  .editor-acoes > .botao-app { margin: 0 !important; }
  .editor-acoes > .botao-cancelar,
  .editor-acoes > .botao-app { min-height: 38px; height: 38px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
  .editor-acoes > .ev-aviso { flex: 0 0 100%; order: 99; margin: 4px 0 0; }
}

/* =========================================================
   EDITOR: a folha move-se e aproxima com "transform"
   (a mão arrasta em qualquer zoom; a roda faz zoom)
   ========================================================= */
.previa.a-editar .previa-corpo { position: relative; overflow: hidden; display: block; touch-action: none; }
.previa.a-editar .editor-area {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  min-width: 0;
  transform-origin: 0 0;
  will-change: transform;
}
/* visualizador: a camada nítida (desenhada à resolução do ecrã quando se pára de mexer) */
.ver-nitida {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 1;
}
.ver-zoom { z-index: 3; }

/* =========================================================
   EDITOR (PC e tablet): barra simétrica
   todos com 38px de altura, o mesmo espaço dentro de cada grupo,
   e o mesmo separador (linha fina com 14px de cada lado) entre grupos
   ========================================================= */
@media (min-width: 601px) {
  .editor-barra { flex-wrap: wrap; align-items: center; gap: 10px 0; padding: 10px 16px; }
  .editor-ferramentas, .editor-cores, .editor-espessura.editor-espessura-barra, .editor-zoom, .editor-acoes {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
  }
  /* o separador entre grupos: sempre igual */
  .editor-cores, .editor-espessura.editor-espessura-barra, .editor-zoom {
    margin: 0 0 0 14px;
    padding: 0 0 0 14px;
    border: 0;
    border-left: 1px solid #E3E6EF;
    border-radius: 0;
    background: none;
  }
  /* botões: todos 38×38, cantos de 10px */
  .editor-ferramentas .editor-ferr,
  .editor-zoom .editor-ferr,
  .editor-acoes > .editor-ferr { width: 38px; height: 38px; border-radius: 10px; }
  .editor-zoom .editor-zoom-valor { height: 38px; min-width: 58px; border-radius: 10px; }
  /* cores: círculos de 26px, com o mesmo espaço */
  .editor-cores { gap: 8px; }
  .editor-cores button { width: 26px; height: 26px; }
  /* espessura: barra, número e amostra alinhados */
  .editor-espessura.editor-espessura-barra { gap: 10px; }
  .editor-espessura-caixa { width: 38px; height: 38px; border-radius: 10px; }
  /* ações: à direita, com o mesmo espaço */
  .editor-acoes { margin-left: auto; padding-left: 14px; gap: 6px; }
  .editor-acoes > .botao-cancelar,
  .editor-acoes > .botao-app { height: 38px; min-height: 38px; border-radius: 10px; }
  .editor-acoes > .ev-aviso { height: auto; }
}
@media (min-width: 601px) { .editor-acoes { height: auto; min-height: 38px; } }
@media (max-width: 600px) {
  .previa.a-editar .editor-ferramentas { grid-template-columns: repeat(6, 1fr); }   /* … · texto · borracha · mão */
}

/* a janela de ver / editar ficheiros: quase o ecrã todo (no PC e no tablet) */
@media (min-width: 601px) {
  .previa-fundo { padding: 16px; }
  .previa {
    width: min(1800px, 100%);
    height: calc((100vh - 32px) / var(--zoom, 1));
    height: calc(100dvh - 32px);
    max-height: none;
  }
}

/* palavra-passe sem o browser a guardar: um campo de texto que mostra •••• */
.campo-secreto { -webkit-text-security: disc; text-security: disc; font-family: inherit; letter-spacing: .1em; }
.campo-secreto::placeholder { letter-spacing: normal; }
/* linhas escondidas do formulário (ex.: "Para quem" para quem não é da Gerência/Gestão) */
.ev-linha[hidden], .ev-linha-para[hidden] { display: none !important; }

/* bolinhas do calendário:
   azul = dia que já passou ou que vai acontecer · verde = hoje ·
   radar verde (a pulsar) = há uma marcação nova que ainda não vi */
.cal-d .cal-ponto,
.cal-d.escolhido .cal-ponto { background: var(--azul); }
.cal-d.hoje .cal-ponto { background: var(--verde); }
.cal-d .cal-ponto.novo { background: var(--verde); }
/* radar: ficheiros e visitas novas ficam com o contorno verde (como os cartões novos) */
.obra-ficheiros .ficheiro-degrau.novo { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0, 144, 72, .12); }
.manut-visita.novo { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0, 144, 72, .12); }
/* a etiqueta NOVO sai devagar quando o item foi visto */
.etiqueta-novo { transition: opacity .35s ease, transform .35s ease; }
.etiqueta-novo.a-sair { opacity: 0; transform: scale(.85); }
.ficheiro-degrau, .manut-visita { transition: border-color .4s ease, box-shadow .4s ease; }


/* =========================================================
   "APAGADAS": cartão discreto no fim da grelha das obras e das
   manutenções (só Gerência e Gestão) + a janela com o Repor
   ========================================================= */

.cartao-apagadas {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
  font: inherit;
  color: var(--texto-suave);
  background: transparent;
  border: 1.5px dashed #D6D9E4;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cartao-apagadas[hidden] { display: none; }
.cartao-apagadas:hover { background: var(--branco); border-color: #C2C7D6; color: var(--texto); }
.cartao-apagadas:focus:not(:focus-visible) { outline: none; }
.cartao-apagadas-icone {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A3A8BC;
  background: #EEF0F5;
  border-radius: 12px;
}
.cartao-apagadas-icone svg,
.janela-apagadas-icone svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cartao-apagadas-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cartao-apagadas-texto strong { font-size: 15px; font-weight: 600; }
.cartao-apagadas-texto small { font-size: 12.5px; color: #8A90A6; }

.janela-apagadas { max-width: 460px; width: calc(100% - 32px); text-align: left; }
.janela-apagadas .pergunta-titulo,
.janela-apagadas .pergunta-texto { text-align: left; }
.janela-apagadas-lista {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.janela-apagadas-lista li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--linha);
}
.janela-apagadas-lista li:first-child { border-top: none; }
.janela-apagadas-icone {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  background: #EEF0F8;
  border-radius: 10px;
}
.janela-apagadas-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.janela-apagadas-texto strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.janela-apagadas-texto small { font-size: 12.5px; color: #8A90A6; }
.janela-apagadas-repor {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--azul);
  background: #EEF0F8;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.janela-apagadas-repor:hover { background: #E2E5F2; }
.janela-apagadas-repor:disabled { opacity: 0.5; cursor: default; }
.janela-apagadas:focus { outline: none; }

/* telemóvel: o nome da obra / manutenção tem mais espaço
   (sem a seta — o cartão todo abre —, ícone e botões mais justos) */
@media (max-width: 480px) {
  .obra-cartao-caixa > .obra-cartao { gap: 10px; padding-left: 12px; }
  .obra-cartao-caixa.com-lixo > .obra-cartao { padding-right: 88px; }
  .obra-cartao-caixa > .obra-cartao .obra-seta { display: none; }
  .obra-cartao-caixa > .obra-cartao .obra-icone { width: 40px; height: 40px; flex-basis: 40px; }
  .obra-cartao-caixa > .olho,
  .obra-cartao-caixa > .botao-lixo { width: 32px; height: 32px; }
  .obra-cartao-caixa > .botao-lixo { right: 10px; }
  .obra-cartao-caixa.com-lixo > .olho { right: 48px; }
  /* o "Adicionar" e o "Apagadas" com a mesma proporção dos cartões */
  .corpo-app .obra-adicionar-abrir.obra-cartao-novo { min-height: 0; padding: 14px 12px; gap: 10px; }
  .obra-cartao-novo .obra-icone { width: 40px; height: 40px; flex-basis: 40px; font-size: 22px; }
  .cartao-apagadas { padding: 14px 12px; gap: 10px; }
}

/* lista vazia (manutenções / assistências): espaço até aos cartões */
#lista-manutencoes > .vazio-caixa { margin-bottom: 14px; }

/* um submenu sem nada (ex.: ainda sem assistências) não deixa espaço em branco */
.lateral-sub:empty { display: none; }

/* ficha das manutenções / assistências: contactos no cartão e o acesso */
.ficha-pessoa-contacto { display: block; font-size: 12.5px; color: var(--texto-suave); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ficha-pessoa-contacto:hover { color: var(--azul); text-decoration: underline; }
.ficha-local-acesso { display: block; margin-top: 2px; font-size: 12.5px; color: var(--texto-suave); text-transform: none; letter-spacing: 0; font-weight: 500; }
/* a ficha: a periodicidade / estado e as notas por baixo dos blocos */
.obra-ficha-editar .ficha-extra { margin-top: 14px; }
.obra-ficha-editar .manut-notas-editar { margin-top: 10px; }
/* a ficha do "Adicionar" abre por baixo da grelha, com espaço */
.obra-ficha-editar.ficha-nova { margin-top: 14px; }
/* a periodicidade dentro do quadro "Visitas": tudo numa linha (De [3] em 3 [meses]) */

/* estado da assistência: dois botões lado a lado (Aberta / Resolvida) */
.estado-escolha { display: flex; gap: 8px; flex-wrap: wrap; }
.estado-opcao {
  height: 36px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--texto-suave);
  background: #F1F2F7;
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.estado-opcao:hover { background: #E7E9F1; }
.estado-opcao.e-aberta.escolhido { color: #B26A00; background: #FFF4E0; border-color: #F0C67A; }
.estado-opcao.e-resolvida.escolhido { color: #00713A; background: #E3F5EA; border-color: #8FD3AC; }
.estado-opcao:focus:not(:focus-visible) { outline: none; }

/* submenu: nomes compridos em 2 linhas com folga (não ficam colados à caixa) */
.lateral-menu .lateral-sub a { padding-top: 7px; padding-bottom: 7px; line-height: 1.3; }


/* Dica por baixo de um campo: diz a regra ANTES de a pessoa falhar. */
.campo .dica {
  margin: 6px 2px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--texto-suave);
}

/* Utilizadores: o caixote encostado à direita da linha Ver perfil · Guardar */
.utilizador-botoes .utilizador-apagar { margin-left: auto; align-self: center; }

/* Utilizadores: a foto de cada pessoa a frente do nome (so se ve; sql/base/49) */
.utilizador-cabeca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.utilizador-cabeca .nome { min-width: 0; overflow-wrap: anywhere; }
.utilizador-foto-bola {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--azul); background: #E8EAF6;
}

/* Janela da foto (js/sessao.js, janelaFoto): circulo grande ao centro */
.janela-foto-circulo {
  width: clamp(120px, 38vw, 168px); aspect-ratio: 1;
  margin: 4px auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  color: var(--azul); background: #EEF0F8;
  border: 2px dashed #C9CEE8;
}
.janela-foto-circulo svg { width: 42%; height: 42%; }
.janela-foto-circulo.com-foto { border: none; }
.janela-foto-circulo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.janela-foto-erro { margin: -8px 0 14px; font-size: 14px; color: #C62828; }
.janela-foto .pergunta-botoes .pergunta-botao { flex: 1 1 160px; }
.janela-foto-sair {
  margin-top: 12px; padding: 8px 12px;
  font: inherit; font-size: 14px; color: #5B6178;
  background: none; border: none; cursor: pointer; text-decoration: underline;
}
.janela-foto-sair:hover { color: var(--texto); }

/* Perfil completo (sql/base/50) ----------------------------------------- */
/* Ver perfil: o estado pendente aparece uma vez no cartÃ£o, nÃ£o em cada campo. */
.pessoa-linhas dd.em-branco,
.pessoa-documentos .documento-vazio { color: #B8610A; font-weight: 600; }
.pessoa-documentos .documento-vazio::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: #F08C1A; vertical-align: middle;
}

/* perfil: o que falta, em cada seccao */
.def-lista [hidden] { display: none !important; }
.falta-marca {
  display: block; margin-top: 4px;
  font-size: 13px; font-weight: 600; color: #B8610A;
}
.falta-marca::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px;
  border-radius: 50%; background: #F08C1A; vertical-align: 1px;
}
.foto-caixa.em-falta .foto-perfil { box-shadow: 0 0 0 3px #F08C1A; }
.nao-tenho { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 14.5px; cursor: pointer; }
.nao-tenho input { width: 18px; height: 18px; accent-color: var(--azul); }

/* documentos (js/documentos.js) */
.documentos { display: flex; flex-direction: column; gap: 14px; margin: 4px 0 16px; }
.documento { display: flex; flex-direction: column; gap: 8px; }
.documento-titulo { font-size: 14px; font-weight: 600; color: var(--texto); }
.documento-vazio { margin: 0; font-size: 14px; color: var(--texto-suave); }
.documento-juntar { width: 100%; max-width: 420px; }
.documento-linha { display: flex; align-items: center; gap: 8px; }
.documento-linha .ficheiro-degrau,
.obra-ficheiros .documento-linha .ficheiro-degrau.sub { flex: 1; width: auto; min-width: 0; margin-left: 0; }
.documento-linha.sub { margin-left: min(calc(var(--nivel) * 28px), 45%); }
.obra-ficheiros li.ficheiro-escada:not(.aberta) .documento-linha.sub { display: none; }
.obra-ficheiros li.ficheiro-escada .documento-linha .ficheiro-degrau.sub { display: flex; }
.pessoa-documentos { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.pessoa-documentos h3 { margin: 0; }
.pessoa-progresso {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 16px; padding: 18px 20px; background: #F2F4FB;
  border: 1px solid #E2E6F3; border-radius: 16px;
}
.pessoa-progresso h3 { margin: 0 0 4px; font-size: 16px; }
.pessoa-progresso p { margin: 0; font-size: 14px; color: #68708B; }
.pessoa-progresso-indicador { width: min(260px, 36%); min-width: 150px; display: flex; align-items: center; gap: 10px; }
.pessoa-progresso-indicador strong { font-size: 15px; color: var(--azul); }
.pessoa-progresso-barra { height: 8px; flex: 1; overflow: hidden; background: #D9DEEF; border-radius: 999px; }
.pessoa-progresso-barra span { display: block; height: 100%; background: var(--azul); border-radius: inherit; transition: width .25s ease; }
.pessoa-secao-titulo { margin: 28px 0 12px; font-size: 18px; letter-spacing: -.02em; }
#pessoa-corpo .pessoa-grelha {
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start;
}
#pessoa-corpo .pessoa-grelha > .pessoa-cartao { margin-top: 0; padding: 22px; min-width: 0; }
#pessoa-corpo .pessoa-cartao-cabeca {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px 12px;
  margin-bottom: 20px; align-items: center;
}
#pessoa-corpo .pessoa-cartao-cabeca .ficha-pessoa-roda { grid-row: 1 / 3; }
#pessoa-corpo .pessoa-cartao-cabeca h3 { font-size: 17px; line-height: 1.4; }
#pessoa-corpo .pessoa-cartao-cabeca .pessoa-estado { grid-column: 2; justify-self: start; margin: 0; }
#pessoa-corpo .pessoa-linhas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.pessoa-campo-resumo { min-width: 0; }
.pessoa-campo-largo { grid-column: 1 / -1; }
#pessoa-corpo .pessoa-valor-editavel {
  display: block; width: 100%; box-sizing: border-box; min-height: 24px;
  margin: 0; padding: 0; font: inherit; line-height: 1.5; color: var(--texto);
  border: 0; box-shadow: none; border-radius: 4px; background: #EEF0F5; resize: none;
}
#pessoa-corpo .pessoa-valor-editavel:focus { outline: none; background: #E2E6F0; }
.pessoa-escolha-inline { position: relative; font-size: 14px; }
.pessoa-escolha-inline summary { cursor: pointer; list-style: none; color: inherit; }
.pessoa-escolha-inline summary::-webkit-details-marker { display: none; }
.pessoa-escolha-inline > .pessoa-chips {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 8;
  padding: 14px; margin-top: 6px; border: 1px solid #DFE4EF; border-radius: 12px;
  background: #FFFFFF; box-shadow: 0 8px 24px rgba(35, 43, 83, .12);
}
#pessoa-corpo .pessoa-topo:has(.pessoa-escolha-inline[open]) { overflow: visible; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-nome-inline { padding: 0; border: 0; box-shadow: inset 0 0 0 1px #DFE4EF; min-height: 0; height: 1.25em; border-radius: 5px; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-telefone-inline { padding: 0; border: 0; box-shadow: inset 0 0 0 1px #DFE4EF; min-height: 0; height: 21px; border-radius: 5px; }
/* Ficha da equipa: identidade própria, sem alterar os restantes ecrãs. */
#pessoa-corpo { counter-reset: perfil-area; }
html:has(#pessoa-corpo) { scrollbar-gutter: stable; }
#pessoa-corpo .pessoa-edicao-inline { overflow-anchor: none; }
#pessoa-corpo .pessoa-topo {
  position: relative; padding: 28px; gap: 20px; overflow: hidden;
  border: 1px solid #E0E5F2;
  background: #FFFFFF;
  box-shadow: 0 5px 16px rgba(35, 43, 83, .045);
}
#pessoa-corpo .pessoa-foto {
  width: 100px; height: 100px; border: 5px solid #FFFFFF;
  box-shadow: 0 0 0 1px #DCE2F0, 0 8px 18px rgba(35, 43, 83, .12);
}
#pessoa-corpo .pessoa-topo-texto h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.025em; }
#pessoa-corpo .pessoa-topo-texto { min-width: 0; }
#pessoa-corpo .pessoa-topo-texto h2 { width: 100%; }
#pessoa-corpo .pessoa-nome-inline,
#pessoa-corpo .pessoa-telefone-inline {
  font: inherit; color: inherit; background: #EEF0F5;
  border: 0; border-radius: 4px;
  padding: 0; min-height: 0; box-sizing: border-box;
  outline: none; box-shadow: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
#pessoa-corpo .pessoa-nome-inline { width: 100%; max-width: 100%; font-weight: 700; letter-spacing: inherit; }
#pessoa-corpo .pessoa-contacto-editavel { cursor: text; }
#pessoa-corpo .pessoa-contacto-telefone > span {
  display: inline-block; min-width: 110px; flex-shrink: 0;
}
#pessoa-corpo .pessoa-telefone-inline { width: 18ch; max-width: 100%; font-size: inherit; }
#pessoa-corpo .pessoa-nome-inline:focus,
#pessoa-corpo .pessoa-telefone-inline:focus {
  background: #E2E6F0; border: 0; box-shadow: none;
}
#pessoa-corpo .pessoa-topo .pessoa-editar {
  border-radius: 999px; padding-inline: 20px; background: #FFFFFF;
  box-shadow: 0 3px 10px rgba(35, 43, 83, .05);
}
#pessoa-corpo .pessoa-secao-titulo {
  display: flex; align-items: center; gap: 12px;
  margin-top: 32px; font-size: 18px;
}
#pessoa-corpo .pessoa-secao-titulo::before {
  content: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  background: #E7EBF6; color: var(--azul); font-size: 12px; font-weight: 700;
}
#pessoa-corpo .pessoa-secao-ajuda { padding-left: 0; }
#pessoa-corpo .pessoa-grelha > .pessoa-cartao {
  border: 1px solid #E0E5EF; border-radius: 18px;
  box-shadow: 0 5px 16px rgba(35, 43, 83, .045);
}
#pessoa-corpo .pessoa-cartao-cabeca .ficha-pessoa-roda {
  background: #E9EDF8; border-radius: 13px; color: var(--azul);
}
#pessoa-corpo .pessoa-progresso {
  border: 1px solid #E0E5F2; border-radius: 14px;
  padding: 16px 22px; background: #F5F6FA;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo > span {
  font-size: 13px; color: #525D78; font-weight: 600;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo input,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo textarea,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo select {
  min-height: 46px; border-color: #DFE4EF; background: #F8FAFD;
  border-radius: 11px; padding: 11px 13px; transition: background .15s, border-color .15s, box-shadow .15s;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo input:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo textarea:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo select:focus {
  background: #FFFFFF; border-color: var(--azul); box-shadow: 0 0 0 3px #E9ECFA;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-chip.escolher {
  padding: 7px 12px; border-radius: 9px; font-size: 13px; line-height: 1.4;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-chip.escolher.marcada::before { content: "✓ "; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-cartao-editavel { outline: none; border-color: #CDD5E9; }
#pessoa-corpo .pessoa-edicao-inline > .ev-botoes {
  position: static; width: 100%; justify-content: flex-end;
  margin: 24px 0; padding: 18px 0 0; border: 0; border-top: 1px solid #DFE4EF;
  border-radius: 0; background: transparent; box-shadow: none;
}
/* Edição discreta: o fundo identifica o valor editável sem desenhar caixas. */
.pessoa-edicao-alvo { position: relative; }
.pessoa-edicao-original { visibility: hidden; }
.pessoa-edicao-area {
  position: absolute; inset: -3px -6px; display: block; box-sizing: border-box;
  padding: 3px 6px; max-width: calc(100% + 12px); background: #EEF0F5;
  border-radius: 4px;
}
.pessoa-edicao-area:focus-within { background: #E2E6F0; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-edicao-area .pessoa-controle-estavel {
  display: block; width: 100%; height: 100%; min-height: 0; max-width: 100%;
  box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 0;
  font: inherit; letter-spacing: inherit; line-height: inherit; color: var(--texto);
  background: transparent; outline: none; box-shadow: none; resize: none;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-edicao-area select:not(:focus) { appearance: none; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-edicao-data input:not(:focus) { opacity: 0; }
.pessoa-data-leitura {
  position: absolute; inset: 3px 6px; pointer-events: none;
  font: inherit; line-height: inherit; color: var(--texto);
}
.pessoa-edicao-data:focus-within .pessoa-data-leitura { visibility: hidden; }
.pessoa-data-leitura.sem-data { color: #8A90A6; font-weight: 400; }
#pessoa-corpo .pessoa-formacao-cartao .pessoa-campo-resumo { grid-column: 1 / -1; }
#pessoa-corpo .pessoa-formacao-cartao .pessoa-linhas dd {
  min-height: 96px; padding: 12px; box-sizing: border-box;
  background: #F5F6FA; border-radius: 8px;
}
#pessoa-corpo .pessoa-formacao-cartao .pessoa-edicao-area {
  inset: 0; max-width: 100%; padding: 12px; border-radius: 8px;
}
#pessoa-corpo .pessoa-formacao-cartao .pessoa-edicao-area textarea { font-weight: 400; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-valor-editavel,
#pessoa-corpo .pessoa-edicao-inline .pessoa-nome-inline,
#pessoa-corpo .pessoa-edicao-inline .pessoa-telefone-inline,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo input,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo textarea,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo select {
  border: 0; border-radius: 4px; outline: none; box-shadow: none;
  background: #EEF0F5;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-valor-editavel:hover,
#pessoa-corpo .pessoa-edicao-inline .pessoa-nome-inline:hover,
#pessoa-corpo .pessoa-edicao-inline .pessoa-telefone-inline:hover { background: #DFE5F0; }
#pessoa-corpo .pessoa-edicao-inline .pessoa-valor-editavel:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-nome-inline:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-telefone-inline:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo input:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo textarea:focus,
#pessoa-corpo .pessoa-edicao-inline .pessoa-form-campo select:focus {
  background: #E2E6F0; border: 0; outline: none; box-shadow: none;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-escolha-inline > summary {
  background: #EEF0F5; border-radius: 4px;
}
#pessoa-corpo .pessoa-edicao-inline .pessoa-escolha-inline > summary:focus-visible {
  outline: none; background: #DCE2F0;
}
@media (max-width: 600px) {
  #pessoa-corpo .pessoa-topo { padding: 22px 18px; }
  #pessoa-corpo .pessoa-secao-ajuda { padding-left: 0; }
}
#pessoa-corpo .pessoa-topo > .pessoa-sobre {
  flex: 0 0 100%; min-width: 0; box-sizing: border-box;
  margin: 0; padding: 18px 0 0; border-top: 1px solid #E7EAF2;
  border-radius: 0; background: transparent; box-shadow: none;
}
#pessoa-corpo .pessoa-topo > .pessoa-sobre.pessoa-cartao-editavel { outline: none; }
#pessoa-corpo .pessoa-topo > .pessoa-sobre h3 + p { margin-bottom: 14px; }
#pessoa-corpo .pessoa-edicao-inline {
  display: block; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
}
.pessoa-edicao-inline .pessoa-form-campos {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px;
}
.pessoa-edicao-inline .pessoa-form-campo { min-width: 0; }
.pessoa-edicao-inline .pessoa-form-campo:has(textarea),
.pessoa-edicao-inline .pessoa-form-campo:has(.pessoa-chips),
.pessoa-edicao-inline .pessoa-form-campos > .nota-pequena { grid-column: 1 / -1; }
.pessoa-edicao-inline .pessoa-cartao-editavel { outline: 1px solid #C8CDED; }
.pessoa-edicao-inline > .ev-botoes { margin: 22px 0; }
@media (max-width: 600px) {
  .pessoa-edicao-inline .pessoa-form-campos { grid-template-columns: minmax(0, 1fr); }
}
#pessoa-corpo .pessoa-linhas dt { color: #68708B; font-size: 13px; line-height: 1.45; margin-bottom: 5px; }
#pessoa-corpo .pessoa-linhas dd { font-size: 15px; line-height: 1.5; min-height: 24px; }
.pessoa-campos-grupo {
  grid-column: 1 / -1; border-top: 1px solid #E7EAF2; padding-top: 14px;
  font-size: 12px; font-weight: 700; color: var(--azul); letter-spacing: .03em;
}
.pessoa-campos-grupo:first-child { border-top: none; padding-top: 0; }
.pessoa-secao-ajuda { margin: -6px 0 16px; color: #68708B; font-size: 14px; line-height: 1.5; }
#pessoa-corpo .pessoa-ficha-aptidao { margin-top: 0; }
#pessoa-corpo .pessoa-area .pessoa-documentos .documento { border: none; padding: 0; }
.pessoa-estado {
  display: inline-flex; flex: none; padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pessoa-estado.pendente { color: #A75C0A; background: #FFF0DE; }
.pessoa-estado.completo { color: #08733E; background: #E4F5EA; }
.pessoa-estado.neutro { color: #68708B; background: #EEF0F7; }
.perfil-registos-empresa { margin: 16px 0; padding: 16px; border: 1px solid #E5E8F1; border-radius: 12px; background: #F8F9FD; }
.perfil-registos-empresa > .nota-pequena { margin: 0 0 16px; line-height: 1.5; }
.perfil-registos-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0 0 18px; }
.perfil-registos-lista > div { min-width: 0; }
.perfil-registos-lista dt { margin-bottom: 5px; color: #68708B; font-size: 13px; line-height: 1.4; }
.perfil-registos-lista dd { margin: 0; color: var(--texto); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.perfil-registos-lista dd.sem-registo { color: #8A90A6; font-weight: 400; }
@media (max-width: 600px) {
  .perfil-registos-lista { grid-template-columns: minmax(0, 1fr); }
}
.pessoa-linhas dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.pessoa-linhas dd.em-branco { color: #A0A6B8; font-weight: 500; }
.pessoa-documentos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 12px; padding: 18px;
}
.pessoa-documentos > h3 { grid-column: 1 / -1; }
.pessoa-documentos .documento {
  min-width: 0; min-height: 100px; padding: 18px; gap: 10px; border: 1px solid #E5E8F1;
  border-radius: 10px; background: #FFF;
}
.pessoa-documentos .documento-titulo { line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.pessoa-documentos .documento-vazio { font-size: 13px; }
@media (max-width: 600px) {
  #pessoa-corpo .pessoa-grelha { grid-template-columns: minmax(0, 1fr); }
  #pessoa-corpo .pessoa-linhas { gap: 14px; }
  .pessoa-progresso { align-items: flex-start; flex-direction: column; gap: 12px; }
  .pessoa-progresso-indicador { width: 100%; }
  .pessoa-cartao-cabeca { align-items: flex-start; }
  .pessoa-cartao-cabeca .pessoa-estado { white-space: normal; text-align: right; }
}
@media (max-width: 600px) {
  .documento-linha.sub { margin-left: min(calc(var(--nivel) * 16px), 30%); }
}

/* Utilizadores: "Perfil incompleto" */
.perfil-incompleto { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.perfil-incompleto-etiqueta {
  padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 700;
  color: #B8610A; background: #FFF1E0; border: 1px solid #F6C78E; border-radius: 999px;
}
.utilizador-cabeca { flex-wrap: wrap; }
/* quantas exceções às permissões do cargo tem (roxo, como no quadro) */
.perm-n-excecoes {
  padding: 3px 10px; font-size: 12.5px; font-weight: 700;
  color: #5B21B6; background: #F1EAFE; border: 1px solid #C9B1F7; border-radius: 999px;
}

/* ---- Utilizadores: a equipa em cartões ---- */
.equipa-titulo { display: flex; align-items: baseline; gap: 8px; }
.equipa-titulo span { font-weight: 500; color: #8A92A6; text-transform: none; letter-spacing: 0; }
.equipa-grelha {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.equipa-cartao {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 14px; row-gap: 14px; min-width: 0;
  padding: 18px 16px 0 18px; border-radius: 16px; overflow: hidden;
  background: #fff; border: 1px solid #E4E8F1;
  box-shadow: 0 1px 2px rgba(35, 43, 83, .04);
  transition: box-shadow .18s, border-color .18s;
}
/* sem "saltar" no hover: o cartão não se mexe, só ganha sombra */
.equipa-cartao:hover { border-color: #CDD4E8; box-shadow: 0 8px 22px rgba(35, 43, 83, .09); }
.equipa-cartao.sou-eu { background: linear-gradient(135deg, #F4F6FD, #fff 60%); border-color: #D5DBF0; }
.equipa-cartao .equipa-foto {
  flex: none; width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #2A3170; background: #E8EBF7;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px #E4E8F1;
}
.equipa-texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; padding-right: 26px; }
.equipa-nome {
  font-size: 16.5px; font-weight: 700; color: #1C2236; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* o cartão todo é clicável (o link estica-se por cima) */
.equipa-nome::after { content: ""; position: absolute; inset: 0; }
.equipa-nome:focus-visible { outline: none; }
.equipa-cartao:has(.equipa-nome:focus-visible) { outline: 2px solid #2A3170; outline-offset: 2px; }
.equipa-email { font-size: 13px; color: #6C7487; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipa-telefone {
  position: relative; z-index: 1; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: #2A3170; text-decoration: none;
}
.equipa-telefone:hover { text-decoration: underline; }
.equipa-telefone svg { width: 14px; height: 14px; flex: none; }
.equipa-telefone svg, .equipa-telefone svg * { fill: none; stroke: currentColor; stroke-width: 2; }
.equipa-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.equipa-cargo, .equipa-tu {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.equipa-cargo { background: #E8EBF7; color: #2A3170; }
.equipa-tu { background: #2A3170; color: #fff; }
.equipa-etiquetas .perfil-incompleto { display: inline-flex; }
.equipa-cartao .utilizador-apagar {
  position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0;
  opacity: 0; transition: opacity .15s;
}
.equipa-cartao:hover .utilizador-apagar, .equipa-cartao .utilizador-apagar:focus-visible { opacity: 1; }
@media (hover: none) { .equipa-cartao .utilizador-apagar { opacity: 1; } }
/* "Ver perfil": rodapé a toda a largura; azul só com o rato em cima dele */
.equipa-abrir {
  position: relative; z-index: 1; flex: 1 1 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; margin: 0 -16px 0 -18px;
  border-top: 1px solid #EEF0F6; background: transparent;
  font-size: 13.5px; font-weight: 600; color: #2A3170; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.equipa-abrir svg { width: 14px; height: 14px; }
.equipa-abrir svg, .equipa-abrir svg * { fill: none; stroke: currentColor; stroke-width: 2; }
.equipa-abrir:hover { background: #2A3170; color: #fff; border-top-color: #2A3170; }
/* cargo com a cor dele (corCargo em sessao.js) */
.equipa-cargo {
  background: color-mix(in srgb, var(--cor-cargo, #2A3170) 12%, #fff);
  color: color-mix(in srgb, var(--cor-cargo, #2A3170) 85%, #000);
}

/* a foto no menu do lado: um pouco maior (a regra do logotipo prendia-a a 52px) */
.lateral-logo img.avatar, .lateral-logo span.avatar { width: 72px; height: 72px; }

/* O meu perfil: frente e verso lado a lado (no telemóvel, um por baixo do outro) */
.documentos[data-docs~="cc-verso"], .documentos[data-docs~="carta-verso"] {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start;
}
@media (max-width: 640px) {
  .documentos[data-docs~="cc-verso"], .documentos[data-docs~="carta-verso"] { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   NOVA MARCAÇÃO, ARRUMADA (igual no PC, tablet e telemóvel)
   rótulo em cima, campo azulado por baixo, como no perfil;
   Dia e Hora lado a lado; Para quem e Nota a toda a largura;
   Cancelar / Adicionar ao centro
   ========================================================= */
#form-evento .cal-novo-dentro .ev-linhas {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px;
  padding: 18px; border: 1px solid var(--linha); border-radius: 14px; background: var(--branco);
}
#form-evento .cal-novo-dentro .ev-linhas > .ev-linha,
#form-evento .cal-novo-dentro .ev-linhas > .ev-linha + .ev-linha,
#form-evento .cal-novo-dentro .ev-linhas > .ev-aviso + .ev-linha {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); grid-template-areas: "ic rot" "ic campo";
  column-gap: 10px; row-gap: 6px; align-items: center;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; min-width: 0;
}
#form-evento .cal-novo-dentro .ev-linha:hover,
#form-evento .cal-novo-dentro .ev-linha:focus-within { background: none; }
#form-evento .cal-novo-dentro .ev-linha > svg { grid-area: ic; align-self: center; margin: 0; width: 20px; height: 20px; }
#form-evento .cal-novo-dentro .ev-linha .ev-rotulo {
  grid-area: rot; margin: 0; font-size: 12.5px; font-weight: 500; color: #727B8E; line-height: 18px;
}
#form-evento .cal-novo-dentro .ev-linha .ev-rotulo small { display: none; }   /* vai para o campo: "Sem hora · todo o dia" */
#form-evento .cal-novo-dentro .ev-linha input[type="date"],
#form-evento .cal-novo-dentro .ev-linha input.campo-data,
#form-evento .cal-novo-dentro .ev-linha input.campo-hora,
#form-evento .cal-novo-dentro .ev-linha input[type="time"] {
  grid-area: campo; width: 100%; max-width: none; height: 42px; box-sizing: border-box; margin: 0;
  padding: 0 12px; border: 0; border-radius: 8px; background: #F0F2FA; color: var(--texto);
  font: inherit; font-size: 14.5px; font-weight: 500; text-align: left;
}
#form-evento .cal-novo-dentro .ev-linha input:hover { background: #E3E7F7; }
#form-evento .cal-novo-dentro .ev-linha input::placeholder { color: #8A93A8; font-weight: 400; }
#form-evento .cal-novo-dentro .ev-linha input:focus { outline: 2px solid #BAC6DE; outline-offset: 1px; }

/* Para quem e Nota: a linha toda */
#form-evento .cal-novo-dentro .ev-linhas > .ev-linha-para,
#form-evento .cal-novo-dentro .ev-linhas > .ev-linha-nota,
#form-evento .cal-novo-dentro .ev-linhas > .ev-aviso { grid-column: 1 / -1; }
#form-evento .cal-novo-dentro .ev-linha-para > svg { align-self: start; }
#form-evento .cal-novo-dentro .ev-linha-para .ev-para-caixa { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
#form-evento .cal-novo-dentro .ev-linha-para .ev-para-caixa .ev-rotulo { display: block; margin-bottom: 8px; }
#form-evento .cal-novo-dentro .ev-linha-para .escolhas { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
#form-evento .cal-novo-dentro .ev-linha-nota > svg { align-self: start; margin-top: 11px; }
#form-evento .cal-novo-dentro .ev-linha-nota textarea {
  grid-column: 2; grid-row: 1 / span 2; width: 100%; min-height: 76px; box-sizing: border-box; margin: 0;
  padding: 10px 12px; border: 0; border-radius: 8px; background: #F0F2FA; resize: vertical;
  font: inherit; font-size: 14.5px; line-height: 1.45;
}
#form-evento .cal-novo-dentro .ev-linha-nota textarea:focus { outline: 2px solid #BAC6DE; outline-offset: 1px; }
#form-evento .cal-novo-dentro .ev-linhas .ev-aviso { margin: 6px 0 0 30px; padding: 0; }

/* Cancelar / Adicionar ao centro */
#form-evento .cal-novo-dentro .ev-botoes { justify-content: center; gap: 10px; margin-top: 16px; }
#form-evento .cal-novo-dentro .ev-botoes > button { flex: 0 0 auto; width: auto; min-width: 140px; }

@media (max-width: 600px) {
  #form-evento .cal-novo-dentro .ev-linhas { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 14px; }
  #form-evento .cal-novo-dentro .ev-botoes > button { flex: 1 1 0; min-width: 0; }
}
/* Cancelar e Adicionar: a mesma altura e o mesmo feitio */
#form-evento .cal-novo-dentro .ev-botoes > button {
  height: 44px; padding: 0 22px; box-sizing: border-box; border-radius: 12px; font-size: 15px; line-height: 1;
}
#form-evento .cal-novo-dentro .ev-botoes > button { min-height: 44px; border-radius: 12px; }
#form-evento .cal-novo-dentro .ev-botoes { align-items: center; }
#form-evento .cal-novo-dentro .ev-botoes > button { margin: 0; }

/* ---------- arrastar pela pega ⠿ (js/arrastar.js): secções e progresso ---------- */
.pega-arrastar {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent;
  font-size: 16px; line-height: 1; color: #B7BDD3;
  cursor: grab; touch-action: none;                 /* no telemóvel, arrasta em vez de deslizar a página */
}
.pega-arrastar svg { display: block; fill: currentColor; }
.pega-arrastar:hover { background: #EEF0F8; color: var(--azul); }
.pega-arrastar:focus-visible { outline: 3px solid var(--azul); outline-offset: 1px; }
body.a-arrastar, body.a-arrastar * { cursor: grabbing !important; user-select: none; }
/* nas secções, a pega fica à esquerda, por cima do cabeçalho */
/* (sempre à altura do ícone do cabeçalho, aberta ou fechada: o cabeçalho tem
   14 + 40 + 14 = 68px; no telemóvel 12 + 40 + 12 = 64px) */
.obra-sec.com-pega > .pega-arrastar { position: absolute; left: 6px; top: 18px; width: 22px; height: 32px; z-index: 2; }
.obra-sec.com-pega > .obra-sec-topo { padding-left: 32px; }
@media (max-width: 600px) {
  .obra-sec.com-pega > .pega-arrastar { left: 4px; top: 16px; width: 20px; }
  .obra-sec.com-pega > .obra-sec-topo { padding-left: 28px; }
}
.progresso-fase-topo > .pega-arrastar { margin-left: 4px; }
.progresso-tarefa > .pega-arrastar { margin-left: -4px; }
/* o que se arrasta: fica um buraco tracejado no sítio onde vai cair */
.a-ser-arrastado {
  outline: 2px dashed color-mix(in srgb, var(--azul) 45%, transparent);
  outline-offset: -4px;
}
.a-ser-arrastado > * { opacity: 0.25; }
/* a cópia que segue o rato */
.arrastar-fantasma {
  position: fixed; z-index: 1000; margin: 0;
  background: var(--branco); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(30, 40, 90, 0.18);
  pointer-events: none; transform: rotate(-0.6deg);
  max-height: 90px; overflow: hidden;
}

/* ---------- obras e manutenções: secções e grupos acrescentados ---------- */
/* o último cartão de cada grupo: “+ Nova secção” (do tamanho de um cabeçalho de secção) */
.obra-sec-nova {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 14px);
  width: 100%;
  min-height: 64px;
  padding: 12px clamp(14px, 1.6vw, 18px);
  font: inherit;
  text-align: left;
  color: var(--azul);
  background: transparent;
  border: 1.5px dashed #C3C8E4;
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.obra-sec-nova:hover, .obra-sec-nova:focus-visible { background: #EEF0FA; border-color: var(--azul); }
.obra-sec-nova-icone {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #E8EAF6;
}
.obra-sec-nova-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.obra-sec-nova-texto { display: flex; flex-direction: column; min-width: 0; }
.obra-sec-nova-texto strong { font-size: 15px; }
.obra-sec-nova-texto small { font-size: 12.5px; color: #6B7090; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.a-arrastar .obra-sec-nova { opacity: .4; }

/* “+ Novo grupo de secções”: barra larga no fim da página */
.obra-grupo-novo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 26px;
  padding: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--azul);
  background: transparent;
  border: 1.5px dashed #C3C8E4;
  border-radius: 14px;
  cursor: pointer;
}
.obra-grupo-novo:hover, .obra-grupo-novo:focus-visible { background: #EEF0FA; border-color: var(--azul); }
.obra-grupo-novo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* mudar o nome / apagar ao lado do título de um grupo acrescentado */
.obra-grupo:has(.obra-grupo-acoes) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.obra-grupo-acoes { display: inline-flex; gap: 4px; }
/* lápis e lixo do tamanho das letras do título; o lixo a vermelho */
.obra-grupo-acoes .olho { width: 20px; height: 20px; min-width: 0; min-height: 0; padding: 0; border-radius: 5px; }
.obra-grupo-acoes .olho svg { width: 13px; height: 13px; }
.obra-grupo-acoes .olho.lixo { color: var(--vermelho, #D93636); background: #FDECEC; }
.obra-grupo-acoes .olho.lixo:hover { background: #F9D6D6; }

/* a janela da secção / grupo novo: como as outras janelas com campos (cargo novo) —
   campos de 44px a toda a largura, rótulo colado ao campo, 16px entre linhas */
.pergunta.pergunta-com-icone .pergunta-icone { color: var(--azul); background: #EEF0F8; }
.pergunta .obra-extra-janela { display: grid; gap: 16px; width: 100%; margin: 4px 0 22px; text-align: left; }
.obra-extra-linha { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: var(--texto-suave); }
/* as caixas de escrever: como nos formulários do Calendário e dos Lembretes
   (44px, fundo cinzento claro, sem contorno; azul ao escrever).
   min-height: 0 — a regra geral .campo-livre tem 84px (é para textos longos) */
.pergunta .obra-extra-linha .campo-livre {
  box-sizing: border-box; width: 100%; height: 44px; min-height: 0; margin: 0; padding: 0 14px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--texto); resize: none;
  background: var(--fundo); border: 1.5px solid transparent; border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.pergunta .obra-extra-linha .campo-livre::placeholder { color: #A0A6B8; font-weight: 400; }
.pergunta .obra-extra-linha .campo-livre:hover { border-color: #DADDEB; }
.pergunta .obra-extra-linha .campo-livre:focus { outline: none; background: var(--branco); border-color: var(--azul); }
/* escolher o ícone: o botão das listas (.eb-botao), a toda a largura;
   a grelha abre por baixo, dentro da janela (empurra os botões) */
.eb-icone { width: 100%; }
.eb-icone .eb-botao { width: 100%; max-width: none; }
.eb-icone .eb-botao { padding: 0 14px; }
.eb-icone .eb-nome { font-size: 15px; font-weight: 600; }
.eb-icones {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  margin-top: 8px; padding: 8px;
  /* muitos ícones: cerca de 4 filas à vista, o resto desliza */
  max-height: min(212px, 40vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--branco); border: 1px solid var(--linha); border-radius: 14px;
  animation: eb-abre 0.18s ease-out;
}
.eb-icones[hidden] { display: none; }
.eb-icones button {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 38px; padding: 0;
  color: var(--texto-suave); background: var(--branco);
  border: 1px solid var(--linha); border-radius: 10px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.eb-icones button:hover { background: var(--fundo); color: var(--azul); }
.eb-icones button[aria-checked="true"] { color: var(--azul); background: var(--azul-claro); border-color: var(--azul); box-shadow: inset 0 0 0 1px var(--azul); }
.eb-icones button:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.eb-icones svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 360px) { .eb-icones { grid-template-columns: repeat(5, 1fr); } }

/* progresso da obra: “+ Nova fase” no fim e os botões das fases acrescentadas */
.progresso-fases > .progresso-fase-nova { margin-top: 0; }
.progresso-fase-topo .progresso-fase-acao { flex: none; }

/* editar uma secção (caneta): o ícone do cabeçalho passa a botão
   (contorno tracejado azul + lápis pequeno); a grelha abre no topo do formulário */
.obra-sec-icone.a-mudar {
  position: relative; cursor: pointer;
  outline: 1.5px dashed var(--azul); outline-offset: 2px;
  transition: background .15s;
}
.obra-sec-icone.a-mudar:hover { background: var(--azul-claro); }
.obra-sec-icone.a-mudar:focus-visible { outline: 3px solid var(--azul); }
.obra-sec-icone.a-mudar::after {
  content: ""; position: absolute; right: -6px; bottom: -6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--azul) center / 10px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 2px var(--branco);
}
/* a grelha no formulário da secção (que é largo): ícones de 44px, quantos couberem por linha */
.obra-form .obra-sec-icones {
  order: -1; margin: 0 0 4px;
  grid-template-columns: repeat(auto-fill, 44px); justify-content: start;
  max-height: 168px;
}
.obra-form .obra-sec-icones[hidden] { display: none; }
.obra-form .obra-sec-icones button {
  width: 44px; height: 44px; min-height: 0; min-width: 0; aspect-ratio: auto; margin: 0; padding: 0;
}
/* a pega dos grupos de secções, antes do nome */
.obra-grupo.com-pega { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.obra-grupo.com-pega > .pega-arrastar { margin-left: -6px; height: 26px; }

/* ---------- notas das tarefas do progresso (sql/base/75) ---------- */
.progresso-nota {
  /* inline-block: o risco da tarefa feita não passa para a nota */
  display: inline-block; width: 100%; box-sizing: border-box; text-decoration: none;
  margin-top: 2px; padding: 4px 8px;
  font-size: 13px; color: #5B6178; white-space: pre-wrap; overflow-wrap: anywhere;
  background: #FFF8E1; border-left: 3px solid #F2C14E; border-radius: 6px;
}
.progresso-tarefa.feita .progresso-tarefa-texto > .progresso-nota { text-decoration: none; color: #5B6178; }
.progresso-nota + .progresso-nota { margin-top: 4px; }
.progresso-nota-autor { display: inline-block; font-size: 12px; font-weight: 600; color: #8A6D1F; margin-right: 6px; }
.progresso-nota-texto { display: block; }
.progresso-nota-acoes { float: right; display: inline-flex; gap: 2px; }
.progresso-nota-acoes button {
  width: 24px; height: 24px; padding: 3px; border: 0; border-radius: 6px;
  background: transparent; color: #A58A3C; cursor: pointer;
}
.progresso-nota-acoes button { display: inline-flex; align-items: center; justify-content: center; }
.progresso-nota-acoes button svg, .progresso-nota-acoes button svg * {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.progresso-nota-acoes button:hover { background: #FBEFC6; }
.progresso-nota-acoes button.lixo { color: #D64545; }
.progresso-nota-acoes button.lixo:hover { background: #FDE8E8; }
.progresso-nota-botao.ativo { color: #B7791F; background: #FFF4D6; }
.progresso-tarefa.com-nota-aberta { flex-wrap: wrap; }
.progresso-nota-form { flex-basis: 100%; padding: 4px 0 8px 34px; }
.progresso-nota-form textarea {
  flex: 1 1 100%; min-width: 0; min-height: 60px; resize: vertical;
  padding: 10px 12px; font: inherit; font-size: 14px; color: var(--texto);
  background: #F4F5F9; border: 1.5px solid transparent; border-radius: 10px;
}
.progresso-nota-form textarea:focus { outline: none; border-color: var(--azul); background: #fff; }
@media (max-width: 600px) { .progresso-nota-form { padding-left: 0; } }
/* a editar o texto de uma tarefa: só o campo e os botões (a caixa, o texto e a pega saem) */
.progresso-tarefa.a-editar > .progresso-marca,
.progresso-tarefa.a-editar > .pega-arrastar,
.progresso-tarefa.a-editar > .progresso-ficheiros { display: none; }
/* telemóvel: a cabeça das fases tem a pega, o olho e o lixo — dar lugar ao nome
   (sem o ícone, gaps menores; as palavras compridas partem em vez de passar por cima do “0/9”) */
.progresso-fase-nome strong { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 600px) {
  .progresso-fase-topo { gap: 4px; padding-right: 6px; }
  .progresso-fase-topo > .pega-arrastar { margin-left: 0; width: 20px; }
  .progresso-fase-topo .progresso-fase-cabeca { padding: 12px 4px; gap: 8px; }
  .progresso-fase-topo .progresso-fase-num { display: none; }
  .progresso-fase-topo .progresso-fase-conta { min-width: 0; padding: 3px 6px; }
  .progresso-fase-topo .quem-ve-botao, .progresso-fase-topo .progresso-fase-acao { width: 32px; height: 32px; }
}

/* a seta das versões: radar leve (como o NOVO, em azul) a avisar que há mais versões;
   para quando a escada está aberta */
.ficheiro-seta { animation: radar-versoes 2.4s ease-out infinite; }
.ficheiro-escada.aberta .ficheiro-seta { animation: none; }
@keyframes radar-versoes {
  0%   { box-shadow: 0 0 0 0 rgba(42, 59, 130, 0.28); }
  70%  { box-shadow: 0 0 0 7px rgba(42, 59, 130, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 59, 130, 0); }
}
@media (prefers-reduced-motion: reduce) { .ficheiro-seta { animation: none; } }
/* Caixote do histórico: separado do botão que abre/fecha a caixa. */
.apagados { position: relative; }
.apagados > .historico-lixo { position: absolute; top: 18px; right: 18px; z-index: 1; }
.apagados:has(> .historico-lixo) > .apagados-topo { padding-right: 66px; }
.historico-lixo { flex-shrink: 0; width: 34px; height: 34px; margin-bottom: 8px; }
.historico-lixo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }

/* Histórico das permissões: cada entrada tem as suas próprias ações. */
.perm-hist-acoes { display: flex; flex-shrink: 0; gap: 6px; align-self: flex-start; margin-top: 2px; }
.botao-repor-icone {
  flex-shrink: 0; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; color: var(--azul); background: var(--azul-claro); border: 0; border-radius: 10px; cursor: pointer;
}
.botao-repor-icone:hover { background: #D6D9EC; }
.botao-repor-icone:active { transform: scale(.92); }
.botao-repor-icone:focus-visible { outline: 3px solid var(--azul); outline-offset: 1px; }
.botao-repor-icone:disabled, .perm-hist-acoes .botao-lixo:disabled { opacity: .55; cursor: wait; }
.botao-repor-icone svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Progresso da obra: seta para recolher/mostrar as fases (como as secções) */
.progresso-topo { align-items: center; }
.progresso-topo .progresso-resumo { margin-left: auto; }
.progresso-recolher {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0; background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.progresso-recolher:hover { background: #F4F5FA; }
/* a ficha da obra: a mesma seta, recolhe os dados (fica o nome e a barra do progresso) */
.ficha-recolher {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0; background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.ficha-recolher:hover { background: #F4F5FA; }
.ficha-recolher .opcao-seta { margin: 4px 0 0; transform: rotate(-135deg); }
.obra-ficha.recolhida .ficha-recolher .opcao-seta { transform: rotate(45deg); }
.obra-ficha.recolhida .ficha-vista { display: none; }
.obra-ficha.recolhida .obra-ficha-topo { margin-bottom: 0; }
/* a cabeça da ficha numa só linha: o nome parte, os botões ficam à direita */
.obra-ficha-topo { flex-wrap: nowrap; }
.obra-ficha-topo h2 { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.obra-ficha-topo .ficha-estado, .obra-ficha-topo > button, .obra-ficha-topo > .olho { flex-shrink: 0; }
.obra-ficha-topo .ficha-estado { white-space: nowrap; }
@media (max-width: 600px) {
  .obra-ficha-topo { gap: 6px; }
  .obra-ficha-topo h2 { font-size: 18px; }
  .ficha-recolher { width: 28px; }
}
/* ficha estreita: o nome numa linha só sua e os botões por baixo (nada sai da caixa) */
.obra-ficha { container: ficha / inline-size; }
@container ficha (max-width: 520px) {
  .obra-ficha-topo { flex-wrap: wrap; }
  .obra-ficha-topo h2 { flex: 1 1 100%; }
}
.progresso-clicavel { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.progresso-recolher .opcao-seta { margin: 4px 0 0; transform: rotate(-135deg); }
.progresso-obra.recolhido .progresso-recolher .opcao-seta { transform: rotate(45deg); }
.progresso-obra.recolhido .progresso-fases,
.progresso-obra.recolhido .progresso-fases ~ * { display: none; }

/* Cabeça das fases em ecrãs pequenos: olho, mudar e apagar atrás de um só ⋯ (como as tarefas) */
@media (max-width: 1024px) {
  .progresso-fase-topo .tarefa-menu > .progresso-fase-acao { width: 100%; height: 44px; }
  .tarefa-menu > .quem-ve { display: block; width: 100%; }
  .tarefa-menu > .quem-ve .quem-ve-conta { display: none; }
  .tarefa-menu > .quem-ve .quem-ve-botao {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
    color: var(--verde); background: transparent;
  }
  .tarefa-menu > .quem-ve .quem-ve-botao.fechado { color: #C62828; background: transparent; }
  .tarefa-menu > .quem-ve .quem-ve-botao:hover { background: #F4F5FA; }
  .tarefa-menu > .quem-ve .quem-ve-botao svg { width: 24px; height: 18px; flex: 0 0 24px; }
  .tarefa-menu > .quem-ve .quem-ve-botao::after {
    content: "Quem vê"; flex: 1; text-align: left; white-space: nowrap;
    font-size: 14px; font-weight: 600; color: var(--texto);
  }
}

/* Mapa de quantidades no telemóvel: cada material é um cartão (nome em cima,
   Unid./Previsto/Aplicado/Falta com o nome da coluna por cima, ações por baixo)
   em vez de uma tabela larga que escondia a “Falta” e os botões à direita */
@media (max-width: 600px) {
  .obra-tabela-caixa { overflow-x: visible; }
  .obra-tabela thead { display: none; }
  .obra-tabela, .obra-tabela tbody { display: block; width: 100%; }
  .obra-tabela tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; border-top: 1px solid var(--linha); }
  .obra-tabela tr:first-child { border-top: 0; }
  .obra-tabela td { display: block; padding: 0; border: 0; min-width: 0; }
  .obra-tabela td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .obra-tabela td[data-rotulo]:not(:first-child)::before {
    content: attr(data-rotulo); display: block; margin-bottom: 2px;
    font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-suave);
  }
  .obra-tabela td.material-botoes, .obra-tabela td.obra-tabela-vazia { grid-column: 1 / -1; }
  .obra-tabela td.material-botoes { display: flex; justify-content: flex-end; gap: 8px; }
  .obra-tabela td input { width: 100%; box-sizing: border-box; }
}
/* Adicionar ficheiro: barra dos 0 aos 100 % por baixo do texto (js/obra.js) */
.obra-sec-adicionar { position: relative; overflow: hidden; }
.obra-sec-adicionar-barra {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(44, 53, 120, .12);
}
.obra-sec-adicionar-barra[hidden] { display: none; }
.obra-sec-adicionar-barra > span {
  display: block; height: 100%; width: 0; background: var(--verde);
  transition: width .2s ease;
}

/* envio de ficheiros: percentagem em baixo, em todas as páginas (js/sessao.js) */
.envio-aviso {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1001;
  width: min(420px, calc(100vw - 32px)); padding: 10px 14px 12px;
  background: #fff; color: var(--azul-escuro, #1d2461); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18); font-size: .9rem; font-weight: 600;
}
.envio-aviso[hidden] { display: none; }
.envio-aviso-texto { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envio-aviso-barra { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: #E6E8F2; overflow: hidden; }
.envio-aviso-barra > span { display: block; height: 100%; width: 0; background: var(--verde); transition: width .2s ease; }

/* pastas dentro das secções (js/obra.js, sql/base/94) */
.obra-pastas { display: flex; flex-direction: column; gap: 6px; }
.obra-pastas:empty { display: none; }
.obra-categorias > li.obra-pasta { flex-wrap: wrap; padding: 0; gap: 0; }
.obra-pasta-topo {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; background: none; font: inherit; color: inherit;
  text-align: left; cursor: pointer; border-radius: 10px;
}
.obra-pasta-topo span:not(.opcao-seta) { flex: 1; min-width: 0; }
.obra-pasta-topo small { font-size: 12px; color: var(--texto-suave); white-space: nowrap; }
.obra-pasta-topo .opcao-seta,
.obra-sec.aberta .obra-pasta-topo .opcao-seta { flex: 0 0 9px; width: 9px; height: 9px; margin: 0 4px 3px 2px; transform: rotate(45deg); }
.obra-pasta.aberta .obra-pasta-topo .opcao-seta { transform: rotate(-135deg); margin-bottom: -3px; }
/* editar e apagar das pastas: os mesmos botões das secções (.olho.sec-acao) */
.obra-pasta-acao { margin-right: 6px; cursor: pointer; }
.obra-pasta-corpo { flex: 0 0 100%; padding: 0 10px; }
.obra-pasta.aberta .obra-pasta-corpo { padding: 4px 10px 12px; }
/* abrir a pasta devagar, como as secções */
.obra-pasta-corpo > * { animation: pasta-abre .28s ease-out both; }
@keyframes pasta-abre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .obra-pasta-corpo > * { animation: none; } }
.obra-pasta-vazia { margin: 4px 2px 10px; font-size: 13px; color: var(--texto-suave); }
.obra-pasta-adicionar, .obra-pasta-nova {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 12px;
  border: 1.5px dashed #C9CDE3; border-radius: 10px; background: #fff; color: var(--azul);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
/* "Nova pasta": sempre no fundo da secção, por baixo de "Adicionar ficheiro" */
.obra-sec-adicionar-caixa { display: flex; flex-direction: column; gap: 8px; }
.obra-pasta-nova { align-self: stretch; margin: 0; padding: 11px 12px; gap: 10px; font-size: 14.5px;
  background: transparent; border-color: #D5D9EA; }
/* com pastas, cada pasta tem o seu "Adicionar": o botão grande da secção sai */
.obra-sec-adicionar-caixa.com-pastas .obra-sec-adicionar { display: none; }
.obra-pasta-nova:hover { background: #F5F6FB; border-color: var(--azul); }
.obra-pasta-adicionar svg, .obra-pasta-nova svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ficheiro-mover {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; color: var(--azul); cursor: pointer;
}
.ficheiro-mover:hover { background: var(--fundo); }
.ficheiro-mover svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pasta-escolher { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; text-align: left; font-size: 13px; font-weight: 600; }
.pasta-escolher select, .pasta-escolher input {
  font: inherit; font-weight: 400; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--linha); border-radius: 10px; background: #fff;
}

/* sem zoom sem querer nos ecrãs táteis: o duplo toque não amplia e, no iPhone/iPad,
   os campos com letra < 16px fazem zoom ao escrever. Dois dedos continuam a ampliar. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}

/* ficheiros: mover e caixote lado a lado à direita, com o mesmo tamanho */
.ficheiro-mover { width: 32px; height: 32px; margin-left: auto; }
.ficheiro-mover + .ficheiro-lixo { margin-left: 4px; }
/* mapa de quantidades: Adicionar/Guardar e Cancelar na mesma linha, com espaço entre eles */
.obra-tabela tr.material-form .material-botoes > button { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.corpo-app .obra-tabela tr.material-form .material-botoes .botao-cancelar { margin-left: 10px; }
/* espaço entre as pastas e os ficheiros soltos */
.obra-pastas:not(:empty) { margin-bottom: 12px; }
/* botões de ícone (olho, lápis, caixote…): só a cor do desenho, sem fundo; ao passar, um fundo leve */
.olho, .olho.lapis, .olho.sec-acao, .olho.sec-acao.sec-remover, .olho.fechado { background: transparent; }
.olho:hover, .olho.lapis:hover, .olho.sec-acao:hover { background: #EEF0F8; }
.olho.sec-acao.sec-remover:hover { background: #FDECEC; }

/* todos os ícones com a mesma grossura de traço (nem fino nem grosso). Ficam de fora os vistos
   pequenos (✓ dentro de círculos) e os desenhos do editor de ficheiros. */
svg[viewBox="0 0 24 24"]:not(.editor-folha svg):not(.partilha-visto svg):not(.progresso-visto svg):not(.progresso-fase-num svg) { stroke-width: 1.9 !important; }
.ficheiro-seta svg *, .apagado-repor svg * { stroke-width: 1.9; }
.ev-aviso.aviso-flutuante {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--sombra);
  max-height: calc(100vh - 24px);
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.ev-aviso.sucesso { color: var(--verde); }
.ev-aviso.sucesso::before { content: "✓"; background: var(--verde); }
.material-imagem-acoes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.material-imagem-ver { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; color: var(--azul); }
.material-imagem-ver img { display: block; width: 100%; height: 100%; object-fit: cover; }
.material-imagem-acoes .material-imagem-escolher { min-width: 0; padding: 6px 10px; font-size: 12px; }
.material-imagem-grande { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; margin: 0 auto; }
.materiais-pastas { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.materiais-pasta { min-width: 0; padding: 12px; border: 1px solid var(--linha); border-radius: 12px; background: #fff; }
.materiais-pasta-topo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.materiais-pasta-topo > strong { margin-right: auto; }
.materiais-pasta-topo .material-pasta-adicionar { min-height: 38px; padding: 7px 12px; }
.materiais-pasta .obra-tabela-caixa { margin: 0; }

/* Mapa de quantidades: foto antes do nome; foto e botões do formulário numa linha própria */
.obra-tabela td.material-nome { min-width: 140px; }
.material-nome .material-imagem-ver { width: 44px; height: 44px; margin: 0 10px 0 0; vertical-align: middle; border-radius: 8px; }
.material-nome > span { vertical-align: middle; }
.material-nome .material-imagem-acoes { margin-top: 6px; }
.obra-tabela tr.material-form-fundo td { border-top: 0; padding-top: 0; }
.material-form-fundo-dentro { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.corpo-app .obra-tabela tr.material-form-fundo .botao-app, .corpo-app .obra-tabela tr.material-form-fundo .botao-cancelar { margin: 0; }
.material-form-foto {
  margin-right: auto; min-height: 36px; padding: 0 14px; border: 1px dashed #A9AFC8; border-radius: 10px;
  background: #fff; color: var(--azul); font: inherit; font-weight: 600; cursor: pointer;
}
.material-form-foto.tem-foto { width: 56px; height: 56px; padding: 0; overflow: hidden; border-style: solid; }
.material-form-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* os blocos do mapa acompanham a largura da janela: abaixo de ~860px cada material passa a cartão */
.materiais { container-type: inline-size; min-width: 0; }
@container (max-width: 860px) {
  .materiais .obra-tabela-caixa { overflow-x: visible; }
  .materiais .obra-tabela thead { display: none; }
  .materiais .obra-tabela, .materiais .obra-tabela tbody { display: block; width: 100%; }
  .materiais .obra-tabela tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px 10px; padding: 12px; border-top: 1px solid var(--linha); }
  .materiais .obra-tabela tr:first-child, .materiais .obra-tabela tr.material-form-fundo { border-top: 0; }
  .materiais .obra-tabela td { display: block; padding: 0; border: 0; min-width: 0; }
  .materiais .obra-tabela td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .materiais .obra-tabela td[data-rotulo]:not(:first-child)::before {
    content: attr(data-rotulo); display: block; margin-bottom: 2px;
    font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-suave);
  }
  .materiais .obra-tabela td.material-botoes, .materiais .obra-tabela td.obra-tabela-vazia { grid-column: 1 / -1; }
  .materiais .obra-tabela td.material-botoes { display: flex; justify-content: flex-end; gap: 8px; }
  .materiais .obra-tabela td.material-botoes:empty { display: none; }
  .materiais .obra-tabela td input { width: 100%; min-width: 0 !important; box-sizing: border-box; }
  .materiais .obra-tabela tr.material-form-fundo td { grid-column: 1 / -1; }
}
/* ajustes: as caixas do formulário encolhem com a coluna e a linha da foto/botões usa a largura toda */
.materiais .obra-tabela tr.material-form input { width: 100%; min-width: 0; box-sizing: border-box; }
.materiais .obra-tabela tr.material-form td:first-child input { min-width: 110px; }
.materiais .obra-tabela tr.material-form-fundo td, .materiais .obra-tabela tr.material-form-fundo td:last-child { width: auto; white-space: normal; }
.obra-tabela td.material-nome { display: table-cell; }
.material-nome { line-height: 1.3; }
.material-nome .material-imagem-ver { float: left; }
.material-nome::after { content: ""; display: block; clear: both; }
/* nome do material: miniatura e nome alinhados ao centro, como as outras colunas */
.material-nome-linha { display: flex; align-items: center; gap: 12px; }
.material-nome-linha .material-imagem-ver { float: none; flex: 0 0 44px; margin: 0; border: 1px solid var(--linha); background: #fff; }
.obra-tabela tr.material-completo td.material-nome::before { content: none; }
.obra-tabela tr.material-completo td.material-nome > span::before,
.obra-tabela tr.material-completo .material-nome-linha > span::before { content: "✓ "; color: var(--verde); font-weight: 700; }
.material-form-tirar { min-height: 36px; padding: 0 12px; border: 1px solid #F1C6C6; border-radius: 10px; background: #fff; color: var(--vermelho, #C62828); font: inherit; font-weight: 600; cursor: pointer; }
.material-form-tirar.ativo { background: #FDECEC; }
.material-form-fundo-dentro .material-form-tirar { margin-right: auto; }
.material-form-fundo-dentro .material-form-foto:has(+ .material-form-tirar) { margin-right: 0; }

/* foto do material em grande: o Fechar afasta-se da imagem */
.pergunta:has(.material-imagem-grande) .pergunta-botoes { margin-top: 20px; }
.material-imagem-grande { border-radius: 10px; }

/* Mapa de quantidades: pastas que abrem e fecham (quantidades OU folha externa) */
.materiais-pasta { padding: 0; overflow: hidden; }
.materiais-pasta-topo { margin: 0; padding: 6px 10px 6px 6px; gap: 4px; flex-wrap: nowrap; }
.materiais-pasta-abrir {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--texto); font: inherit; text-align: left; cursor: pointer;
}
.materiais-pasta-abrir:hover { background: #F6F7FB; }
.materiais-pasta-abrir svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--azul); }
.materiais-pasta-abrir svg, .materiais-pasta-abrir svg * { fill: none; stroke: currentColor; }
.materiais-pasta-abrir strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.materiais-pasta-abrir small { color: var(--texto-suave); white-space: nowrap; }
.materiais-pasta .opcao-seta { margin: 0 6px 0 auto; transform: rotate(45deg); }
.materiais-pasta.aberta .opcao-seta { transform: rotate(-135deg); }
.materiais-pasta-topo > strong { margin-right: 0; }
.materiais-pasta-corpo { padding: 4px 12px 12px; border-top: 1px solid var(--linha); }
.materiais-pasta-corpo > .obra-tabela-caixa { margin-top: 10px; }
.materiais-pasta-nota { margin: 12px 2px; color: var(--texto-suave); font-size: 13.5px; }
.materiais-pasta-fundo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.materiais-pasta-fundo .material-adicionar { margin: 0; }
.materiais-soltos-titulo { margin: 4px 2px 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-suave); }
.materiais > .material-adicionar[hidden], .materiais-soltos-titulo[hidden] { display: none; }
.obra-sec-adicionar-caixa[hidden] { display: none; }

/* cartões do mapa (janela estreita): formulário num só bloco cinzento, sem retalhos; ações sem rótulo */
@container (max-width: 860px) {
  .materiais .obra-tabela td.material-botoes::before { content: none !important; }
  .materiais .obra-tabela td.material-botoes { align-items: center; }
  .materiais .obra-tabela tr.material-form td { background: transparent; padding: 0; }
  .materiais .obra-tabela tr.material-form:not(.material-form-fundo) {
    margin: 10px 10px 0; padding: 14px 14px 4px; border: 1px solid var(--linha); border-bottom: 0;
    border-radius: 12px 12px 0 0; background: #F6F7FB;
  }
  .materiais .obra-tabela tr.material-form-fundo {
    margin: 0 10px 10px; padding: 8px 14px 14px; border: 1px solid var(--linha); border-top: 0;
    border-radius: 0 0 12px 12px; background: #F6F7FB;
  }
  .materiais .obra-tabela tr.material-form td.material-botoes:empty { display: none; }
  .materiais .obra-tabela tr.material-form input { background: #fff; }
}
.material-form-fundo-dentro .botao-app, .material-form-fundo-dentro .botao-cancelar { width: auto !important; flex: 0 0 auto; margin: 0 !important; min-height: 38px; padding: 0 16px; }

/* procurar secções (por cima do Progresso da obra) e tarefas (dentro dele) */
.obra-pesquisa {
  box-sizing: border-box; display: block; width: 100%; min-height: 46px; margin: 0 0 14px; padding: 0 14px 0 44px;
  border: 1px solid var(--linha); border-radius: 12px; background-color: var(--branco); color: var(--texto); font: inherit; font-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237984a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; background-size: 18px;
}
.obra-pesquisa:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(40, 48, 120, .12); }
.progresso-pesquisa { margin: 12px 0; background-color: #F6F7FB; }
.progresso-obra.recolhido .progresso-pesquisa { display: none; }
.progresso-obra.a-procurar .progresso-fase.com-resultado .progresso-tarefas { display: block; }
.progresso-fase[hidden], .progresso-tarefa[hidden], .obra-sec[hidden], .obra-grupo-bloco[hidden] { display: none !important; }
.obra-pesquisa:not(.progresso-pesquisa) { margin: 16px 0; }

/* Guias de devolução (js/obra.js guiasDevolucao) */
.guias { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.guias-lista { display: flex; flex-direction: column; gap: 10px; }
.guia-nova[hidden] { display: none; }
.guia { border: 1px solid var(--linha); border-left: 4px solid #E0A23B; border-radius: 12px; padding: 12px 14px; background: #fff; }
.guia.tratada { border-left-color: var(--verde); }
.guia-cab { display: flex; align-items: center; gap: 10px; }
.guia-cab strong { flex: 1; min-width: 0; }
.guia-estado { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #FFF1DD; color: #B26A00; white-space: nowrap; }
.guia.tratada .guia-estado { background: #E3F3EA; color: var(--verde); }
.guia-linhas { list-style: none; margin: 10px 0 0; padding: 0; }
.guia-linhas li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid #EEF0F5; font-size: 14px; }
.guia-linhas li strong { white-space: nowrap; }
.guia-fora { margin-left: 8px; font-size: 11px; font-weight: 700; color: #B26A00; }
.guia-nota { margin: 10px 0 0; color: var(--texto-suave); font-size: 13.5px; white-space: pre-line; }
.guia-fundo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.guia-fundo .material-adicionar { margin: 0; }
.corpo-app .guia-fundo .guia-juntar { width: auto; margin: 0; min-height: 40px; padding: 0 16px; }
.guia-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--linha); border-radius: 12px; background: #F6F7FB; }
.guia-form-linhas { display: flex; flex-direction: column; gap: 8px; }
.guia-form-linha { display: grid; grid-template-columns: minmax(0, 1fr) 84px 64px 36px; gap: 8px; align-items: center; }
.guia-form-nome { font-weight: 600; overflow-wrap: anywhere; }
.guia-form input, .guia-form select, .guia-form textarea {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--linha);
  border-radius: 10px; background: #fff; color: var(--texto); font: inherit;
}
.guia-form textarea { resize: vertical; }
.guia-form-escolhas { display: flex; flex-wrap: wrap; gap: 8px; }
.guia-form-escolhas select { flex: 1 1 220px; width: auto; }
.guia-form-escolhas select[hidden] { display: none; }
.guia-form-escolhas .material-adicionar { margin: 0; }
@media (max-width: 480px) { .guia-form-linha { grid-template-columns: minmax(0, 1fr) 70px 52px 36px; gap: 6px; } }
.guia-form .botao-cancelar { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--linha); border-radius: 10px; background: #fff; color: var(--texto-suave); font: inherit; font-weight: 600; cursor: pointer; }
.manut-visita[hidden] { display: none !important; }
.guia-form-dia { display: grid; gap: 4px; max-width: 220px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--texto-suave); }
.obra-sec-texto strong .guias-radar { display: inline-block; margin-left: 10px; vertical-align: middle; }

/* guia por tratar (só para quem junta o PDF): a caixa inteira pisca a laranja, como o radar */
.guia.guia-avisa { border-color: #E0A23B; background: #FFF8EC; animation: guia-radar 1.8s ease-out infinite; }
@keyframes guia-radar { 0% { box-shadow: 0 0 0 0 rgba(224, 162, 59, .55); } 70% { box-shadow: 0 0 0 10px rgba(224, 162, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 162, 59, 0); } }
@media (prefers-reduced-motion: reduce) { .guia.guia-avisa { animation: none; box-shadow: 0 0 0 3px rgba(224, 162, 59, .35); } }

/* ficha em edição em sítios estreitos (telemóvel, blocos de O meu dia): a caixa
   passa para baixo do nome e usa a largura toda, em vez de ficar cortada */
.obra-ficha-editar, .obra-ficha-editar .ficha-bloco { container-type: inline-size; }   /* cada bloco decide pela sua largura */
@container (max-width: 420px) {
  .ficha-bloco .obra-linha { flex-wrap: wrap; row-gap: 6px; }
  .ficha-bloco .obra-linha > input, .ficha-bloco .obra-linha > select, .ficha-bloco .obra-linha > textarea,
  .ficha-bloco .obra-linha > .escolher-lista, .ficha-bloco .obra-linha > div { flex: 1 1 100%; width: 100%; min-width: 0; max-width: none; text-align: left; }
}
.hb-conteudo .obra-ficha-editar { padding: 14px 12px; }
.hb-conteudo .obra-ficha-editar .ficha-bloco { padding: 12px 10px; }

/* O meu dia: registar visita dentro do bloco */
.hoje-visita-form { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--linha); border-radius: 12px; background: #F6F7FB; }
.hoje-visita-dia { display: grid; gap: 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); }
.hoje-visita-dia input, .hoje-visita-form textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--linha); border-radius: 10px; background: #fff; font: inherit; color: var(--texto); text-transform: none; letter-spacing: 0; }
.hoje-visita-form textarea { min-height: 84px; resize: vertical; }
.hoje-visita-botoes { display: flex; justify-content: flex-end; gap: 8px; }
.hoje-visita-botoes .botao-cancelar { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--linha); border-radius: 10px; background: #fff; color: var(--texto-suave); font: inherit; font-weight: 600; cursor: pointer; }
.hb-conteudo .hoje-visita-botoes .botao-app { width: auto; margin: 0; min-height: 40px; padding: 0 16px; }
.material-adicionar[hidden] { display: none; }
/* O meu dia: pastas dentro do bloco de ficheiros */
.hoje-pasta { border: 1px solid var(--linha); border-radius: 12px; background: #fff; }
.hoje-pasta > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-weight: 600; cursor: pointer; list-style: none; }
.hoje-pasta > summary::-webkit-details-marker { display: none; }
.hoje-pasta > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid #9AA0B4; border-bottom: 2px solid #9AA0B4; transform: rotate(-45deg); transition: transform .2s; }
.hoje-pasta[open] > summary::before { transform: rotate(45deg); }
.hoje-pasta[open] > summary { border-bottom: 1px solid var(--linha); }
.hoje-pasta > .ficheiro-escada, .hoje-pasta > ul { margin: 10px; }
/* O meu dia: linhas que levam a outra página (perfil em falta, guias por tratar) */
.hoje-bloco-linha.hoje-ir { position: relative; display: flex; flex-direction: column; gap: 2px; padding-right: 34px; color: var(--texto); font-weight: 600; text-decoration: none; }
.hoje-bloco-linha.hoje-ir small { font-weight: 400; color: var(--texto-suave); }
.hoje-bloco-linha.hoje-ir::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid #9AA0B4; border-top: 2px solid #9AA0B4; transform: translateY(-50%) rotate(45deg); }
.hoje-bloco-linha.hoje-ir:hover { background: #EEF0F8; }
.materiais-pasta-editar { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.materiais-pasta-editar input { flex: 1 1 140px; min-width: 0; max-width: 100%; }
.materiais-pasta-topo > [hidden] { display: none !important; }

/* Pastas: a mesma grelha em documentos e quantidades, nas tres areas. */
.obra-pasta-topo, .materiais-pasta-abrir {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 12px;
  grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px;
  min-width: 0; align-items: center; padding: 10px 12px;
}
.obra-pasta-topo > svg, .materiais-pasta-abrir > svg {
  grid-column: 1; grid-row: 1 / 3; width: 20px; height: 20px;
}
.obra-pasta-topo > span:not(.opcao-seta), .materiais-pasta-abrir > strong {
  grid-column: 2; grid-row: 1; min-width: 0; white-space: normal;
  overflow-wrap: anywhere; text-overflow: clip; font-size: 14px; font-weight: 600;
}
.obra-pasta-topo > small, .materiais-pasta-abrir > small {
  grid-column: 2; grid-row: 2; white-space: normal; font-size: 12px;
  line-height: 1.4; overflow-wrap: anywhere;
}
.obra-pasta-topo > .opcao-seta, .materiais-pasta-abrir > .opcao-seta {
  grid-column: 3; grid-row: 1 / 3; width: 9px; height: 9px; justify-self: center;
}
.obra-pasta-acao, .materiais-pasta-topo > .sec-acao { flex: 0 0 34px; width: 34px; height: 34px; margin: 0 4px 0 0; }
.materiais-pasta-topo { padding: 0; background: #F4F5FB; }
.obra-categorias > li.obra-pasta { background: #F4F5FB; }
.pasta-em-edicao > .sec-acao, .obra-pasta > [hidden] { display: none !important; }
.pasta-editar { flex-basis: 100%; padding: 10px 12px; }
.pasta-editar input { flex-basis: 100%; width: 100%; }
.pasta-editar .botao-app, .pasta-editar .botao-cancelar { flex: 0 1 auto; width: auto; }
@media (hover: hover) {
  .obra-pasta-topo:hover, .materiais-pasta-abrir:hover { background: #EEF0F8; }
}
@media (hover: none) { .materiais-pasta-abrir:hover { background: transparent; } }

/* pesquisa das secções: em que ficheiro se encontrou */
.obra-sec-achado { font-size: 12px; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ler o conteúdo dos ficheiros antigos (por baixo da pesquisa das secções) */
.obra-ler-conteudo { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px auto; padding: 8px 16px; min-height: 38px; border: none; border-radius: 999px; background: #E8ECF8; color: var(--azul); font: 600 14px var(--letra); cursor: pointer; transition: background .15s, transform .1s; }
.obra-ler-conteudo:hover { background: #D6DDF2; }
.obra-ler-conteudo:active { transform: scale(.97); }
.obra-ler-conteudo:disabled { opacity: .7; cursor: wait; }
.obra-ler-conteudo:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.obra-ler-conteudo svg { flex: none; }
@media (max-width: 600px) { .obra-ler-conteudo { width: 100%; justify-content: center; } }

/* quem vê cada ficheiro (sql/base/104): o olho à direita, antes do mover e do caixote */
.ficheiro-quem-ve {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-left: auto; border-radius: 9px; color: var(--verde, #1E9E5A); cursor: pointer;
}
.ficheiro-quem-ve.fechado { color: var(--texto-suave); }
.ficheiro-quem-ve:hover { background: var(--fundo); }
.ficheiro-quem-ve svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ficheiro-quem-ve + .ficheiro-mover, .ficheiro-quem-ve + .ficheiro-lixo { margin-left: 4px; }
/* a janela de escolher quem vê: a lista com as fotos, sem ser flutuante */
.quem-ve-janela { position: static; box-shadow: none; border: 0; padding: 0; max-height: 50vh; overflow: auto; text-align: left; width: 100%; }
.quem-ve-janela > small { display: block; margin-top: 8px; color: var(--texto-suave); }
/* o X das caixas de pesquisa (js/avisos.js, pesquisaComLimpar) */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pesquisa-limpavel { position: relative; min-width: 0; }
.pesquisa-limpar {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fundo, #EEF0F6); color: var(--texto-suave, #6B7280); cursor: pointer;
}
.pesquisa-limpar[hidden] { display: none; }
.pesquisa-limpar:hover { color: var(--texto, #1F2937); }
.pesquisa-limpar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* o olho de cada campo da ficha: so o olho (a contagem aparece no titulo) */
.ev-linha .quem-ve.olho-campo { margin-left: 0; padding: 0; background: none; }
.ev-linha .quem-ve.olho-campo .quem-ve-conta { display: none; }


/* ---------- Lembretes como no iPhone (lembretes.html) ---------- */
.lemb-ios { max-width: 720px; margin: 0 auto; }
.lemb-ios-titulo { font-size: 34px; font-weight: 700; color: var(--azul); margin: 4px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.lemb-ios-conta { font-size: 20px; color: var(--texto-suave); font-weight: 600; }
.lemb-ios .abas { margin-bottom: 8px; }
.lemb-ios .aba { font-family: inherit; cursor: pointer; }
.lemb-ios-lista { display: flex; flex-direction: column; }
.lemb-ios-linha { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--linha); }
.lemb-ios-linha .botao-lixo { opacity: .45; }
.lemb-ios-linha:hover .botao-lixo, .lemb-ios-linha .botao-lixo:focus-visible { opacity: 1; }
.lemb-ios-bola { flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid #C4C7D3; background: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.lemb-ios-bola.cheia { border-color: var(--azul); background: radial-gradient(circle, var(--azul) 0 6px, transparent 7px); }
.lemb-ios-bola:disabled { cursor: default; }
.lemb-ios-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lemb-ios-texto.editavel { cursor: text; }
.lemb-ios-nome { font-size: 16px; overflow-wrap: anywhere; }
.lemb-ios-texto small { font-size: 13px; color: var(--texto-suave); overflow-wrap: anywhere; }
.lemb-ios-nota { white-space: pre-line; }
.lemb-ios-data.atrasado { color: var(--erro); font-weight: 600; }
.lemb-ios-linha.feito .lemb-ios-nome, .lemb-ios-linha.apagado .lemb-ios-nome { color: var(--texto-suave); }
.lemb-ios-flag { color: #E8890C; font-size: 18px; line-height: 24px; }
.lemb-ios-feitos { align-self: flex-start; margin: 12px 0 4px; background: none; border: none; color: var(--azul); font: 600 14px var(--letra); cursor: pointer; padding: 4px; }
.lemb-ios-vazio { color: var(--texto-suave); padding: 18px 4px; }
/* o cartao (novo e editar) */
.lemb-ios-cartao { display: flex; gap: 12px; align-items: flex-start; background: var(--branco); border-radius: 22px; box-shadow: var(--sombra-levantada); padding: 14px 16px; margin: 8px -4px; }
.lemb-ios-cartao[hidden] { display: none; }
.lemb-ios-campos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lemb-ios-campos input[type=text], .lemb-ios-campos textarea { border: none; outline: none; background: none; padding: 2px 0; font: 16px var(--letra); color: var(--texto); resize: none; width: 100%; }
.lemb-ios-campos textarea { font-size: 14px; color: var(--texto-suave); overflow: hidden; }
.lemb-ios-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.lemb-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--fundo); border: none; border-radius: 999px; padding: 6px 12px; font: 600 13px var(--letra); color: var(--texto-suave); cursor: pointer; }
.lemb-chip input { border: none; background: none; font: 13px var(--letra); color: var(--texto); padding: 0; max-width: 130px; }
.lemb-bandeira { font-size: 16px; padding: 6px 14px; }
.lemb-bandeira.ligada { background: #FDEBD3; color: #E8890C; }
.lemb-ios-botoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.lemb-ios-form.escondido { display: none; }
.lemb-ios-mais { display: flex; align-items: center; gap: 10px; background: none; border: none; color: var(--azul); font: 600 16px var(--letra); padding: 14px 4px; cursor: pointer; }
.lemb-ios-mais[hidden] { display: none; }
.lemb-ios-mais-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--azul); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
@media (max-width: 600px) { .lemb-ios-titulo { font-size: 30px; } }
.lemb-ios-botoes .botao-app, .lemb-ios-botoes .botao-cancelar { width: auto; min-width: 0; flex: 0 0 auto; padding: 9px 18px; border-radius: 999px; font: 600 14px var(--letra); margin: 0; }
.lemb-ios-botoes .botao-cancelar { display: inline-block; background: var(--fundo); color: var(--texto); border: none; cursor: pointer; }
.lemb-ios { width: 100%; }
.lemb-ios-bloco { max-width: none; } .lemb-ios-bloco .lemb-ios-linha:last-of-type { border-bottom: none; }
/* nome e nota separados e claros (cartao dos lembretes) */
.lemb-ios-campos input[type=text], .lemb-ios-campos textarea { background: var(--fundo); border: 1.5px solid var(--linha); border-radius: 12px; padding: 10px 12px; }
.lemb-ios-campos input[type=text] { font-weight: 600; }
.lemb-ios-campos input[type=text]:focus, .lemb-ios-campos textarea:focus { border-color: var(--azul); background: var(--branco); }
.lemb-ios-campos textarea { min-height: 44px; color: var(--texto); }
.lemb-ios-rotulo { font: 600 12px var(--letra); color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 2px; }
.lemb-ios-rotulo:first-child { margin-top: 0; }
/* os botoes Dia / Hora / Importante sempre visiveis, tambem no Safari do iPad */
.lemb-ios-chips { display: flex !important; flex-wrap: wrap; gap: 8px; }
.lemb-chip { flex: 0 0 auto; min-height: 36px; }
.lemb-chip input { -webkit-appearance: none; appearance: none; min-width: 96px; width: 110px; max-width: 130px; min-height: 22px; display: inline-block; }
.lemb-chip input::-webkit-date-and-time-value { text-align: left; }
.lemb-chip .escolher-hora, .lemb-chip button:not(.lemb-bandeira) { background: none; border: none; padding: 0; font: 13px var(--letra); color: var(--texto); min-height: 0; box-shadow: none; }
.lemb-bandeira { display: inline-flex !important; gap: 6px; }
.lemb-bandeira::after { content: "Importante"; font: 600 13px var(--letra); }
.lemb-ios-chips .lemb-chip input[type=time], .lemb-ios-chips .lemb-chip input[type=date] { background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; font: 13px var(--letra) !important; color: var(--texto) !important; height: auto !important; min-height: 0 !important; }
.lemb-chip-extra.ligada { background: var(--azul-claro); color: var(--azul); }
.lemb-ios-onde { font-size: 13px; color: var(--azul); font-weight: 600; text-decoration: none; align-self: flex-start; }
.lemb-ios-foto { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; margin-top: 4px; cursor: zoom-in; border: 1px solid var(--linha); }
.lemb-chip svg, .lemb-ios-onde svg, .lemb-ios-flag svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -3px; } .lemb-ios-onde { display: inline-flex; gap: 4px; align-items: center; } .lemb-ios-flag svg { fill: currentColor; } .lemb-bandeira.ligada svg { fill: currentColor; } .lemb-chip span { display: inline-flex; gap: 6px; align-items: center; }
/* Dia e Hora do mesmo tamanho (a hora vira texto "campo-hora" no js/escolher-hora.js) */
.lemb-ios-chips .lemb-chip:has(.campo-data), .lemb-ios-chips .lemb-chip:has(.campo-hora) { width: 170px; justify-content: flex-start; }
.lemb-ios-chips .lemb-chip input.campo-data, .lemb-ios-chips .lemb-chip input.campo-hora { width: 100% !important; max-width: none !important; min-width: 0 !important; background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; font: 13px var(--letra) !important; color: var(--texto) !important; height: auto !important; min-height: 0 !important; border-radius: 0 !important; }
.lemb-ios-chips .lemb-chip input.campo-hora::placeholder, .lemb-ios-chips .lemb-chip input.campo-data::placeholder { color: var(--texto-suave); }
/* Dia, Hora, Importante, Obra e Foto: so o icone, lado a lado */
.lemb-ios-chips .lemb-chip, .lemb-ios-chips .lemb-chip:has(.campo-data), .lemb-ios-chips .lemb-chip:has(.campo-hora) { position: relative; width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
.lemb-ios-chips .lemb-chip svg { width: 20px; height: 20px; }
.lemb-ios-chips .lemb-chip input, .lemb-ios-chips .lemb-chip input.campo-data, .lemb-ios-chips .lemb-chip input.campo-hora { position: absolute !important; inset: 0; width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: 100% !important; opacity: 0; cursor: pointer; }
.lemb-ios-chips .lemb-chip.ligada { background: var(--azul-claro); color: var(--azul); }
.lemb-bandeira::after { content: none; }
.lemb-bandeira.ligada { background: #FDEBD3; color: #E8890C; }
.lemb-ios-form .lemb-ios-cartao { margin: 4px 0 12px; }
/* pastas de lembretes */
.lemb-pastas { margin: 4px 0 10px; }
.lemb-pastas[hidden] { display: none; }
.lemb-pastas-fila { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.lemb-pasta { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--linha); background: var(--branco); font: 600 14px var(--letra); color: var(--texto); cursor: pointer; }
.lemb-pasta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lemb-pasta.ativa { background: var(--azul); border-color: var(--azul); color: #fff; }
.lemb-pasta-n { font-size: 12px; opacity: .75; }
.lemb-pasta-nova { border-style: dashed; color: var(--azul); }
.lemb-pasta-cab { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lemb-pasta-cab h3 { flex: 1; margin: 0; font-size: 24px; font-weight: 700; color: var(--azul); overflow-wrap: anywhere; }
.lemb-pasta-nome { width: 100%; padding: 10px 12px; border: 1.5px solid var(--linha); border-radius: 12px; font: 16px var(--letra); }
/* ---------- Lembretes: inicio como no iPhone ---------- */
.lemb-cartoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 18px; }
.lemb-cartao-int { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--branco); border: none; border-radius: 16px; box-shadow: var(--sombra); cursor: pointer; text-align: left; font-family: var(--letra); }
.lemb-cartao-int:last-child:nth-child(odd) { grid-column: 1 / -1; }
.lemb-cartao-topo { display: flex; align-items: center; justify-content: space-between; }
.lemb-cartao-topo strong { font-size: 26px; font-weight: 700; color: var(--texto); }
.lemb-cartao-nome { font-size: 15px; font-weight: 600; color: var(--texto-suave); }
.lemb-bola-cor { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; }
.lemb-bola-cor svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lemb-listas-titulo { font-size: 20px; font-weight: 700; color: var(--texto); margin: 8px 0 8px; }
.lemb-listas { background: var(--branco); border-radius: 16px; box-shadow: var(--sombra); overflow: hidden; margin-bottom: 6px; }
.lemb-lista-linha { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; background: none; border: none; border-bottom: 1px solid var(--linha); cursor: pointer; font: 16px var(--letra); color: var(--texto); text-align: left; }
.lemb-lista-linha:last-child { border-bottom: none; }
.lemb-lista-nome { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lemb-lista-n { color: var(--texto-suave); font-size: 15px; }
.lemb-lista-linha .opcao-seta { transform: rotate(-90deg); opacity: .5; }
.lemb-lista-nova { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--azul); font: 600 15px var(--letra); padding: 10px 4px 14px; cursor: pointer; }
.lemb-lista-nova svg, .lemb-voltar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lemb-voltar { display: inline-flex; align-items: center; gap: 2px; background: none; border: none; color: var(--azul); font: 600 15px var(--letra); padding: 4px 0; cursor: pointer; }
.lemb-pasta-cab h2 { flex: 1; margin: 2px 0 6px; font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.lemb-pasta-janela, .janela-nome { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; text-align: left; }
.lemb-pasta-janela .lemb-pasta-nome, .janela-nome input { width: 100%; padding: 10px 12px; border-radius: 12px; font: 16px var(--letra); min-height: 0; height: 46px; border: 1.5px solid var(--linha); background: var(--fundo); outline: none; }
.lemb-pasta-janela .lemb-pasta-nome:focus, .janela-nome input:focus { border-color: var(--azul); background: var(--branco); box-shadow: 0 0 0 3px rgba(47,111,224,.15); }
.lemb-cores { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 4px; }
.lemb-cor { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.lemb-cor.escolhida { box-shadow: 0 0 0 2px var(--branco), 0 0 0 4px var(--texto); }
@media (min-width: 900px) { .lemb-ios:not(.lemb-ios-bloco) .lemb-cartoes { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lemb-ios:not(.lemb-ios-bloco) .lemb-cartao-int:last-child:nth-child(odd) { grid-column: auto; } }
.lemb-lista-seta { width: 16px; height: 16px; fill: none; stroke: var(--texto-suave); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
/* cartoes do inicio dos lembretes sem cor (como o resto do site) */ .lemb-cartao-int .lemb-bola-cor { background: var(--fundo) !important; } .lemb-cartao-int .lemb-bola-cor svg { stroke: var(--texto); }

/* ficha: botão "Editar ficha" (com texto) e a edição no lugar da ficha */
.obra-ficha-topo > .ficha-editar-botao { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: none; border-radius: 999px; background: #E8ECF8; color: var(--azul); font: 600 14px var(--letra); cursor: pointer; flex-shrink: 0; transition: background .15s, transform .1s; }
.obra-ficha-topo > .ficha-editar-botao svg { width: 18px; height: 18px; }
.obra-ficha-topo > .ficha-editar-botao:hover { background: #D6DDF2; }
.obra-ficha-topo > .ficha-editar-botao:active { transform: scale(.97); }
.obra-ficha-topo > .ficha-editar-botao:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.obra-ficha-topo > .ficha-editar-botao ~ * { margin-left: 0; }
.obra-ficha.a-editar-ficha .ficha-editar-botao { background: var(--azul); color: #fff; }
.obra-ficha .obra-ficha-editar { margin: 0; padding: 0; border: none; box-shadow: none; background: none; }
@media (max-width: 600px) { .obra-ficha-topo > .ficha-editar-botao span { display: none; } .obra-ficha-topo > .ficha-editar-botao { padding: 0 11px; } }
/* a ficha em edição: menos cinzento, campos brancos com contorno, nomes dos blocos com cor */
.obra-ficha .obra-ficha-editar .ficha-bloco { background: var(--branco); border: 1px solid #E3E6F0; }
.obra-ficha .obra-ficha-editar .ficha-bloco legend { color: var(--azul); font-size: 13px; letter-spacing: .05em; }
.obra-ficha .obra-ficha-editar .ev-linhas { border: none; background: none; }
.obra-ficha .obra-ficha-editar .ev-linha { border-color: #EEF0F6; }
.obra-ficha .obra-ficha-editar .ev-linha input { background: var(--branco); border: 1.5px solid #DDE1EC; border-radius: 10px; }
.obra-ficha .obra-ficha-editar .ev-linha input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(40, 48, 120, .12); outline: none; }
.obra-ficha .obra-ficha-editar .ev-titulo { background: var(--branco); border: 1.5px solid #DDE1EC; border-radius: 12px; }
.obra-ficha .ficha-vista[hidden] { display: none; }
.obra-ficha .obra-ficha-editar .ev-linha input[type] { background: var(--branco); border: 1.5px solid #DDE1EC; border-radius: 10px; outline: none; }
.obra-ficha .obra-ficha-editar .ev-linha input[type]:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(40, 48, 120, .12); outline: none; }
.obra-ficha .obra-ficha-editar .ev-titulo { padding-left: 16px; margin-bottom: 4px; box-shadow: none; }
.obra-ficha .obra-ficha-editar .ev-titulo:focus { border-color: var(--azul); }
.obra-ficha .obra-ficha-editar .ev-linha input[type] { background: var(--branco) !important; border: 1.5px solid #DDE1EC !important; }
.obra-ficha .obra-ficha-editar .ev-linha input[type]:focus { border-color: var(--azul) !important; }

/* ===== ficha da obra em separadores (js/obra.js fichaSeparadores) ===== */
.fo { display: flex; flex-direction: column; gap: 16px; }
.fo-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.fo-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: #EEF0F7; color: var(--texto-suave); font: 600 14.5px var(--letra); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.fo-tab svg { width: 18px; height: 18px; flex: none; }
.fo-tab:hover { background: #E2E6F3; color: var(--texto); }
.fo-tab.ativo { background: var(--azul); color: #fff; }
.fo-tab:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.fo-painel { display: flex; flex-direction: column; gap: 16px; }
.fo-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; }
.fo-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fo-largo { grid-column: 1 / -1; }
.fo-rotulo { font-size: 13.5px; font-weight: 600; color: var(--texto-suave); }
.fo-valor { min-height: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--linha); font-size: 16px; font-weight: 600; color: var(--texto); overflow-wrap: anywhere; white-space: pre-line; }
.fo-vazio { color: #A3A8BC; font-weight: 500; }
.fo-ligacao { color: var(--azul); text-decoration: none; }
.fo-ligacao:hover { text-decoration: underline; }
.fo-mapa { align-self: flex-start; }
.fo-aviso { margin: 0; padding: 10px 14px; border-radius: 12px; background: #FFF6E5; color: #8A5A00; font-size: 14px; font-weight: 500; }
.fo-nome { max-width: 520px; }
.fo-linha { display: flex; align-items: center; gap: 6px; }
.fo-entrada { flex: 1; width: 100%; min-width: 0; min-height: 46px; padding: 0 12px; border: 1.5px solid #D5DAE8; border-radius: 12px; background: #fff; color: var(--texto); font: 16px var(--letra); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.fo-entrada { padding: 10px 12px; resize: vertical; min-height: 84px; }
select.fo-entrada { cursor: pointer; }
.fo-entrada:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(40, 48, 120, .13); }
.fo-linha .quem-ve-conta { display: none; }
.fo-tirar { color: #C0392B; }
.fo-quem-ve { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: #F6F7FB; font-size: 14px; font-weight: 600; color: var(--texto-suave); }
.fo-quem-ve .quem-ve { margin-left: auto; }
.fo-mais { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 2px dashed #C9CEE3; border-radius: 14px; background: none; color: var(--azul); font: 600 15px var(--letra); cursor: pointer; }
.fo-mais svg { width: 20px; height: 20px; }
.fo-mais:hover { background: #F7F8FD; }
.fo-barra { position: sticky; bottom: 12px; z-index: 3; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; border: 1px solid var(--linha); border-radius: 16px; background: #fff; box-shadow: 0 -4px 20px rgba(18, 22, 58, .08); }
.fo-barra button { min-height: 46px; padding: 0 20px; border-radius: 12px; font: 600 15px var(--letra); cursor: pointer; }
.fo-cancelar { border: 1px solid var(--linha); background: #fff; color: var(--texto-suave); }
.fo-guardar { width: auto; }
/* a janela de adicionar campo */
.fo-novo { display: flex; flex-direction: column; gap: 6px; text-align: left; width: min(420px, 78vw); }
.fo-novo .fo-rotulo { margin-top: 8px; color: var(--texto); }
.fo-tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fo-tipo { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; border: 1.5px solid var(--linha); border-radius: 12px; background: #fff; color: var(--texto); font: 500 14px var(--letra); text-align: left; cursor: pointer; }
.fo-tipo svg { width: 18px; height: 18px; flex: none; color: var(--azul); }
.fo-tipo.sel { border-color: var(--azul); background: var(--azul-claro); color: var(--azul); }
.fo-novo-ops { display: flex; flex-direction: column; gap: 6px; }
.fo-novo-ops[hidden] { display: none; }
@media (max-width: 600px) {
  .fo-grelha { grid-template-columns: 1fr; gap: 14px; }
  .fo-tab { padding: 0 13px; }
  .fo-barra button { flex: 1; }
  .fo-tipos { grid-template-columns: 1fr 1fr; }
}
.fo-novo svg, .fo-tipo svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fo-novo { margin-bottom: 18px; }
.fo-linha .quem-ve { flex: none; }
.fo-linha .quem-ve-botao { width: 38px; height: 38px; background: none; }
.fo-linha .quem-ve-botao:hover { background: #EEF0F7; }
@media (max-width: 900px) { .obra-ficha-topo > .ficha-editar-botao span { display: none; } .obra-ficha-topo > .ficha-editar-botao { padding: 0 11px; } }
@media (max-width: 600px) { .obra-ficha-topo .quem-ve-conta { display: none; } .obra-ficha-topo h2 { min-width: 80px; } }
.fo .fo-linha .quem-ve { background: none; padding: 0; border: 0; box-shadow: none; }
.fo .fo-linha .quem-ve-botao.fechado { color: #C62828; background: #FDECEC; }
.fo-barra { border: 0; border-top: 1px solid var(--linha); border-radius: 0; box-shadow: none; padding: 14px 0 2px; bottom: 0; }
.fo-novo { width: 100%; max-width: 100%; box-sizing: border-box; }
.fo-novo .fo-entrada, .fo-novo .fo-tipos { width: 100%; box-sizing: border-box; }
.fo-tipo { min-width: 0; }
.fo-tipo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* edição da ficha mais leve: aviso discreto e "quem vê" junto ao texto */
.fo-aviso { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--azul-claro); color: var(--azul); font-weight: 500; }
.fo-aviso::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E") center / contain no-repeat; }
.fo-quem-ve { align-self: flex-start; display: inline-flex; gap: 8px; padding: 0; background: none; font-size: 14px; font-weight: 500; }
.fo-quem-ve .quem-ve { margin-left: 0; }
/* separadores com quantos campos estão preenchidos */
.fo-conta { padding: 1px 7px; border-radius: 999px; background: rgba(40, 48, 120, .08); font-size: 11.5px; font-weight: 700; }
.fo-conta.completo { background: var(--verde-claro); color: var(--verde); }
.fo-tab.ativo .fo-conta { background: rgba(255, 255, 255, .2); color: #fff; }
/* olhos dos campos: só à vista quando há restrição, ou ao passar/tocar no campo */
.fo .fo-linha .quem-ve:not(:has(.fechado)) { opacity: 0; transition: opacity .15s; }
.fo .fo-campo:hover .quem-ve, .fo .fo-campo:focus-within .quem-ve, .fo .fo-linha .quem-ve:has(.quem-ve-lista) { opacity: 1; }
@media (hover: none) { .fo .fo-linha .quem-ve:not(:has(.fechado)) { opacity: .35; } }
/* no topo da ficha: só o olho (o texto aparece se a ficha estiver restrita) */
.obra-ficha-topo .quem-ve:not(:has(.fechado)) .quem-ve-conta { display: none; }
.obra-ficha-topo .quem-ve:not(:has(.fechado)) { background: none; padding: 0; }
/* o prazo da obra */
.fo-prazo { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #F4F6FC, #EEF1FA); }
.fo-prazo-data { display: flex; flex-direction: column; gap: 2px; }
.fo-prazo-data small { font-size: 12.5px; font-weight: 600; color: var(--texto-suave); }
.fo-prazo-data strong { font-size: 19px; color: var(--texto); }
.fo-prazo-data.vazio strong { font-size: 15px; color: #A3A8BC; font-weight: 500; }
.fo-prazo-seta { color: #9AA1BC; }
.fo-prazo-seta svg { width: 22px; height: 22px; }
.fo-prazo-falta { margin-left: auto; padding: 6px 14px; border-radius: 999px; background: var(--azul); color: #fff; font-size: 14px; font-weight: 600; }
.fo-prazo-falta.perto { background: #E8890C; }
.fo-prazo-falta.atrasado { background: #C0392B; }
@media (max-width: 600px) { .fo-prazo-falta { margin-left: 0; } }
.fo-tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 600px) { .fo-tabs { flex-wrap: nowrap; overflow-x: auto; } }
/* em edição, tudo com o mesmo aspeto do "ver": linha por baixo em vez de caixa */
.fo .fo-grelha .fo-entrada, .fo .fo-prazo .fo-entrada { min-height: 40px; padding: 0 2px 6px; border: 0; border-bottom: 1.5px solid #C9CEE3; border-radius: 0; background: transparent; font-size: 16px; font-weight: 600; box-shadow: none; }
.fo .fo-grelha textarea.fo-entrada { padding-top: 6px; min-height: 64px; }
.fo .fo-grelha .fo-entrada:focus, .fo .fo-prazo .fo-entrada:focus { border-bottom-color: var(--azul); box-shadow: 0 2px 0 var(--azul); background: transparent; }
.fo .fo-grelha .fo-entrada::placeholder { font-weight: 500; color: #A3A8BC; }
.fo .fo-prazo .fo-entrada { font-size: 18px; font-weight: 700; width: 180px; }
.fo-campo .fo-linha { align-items: flex-end; }
.fo .fo-nome .fo-entrada { border: 0; border-bottom: 1.5px solid #C9CEE3; border-radius: 0; background: transparent; padding: 0 2px 6px; font-size: 20px; font-weight: 700; box-shadow: none; }
.fo .fo-nome .fo-entrada:focus { border-bottom-color: var(--azul); box-shadow: 0 2px 0 var(--azul); }

/* =========================================================
   UNIFORMIZAR (auditoria 19/10): o mesmo aspeto em todas as páginas
   (o ecrã de entrar/criar conta fica de fora: botões altos de propósito)
   ========================================================= */
/* botão principal e Cancelar: 44px, cantos de 12px, a mesma letra */
html body:has(.barra-app) .botao-app { min-height: 44px; padding: 10px 18px; border-radius: 12px; font-size: 15px; font-weight: 700; }
html body:has(.barra-app) .botao-cancelar { min-height: 44px; padding: 10px 18px; border-radius: 12px; font-size: 15px; font-weight: 600; }
html body:has(.barra-app) .cal-novo-abrir { min-height: 44px; border-radius: 12px; }
/* botões claros (Editar ficha, Ler o conteúdo, Adicionar quantidade, listas): cantos de 12px */
html .ficha-editar-botao, html .obra-ler-conteudo, html .material-adicionar, html .eb-botao { border-radius: 12px; }
/* apagar: sempre o mesmo vermelho claro */
html .botao-lixo { background: #FDECEC; color: #C62828; }
html .botao-lixo:hover { background: #F9D9D9; }
/* separadores (abas): todos em pílula, como os da ficha */
html .abas { gap: 6px; }
html .aba { border-radius: 999px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; border-color: transparent; background: #EEF0F7; transition: background .15s, color .15s; }
html .aba:hover { background: #E2E6F3; color: var(--texto); }
html .aba.ativa, html .aba[aria-selected="true"] { background: var(--azul); color: #fff; }
/* ícones sempre em traço (o lápis do "Editar ficha" aparecia cheio) */
.ficha-editar-botao svg, .ficha-editar-botao svg * { fill: none; stroke: currentColor; }
/* lápis e caixote dos grupos: área de toque maior, o desenho fica do mesmo tamanho */
.obra-grupo-acoes .olho { width: 32px; height: 32px; border-radius: 10px; }
.obra-grupo-acoes .olho svg { width: 16px; height: 16px; }
/* "Juntar fotografia ou PDF" partia o texto no tablet */
.documento-juntar { white-space: normal; height: auto; }
.documento-juntar * { white-space: normal; }
/* animações suaves iguais nos botões */
@media (prefers-reduced-motion: no-preference) {
  html .botao-app, html .botao-cancelar, html .botao-lixo, html .botao-lapis, html .olho, html .aba, html .fo-tab, html .material-adicionar { transition: background .15s, color .15s, transform .1s, box-shadow .15s; }
  html .botao-app:active, html .botao-cancelar:active, html .botao-lixo:active, html .botao-lapis:active, html .aba:active, html .fo-tab:active, html .material-adicionar:active { transform: scale(.97); }
}
/* calendário: quantas marcações tem o dia, em destaque */
.cal-dia-conta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: #EEF0F5; color: var(--texto-suave); font-size: 13px; font-weight: 700; }
.cal-dia-conta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #B4B9CC; }
.cal-dia-conta.tem { background: var(--azul-claro); color: var(--azul); }
.cal-dia-conta.tem::before { background: var(--verde); }
.cal-dia-resto { display: flex; flex-direction: column; }
/* cartões Hoje/Agendados/…: mais pequenos, numa só linha (ícone · nome · número) */
html .lemb-cartoes { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
html .lemb-cartao-int, html .lemb-ios:not(.lemb-ios-bloco) .lemb-cartao-int { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; grid-column: auto; min-height: 48px; }
html .lemb-cartao-int:last-child:nth-child(odd) { grid-column: auto; }
.lemb-cartao-int .lemb-cartao-topo { display: contents; }
.lemb-cartao-int .lemb-bola-cor { order: 1; width: 28px; height: 28px; flex-basis: 28px; }
.lemb-cartao-int .lemb-bola-cor svg { width: 16px; height: 16px; }
.lemb-cartao-int .lemb-cartao-nome { order: 2; flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lemb-cartao-int .lemb-cartao-topo strong { order: 3; font-size: 18px; }
@media (max-width: 380px) { html .lemb-cartoes { grid-template-columns: 1fr 1fr; } }
/* cartões dos lembretes proporcionais à caixa: enchem a largura (5, 3 ou 2 por linha) */
.lemb-ios { container-type: inline-size; }
html .lemb-cartoes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html .lemb-cartao-int, html .lemb-ios:not(.lemb-ios-bloco) .lemb-cartao-int { min-height: 58px; padding: 10px 14px; }
.lemb-cartao-int .lemb-bola-cor { width: 32px; height: 32px; flex-basis: 32px; }
.lemb-cartao-int .lemb-cartao-nome { font-size: 15px; }
.lemb-cartao-int .lemb-cartao-topo strong { font-size: 22px; }
html .lemb-cartao-int:last-child:nth-child(odd) { grid-column: 1 / -1; }
@container (min-width: 520px) {
  html .lemb-cartoes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html .lemb-cartao-int:last-child:nth-child(odd) { grid-column: auto; }
}
@container (min-width: 760px) {
  html .lemb-cartoes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* compacto mas com o nome inteiro: ícone e número em cima, nome por baixo */
html .lemb-cartao-int, html .lemb-ios:not(.lemb-ios-bloco) .lemb-cartao-int { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 12px; min-height: 0; }
.lemb-cartao-int .lemb-cartao-topo { display: flex; align-items: center; justify-content: space-between; }
.lemb-cartao-int .lemb-bola-cor { width: 28px; height: 28px; flex-basis: 28px; }
.lemb-cartao-int .lemb-cartao-topo strong { font-size: 20px; }
.lemb-cartao-int .lemb-cartao-nome { font-size: 14px; white-space: normal; overflow: visible; }
/* títulos "As minhas listas" e "Por fazer" com ícone, como os cabeçalhos dos blocos */
.lemb-listas-titulo { display: flex; align-items: center; gap: 10px; }
.lemb-titulo-icone { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #EEF0F7; color: var(--azul); flex: none; }
.lemb-titulo-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* mini calendário do dia: da mesma altura do texto ao lado, mais limpo */
html .dia-folha { flex: 0 0 72px; height: 78px; border-radius: 16px; box-shadow: 0 2px 8px rgba(18, 22, 58, .08), 0 0 0 1px #E1E4EE; }
html .dia-folha-mes { padding: 5px 0 4px; font-size: 11.5px; }
html .dia-folha-num { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 32px; line-height: 1; }
html .cal-dia-titulo { align-items: center; gap: 14px; }
html .cal-dia-titulo .cal-dia-resto { gap: 2px; min-width: 0; }
html .cal-dia-conta { margin-top: 4px; }
@media (max-width: 600px) { html .dia-folha { flex-basis: 64px; height: 72px; } html .dia-folha-num { font-size: 28px; } }
.lemb-listas-fim { margin-top: 24px; }
.lemb-pastas .lemb-cartoes { margin-bottom: 22px; }
.lemb-listas-fim[hidden] { display: none; }
/* as listas como cartões, numa linha mais baixa: cor · nome · número */
html .lemb-cartoes.lemb-cartoes-listas { margin-top: -12px; }
html .lemb-cartao-lista, html .lemb-cartao-nova { flex-direction: row !important; align-items: center !important; gap: 10px; padding: 8px 12px !important; min-height: 44px; }
.lemb-cartao-lista .lemb-bola-cor { width: 26px; height: 26px; flex: 0 0 26px; }
.lemb-cartao-lista .lemb-bola-cor svg { stroke: #fff !important; width: 14px; height: 14px; }
.lemb-cartao-lista .lemb-cartao-nome { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texto); }
.lemb-cartao-lista strong { font-size: 17px; color: var(--texto); }
html .lemb-cartao-nova { justify-content: center; background: transparent; box-shadow: none; border: 2px dashed #C9CEE3; color: var(--azul); font-weight: 600; font-size: 14px; }
.lemb-cartao-nova svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.lemb-cartao-nova:hover { background: #F7F8FD; }
.lemb-cartao-lista .lemb-bola-cor { order: 1; } .lemb-cartao-lista .lemb-cartao-nome { order: 2; } .lemb-cartao-lista strong { order: 3; margin-left: auto; }
/* os lembretes num cartão branco, como as listas de cima */
.lemb-ios #lista:not(:empty) { margin-top: 10px; padding: 4px 14px; background: var(--branco); border-radius: 16px; box-shadow: var(--sombra); }
.lemb-ios #lista:not(:empty) > :last-child { border-bottom: 0; }
/* o cartão de adicionar e os lembretes num só bloco: escreve-se em cima, a lista continua por baixo */
.lemb-ios-form:has(+ #lista:not(:empty)) .lemb-ios-cartao { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; box-shadow: none; }
.lemb-ios-form:has(+ #lista:not(:empty)) { margin-bottom: 0; background: var(--branco); border-radius: 16px 16px 0 0; box-shadow: var(--sombra); clip-path: inset(-30px -30px 0 -30px); }
.lemb-ios-form + #lista:not(:empty) { margin-top: 0; border-top: 1px solid var(--linha); border-radius: 0 0 16px 16px; clip-path: inset(0 -30px -30px -30px); }
/* sem recortes (cortavam o menu "Para quem"): a lista tapa a sombra de baixo do cartão; ao escolher, o cartão fica por cima de tudo */
.lemb-ios-form:has(+ #lista:not(:empty)) { clip-path: none; position: relative; z-index: 1; }
.lemb-ios-form + #lista:not(:empty) { clip-path: none; position: relative; z-index: 2; }
.lemb-ios-form:focus-within, .lemb-ios-form:has([aria-expanded="true"]) { z-index: 5 !important; }
/* na lista: o lembrete em destaque e a nota claramente separada (caixa amarela com o ícone de nota, como nas tarefas) */
html .lemb-ios-nome { font-size: 16px; font-weight: 600; color: var(--texto); }
html .lemb-ios-texto small.lemb-ios-nota { display: block; align-self: flex-start; margin: 4px 0 2px; padding: 5px 10px 5px 28px; border-radius: 8px; background: #FFF8E1; color: #6B5A1E; font-size: 13.5px; position: relative; max-width: 100%; }
html .lemb-ios-texto small.lemb-ios-nota::before { content: ""; position: absolute; left: 9px; top: 8px; width: 13px; height: 13px; background: #B08A1E; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ficha em edição: a caixa das Notas (manutenções e assistências) com altura
   para escrever; o resto usa o aspeto comum dos campos */
.ecra-app .obra-ficha-editar .ficha-blocos .ficha-bloco .obra-linha > textarea.ficha-notas { height: auto; min-height: 110px; resize: vertical; }
@container (min-width: 421px) { .ficha-bloco .obra-linha > select, .ficha-bloco .obra-linha > input[type="number"] { flex: 1; min-width: 0; } }
.ficha-bloco .obra-linha:has(textarea) { align-items: flex-start; }

/* ficha nova ("Adicionar"): o mesmo espaço que entre os cartões da grelha */
.obras-grelha + .fo-nova { margin-top: 14px; }

/* =========================================================
   MANUTENÇÃO: VISITA EM CURSO (sql/base/113 e 114)
   ========================================================= */
.manut-form-titulo { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--texto-suave); }
.manut-check-cab { display: flex; align-items: center; gap: 10px; }
.manut-check-cab small { color: #8A90A6; font-weight: 500; }
.manut-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.manut-chip { min-height: 38px; padding: 0 14px; border: 1.5px solid #D5DAE8; border-radius: 999px; background: var(--branco); font: inherit; font-weight: 500; cursor: pointer; }
.manut-chip[aria-pressed="true"] { border-color: var(--azul); background: var(--azul-claro); color: var(--azul); }
.manut-check { display: flex; flex-direction: column; gap: 4px; }
.manut-pendentes { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #FFF4E5; }
.manut-pendentes > strong { font-size: 14px; color: #A35A00; }
.manut-pendente { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.manut-pendente span { flex: 1; min-width: 0; }

.manut-prova { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; }
.manut-prova-local { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.manut-prova-local svg { width: 16px; height: 16px; }
.manut-visita svg, .manut-prova-local svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-visita .ficha-local-icone { color: var(--azul); }

/* a visita em curso: o mesmo cartão branco do Progresso da obra */
.manut-ao-vivo { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--verde); flex: none; }
.manut-ao-vivo::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--verde); animation: manut-pulsa 1.8s ease-out infinite; }
@keyframes manut-pulsa { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .manut-ao-vivo::after { animation: none; } }
.manut-chip-prova { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--fundo); color: var(--texto-suave); font-size: 13px; font-weight: 500; text-decoration: none; }
.manut-chip-prova.ok { color: var(--azul); font-weight: 600; }
.manut-chip-prova.falta { color: #A35A00; background: #FFF4E5; }
.manut-chip-prova svg, .manut-unidade svg, .manut-foto svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-chip-prova svg { width: 16px; height: 16px; }
.manut-barra { margin: 16px 0 4px; }
.manut-sec-titulo { margin: 18px 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texto-suave); }
.manut-unidade-estado { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fundo); color: var(--texto-suave); font-size: 14px; font-weight: 700; flex: none; }
.manut-unidade-estado svg { width: 18px; height: 18px; }
.manut-nao-vista { padding: 0; font-size: 12.5px; }
.manut-motivo { width: 100%; min-height: 38px; margin-top: 4px; padding: 6px 10px; border: 1px solid #E1E4EE; border-radius: 10px; background: var(--fundo); font: inherit; font-size: 14px; }
.manut-motivo:focus { outline: none; border-color: var(--azul); background: var(--branco); }
.manut-foto svg { width: 24px; height: 24px; }
.manut-foto.tirada { position: relative; padding: 0; border: 0; }
.manut-foto.tirada img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.manut-foto.tirada span { position: absolute; inset: auto 0 0; padding: 2px 0; background: rgba(18,22,58,.55); color: #fff; font-size: 10.5px; }
.manut-foto:disabled { opacity: .6; cursor: progress; }

/* cada máquina: um cartão que abre (uma de cada vez), com os passos lá dentro */
.manut-fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.manut-foto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 120px; height: 96px; padding: 6px; border: 1.5px dashed #C9CEE3; border-radius: 12px; background: var(--fundo); color: var(--azul); font: inherit; font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer; overflow: hidden; }
.manut-dica { margin: 0; font-size: 13.5px; }
@media (max-width: 480px) {
  .manut-foto { width: calc(50% - 5px); }
  .manut-fotos { width: 100%; }
}
.manut-foto.tirada span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 4px; }
.manut-check .progresso-tarefa { align-items: center; }
.manut-nota-botao { flex: none; color: #9AA1BC; }
.manut-nota-botao.com-nota { color: var(--azul); }
.manut-nota-botao svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-nota-tarefa { margin: 0 0 6px 44px; width: calc(100% - 44px); }
.manut-nota-tarefa[hidden] { display: none; }

/* unidades exteriores e interiores (sql/base/116) */
.manut-tipo { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: 2px; }
.manut-tipo.exterior { background: var(--azul-claro); color: var(--azul); }
.manut-tipo.interior { background: var(--verde-claro); color: var(--verde); }
.interior-ligada { margin-left: 28px; position: relative; }
.interior-ligada::before { content: ""; position: absolute; left: -16px; top: -9px; bottom: 50%; width: 12px; border-left: 2px solid #D5DAE8; border-bottom: 2px solid #D5DAE8; border-bottom-left-radius: 8px; }
.manut-foto-mais { border-style: dashed; color: var(--texto-suave); }
@media (max-width: 480px) { .interior-ligada { margin-left: 18px; } .interior-ligada::before { left: -12px; width: 9px; } }

/* cada exterior é um grupo que abre e fecha, com as suas interiores lá dentro */

/* =========================================================
   VISITA EM CURSO: ASPETO ARRUMADO (sobrepõe o que está acima)
   ========================================================= */
/* cada exterior: um cartão branco; as unidades em linhas com traço fino */

/* o círculo de cada unidade, mais pequeno nas interiores */
.manut-unidade-estado { width: 34px; height: 34px; font-size: 13px; }
.interior-ligada .manut-unidade-estado { width: 28px; height: 28px; font-size: 12px; }

/* fotografias: três quadrados iguais lado a lado */
.manut-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 420px; }
.manut-foto { width: auto; height: auto; aspect-ratio: 1; padding: 6px; border-radius: 12px; font-size: 12px; }
.manut-foto svg { width: 22px; height: 22px; }

/* títulos dos passos e das partes, mais discretos */
.manut-passo, .manut-sec-titulo { font-size: 12px; letter-spacing: .04em; color: #8A90A6; }

@media (max-width: 480px) {
  .manut-grupo .interior-ligada .manut-unidade-corpo,
  .manut-foto { width: auto; }
}

/* menos confuso: um cartão por exterior, sem cabeçalho a repetir o nome */
.manut-fotos { grid-template-columns: repeat(3, 96px); max-width: none; }
.manut-foto { width: 96px; height: 96px; aspect-ratio: auto; }
@media (max-width: 480px) {
  .manut-fotos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manut-foto { width: auto; height: auto; aspect-ratio: 1; }
}

/* o relatório de uma visita terminada */
.manut-resumo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.manut-chip-prova.feito { background: var(--verde-claro); color: var(--verde); font-weight: 600; }
.manut-ver-relatorio { margin: 10px 0 0; }
.manut-relatorio { display: flex; flex-direction: column; gap: 10px; margin: -2px 0 6px; padding: 14px; border: 1px solid #E8EAF1; border-top: 0; border-radius: 0 0 14px 14px; background: #FAFBFE; }
.manut-rel-unidade { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #E8EAF1; border-radius: 14px; background: var(--branco); }
.manut-rel-unidade.interior-ligada { margin-left: 24px; }
.manut-rel-unidade.interior-ligada::before { display: none; }
.manut-rel-unidade.nao-vista { background: #FFF8EE; border-color: #F3DDBA; }
.manut-rel-cab { display: flex; align-items: center; gap: 10px; }
.manut-rel-cab strong { flex: 1; min-width: 0; font-size: 15px; }
.manut-rel-cab small { color: #8A90A6; font-size: 12.5px; white-space: nowrap; }
.manut-rel-motivo { margin: 0; font-size: 14px; color: #A35A00; }
.manut-rel-fotos .manut-foto { width: 80px; height: 80px; }
.manut-rel-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.manut-rel-check li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.manut-rel-check li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.manut-rel-check li.rel-ok svg { color: var(--verde); }
.manut-rel-check li.rel-falta { color: #8A90A6; }
.manut-rel-check li.rel-falta svg { color: #C2C6D6; }
.manut-rel-check li span { display: flex; flex-direction: column; gap: 2px; }
.manut-rel-check li small { padding-left: 8px; border-left: 3px solid #F2D36B; color: var(--texto); font-size: 13px; }
.manut-rel-texto { margin: 0; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
@media (max-width: 480px) { .manut-rel-unidade.interior-ligada { margin-left: 12px; } .manut-rel-fotos .manut-foto { width: auto; height: auto; } }
.manut-visita:has(+ .manut-relatorio) { border-radius: 14px 14px 0 0; }
.manut-rel-cab strong { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.manut-rel-cab strong .manut-tipo { margin-left: 0; }

/* =========================================================
   MANUTENÇÃO EM SEPARADORES (Resumo · Visitas · Equipamentos · Ficheiros)
   e a visita/relatório numa folha por cima da página
   ========================================================= */
.manut-acao { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; }
.manut-acao-botao { display: inline-flex; align-items: center; gap: 8px; }
.manut-acao-botao svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-tabs { margin: 16px 0 14px; }
.manut-painel { display: flex; flex-direction: column; gap: 14px; }
.manut-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }   /* 4 lado a lado só se couberem */
.manut-kpi { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 16px; background: var(--branco); box-shadow: 0 1px 2px rgba(18,22,58,.05), 0 6px 20px rgba(18,22,58,.06); }
.manut-kpi small { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8A90A6; }
.manut-kpi strong { font-size: 21px; overflow-wrap: anywhere; }
.manut-kpi span { font-size: 13px; color: var(--texto-suave); }
.manut-kpi.mau strong { color: #C62828; }
.manut-kpi.aviso strong { color: #B86200; }
.manut-kpi.ok strong { color: var(--verde); }
.manut-cartao { padding: 18px 20px; border-radius: 18px; background: var(--branco); box-shadow: 0 1px 2px rgba(18,22,58,.05), 0 6px 20px rgba(18,22,58,.06); }
.manut-cartao-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.manut-cartao-cab h2 { margin: 0; font-size: 16px; }
.manut-cartao > .material-adicionar { margin-top: 12px; }
.manut-linha { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #EEF0F5; }
.manut-cartao-cab + .manut-linha { border-top: 0; }
.manut-linha-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.manut-linha-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-linha-ic.e-mau { background: #FDECEC; color: #C62828; }
.manut-linha-ic.e-aviso { background: #FFF1DF; color: #B86200; }
.manut-linha-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.manut-linha-meio strong { font-size: 14.5px; }
.manut-linha-meio small { font-size: 12.5px; color: #8A90A6; }

/* as visitas em linhas: data · quem · resumo · seta */
.manut-vlinha { align-items: center; padding: 0; border: 0; border-top: 1px solid #EEF0F5; border-radius: 0; }
.manut-cartao-cab + .manut-vlinha, .manut-cartao .obra-pesquisa + .manut-vlinha { border-top: 0; }
.manut-cartao .obra-pesquisa { margin-bottom: 6px; }
.manut-vlinha-botao { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.manut-vlinha-botao:disabled { cursor: default; }
.manut-data { width: 54px; flex: none; text-align: center; display: flex; flex-direction: column; }
.manut-data b { font-size: 21px; line-height: 1; }
.manut-data span { font-size: 11.5px; color: #8A90A6; text-transform: uppercase; margin-top: 2px; }
.manut-seta { margin-left: auto; color: #A3A8BC; flex: none; }
.manut-seta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-chip-prova.mau { background: #FDECEC; color: #C62828; font-weight: 600; }

/* o estado de uma tarefa / unidade */
.manut-estado { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.manut-estado.e-ok { background: var(--verde-claro); color: var(--verde); }
.manut-estado.e-aviso { background: #FFF1DF; color: #B86200; }
.manut-estado.e-mau { background: #FDECEC; color: #C62828; }
.manut-estado.e-na { background: #EEF0F5; color: #6B7189; }
.manut-equip .manut-estado { align-self: center; }

/* a folha (visita em curso, relatório) */
html.manut-folha-aberta { overflow: hidden; }
.manut-folha-fundo { position: fixed; inset: 0; z-index: 900; background: rgba(18, 22, 58, .45); display: flex; justify-content: center; padding: 24px; }
.manut-folha { width: 100%; max-width: 880px; display: flex; flex-direction: column; border-radius: 20px; background: var(--fundo); overflow: hidden; box-shadow: 0 20px 60px rgba(18,22,58,.3); }
.manut-folha-topo { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--branco); border-bottom: 1px solid #E3E6EF; }
.manut-folha-topo h3 { flex: 1; min-width: 0; margin: 0; font-size: 17px; }
.manut-folha-fechar { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--fundo); cursor: pointer; flex: none; }
.manut-folha-fechar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.manut-folha-corpo { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 16px 18px 24px; }
.manut-folha-rodape { padding: 12px 18px; background: var(--branco); border-top: 1px solid #E3E6EF; }
.manut-folha-nav { display: flex; gap: 10px; }
.manut-folha-nav > button { flex: 1; min-height: 46px; }
.manut-folha .manut-dica { margin: 4px 0 8px; }
.manut-dica.falta { color: #B86200; }

/* o resultado de cada tarefa: OK · Atenção · Falha · N/A */
.manut-tarefa { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; border-top: 1px solid #EEF0F5; }
.manut-check .manut-tarefa:first-child { border-top: 0; }
.manut-tarefa .progresso-tarefa-texto { flex: 1; min-width: 180px; }
.manut-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fundo); }
.manut-seg button { padding: 7px 11px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--texto-suave); cursor: pointer; }
.manut-seg button.on.e-ok { background: var(--verde); color: #fff; }
.manut-seg button.on.e-aviso { background: #B86200; color: #fff; }
.manut-seg button.on.e-mau { background: #C62828; color: #fff; }
.manut-seg button.on.e-na { background: #8A90A6; color: #fff; }
.manut-tarefa + .manut-nota-tarefa, .manut-nota-tarefa { margin-left: 0; width: 100%; }
.manut-rel-check li .manut-estado { width: 64px; justify-content: center; flex: none; }
.manut-rel-folha .manut-relatorio { margin: 12px 0 0; padding: 0; border: 0; background: none; }
.manut-rel-quem { margin: 8px 0 0; color: var(--texto-suave); font-size: 13.5px; }

@media (max-width: 700px) {
  .manut-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manut-acao-botao { width: 100%; justify-content: center; }
  .manut-folha-fundo { padding: 0; }
  .manut-folha { border-radius: 0; max-width: none; }
  .manut-cartao { padding: 16px; }
}
.manut-tabs { flex-wrap: wrap; }
.manut-tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manut-seg { flex-wrap: nowrap; }
.manut-seg button { display: block; line-height: 1.2; white-space: nowrap; min-height: 34px; }
.manut-folha .progresso-nova { padding: 0; margin-top: 12px; }
.manut-folha .progresso-nova input { min-width: 0; }
.manut-folha .progresso-nova .botao-app { width: auto; flex: none; }
.manut-rel-check li { align-items: center; }
@media (max-width: 480px) {
  .manut-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: calc(100% - 48px); }
  .manut-tarefa .progresso-tarefa-texto { flex-basis: 100%; }
}

/* =========================================================
   VIDA: animações discretas, só em resposta ao que se faz
   (e nenhuma para quem pediu ao aparelho menos movimento)
   ========================================================= */
@keyframes vida-entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes vida-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vida-folha-sobe { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  /* ao abrir a página: os cartões entram um a seguir ao outro */
  html.a-entrar :is(.obra-cartao-caixa, .obra-ficha, .manut-acao, .manut-kpi, .manut-cartao, .progresso-obra,
    .obra-grupo-bloco, .hb-bloco, .lemb-ios-cartao, .lemb-ios-filtro, .opcao, .pessoa-cartao, .vazio-caixa) {
    animation: vida-entra .45s cubic-bezier(.2, .7, .2, 1) both;
  }
  html.a-entrar :is(.obras-grelha, .manut-kpis, .hb-grelha, .manut-painel, #hb-grelha) > :nth-child(2) { animation-delay: .05s; }
  html.a-entrar :is(.obras-grelha, .manut-kpis, .hb-grelha, .manut-painel, #hb-grelha) > :nth-child(3) { animation-delay: .1s; }
  html.a-entrar :is(.obras-grelha, .manut-kpis, .hb-grelha, .manut-painel, #hb-grelha) > :nth-child(4) { animation-delay: .15s; }
  html.a-entrar :is(.obras-grelha, .manut-kpis, .hb-grelha, .manut-painel, #hb-grelha) > :nth-child(n+5) { animation-delay: .2s; }

  /* mudar de separador */
  .manut-painel.entrar > * { animation: vida-fade .25s ease both; }
  .manut-painel.entrar > :nth-child(2) { animation-delay: .04s; }
  .manut-painel.entrar > :nth-child(n+3) { animation-delay: .08s; }

  /* a visita e o relatório: crescem no PC, sobem do fundo no telemóvel */
  .manut-folha-fundo { animation: previa-entrar .2s ease both; }
  .manut-folha { animation: previa-subir .28s cubic-bezier(.2, .7, .2, 1) both; }
  .manut-folha-corpo.entrar > * { animation: vida-fade .22s ease both; }

  /* ao marcar: os botões respondem ao toque (sem "saltos" que voltavam a cada redesenho) */
  .progresso-barra i, .manut-barra i { transition: width .6s cubic-bezier(.2, .7, .2, 1); }
  .manut-seg button, .manut-passo, .manut-foto, .manut-vlinha-botao, .fo-tab, .manut-kpi, .obra-cartao { transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease; }
  :is(.manut-seg button, .manut-passo, .manut-foto, .manut-vlinha-botao, .manut-linha .botao-claro):active { transform: scale(.97); }

  /* no PC, os cartões levantam um pouco ao passar o rato */
  @media (hover: hover) and (pointer: fine) {
    .manut-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(18, 22, 58, .1); }
    .obra-cartao:hover { box-shadow: 0 10px 28px rgba(18, 22, 58, .1); }   /* sem levantar: o olho e o caixote estão por cima */
    .manut-vlinha:hover { background: #F8F9FC; }
    .manut-foto:not(.tirada):hover { border-color: var(--azul); background: var(--azul-claro); }
  }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 700px) {
  .manut-folha { animation: vida-folha-sobe .3s cubic-bezier(.2, .7, .2, 1) both; }
}
.ja-entrou { animation: none !important; }

/* os dados da chapa na visita (gás, carga, modelo) */
.manut-chapa { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--fundo); }
.manut-chapa-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.manut-chapa-cab strong { font-size: 14px; }
.manut-chapa-campos { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; }
.manut-chapa-campo { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--texto-suave); }
.manut-chapa-campo .manut-motivo { background: var(--branco); }
.manut-chapa .material-adicionar { align-self: flex-start; margin: 0; }
.manut-chapa .material-adicionar:disabled { opacity: .7; cursor: default; }
@media (max-width: 600px) { .manut-chapa-campos { grid-template-columns: 1fr 1fr; } .manut-chapa-campo:last-child { grid-column: 1 / -1; } }
.manut-chapa-campos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manut-chapa-campo:last-child { grid-column: auto; }
.manut-chapa-mais summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--azul); padding: 4px 0; }
.manut-chapa-mais[open] summary { margin-bottom: 8px; }
@media (max-width: 600px) { .manut-chapa-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .manut-chapa-campo:last-child { grid-column: auto; } }
.manut-chapa-campo { justify-content: flex-end; }
.manut-foto small { font-size: 11px; font-weight: 500; line-height: 1.25; color: #8A90A6; }
.manut-fotos { grid-template-columns: repeat(3, 128px); }
.manut-foto { width: 128px; height: 116px; padding: 8px; }
.manut-foto.tirada small { display: none; }
@media (max-width: 480px) {
  .manut-fotos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manut-foto { width: auto; height: auto; aspect-ratio: auto; min-height: 120px; }
}

/* botão claro (Verificado hoje, Resolvido): não tinha estilo e saía como botão do sistema */
.botao-claro { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 38px; padding: 0 14px; border: none; border-radius: 12px; background: #E8ECF8; color: var(--azul); font: 600 14px var(--letra); white-space: nowrap; cursor: pointer; transition: background .15s; }
.botao-claro:hover { background: #D6DDF2; }
.botao-claro:disabled { opacity: .6; cursor: default; }
.botao-claro:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
/* equipamentos e linhas do Resumo estreitos: o texto fica com a linha toda ao lado do ícone
   e o estado e os botões descem para a linha de baixo, encostados à direita */
.manut-equip, .manut-linha { flex-wrap: wrap; justify-content: flex-end; container-type: inline-size; }   /* o texto (flex: 1) ocupa o espaço; o que desce fica à direita */
.manut-fugas { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }   /* a etiqueta do prazo não tapa o texto */
.manut-fugas .fo-prazo-falta { margin-left: 0; padding: 4px 12px; font-size: 13px; }
@container (max-width: 520px) {
  .manut-equip > .manut-visita-texto { flex-basis: calc(100% - 54px); }   /* ícone 42 + espaço 12 */
  .manut-linha > .manut-linha-meio { flex-basis: calc(100% - 48px); }
}
/* nomes compridos de secções e fases: partem com hífen em vez de sair da caixa */
.obra-sec-texto strong, .obra-texto strong { overflow-wrap: break-word; hyphens: auto; }
.progresso-fase-opcional { max-width: calc(100% - 8px); box-sizing: border-box; }   /* a etiqueta “Conforme a obra” cabe mesmo quando desce de linha */
/* visita: cada exterior numa página, com as suas interiores por baixo no mesmo cartão */
@media (max-width: 600px) { .manut-grupo .interior-ligada .manut-unidade-corpo { padding-left: 16px; } }
/* visita: "+ Exterior" na fila de cima (o formulário abre por baixo da fila) */
/* fechar a visita: escolhas largas, o gás e a assinatura */
.manut-fecho { display: flex; flex-direction: column; }
.manut-seg-largo { display: flex; flex-wrap: wrap; width: 100%; box-sizing: border-box; }
.manut-seg-largo button { flex: 1 1 auto; min-height: 42px; padding: 8px 12px; font-size: 14px; }
.manut-seg button.on.e-sim { background: var(--azul); color: #fff; }
.manut-gas-campos { margin-top: 10px; }
.manut-assinatura { margin-top: 10px; }
.manut-assinatura-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--texto-suave); }
.manut-assinatura canvas { display: block; width: 100%; height: 160px; box-sizing: border-box; border: 1.5px dashed #C9CEE3; border-radius: 12px; background: var(--branco); touch-action: none; cursor: crosshair; }
.manut-rel-assinatura { display: block; max-width: min(320px, 100%); margin-top: 10px; border: 1px solid #E3E6EF; border-radius: 12px; background: var(--branco); }
/* ===== VISITA EM PÁGINA PRÓPRIA: a lista das unidades, uma unidade de cada vez e o fecho (js/manutencao.js) ===== */
.visita-un .opcao-seta { transform: rotate(-45deg); }
.visita-pagina { display: flex; flex-direction: column; gap: 12px; }
.visita-topo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.visita-menu-botao svg, .visita-adicionar svg, .visita-feita svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visita-topo-linha { display: flex; align-items: center; gap: 10px; width: 100%; }
.visita-sub { flex: 1; min-width: 0; margin: 0; color: var(--texto-suave); font-size: 14px; }
.visita-grupo, .visita-sec { background: var(--branco); border-radius: 18px; box-shadow: var(--sombra); padding: 6px 16px; }
.visita-sec { padding: 16px; }
.visita-grupo-titulo { margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--texto-suave); }
.visita-vazia { padding: 18px 16px; } .visita-vazia p { margin: 6px 0 0; color: var(--texto-suave); }
.visita-un-linha { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--linha); }
.visita-grupo > .visita-un-linha:first-child, .visita-grupo-titulo + .visita-un-linha { border-top: 0; }
.visita-un-linha.recuo { padding-left: 26px; }
.visita-un-linha .visita-menu-botao { width: 40px; height: 40px; background: none; box-shadow: none; }
.visita-un-linha .visita-menu-botao:hover { background: var(--fundo); }
.visita-un { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 12px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.visita-num { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 10px; background: var(--fundo); color: var(--azul); font-weight: 700; font-size: 13px; flex: none; }
.visita-num.e-feita { background: var(--verde-claro); color: var(--verde); } .visita-num.e-nao { background: #FFF4E5; color: #A35A00; } .visita-num.e-curso { background: var(--azul-claro); }
.visita-un-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.visita-un-meio strong { font-weight: 600; overflow-wrap: anywhere; }
.visita-un-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.visita-un-info small { color: var(--texto-suave); font-size: 12.5px; }
.visita-un-info .manut-chip-prova, .visita-chapa summary .manut-chip-prova { padding: 2px 10px; font-size: 12.5px; }
/* a barra de baixo: fica à vista enquanto se desliza a página */
.visita-fundo { position: sticky; bottom: 0; z-index: 4; margin: 4px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(243, 245, 250, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--linha); }
.visita-fundo small { display: block; margin-bottom: 6px; color: var(--texto-suave); font-size: 12.5px; text-align: center; }
.visita-fundo-botoes { display: flex; flex-direction: column; gap: 8px; }
.visita-fundo-botoes > button { flex: 1 1 0; min-width: 0; min-height: 48px; gap: 6px; padding: 4px 10px; font-size: 15px; line-height: 1.2; white-space: normal; text-align: center; }
.visita-fundo-botoes > button:disabled { opacity: .45; cursor: default; }
/* "Adicionar unidades": branco com contorno azul, para se ver bem sobre o fundo claro */
.visita-fundo-botoes > .visita-adicionar { background: var(--branco); border: 1.5px solid var(--azul); color: var(--azul); box-shadow: var(--sombra); }
.visita-fundo-botoes > .visita-adicionar:hover { background: var(--azul-claro); }
/* uma unidade */
.visita-passo { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.visita-passo-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); font-size: 13px; font-weight: 700; flex: none; }
.visita-passo-num.e-feito { background: var(--verde); color: #fff; }
.visita-passo-conta { color: var(--texto-suave); font-size: 13px; font-weight: 500; }
.visita-sec > .manut-notas-editar { margin-top: 12px; width: 100%; }
.visita-sec > .ligacao-simples { margin-top: 10px; }
.visita-chapa { margin-top: 12px; border: 1px solid var(--linha); border-radius: 12px; padding: 0 12px; }
.visita-chapa summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 12px 0; cursor: pointer; }
.visita-chapa summary small { color: var(--texto-suave); }
.visita-chapa .manut-chapa { margin: 0 0 12px; }
.visita-so-esta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--texto); cursor: pointer; }
.visita-so-esta input { width: 20px; height: 20px; margin: 0; accent-color: var(--azul); }
.visita-so-dica { display: block; margin-top: 4px; color: var(--texto-suave); font-size: 12.5px; }
.visita-aviso { margin: 0; }
.visita-menu { position: relative; flex: none; }
.visita-menu-botao { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--branco); box-shadow: var(--sombra); color: var(--texto-suave); cursor: pointer; }
.visita-menu-botao circle { fill: currentColor; stroke: none; }
.visita-menu-lista { position: absolute; right: 0; top: 50px; z-index: 6; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--branco); box-shadow: 0 10px 30px rgba(18, 22, 58, .18); }
.visita-menu-lista button { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--texto); font: 500 15px var(--letra); text-align: left; cursor: pointer; }
.visita-menu-lista button:hover:not(:disabled) { background: var(--fundo); }
.visita-menu-lista button.perigo { color: #C62828; }
.visita-menu-lista button:disabled { opacity: .45; cursor: default; }
.visita-menu-lista p { margin: 2px 12px 8px; color: var(--texto-suave); font-size: 12px; }
/* adicionar unidades */
.visita-nova-unidade { container-type: inline-size; }
/* a folha de adicionar é curta: do tamanho do que tem, ao centro no PC e em baixo no telemóvel */
.manut-folha-fundo[data-tipo="adicionar"] { align-items: center; }
.manut-folha-fundo[data-tipo="adicionar"] .manut-folha { max-width: 600px; max-height: 100%; }
@media (max-width: 700px) {
  .manut-folha-fundo[data-tipo="adicionar"] { align-items: flex-end; }
  .manut-folha-fundo[data-tipo="adicionar"] .manut-folha { max-height: 92dvh; border-radius: 20px 20px 0 0; }
}
/* a localização alinhada com o texto de cima, sem a pastilha */
.visita-topo > .manut-chip-prova { padding: 0; background: none; }
.visita-nova-unidade .manut-sec-titulo { margin: 18px 0 8px; }
.visita-nova-unidade > .manut-sec-titulo:first-child { margin-top: 0; }
/* os dois tipos em cartões grandes, com o desenho */
.visita-tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.visita-tipos button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1.5px solid var(--linha); border-radius: 16px; background: var(--branco); color: var(--texto); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.visita-tipos button strong { font-size: 16px; }
.visita-tipo-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--fundo); color: var(--azul); transition: background .15s, color .15s; }
.visita-tipo-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visita-tipos button[aria-pressed="true"] { border-color: var(--azul); background: var(--azul-claro); box-shadow: 0 6px 18px rgba(40, 48, 120, .14); }
.visita-tipos button[aria-pressed="true"] .visita-tipo-ic { background: var(--azul); color: var(--branco); }
.visita-tipos button:disabled { opacity: .5; cursor: default; }
.visita-tipos button:not(:disabled):active { transform: scale(.98); }
/* as exteriores em etiquetas */
.visita-exts { display: flex; flex-wrap: wrap; gap: 8px; }
.visita-exts button { min-height: 40px; padding: 0 14px; border: 1.5px solid var(--linha); border-radius: 999px; background: var(--branco); color: var(--texto); font: inherit; cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.visita-exts button strong { font-weight: 600; font-size: 14px; }
.visita-exts button[aria-pressed="true"] { border-color: var(--azul); background: var(--azul); color: var(--branco); }
/* quantas e o nome lado a lado quando há espaço */
.visita-qt-nome { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; align-items: end; }
.visita-qt-nome .manut-motivo { width: 100%; }
@container (max-width: 380px) { .visita-qt-nome { grid-template-columns: minmax(0, 1fr); } }
.visita-qt { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fundo); width: max-content; }
.visita-qt button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--branco); color: var(--azul); font: 700 22px var(--letra); box-shadow: var(--sombra); cursor: pointer; }
.visita-qt button:disabled { opacity: .4; cursor: default; box-shadow: none; }
.visita-qt output { min-width: 40px; text-align: center; font-size: 20px; font-weight: 700; }
/* o que vai ser criado */
.visita-previa { margin-top: 18px; padding: 12px; border-radius: 14px; background: var(--verde-claro); }
.visita-previa > small { display: block; margin-bottom: 8px; color: var(--verde); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.visita-previa-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.visita-previa-nome { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--branco); color: var(--texto); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; animation: visita-entra .25s ease both; }
.visita-previa-nome svg { width: 16px; height: 16px; fill: none; stroke: var(--verde); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@keyframes visita-entra { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .visita-previa-nome { animation: none; } }

/* ===== MANUTENÇÃO IGUAL NO TELEMÓVEL, NO IPAD E NO PC ===== */
.manut-acao-botao { justify-content: center; }
/* os separadores dividem a linha por igual: 4 lado a lado, ou 2 + 2 quando não cabem */
.manut-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.manut-tabs .fo-tab { justify-content: center; margin: 0; }
.manut-cartao-cab .ligacao-simples { margin: 0; }
.manut-nota-fugas { margin: 0 0 12px; text-align: left; }
/* os números da ficha partem a linha em vez de cortar (ex.: "De 3 em 3 meses") */
.ficha-numero strong { white-space: normal; overflow-wrap: anywhere; }

/* dados da chapa: a seta à direita mostra que abre (e roda quando está aberto) */
.visita-chapa summary, .manut-chapa-mais summary { list-style: none; }
.visita-chapa summary::-webkit-details-marker, .manut-chapa-mais summary::-webkit-details-marker { display: none; }
.visita-chapa summary .opcao-seta { margin-left: auto; flex: none; }
.visita-chapa[open] > summary .opcao-seta, .manut-chapa-mais[open] > summary .opcao-seta { transform: rotate(-135deg); }
.manut-chapa-mais summary { display: flex; align-items: center; gap: 10px; }
.manut-chapa-mais summary .opcao-seta { flex: none; border-color: var(--azul); }

/* foto já tirada: tocar abre-a; o botão do canto tira outra (ou tira-a da visita) */
.manut-foto-caixa { position: relative; }
.manut-foto-caixa > .manut-foto { width: 100%; }   /* (um botão não estica sozinho: a largura é a da casa; a altura, a da foto) */
.manut-foto-canto { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--azul); box-shadow: 0 2px 6px rgba(18, 22, 58, .25); cursor: pointer; }
.manut-foto-canto svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.manut-foto-canto:hover { background: var(--branco); }

/* a pílula do zoom do visualizador também no PC/tablet: a regra da barra do editor
   (.editor-zoom, ≥601px) tirava-lhe o fundo, os cantos redondos e os botões redondos */
.editor-zoom.ver-zoom { height: auto; margin: 0; padding: 4px; gap: 2px; background: #fff; border: 0; border-radius: 999px; box-shadow: 0 6px 20px rgba(20, 24, 60, .22); }
.editor-zoom.ver-zoom .editor-ferr { width: 38px; height: 38px; border: 0; border-radius: 50%; }
.editor-zoom.ver-zoom .editor-zoom-valor { min-width: 58px; height: 38px; border: 0; border-radius: 999px; background: #F3F4F9; }
