/* 4Docs — portal de documentos de um cliente: claro, cartões grandes, botões fortes (como o KangarooFiles), com as cores
   da marca 4Docs (kit em docs/marca-4docs, D22): azul #12599A, marinho #002B61, ciano #13A5F2. */
:root {
  --azul: #12599a;
  --azul-escuro: #0a3d75;
  --azul-claro: #e6f0fa;
  --marinho: #002b61;
  --ciano: #13a5f2;
  --fundo: #eef3f9;
  --cartao: #ffffff;
  --texto: #1b2533;
  --suave: #5b6b7f;
  --linha: #d9e2ee;
  --verde: #1f9d6b;
  --vermelho: #c93b3b;
  --ambar: #9a6400;
  --sombra: 0 1px 2px rgba(19, 68, 127, .06), 0 8px 24px rgba(19, 68, 127, .08);
  --sombra-forte: 0 24px 60px rgba(19, 68, 127, .18);
  --raio: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--azul); }
button { font: inherit; cursor: pointer; }
.icone { width: 20px; height: 20px; flex: none; }
.icone.pequeno { width: 16px; height: 16px; }
.fora-do-ecra { position: fixed; left: -9999px; top: 0; }

/* ---------- a carregar ---------- */
#app.a-carregar, .a-carregar-bloco { display: grid; place-items: center; min-height: 60vh; }
#app.a-carregar::after, .a-carregar-bloco::after {
  content: ""; width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--azul-claro); border-top-color: var(--azul); animation: rodar .8s linear infinite;
}
.a-carregar-bloco { min-height: 200px; }
@keyframes rodar { to { transform: rotate(360deg); } }

/* ---------- marca 4Docs ---------- */
/* align-self: numa coluna flexível a imagem esticava à largura toda e o SVG desenhava-se ao centro */
.marca-logo { display: block; height: 46px; width: auto; max-width: 100%; align-self: flex-start; }
.entrada-lado .marca-logo { height: 76px; }
.topo-icone { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 2px 6px rgba(0, 43, 97, .25); }

