/* FERCOPOR Experience — estilos específicos, carregados DEPOIS do FERCOPOR Design System (ver ds.lock.json). */
/* ---------- Correspondência com a marcação da app (títulos simples) ---------- */
.conteudo > h1, .conteudo section > h1, .cabecalho-pagina h1, .cabecalho-relatorio h1 { font-family: var(--ds-serifa); font-weight: 600; letter-spacing: -.01em; font-size: var(--ds-t-display); line-height: 1.12; color: var(--ds-texto); margin: 0; }
.conteudo h2 { font-family: var(--ds-serifa); font-weight: 600; letter-spacing: -.005em; color: var(--ds-texto); font-size: var(--ds-t-seccao); }
.conteudo h3 { font-size: 15px; }
.aviso { border-radius: var(--ds-r); }
.conteudo { animation: entrada-pagina 180ms ease-out both; }
@media (prefers-reduced-motion: reduce) { .conteudo { animation: none; } }

/* ---------- Cabeçalhos de página ---------- */
.cabecalho-pagina, .cabecalho-relatorio { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.sobretitulo { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ds-dourado); }
.acoes-relatorio { display: flex; flex-wrap: wrap; gap: 8px; }
.etiquetas { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.topo .so-largo { display: none; }
@media (min-width: 900px) { .topo .so-largo { display: inline-flex; } }
.mensagem-pagina { margin: 0; padding: 12px 16px; border-radius: var(--ds-r); font-weight: 650; border: 1px solid; }
.mensagem-pagina.ok { background: var(--ds-sucesso-fundo); color: var(--ds-sucesso); border-color: #BFDCCB; }
.mensagem-pagina.erro { background: var(--ds-erro-fundo); color: var(--ds-erro); border-color: #EDC4C4; }
.mensagem-pagina ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.mensagem-pagina p { margin: 0; }

/* ---------- Filtros ---------- */
.barra-filtros .campo { min-width: 160px; flex: 1 1 160px; }
.barra-filtros .campo input, .barra-filtros .campo select { width: 100%; }
.filtros-botoes { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.caixa-filtro { align-self: center; min-height: 48px; }

/* ---------- Indicadores ---------- */
@media (min-width: 900px) { .indicadores.cinco { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
a.indicador { text-decoration: none; color: inherit; }
a.indicador:hover { border-color: var(--ds-dourado-luz); }
.ind-resolvidas { box-shadow: inset 0 -4px 0 #8CC26B; }
.ind-curso { box-shadow: inset 0 -4px 0 #F2C230; }
.ind-resolver { box-shadow: inset 0 -4px 0 #E07B1F; }
.ind-ativa { box-shadow: inset 0 -4px 0 #8CC26B; } .ind-aexpirar { box-shadow: inset 0 -4px 0 #F2C230; } .ind-expirada { box-shadow: inset 0 -4px 0 #B9B2A3; }
.ind-futura { box-shadow: inset 0 -4px 0 #7FA6D6; } .ind-sem { box-shadow: inset 0 -4px 0 #E07B1F; }

/* ---------- Estados (cores do dashboard do Excel; o texto diz sempre o estado) ---------- */
.est-resolvidas { background: #E4F2DA; color: #2E5A16; }
.est-analise { background: #FFF6CC; color: #6B5300; }
.est-resolucao { background: #FFE6B3; color: #7A4A00; }
.est-agendado { background: #FFF9E0; color: #6B5A1A; }
.est-resolver { background: #FBDDC4; color: #8A3B00; }
.est-fechado { background: #E8E6E1; color: #4A463F; }
.est-cancelado { background: #ECECEC; color: #555; text-decoration: line-through; }
.est-novo { background: #E8EFF8; color: #1F4E8C; }
.etiqueta-etapa { background: var(--ds-superficie-2); color: var(--ds-texto-2); border: 1px solid var(--ds-linha-forte); }
.marcador { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: baseline; }
.marcador.est-resolvidas, .legenda i.est-resolvidas { background: #8CC26B; }
.marcador.est-analise, .legenda i.est-analise { background: #F2D230; }
.marcador.est-resolucao, .legenda i.est-resolucao { background: #F2A630; }
.marcador.est-agendado, .legenda i.est-agendado { background: #F7E7A0; }
.marcador.est-resolver, .legenda i.est-resolver { background: #E07B1F; }
.marcador.est-fechado, .legenda i.est-fechado { background: #B9B2A3; }
.marcador.est-novo, .legenda i.est-novo { background: #7FA6D6; }
.barra rect.est-resolvidas { fill: #8CC26B; } .barra rect.est-analise { fill: #F2D230; } .barra rect.est-resolucao { fill: #F2A630; }
.barra rect.est-agendado { fill: #F7E7A0; } .barra rect.est-resolver { fill: #E07B1F; } .barra rect.est-fechado { fill: #B9B2A3; } .barra rect.est-novo { fill: #7FA6D6; }
.pct { display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 6px; font-weight: 700; text-align: center; }
.gar-ativa { background: #E4F2DA; color: #2E5A16; } .gar-aexpirar { background: #FFF6CC; color: #6B5300; } .gar-expirada { background: #ECECEC; color: #4A463F; }
.gar-futura { background: #E8EFF8; color: #1F4E8C; } .gar-sem { background: #FBDDC4; color: #8A3B00; }

/* ---------- Relatório ---------- */
.tabela-relatorio th[scope="row"] { white-space: nowrap; }
.tabela-relatorio td a { color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.tabela-relatorio td a:hover { text-decoration: underline; color: var(--ds-dourado-escuro); }
.tabela-relatorio .linha-reportadas { background: var(--ds-dourado-vela); font-weight: 700; }
.tabela-relatorio .linha-tempo { background: var(--ds-superficie-2); }
.tabela-relatorio .col-total { background: rgba(126, 106, 50, .06); }
td small { font-weight: 500; }
.negativo { color: var(--ds-erro); }
.barras-empilhadas .barra { height: 16px; }
.barra rect.trilho { fill: var(--bronze-claro); }
.colunas.colunas-duplas li rect.serie-novas:not(.trilho) { fill: var(--bronze); }
.colunas.colunas-duplas li rect.serie-resolvidas:not(.trilho) { fill: #8CC26B; }
.legenda i.serie-novas { background: var(--bronze); }
.legenda i.serie-resolvidas { background: #8CC26B; }
.colunas-duplas .coluna { width: 80%; max-width: 46px; }
.colunas-anuais .coluna { max-width: 72px; }
.colunas-anuais + .legenda + .caixa-tabela { margin-top: 16px; }

/* ---------- Listas e fichas ---------- */
.linha-sec { display: block; color: var(--ds-texto-3); font-size: 12.5px; margin-top: 2px; }
.ligacao-ocorrencia { font-weight: 700; text-decoration: none; color: var(--ds-texto); }
.ligacao-ocorrencia:hover { color: var(--ds-dourado-escuro); text-decoration: underline; }
.num-data { white-space: nowrap; font-variant-numeric: tabular-nums; }
.paginacao { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.grelha-dados { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 18px; }
.grelha-dados dt { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ds-texto-3); }
.grelha-dados dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.texto-descricao { margin: 0; white-space: normal; line-height: 1.55; }
.pessoa { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }
.pessoa small { color: var(--ds-texto-3); overflow-wrap: anywhere; }
.etapa-rapida { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.etapa-rapida .campo { flex: 1 1 220px; }
.notas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.notas li { border-left: 3px solid var(--ds-dourado-luz); padding: 6px 0 6px 12px; }
.notas time { display: block; font-size: 12px; color: var(--ds-texto-3); font-weight: 700; }
.form-nota { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.form-nota .campo { width: 100%; }
.lista-contactos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-contactos li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-top: 1px solid var(--ds-linha); padding-top: 8px; }
.lista-contactos li:first-child { border-top: 0; padding-top: 0; }
.acoes-linha { white-space: nowrap; }
.acordeao > summary h2, .acordeao > summary h3 { margin: 0; }
.novo-contacto { border: 1px solid var(--ds-linha); border-radius: var(--ds-r); }
.aviso-config code { background: var(--ds-superficie-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- Formulários ---------- */
.formulario { display: flex; flex-direction: column; gap: 16px; }
.grelha-campos { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.campo { display: flex; flex-direction: column; }
.campo input, .campo select, .campo textarea { width: 100%; font: inherit; }
.campo textarea { min-height: 110px; resize: vertical; border: 1px solid var(--ds-linha-forte); }
.ajuda-campo { font-weight: 500; color: var(--ds-texto-3); font-size: 12.5px; }
.obrigatorio { color: var(--ds-erro); }
.caixas { border: 0; padding: 0; margin: 0; }
.caixas legend { font-size: 13.5px; font-weight: 650; margin-bottom: 8px; padding: 0; }
.caixas-lista { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.caixa { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--ds-linha-forte); border-radius: var(--ds-r-pilula); background: var(--ds-superficie); font-size: 14px; font-weight: 500; cursor: pointer; }
.caixa input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--ds-dourado); }
.caixa:has(input:checked) { background: var(--ds-dourado-vela); border-color: var(--ds-dourado-luz); font-weight: 650; }
.opcoes-ambito { border: 0; margin: 0; padding: 0; }
.opcoes-ambito legend { font-size: 13.5px; font-weight: 650; margin-bottom: 8px; padding: 0; }
.opcoes-ambito { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opcoes-ambito legend { flex-basis: 100%; }
.painel > .caixa, .formulario .painel > label.caixa { align-self: flex-start; }
.relatorio > * + * { margin-top: 20px; }
.barra-gravar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 4px 0; }
[hidden] { display: none !important; }

/* ---------- Impressão (relatório em PDF) ---------- */
@media print {
  .topo, .nav-fundo, .rodape, .barra-filtros, .acoes-relatorio, .aviso-demo, .saltar { display: none !important; }
  body, .conteudo { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .conteudo { max-width: none; animation: none; }
  .painel, .indicador, .tabela { box-shadow: none !important; break-inside: avoid; }
  .duas-colunas { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4 landscape; margin: 12mm; }
}
.pessoa .funcoes { margin-top: 4px; color: var(--ds-texto-2); white-space: normal; }
/* Nomes clicáveis nas listas: seta a seguir ao nome */
.ligacao-ocorrencia::after { content: "\2197"; display: inline-block; margin-left: 5px; color: var(--ds-dourado); font-weight: 700; transition: transform var(--ds-rapido) ease; }
.ligacao-ocorrencia:hover::after { transform: translate(2px, -2px); }
/* Satisfação do cliente (1 a 5) */
.satisfacao { border: 0; margin: 0; padding: 0; gap: 8px; }
.satisfacao legend { font-size: 13.5px; font-weight: 650; padding: 0; margin-bottom: 4px; }
.niveis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.nivel { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--ds-linha-forte); border-radius: var(--ds-r); background: var(--ds-superficie); cursor: pointer; text-align: center; }
.nivel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nivel-n { font-size: 22px; font-weight: 800; line-height: 1; }
.nivel-cara { font-size: 28px; line-height: 1; margin-bottom: 4px; filter: grayscale(.35); transition: transform .12s, filter .12s; }
.nivel:hover .nivel-cara, .nivel:has(input:checked) .nivel-cara { filter: none; transform: scale(1.12); }
.nivel-t { font-size: 12px; color: var(--ds-texto-3); }
.nivel:has(input:checked) { background: var(--ds-dourado-vela); border-color: var(--ds-dourado); box-shadow: inset 0 0 0 1px var(--ds-dourado); }
.nivel:has(input:focus-visible) { outline: 3px solid var(--ds-dourado); outline-offset: 2px; }
.etapa-rapida .linha-inteira { flex-basis: 100%; }
.ind-satisfacao { box-shadow: inset 0 -4px 0 var(--ds-dourado-luz); }
.indicador strong .de5 { font-size: 15px; font-weight: 600; color: var(--ds-texto-3); }
@media (min-width: 640px) { .indicadores.seis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .indicadores.seis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.sat-1, .sat-2 { background: #FBDDC4; color: #8A3B00; } .sat-3 { background: #FFF6CC; color: #6B5300; } .sat-4, .sat-5 { background: #E4F2DA; color: #2E5A16; }
@media (max-width: 480px) { .nivel-t { font-size: 10.5px; } }
/* Cliente: prioridade e nova pessoa */
.etiqueta.prioridade { background: #2A2416; color: #F2D98C; margin-left: 6px; }
.ind-prioridade { box-shadow: inset 0 -4px 0 #B49A55; }
.ligacao-cliente { color: var(--ds-texto-2); font-weight: 650; }
.contactos-cliente { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ds-texto-2); }
.novo-cliente { margin-top: 14px; padding: 14px; border: 1px dashed var(--ds-dourado-luz); border-radius: var(--ds-r); background: var(--ds-dourado-vela); display: flex; flex-direction: column; gap: 10px; }
.novo-cliente h3 { margin: 0; }
.form-prioridade { gap: 10px; }

/* Lista agrupada por cliente */
.tabela-agrupada .linha-grupo th { background: var(--ds-dourado-vela); text-align: left; padding-top: 12px; padding-bottom: 12px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ds-texto-1, inherit); }
.tabela-agrupada .linha-grupo th { display: table-cell; }
.grupo-nome { font-weight: 700; font-size: 15px; margin-right: 16px; }
.grupo-dados { display: inline-flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 500; color: var(--ds-texto-2); }
.tabela-agrupada tbody.grupo-cliente + tbody.grupo-cliente .linha-grupo th { border-top: 10px solid var(--ds-superficie-1, #fff); }

/* ---------- Telemóvel (verificação UX/UI em iPhone 17, 402 px) ---------- */
/* Tabelas: o texto só para leitores de ecrã (posição absoluta) não pode alargar a página */
.caixa-tabela { position: relative; }
/* Caixas de opção: visto à esquerda, texto na mesma linha (também dentro dos filtros) */
.filtros label.caixa, label.caixa { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.campo.opcoes-ambito { flex-direction: row; flex-wrap: wrap; align-items: center; }
/* Campos nunca mais largos do que o formulário (iOS dá largura mínima às datas e às listas) */
.campo, .campo > *, .barra-filtros > * { min-width: 0; }
.campo input, .campo select, .campo textarea { max-width: 100%; box-sizing: border-box; }
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; width: 100%; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
textarea { font-size: 16px; max-width: 100%; box-sizing: border-box; }   /* 16 px: o iPhone não faz zoom ao escrever */
/* Barra de navegação: nomes numa só linha */
.nav-fundo a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (max-width: 560px) {
  .nav-fundo a { font-size: 10.5px; letter-spacing: -.1px; }
  /* Filtros: duas colunas certas; caixas de opção a toda a largura; botões no fim */
  .barra-filtros.filtros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .barra-filtros.filtros .campo { min-width: 0; }
  .barra-filtros.filtros .campo:has(input[type="search"]) { grid-column: 1 / -1; }
  .barra-filtros.filtros .campo:has(select[name="ordem"]) { grid-column: 1 / -1; }
  .barra-filtros.filtros .caixa-filtro { grid-column: 1 / -1; min-height: 44px; justify-content: flex-start; }
  .barra-filtros.filtros .filtros-botoes { grid-column: 1 / -1; }
  .barra-filtros.filtros .filtros-botoes .botao { flex: 1; }
  .barra-filtros select { min-width: 0; }
  /* Satisfação: uma linha por nível (cara, número e texto lado a lado) */
  .niveis { grid-template-columns: 1fr; gap: 6px; }
  .nivel { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 14px; text-align: left; }
  .nivel-cara { font-size: 26px; margin: 0; }
  .nivel-n { font-size: 18px; min-width: 14px; }
  .nivel-t { font-size: 14px; }
  /* Lista de ocorrências em cartões (sem deslizar para o lado) */
  .tabela-ocorrencias thead { display: none; }
  .caixa-tabela > table.tabela-ocorrencias { width: 100%; min-width: 0; }
  .tabela-ocorrencias, .tabela-ocorrencias tbody { display: block; }
  .tabela-ocorrencias tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 0; padding: 12px 4px; border-bottom: 1px solid var(--ds-linha); }
  .tabela-ocorrencias td { display: block; padding: 0; border: 0; min-width: 0; font-size: 13px; color: var(--ds-texto-2); }
  .tabela-ocorrencias td:nth-child(1) { order: 1; flex: 1 1 auto; font-size: 12.5px; }
  .tabela-ocorrencias td:nth-child(7) { order: 2; flex: none; }
  .tabela-ocorrencias td.col-nome { order: 3; flex: 1 1 100%; font-size: 15px; color: var(--ds-texto); margin: 2px 0; }
  .tabela-ocorrencias td:nth-child(3) { order: 4; }
  .tabela-ocorrencias td:nth-child(4) { order: 5; }
  .tabela-ocorrencias td:nth-child(5) { order: 6; }
  .tabela-ocorrencias td:nth-child(3)::after, .tabela-ocorrencias td:nth-child(4)::after { content: "\00a0·\00a0"; }
  .tabela-ocorrencias td:nth-child(6) { order: 7; flex: 1 1 100%; }
  .tabela-ocorrencias td:nth-child(6)::before { content: "Executante: "; color: var(--ds-texto-3); }
  .tabela-ocorrencias td:nth-child(8) { display: none; }
  .tabela-ocorrencias .linha-grupo { display: block; padding: 0; border: 0; }
  .tabela-ocorrencias .linha-grupo th { display: block; padding: 12px; border-radius: var(--ds-r); }
  .grupo-nome { display: block; margin: 0 0 4px; }
  .grupo-dados { font-size: 13px; }
}

/* ---------- Experience: caixa de entrada ---------- */
.tabela tr.nao-lido td { background: var(--ds-superficie-2, #FBF8F1); }
.tabela tr.nao-lido .ligacao-ocorrencia { font-weight: 700; }
.texto-email { white-space: normal; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; }
@media (max-width: 720px) {
  .caixa-tabela > table.tabela-emails { width: 100%; min-width: 0; }
  .tabela-emails thead { display: none; }
  .tabela-emails, .tabela-emails tbody, .tabela-emails tr, .tabela-emails td { display: block; width: 100%; }
  .tabela-emails tr { padding: 12px 14px; border-bottom: 1px solid var(--ds-borda, #E6E0D4); }
  .tabela-emails td { padding: 2px 0; border: 0; white-space: normal; }
  .tabela-emails td.num-data { font-size: 13px; color: var(--ds-texto-3); }
  .tabela-emails td:last-child { padding-top: 8px; }
}

/* ---------- Experience: revendas ---------- */
.bloco-pessoa { border: 0; margin: 0; }
.bloco-pessoa legend { padding: 0; float: left; width: 100%; }
.bloco-pessoa legend h2 { margin: 0 0 4px; }
.bloco-pessoa legend + * { clear: both; }
.pessoa-encontrada { margin: 0; padding: 10px 12px; border-radius: var(--ds-r); background: #E4F2DA; color: #2E5A16; font-weight: 600; font-size: 14px; }
.pessoa-encontrada.erro { background: #FBDDC4; color: #8A3B00; }
.grelha-campos .pessoa-encontrada { grid-column: 1 / -1; }

/* ---------- Experience: submenu das Transações ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 6px; background: var(--ds-superficie, #fff); border: 1px solid var(--ds-linha); border-radius: 999px; width: fit-content; max-width: 100%; }
.subnav a { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ds-texto-2); text-decoration: none; }
.subnav a:hover { background: var(--ds-dourado-vela, #F4EEDD); color: var(--ds-texto); }
.subnav a.ativo { background: var(--ds-texto, #202020); color: #fff; }
@media (max-width: 640px) { .subnav { border-radius: 14px; width: 100%; } }

/* Botão de eliminar (vermelho discreto) */
.botao.botao-perigo { background: #fff; color: #A8321F; border-color: #E9B8AE; }
.botao.botao-perigo:hover { background: #FBE9E5; color: #8A2414; border-color: #D98C7C; }
form .botao.botao-perigo[type="submit"] { background: #B23A26; color: #fff; border-color: #B23A26; }
form .botao.botao-perigo[type="submit"]:hover { background: #8F2C1B; }
/* Padrão de Acessos FERCOPOR (2026-11-13): Utilizadores e Níveis de Acesso e Ações */
.formulario-admin { display: flex; flex-direction: column; gap: 16px; }
.formulario-admin select, .formulario-admin input[type="text"], .formulario-admin input:not([type]), .formulario-admin input[type="email"] { min-height: 38px; padding: 0 10px; font: inherit; }
.formulario-admin th small { font-weight: 400; color: var(--texto-3, #777); }
.tabela-acoes td { text-align: center; }
.tabela-acoes .linha-modulo th { text-align: left; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.linha-cargo { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