/* ---------- entrar ---------- */
.entrada-ecra { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; }
.entrada-ecra.so-cartao { grid-template-columns: 1fr; background: linear-gradient(160deg, #f4f8fd 0%, #e6eef9 100%); }
/* painel claro (D23: «está muito azul»): o azul fica para os ícones e o botão */
.entrada-lado {
  position: relative; overflow: hidden; color: var(--marinho);
  background: #fff; border-right: 1px solid var(--linha);
}
.entrada-lado::before, .entrada-lado::after {
  content: ""; position: absolute; border-radius: 50%; background: #f1f6fc;
}
.entrada-lado::before { width: 520px; height: 520px; right: -180px; bottom: -160px; }
.entrada-lado::after { width: 260px; height: 260px; left: -90px; top: -70px; }
.entrada-lado-dentro {
  position: relative; z-index: 1; height: 100%; padding: 56px 56px 64px;
  display: flex; flex-direction: column; justify-content: center; gap: 36px; max-width: 560px;
}
.entrada-lado h2 { font-size: 34px; font-weight: 700; }
.entrada-lado .realce { color: var(--ciano); }
.vantagens { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.vantagens li { display: flex; align-items: center; gap: 14px; font-size: 16px; color: #3d4c5f; }
.vantagens .icone {
  width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--azul-claro); color: var(--azul);
}
.entrada-principal { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #f4f6f9; }
.entrada-cartao {
  width: min(440px, 100%); background: var(--cartao); border-radius: 22px; padding: 40px;
  box-shadow: var(--sombra-forte); display: flex; flex-direction: column; gap: 10px;
}
.entrada-cartao > .marca-logo, .so-telemovel .marca-logo { margin-bottom: 18px; }
.entrada-cartao h1 { font-size: 30px; }
.entrada-cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.entrada-icone { width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 6px 16px rgba(0, 43, 97, .22); }
.entrada-cliente {
  align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--azul);
  background: var(--azul-claro); padding: 4px 10px; border-radius: 999px;
}
.entrada-sub { color: var(--suave); margin-bottom: 14px; }
.entrada-ajuda { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 13px; margin-top: 10px; }
.entrada-ajuda .icone { width: 16px; height: 16px; }
.so-telemovel { display: none; margin-bottom: 18px; }
.selo {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--azul-claro); color: var(--azul); margin-bottom: 6px;
}
.selo .icone { width: 28px; height: 28px; }
.ligacao { align-self: center; background: none; border: 0; color: var(--suave); text-decoration: underline; margin-top: 6px; }

/* ---------- formulários ---------- */
.formulario { display: flex; flex-direction: column; gap: 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 14px; font-weight: 600; }
.entrada {
  width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--texto);
  background: #fff; border: 1.5px solid var(--linha); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.entrada::placeholder { color: #9aa8b8; }
.entrada:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(19, 165, 242, .18); }
.com-botao { position: relative; }
.com-botao .entrada { padding-right: 52px; }
.mostrar {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--suave);
  display: grid; place-items: center;
}
.mostrar:hover { background: var(--fundo); color: var(--texto); }
.erro { color: var(--vermelho); font-size: 14px; min-height: 0; }
.erro:empty { display: none; }
.regras { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--suave); }
.regras li { display: flex; align-items: center; gap: 6px; }
.regras .icone { width: 16px; height: 16px; color: #b8c4d2; }
.regras li.cumprida { color: var(--verde); }
.regras li.cumprida .icone { color: var(--verde); }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--azul); color: #fff; font-weight: 600; white-space: nowrap; text-decoration: none;
  box-shadow: 0 1px 2px rgba(19, 68, 127, .2); transition: background .15s, transform .05s;
}
.botao:hover { background: var(--azul-escuro); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: .7; cursor: default; }
.botao-grande { width: 100%; height: 52px; font-size: 16px; margin-top: 4px; }
.botao-secundario { background: #fff; color: var(--texto); border: 1.5px solid var(--linha); box-shadow: none; }
.botao-secundario:hover { background: var(--fundo); }
.botao-perigo { background: var(--vermelho); }
.botao-perigo:hover { background: #a92f2f; }
.botao-pequeno { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.botao-pequeno .icone { width: 16px; height: 16px; }
.botao.a-trabalhar span { opacity: .6; }
.botao.a-trabalhar::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: rodar .7s linear infinite;
}
.botao-icone {
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--suave);
  display: grid; place-items: center;
}
.botao-icone:hover { background: var(--fundo); color: var(--texto); }

/* ---------- topo ---------- */
.topo { background: #fff; box-shadow: 0 1px 0 var(--linha), 0 6px 20px rgba(19, 68, 127, .05); position: sticky; top: 0; z-index: 10; }
.topo-dentro {
  max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 76px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.topo-cliente { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topo-cliente > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.topo-cliente strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-cliente span { font-size: 13px; color: var(--suave); }
.separadores { display: flex; gap: 6px; background: var(--fundo); padding: 5px; border-radius: 14px; }
.separadores a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  color: var(--suave); font-weight: 600; text-decoration: none;
}
.separadores a:hover { color: var(--texto); }
.separadores a.ativo { background: #fff; color: var(--azul); box-shadow: var(--sombra); }
.menu { position: relative; justify-self: end; }
.menu-botao {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border: 1.5px solid var(--linha);
  border-radius: 999px; background: #fff; color: var(--texto);
}
.menu-botao:hover { background: var(--fundo); }
.menu-nome { font-weight: 600; }
.menu-lista {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: #fff; border-radius: 14px;
  box-shadow: var(--sombra-forte); padding: 8px; display: none; flex-direction: column;
}
.menu.aberto .menu-lista { display: flex; }
.menu-cabeca { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--linha); margin-bottom: 6px; }
.menu-cabeca span { font-size: 13px; color: var(--suave); }
.menu-lista button {
  display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 10px; background: none;
  color: var(--texto); text-align: left;
}
.menu-lista button:hover { background: var(--fundo); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--azul-claro); color: var(--azul); font-weight: 700; font-size: 13px;
}
.avatar-gabinete { background: #ede7fb; color: #5b3fb5; }

/* ---------- conteúdo ---------- */
.conteudo { max-width: 1200px; margin: 0 auto; padding: 36px 24px 64px; }
.boas-vindas { margin-bottom: 24px; }
.boas-vindas h1 { font-size: 32px; }
.boas-vindas p { color: var(--suave); margin-top: 6px; font-size: 16px; }
.vazio {
  background: var(--cartao); border-radius: 20px; box-shadow: var(--sombra); padding: 48px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
}
.vazio h2 { font-size: 22px; }
.vazio p { color: var(--suave); max-width: 520px; }
.vazio-simbolo {
  width: 76px; height: 76px; border-radius: 22px; background: var(--azul-claro); color: var(--azul);
  display: grid; place-items: center; margin-bottom: 6px;
}
.vazio-simbolo .icone { width: 36px; height: 36px; }

/* ---------- cartões (pastas do topo) ---------- */
.grelha-cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.cartao-pasta {
  --acento: var(--azul); --acento-claro: var(--azul-claro);
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 196px; padding: 20px 22px 18px;
  background: var(--cartao); border-radius: 18px; box-shadow: var(--sombra); color: var(--texto); text-decoration: none;
  border: 1.5px solid transparent; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cartao-pasta:hover { transform: translateY(-3px); box-shadow: var(--sombra-forte); border-color: var(--acento-claro); }
.cartao-pasta:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }
.cartao-pasta h3 { font-size: 19px; margin-top: 10px; }
.cartao-pasta p { color: var(--suave); font-size: 14px; flex: 1; }
.cartao-topo { display: flex; align-items: flex-start; justify-content: space-between; }
.cartao-icone {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--acento-claro); color: var(--acento);
}
.cartao-icone .icone { width: 26px; height: 26px; }
.cartao-rodape { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--suave); padding-top: 12px; border-top: 1px solid var(--linha); }
.cartao-seta { margin-left: auto; color: var(--acento); display: grid; transition: transform .15s; }
.cartao-pasta:hover .cartao-seta { transform: translateX(3px); }
.cor-0 { --acento: #12599a; --acento-claro: #e6f0fa; }
.cor-1 { --acento: #6d4bd8; --acento-claro: #efeafd; }
.cor-2 { --acento: #0f8a8a; --acento-claro: #e0f4f3; }
.cor-3 { --acento: #b26b00; --acento-claro: #fdf1dc; }
.cor-4 { --acento: #c2416b; --acento-claro: #fdeaf0; }
.cor-5 { --acento: #2f855a; --acento-claro: #e5f4ec; }
.cartao-pasta.ano { --acento: #3b5bdb; --acento-claro: #e7ecff; }
.cartao-pasta.privada {
  --acento: #ffffff; --acento-claro: rgba(255, 255, 255, .16);
  background: linear-gradient(140deg, #0f766e 0%, #115e59 100%); color: #fff;
}
.cartao-pasta.privada p, .cartao-pasta.privada .cartao-rodape { color: rgba(255, 255, 255, .82); border-color: rgba(255, 255, 255, .2); }
.cartao-pasta.privada .botao-menu { color: rgba(255, 255, 255, .85); }
.cartao-pasta.privada .botao-menu:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.etiqueta-privada { background: #e0f2ef; color: #0f766e; }
.cartao-pasta.privada .etiqueta-privada { background: rgba(255, 255, 255, .18); color: #fff; }
.cartao-novo {
  min-height: 196px; border: 2px dashed #c4d1e1; border-radius: 18px; background: transparent; color: var(--suave);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
.cartao-novo .icone { width: 30px; height: 30px; }
.cartao-novo:hover { border-color: var(--azul); color: var(--azul); background: rgba(30, 95, 175, .04); }

/* menus «⋮» */
.menu-acoes { justify-self: auto; }
.menu-acoes .menu-lista { min-width: 230px; z-index: 20; }
.menu-acoes .menu-lista button { white-space: nowrap; }
.menu-lista button.perigo { color: var(--vermelho); }
.menu-lista button.perigo:hover { background: #fdecec; }

/* ---------- uma pasta por dentro ---------- */
.migalhas { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--suave); margin-bottom: 16px; }
.migalhas a { display: inline-flex; align-items: center; gap: 6px; color: var(--suave); text-decoration: none; }
.migalhas a:hover { color: var(--azul); }
.migalhas span[aria-current] { color: var(--texto); font-weight: 600; }
.cabecalho-pasta { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.botao-voltar {
  width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--azul); color: #fff; box-shadow: 0 2px 6px rgba(19, 68, 127, .25);
}
.botao-voltar:hover { background: var(--azul-escuro); }
.cabecalho-texto { flex: 1; min-width: 0; }
.cabecalho-texto h1 { font-size: 28px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cabecalho-texto p { color: var(--suave); margin-top: 4px; }
.cabecalho-acoes { display: flex; align-items: center; gap: 8px; }
.lista-pastas { background: var(--cartao); border-radius: 18px; box-shadow: var(--sombra); overflow: visible; margin-bottom: 22px; }
.linha-pasta {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  padding: 14px 18px; color: var(--texto); text-decoration: none; border-bottom: 1px solid var(--linha);
}
.linha-pasta:last-child { border-bottom: 0; }
.linha-pasta:first-child { border-radius: 18px 18px 0 0; }
.linha-pasta:last-child { border-radius: 0 0 18px 18px; }
.linha-pasta:only-child { border-radius: 18px; }
.linha-pasta:hover { background: #f5f8fc; }
.linha-icone { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff4d6; color: #c98a00; }
.linha-icone .icone { fill: #ffd977; }
.linha-nome { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-info { font-size: 13px; color: var(--suave); }
.linha-seta { color: #9aa8b8; display: grid; }
.zona-documentos {
  border: 2px dashed #c4d1e1; border-radius: 18px; padding: 40px 24px; background: rgba(255, 255, 255, .55);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.zona-documentos h2 { font-size: 18px; }
.zona-documentos p { color: var(--suave); max-width: 460px; }
.zona-simbolo { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--azul-claro); color: var(--azul); }
.zona-simbolo .icone { width: 30px; height: 30px; }
.zona-documentos .botao { margin-top: 8px; }

/* ---------- documentos ---------- */
.vista-pasta { position: relative; }
.vista-pasta.a-largar::after {
  content: attr(data-largar); position: absolute; inset: -12px; z-index: 30; border-radius: 22px;
  border: 3px dashed var(--azul); background: rgba(232, 240, 251, .92); color: var(--azul-escuro);
  display: grid; place-items: center; padding: 24px; text-align: center; font-size: 22px; font-weight: 700; pointer-events: none;
}
.documentos { display: flex; flex-direction: column; gap: 12px; }
.documentos-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.documentos-topo h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.contador:not(:empty) {
  font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--azul-claro); color: var(--azul);
}
.nota-tipos { font-size: 13px; color: var(--suave); text-align: center; }
.lista-ficheiros { display: flex; flex-direction: column; gap: 8px; }
.linha-ficheiro {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  background: var(--cartao); border-radius: 14px; box-shadow: var(--sombra); padding: 12px 14px 12px 16px;
}
.ficheiro-icone {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #fff; background: #64748b;
}
.tipo-pdf { background: #d64545; }
.tipo-imagem { background: #7c4dcc; }
.tipo-word { background: #2b6cc4; }
.tipo-excel { background: #1f8a53; }
.tipo-zip { background: #c27c0e; }
.tipo-texto { background: #64748b; }
.ficheiro-texto { display: flex; flex-direction: column; min-width: 0; }
.ficheiro-nome {
  align-self: flex-start; max-width: 100%; padding: 0; border: 0; background: none; text-align: left;
  font-weight: 600; font-size: 15px; color: var(--texto); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ficheiro-nome:hover { color: var(--azul); text-decoration: underline; }
.ficheiro-info { font-size: 13px; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficheiro-acoes { display: flex; align-items: center; gap: 6px; }
.envios { display: flex; flex-direction: column; gap: 8px; }
.envios:empty { display: none; }
.envio {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 10px 10px 10px 14px; border: 1.5px solid var(--azul-claro);
}
.envio .ficheiro-icone { width: 36px; height: 36px; font-size: 10px; }
.envio-texto { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.envio-texto strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envio-barra { height: 6px; border-radius: 999px; background: var(--azul-claro); overflow: hidden; }
.envio-barra-cheia { display: block; height: 100%; width: 0; background: var(--azul); border-radius: 999px; transition: width .2s; }
.envio-estado { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--suave); white-space: nowrap; }
.envio.enviado { border-color: #bfe6d2; }
.envio.enviado .envio-barra-cheia { background: var(--verde); }
.envio.enviado .envio-estado { color: var(--verde); font-weight: 600; }
.envio.com-erro { border-color: #f3c4c4; background: #fff8f8; }
.envio.com-erro .envio-estado { color: var(--vermelho); font-weight: 600; white-space: normal; }
.envio.com-erro .envio-barra { display: none; }

/* recebidos e os meus envios (D21) */
.seccao-envios { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.seccao-envios .documentos-topo { align-items: flex-end; }
.seccao-sub { color: var(--suave); font-size: 14px; margin-top: 2px; }
.recebidos-vazio {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px; border-radius: 14px;
  background: var(--cartao); box-shadow: var(--sombra); color: var(--verde); font-weight: 600;
}
.etiqueta-novo { background: #ffe9d9; color: #c2410c; }
.cartao-pasta.privada .etiqueta-novo { background: #ffe9d9; color: #c2410c; }
.linha-ficheiro.por-ver { box-shadow: inset 4px 0 0 #f97316, var(--sombra); }
.ficheiro-linha-nome { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ficheiro-linha-nome .ficheiro-nome { min-width: 0; }
.ficheiro-linha-nome .etiqueta { flex: none; }
.ficheiro-pasta {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%;
  font-size: 13px; color: var(--azul); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ficheiro-pasta:hover { text-decoration: underline; }
.ficheiro-pasta .icone { flex: none; }

/* ver um documento */
.janela-grande { width: min(1100px, 100%); }
.ver { display: flex; flex-direction: column; }
.ver .janela-botoes { margin-top: 16px; }
.ver-pdf { width: 100%; height: 72vh; border: 0; border-radius: 12px; background: var(--fundo); }
.ver-imagem { display: grid; place-items: center; background: var(--fundo); border-radius: 12px; padding: 10px; }
.ver-imagem img { max-width: 100%; max-height: 72vh; border-radius: 8px; }

/* ---------- contas ---------- */
.cabecalho-vista { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.cabecalho-vista h1 { font-size: 28px; }
.cabecalho-vista p { color: var(--suave); margin-top: 4px; }
.contas { display: flex; flex-direction: column; gap: 10px; }
.conta {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 250px 120px 280px; align-items: center; gap: 16px;
  background: var(--cartao); border-radius: var(--raio); padding: 14px 18px; box-shadow: var(--sombra);
}
.conta .avatar { width: 44px; height: 44px; font-size: 15px; }
.conta.desativada { opacity: .6; }
.conta-quem { display: flex; flex-direction: column; min-width: 0; }
.conta-quem strong { font-size: 16px; }
.conta-quem span { color: var(--suave); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.voce { color: var(--suave); font-weight: 400; font-style: normal; }
.conta-etiquetas { display: flex; gap: 6px; flex-wrap: wrap; }
.conta-acesso { color: var(--suave); font-size: 13px; }
.conta-acoes { display: flex; gap: 8px; justify-content: flex-end; }
.etiqueta { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.etiqueta-cliente { background: var(--azul-claro); color: var(--azul); }
.etiqueta-gabinete { background: #ede7fb; color: #5b3fb5; }
.etiqueta-desativada { background: #eef1f5; color: var(--suave); }
.etiqueta-pendente { background: #fff3d6; color: var(--ambar); }

/* ---------- janelas ---------- */
.janela-fundo {
  position: fixed; inset: 0; z-index: 50; background: rgba(13, 26, 46, .45); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; animation: aparecer .15s ease-out;
}
.janela {
  width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 20px;
  box-shadow: var(--sombra-forte); padding: 24px 28px 28px; animation: subir .18s ease-out;
}
.janela-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.janela-topo h2 { font-size: 21px; }
.janela-texto { color: var(--suave); margin-bottom: 18px; }
.janela-botoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }
.opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcao {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px;
  border: 1.5px solid var(--linha); border-radius: 12px; background: #fff; color: var(--texto);
}
.opcao span { font-size: 13px; color: var(--suave); }
.opcao.escolhida { border-color: var(--azul); background: #f2f7fd; box-shadow: 0 0 0 3px rgba(30, 95, 175, .12); }
.dados-acesso {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; padding: 16px 18px;
  background: var(--fundo); border-radius: 14px;
}
.dados-acesso dt { color: var(--suave); font-size: 14px; }
.dados-acesso dd { margin: 0; font-weight: 600; word-break: break-all; }
.password-mostrada { font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 19px; letter-spacing: .06em; color: var(--azul-escuro); }
.nota { font-size: 13px; color: var(--suave); margin-top: 12px; }

/* ---------- avisos ---------- */
#avisos { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.aviso {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #fff;
  box-shadow: var(--sombra-forte); font-weight: 600; border-left: 4px solid var(--verde); animation: subir .2s ease-out;
  transition: opacity .4s, transform .4s;
}
.aviso .icone { color: var(--verde); }
.aviso-erro { border-left-color: var(--vermelho); }
.aviso-erro .icone { color: var(--vermelho); }
.aviso.a-sair { opacity: 0; transform: translateY(6px); }

/* ---------- ecrãs pequenos ---------- */
@media (max-width: 900px) {
  .entrada-ecra { grid-template-columns: 1fr; background: linear-gradient(160deg, #f4f8fd 0%, #e6eef9 100%); }
  .entrada-lado { display: none; }
  .so-telemovel { display: block; }
  .entrada-icone { display: none; }
  .entrada-cartao { padding: 28px 22px; border-radius: 18px; }
  .topo-dentro { grid-template-columns: 1fr auto; height: auto; padding: 12px 16px; }
  .separadores { grid-column: 1 / -1; order: 3; justify-self: stretch; }
  .separadores-vazio { display: none; }
  .separadores a { flex: 1; justify-content: center; }
  .menu-nome { display: none; }
  .conteudo { padding: 24px 16px 48px; }
  .boas-vindas h1 { font-size: 26px; }
  .grelha-cartoes { grid-template-columns: 1fr; gap: 12px; }
  .cartao-pasta, .cartao-novo { min-height: 0; }
  .cartao-novo { padding: 22px; }
  .cabecalho-pasta { flex-wrap: wrap; }
  .cabecalho-texto h1 { font-size: 23px; }
  .cabecalho-acoes { width: 100%; }
  .cabecalho-acoes .botao { flex: 1; }
  .linha-info { display: none; }
  .so-largo { display: none; }
  .documentos-topo { flex-direction: column; align-items: stretch; }
  .linha-ficheiro { grid-template-columns: auto minmax(0, 1fr); }
  .ficheiro-acoes { grid-column: 1 / -1; justify-content: flex-end; }
  .ficheiro-info { white-space: normal; }
  .ver-pdf { height: 60vh; }
  .cabecalho-vista { flex-direction: column; align-items: stretch; }
  .conta { grid-template-columns: auto minmax(0, 1fr); }
  .conta-etiquetas, .conta-acesso, .conta-acoes { grid-column: 2; }
  .conta-acoes { justify-content: flex-start; flex-wrap: wrap; }
  .opcoes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
