/* assets/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    padding: 30px 25px;
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.empresa {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.info p {
    margin: 8px 0;
    color: #444;
    font-size: 0.95rem;
}

.info i {
    margin-right: 8px;
    color: #007bff;
}

/* Barra de ferramentas horizontal */
.toolbar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-social:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.instagram { background: #E4405F; }
.linkedin  { background: #0077B5; }
.facebook  { background: #1877F2; }
.youtube   { background: #FF0000; }
.google    { background: #EA4335; }
.whatsapp  { background: #25D366; }
.x-twitter { background: #000000; }

/* Botões de ação */
.actions {
    display: flex;
    /* Sem isto, tres botoes numa fila passam da largura do ecra do
       telemovel e a pagina desliza de lado. */
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

@media (max-width: 560px) {
    .actions {
        gap: 9px;
    }

    .actions .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        padding: 10px 8px;
        font-size: 0.82rem;
        justify-content: center;
        text-align: center;
    }
}

/* Verde do WhatsApp (#25D366) e nao o verde do "Baixar Contato" (#28a745):
   sao ambos verdes, mas este e o que se reconhece como WhatsApp. */
.btn-compartilhar {
    background: #25d366;
}

.btn-compartilhar:hover {
    background: #1da851;
}

html[data-tema="escuro"] .btn-compartilhar {
    background: #25d366;
    color: #06301a;
}

html[data-tema="escuro"] .btn-compartilhar:hover {
    background: #1da851;
    color: #ffffff;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
    color: #fff;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-download {
    background: #28a745;
}

.btn-download:hover {
    background: #218838;
}

.btn-lead {
    background: #007bff;
}

.btn-lead:hover {
    background: #0069d9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #1a1a1a;
}

.modal-content label {
    display: block;
    text-align: left;
    margin: 10px 0 5px;
    font-size: 0.9rem;
    color: #555;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
}

.btn-submit {
    margin-top: 15px;
    width: 100%;
    background: #007bff;
    justify-content: center;
}

.btn-submit:hover {
    background: #0069d9;
}

#lead-message {
    margin-top: 10px;
    font-size: 0.9rem;
}

#lead-message.success {
    color: #28a745;
}

#lead-message.error {
    color: #dc3545;
}

.card-footer {
    margin-top: 20px;
    color: #aaa;
    font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════
   Avatar / foto do contato
   O avatar e SEMPRE um elemento de tamanho fixo. A imagem fica
   dentro dele e e cortada (object-fit), nunca distorcida nem
   renderizada na resolucao original.
   ══════════════════════════════════════════════════════════ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    font-weight: 600;
    user-select: none;
    /* tamanho padrao: nunca depende da imagem */
    width: 96px;
    height: 96px;
    line-height: 1;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 50%;
}

/* Caso a classe venha aplicada direto na tag <img> (compatibilidade) */
img.avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    object-position: center;
}

.avatar-card {
    width: 110px;
    height: 110px;
    margin: 0 auto 15px;
    font-size: 2.4rem;
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

img.avatar-card {
    width: 110px;
    height: 110px;
}

.avatar-preview {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

img.avatar-preview {
    width: 96px;
    height: 96px;
}

.avatar-iniciais {
    letter-spacing: 1px;
}

/* Rede de seguranca: nenhuma imagem pode estourar o cartao */
.card img {
    max-width: 100%;
}

/* ══════════════════════════════════════════════════════════
   Paginas de formulario (entrar / editar)
   ══════════════════════════════════════════════════════════ */
body.pagina-form {
    align-items: flex-start;
}

.card-form {
    text-align: left;
    max-width: 520px;
}

.card-largo {
    max-width: 680px;
}

.card-form .card-header {
    text-align: center;
}

.form-perfil fieldset {
    border: 1px solid #e6e9ef;
    border-radius: 12px;
    padding: 15px 18px 18px;
    margin: 0 0 18px;
}

.form-perfil legend {
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #007bff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-perfil label {
    display: block;
    margin: 12px 0 5px;
    font-size: 0.88rem;
    color: #555;
}

.form-perfil input[type=text],
.form-perfil input[type=email],
.form-perfil input[type=tel],
.form-perfil input[type=password],
.form-perfil input[type=file] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-perfil input:focus {
    outline: 2px solid rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.form-perfil input[readonly] {
    background: #f5f6f8;
    color: #777;
}

.checkbox {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.checkbox input {
    width: auto;
}

.dica {
    display: block;
    margin-top: 5px;
    color: #8a94a6;
    font-size: 0.78rem;
}

/* ══════════════════════════════════════════════════════════
   Alertas
   ══════════════════════════════════════════════════════════ */
/* ── Chave PIX ──────────────────────────────────────────────────────── */

.linha-pix {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Botao de copiar: existe porque ninguem decora uma chave PIX, e escreve-la
   a mao e onde se erra. Fica discreto — e um auxiliar, nao uma accao. */
.btn-copiar {
    background: #eef1f6;
    border: 1px solid #dde3ec;
    color: #55617a;
    border-radius: 7px;
    padding: 3px 9px;
    cursor: pointer;
    font-size: .82em;
    line-height: 1.6;
    font-family: inherit;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-copiar:hover  { background: #e2e8f2; color: #33415c; }
.btn-copiar:active { transform: scale(.96); }
.btn-copiar.copiado {
    background: #e6f6ec;
    border-color: #b7e3c6;
    color: #15803d;
}

/* ── Ajuda do atalho no telemovel ───────────────────────────────────── */

.atalho-ajuda {
    background: #eef4ff;
    border: 1px solid #cfe0ff;
    border-radius: 10px;
    padding: 13px 16px;
    margin: 0 0 18px;
    font-size: 0.88rem;
    color: #22364f;
    line-height: 1.5;
}

.atalho-ajuda[hidden] { display: none; }

.atalho-ajuda ol {
    margin: 9px 0 8px;
    padding-left: 22px;
}

.atalho-ajuda li { margin-bottom: 4px; }

.atalho-ajuda small { color: #5b7089; }

html[data-tema="escuro"] .atalho-ajuda {
    background: #17293d;
    border-color: #26456b;
    color: #cfe0f5;
}

html[data-tema="escuro"] .atalho-ajuda small { color: #8fa6bd; }

/* ── Accoes do endereco gerado ──────────────────────────────────────── */

.acoes-url {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.acoes-url[hidden] { display: none; }

html[data-tema="escuro"] .btn-copiar {
    background: #1f2937; border-color: #2a3644; color: #9fb0c4;
}
html[data-tema="escuro"] .btn-copiar:hover { background: #26334a; color: #e2e8f0; }
html[data-tema="escuro"] .btn-copiar.copiado {
    background: #14351f; border-color: #1f5c36; color: #6ee7a0;
}

/* ── Marca (logo) ───────────────────────────────────────────────────── */

/* Fica no canto oposto ao botao de tema, para nao competir com ele.
   `pointer-events: none` porque e decorativa: nao deve interceptar cliques
   em nada que esteja por baixo. */
.marca-logo {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 36px;
    height: 36px;
    opacity: .82;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity .15s;
}

/* O logo e PRETO. Num fundo escuro desaparecia por completo — por isso se
   inverte. E a razao de o ficheiro ser um PNG com transparencia: o mesmo
   desenho serve nos dois temas, sem precisar de duas imagens. */
html[data-tema="escuro"] .marca-logo {
    filter: invert(1);
    opacity: .78;
}

@media (max-width: 480px) {
    .marca-logo { width: 28px; height: 28px; top: 12px; left: 12px; }
}

.alerta {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin: 0 0 16px;
}

.alerta-erro { background: #fdecec; color: #b32020; border: 1px solid #f5c2c2; }
.alerta-ok   { background: #e9f7ee; color: #1c7c3c; border: 1px solid #b9e4c8; }
.alerta-info { background: #eaf3fe; color: #14589c; border: 1px solid #bcd9f7; }

/* ══════════════════════════════════════════════════════════
   Editor de foto e acoes do topo
   ══════════════════════════════════════════════════════════ */
.foto-editor {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.foto-controles {
    flex: 1;
    min-width: 220px;
}

.acoes-topo {
    display: flex;
    /* SEM isto, seis botoes ficam numa fila unica mais larga do que o ecra
       do telemovel, e a pagina passa a deslizar de lado. */
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

/* No telemovel os botoes secundarios encolhem e ficam dois por linha.
   `min-width: 0` e necessario: sem ele um item flex recusa encolher abaixo
   da largura do proprio conteudo, e "Cadastrar etiquetas" continuaria a
   empurrar. */
@media (max-width: 560px) {
    .acoes-topo {
        gap: 7px;
    }

    .acoes-topo .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 9px 8px;
        font-size: 0.79rem;
        justify-content: center;
        text-align: center;
    }
}

.btn-secundario {
    background: #eef1f6;
    color: #33415c;
    font-size: 0.85rem;
    padding: 9px 14px;
}

.btn-secundario:hover {
    background: #e2e7f0;
}

.card-footer a {
    color: #8a94a6;
}

.link-editar {
    display: block;
    margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════
   BOTAO PINTEREST
   ══════════════════════════════════════════════════════════ */
.pinterest { background: #E60023; }

/* ══════════════════════════════════════════════════════════
   ALTERNADOR DE TEMA
   ══════════════════════════════════════════════════════════ */
.btn-tema {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #dddddd;
    background: #ffffff;
    color: #33415c;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-tema:hover {
    transform: scale(1.1);
}

.btn-tema:focus-visible {
    outline: 3px solid rgba(0, 123, 255, 0.45);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   TEMA ESCURO (fundo preto)
   Ativado por <html data-tema="escuro">, gravado no navegador.
   Usa seletores mais especificos para vencer o tema claro.
   ══════════════════════════════════════════════════════════ */
html[data-tema="escuro"] body {
    background: linear-gradient(135deg, #000000 0%, #0e1620 100%);
    color: #e8eef5;
}

html[data-tema="escuro"] .card {
    background: #151d27;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

html[data-tema="escuro"] .card-header h1 {
    color: #f4f7fa;
}

html[data-tema="escuro"] .empresa {
    color: #9fb0c2;
}

html[data-tema="escuro"] .info p {
    color: #cfdae6;
}

html[data-tema="escuro"] .info i {
    color: #5aa9ff;
}

html[data-tema="escuro"] .info a {
    color: #5aa9ff;
}

/* Modal */
html[data-tema="escuro"] .modal {
    background-color: rgba(0, 0, 0, 0.78);
}

html[data-tema="escuro"] .modal-content {
    background: #1b242f;
    color: #e8eef5;
}

html[data-tema="escuro"] .modal-content h2 {
    color: #f4f7fa;
}

html[data-tema="escuro"] .modal-content label {
    color: #9fb0c2;
}

html[data-tema="escuro"] .modal-content input {
    background: #131b24;
    border-color: #2e3a48;
    color: #e8eef5;
}

html[data-tema="escuro"] .close {
    color: #8494a6;
}

html[data-tema="escuro"] .close:hover {
    color: #e8eef5;
}

/* Formularios */
html[data-tema="escuro"] .form-perfil fieldset {
    border-color: #2a3644;
}

html[data-tema="escuro"] .form-perfil legend {
    color: #5aa9ff;
}

html[data-tema="escuro"] .form-perfil label {
    color: #9fb0c2;
}

html[data-tema="escuro"] .form-perfil input[type=text],
html[data-tema="escuro"] .form-perfil input[type=email],
html[data-tema="escuro"] .form-perfil input[type=tel],
html[data-tema="escuro"] .form-perfil input[type=password],
html[data-tema="escuro"] .form-perfil input[type=file] {
    background: #131b24;
    border-color: #2e3a48;
    color: #e8eef5;
}

html[data-tema="escuro"] .form-perfil input:focus {
    outline-color: rgba(90, 169, 255, 0.35);
    border-color: #5aa9ff;
}

html[data-tema="escuro"] .form-perfil input[readonly] {
    background: #10171f;
    color: #788898;
}

html[data-tema="escuro"] .dica {
    color: #8494a6;
}

html[data-tema="escuro"] .btn-secundario {
    background: #26313e;
    color: #dbe3ec;
}

html[data-tema="escuro"] .btn-secundario:hover {
    background: #2f3c4b;
}

/* Alertas: fundo escuro com texto claro, mantendo o significado */
html[data-tema="escuro"] .alerta-erro {
    background: #3a1d1d;
    color: #ffb3b3;
    border-color: #5c2b2b;
}

html[data-tema="escuro"] .alerta-ok {
    background: #17301f;
    color: #9be3b4;
    border-color: #24512f;
}

html[data-tema="escuro"] .alerta-info {
    background: #17293d;
    color: #a9cdf5;
    border-color: #26456b;
}

/* Rodape */
html[data-tema="escuro"] .card-footer {
    color: #7d8a99;
}

html[data-tema="escuro"] .card-footer a {
    color: #8494a6;
}

/* Botao do tema no modo escuro */
html[data-tema="escuro"] .btn-tema {
    background: #1b242f;
    border-color: #2e3a48;
    color: #ffd166;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

/* ══════════════════════════════════════════════════════════
   Cadastro de etiquetas NFC (Web NFC) — area do administrador
   ══════════════════════════════════════════════════════════ */

.passos {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}

.passos .passo-num {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 99px;
    background: #eef1f6;
    color: #8a94a6;
    font-size: 0.78rem;
    font-weight: 600;
}

.passos .passo-num.ativo {
    background: #eaf3fe;
    color: #14589c;
}

.passos .passo-num.feito {
    background: #e9f7ee;
    color: #1c7c3c;
}

/* Bloco de cada etapa; so a etapa atual fica visivel */
.etapa[hidden] {
    display: none;
}

/* .alerta, .dica e .btn definem display, o que anularia o atributo hidden.
   Sem isto, elementos marcados como escondidos continuariam visiveis. */
.alerta[hidden],
.dica[hidden],
.btn[hidden],
.nfc-url[hidden] {
    display: none;
}

.nfc-alvo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 26px 16px;
    border: 2px dashed #cfd8e3;
    border-radius: 16px;
    margin-bottom: 18px;
}

.nfc-alvo i {
    font-size: 2.6rem;
    color: #007bff;
}

.nfc-alvo.a-ler {
    border-color: #007bff;
    animation: nfc-pulso 1.4s ease-in-out infinite;
}

@keyframes nfc-pulso {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.28); }
    50%      { box-shadow: 0 0 0 14px rgba(0, 123, 255, 0); }
}

/* Respeita quem pediu menos animacao no sistema */
@media (prefers-reduced-motion: reduce) {
    .nfc-alvo.a-ler { animation: none; }
}

.nfc-uid {
    display: inline-block;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 1rem;
    letter-spacing: 1px;
    background: #f4f6fa;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    padding: 9px 14px;
    color: #33415c;
    word-break: break-all;
}

.nfc-url {
    display: block;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    background: #f4f6fa;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    padding: 11px 13px;
    color: #33415c;
    text-align: left;
    word-break: break-all;
    margin: 8px 0 4px;
}

.btn-grande {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
    font-size: 1.02rem;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.rodape-etiquetas {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eef1f6;
    font-size: 0.8rem;
    color: #8a94a6;
    text-align: left;
}

.rodape-etiquetas code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    background: #f4f6fa;
    padding: 1px 5px;
    border-radius: 5px;
    color: #33415c;
}

/* Tema escuro dos elementos novos */
html[data-tema="escuro"] .passos .passo-num {
    background: #26313e;
    color: #8494a6;
}

html[data-tema="escuro"] .passos .passo-num.ativo {
    background: #17293d;
    color: #a9cdf5;
}

html[data-tema="escuro"] .passos .passo-num.feito {
    background: #17301f;
    color: #9be3b4;
}

html[data-tema="escuro"] .nfc-alvo {
    border-color: #2e3a48;
}

html[data-tema="escuro"] .nfc-alvo i {
    color: #5aa9ff;
}

html[data-tema="escuro"] .nfc-alvo.a-ler {
    border-color: #5aa9ff;
}

html[data-tema="escuro"] .nfc-uid,
html[data-tema="escuro"] .nfc-url {
    background: #131b24;
    border-color: #2e3a48;
    color: #cfdae6;
}

html[data-tema="escuro"] .rodape-etiquetas {
    border-top-color: #2a3644;
    color: #8494a6;
}

html[data-tema="escuro"] .rodape-etiquetas code {
    background: #131b24;
    color: #cfdae6;
}

@keyframes nfc-pulso-escuro {
    0%, 100% { box-shadow: 0 0 0 0 rgba(90, 169, 255, 0.3); }
    50%      { box-shadow: 0 0 0 14px rgba(90, 169, 255, 0); }
}

html[data-tema="escuro"] .nfc-alvo.a-ler {
    animation-name: nfc-pulso-escuro;
}

/* ══════════════════════════════════════════════════════════
   Listagem de pessoas — area do administrador
   ══════════════════════════════════════════════════════════ */

.card-tabela {
    max-width: 1200px;
    text-align: left;
}

.card-tabela .card-header {
    text-align: center;
}

.resumo {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.resumo .item {
    background: #f4f6fa;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 0.8rem;
    color: #55617a;
}

.resumo .item strong {
    color: #007bff;
    font-size: 0.95rem;
}

.filtros {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.filtros input[type="search"] {
    flex: 1 1 230px;
    max-width: 330px;
    padding: 11px 13px;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #33415c;
}

.filtros input[type="search"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

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

.aba {
    padding: 9px 14px;
    border-radius: 9px;
    background: #eef1f6;
    color: #33415c;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.aba:hover {
    background: #e2e7f0;
}

.aba.ativa {
    background: #007bff;
    color: #fff;
}

.tabela-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eef1f6;
    border-radius: 12px;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.tabela th {
    background: #f4f6fa;
    color: #55617a;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 11px 12px;
    border-bottom: 1px solid #e6e9ef;
    white-space: nowrap;
}

.tabela td {
    padding: 11px 12px;
    border-bottom: 1px solid #f2f5f9;
    color: #33415c;
    vertical-align: top;
}

.tabela tbody tr:last-child td {
    border-bottom: none;
}

.tabela tbody tr:hover td {
    background: #fafbfd;
}

.tabela .num {
    color: #98a3b4;
    font-size: 0.78rem;
    white-space: nowrap;
}

.tabela .mono {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.75rem;
    word-break: break-all;
    color: #55617a;
}

.tabela .vazio {
    color: #b6bfcc;
    font-style: italic;
}

.pilha {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pilha span {
    white-space: nowrap;
}

.selo {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.selo-ativo  { background: #e9f7ee; color: #1c7c3c; }
.selo-branco { background: #fdf3e3; color: #96690f; }
.selo-admin  { background: #eaf3fe; color: #14589c; }
.selo-senha  { background: #eef1f6; color: #55617a; }

.acoes-linha {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.acoes-linha a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.8rem;
}

.acoes-linha a:hover {
    text-decoration: underline;
}

.sem-resultado {
    padding: 40px 12px;
    text-align: center;
    color: #8a94a6;
    font-size: 0.9rem;
}

.nota-rodape {
    margin-top: 18px;
    font-size: 0.78rem;
    color: #8a94a6;
    text-align: center;
}

/* Tema escuro da listagem */
html[data-tema="escuro"] .resumo .item {
    background: #131b24;
    border-color: #2e3a48;
    color: #9fb0c2;
}

html[data-tema="escuro"] .resumo .item strong {
    color: #5aa9ff;
}

html[data-tema="escuro"] .filtros input[type="search"] {
    background: #131b24;
    border-color: #2e3a48;
    color: #e8eef5;
}

html[data-tema="escuro"] .aba {
    background: #26313e;
    color: #dbe3ec;
}

html[data-tema="escuro"] .aba:hover {
    background: #2f3c4b;
}

html[data-tema="escuro"] .aba.ativa {
    background: #007bff;
    color: #fff;
}

html[data-tema="escuro"] .tabela-wrap {
    border-color: #2a3644;
}

html[data-tema="escuro"] .tabela th {
    background: #131b24;
    color: #9fb0c2;
    border-bottom-color: #2e3a48;
}

html[data-tema="escuro"] .tabela td {
    border-bottom-color: #1f2937;
    color: #cfdae6;
}

html[data-tema="escuro"] .tabela tbody tr:hover td {
    background: #1a232e;
}

html[data-tema="escuro"] .tabela .num {
    color: #788898;
}

html[data-tema="escuro"] .tabela .mono {
    color: #9fb0c2;
}

html[data-tema="escuro"] .tabela .vazio {
    color: #66788c;
}

html[data-tema="escuro"] .acoes-linha a {
    color: #5aa9ff;
}

html[data-tema="escuro"] .sem-resultado,
html[data-tema="escuro"] .nota-rodape {
    color: #8494a6;
}

html[data-tema="escuro"] .selo-ativo  { background: #17301f; color: #9be3b4; }
html[data-tema="escuro"] .selo-branco { background: #3a2f14; color: #f0cc7a; }
html[data-tema="escuro"] .selo-admin  { background: #17293d; color: #a9cdf5; }
html[data-tema="escuro"] .selo-senha  { background: #26313e; color: #9fb0c2; }

/* Botao pequeno de acao dentro da tabela */
.btn-mini {
    padding: 5px 10px;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    background: #f4f6fa;
    color: #33415c;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini:hover {
    background: #e8edf5;
    border-color: #c6d0de;
}

.btn-mini.perigo {
    background: #fdecec;
    border-color: #f5c2c2;
    color: #b32020;
}

.btn-mini.perigo:hover {
    background: #f9dcdc;
}

html[data-tema="escuro"] .btn-mini {
    background: #26313e;
    border-color: #2e3a48;
    color: #dbe3ec;
}

html[data-tema="escuro"] .btn-mini:hover {
    background: #2f3c4b;
}

html[data-tema="escuro"] .btn-mini.perigo {
    background: #3a1d1d;
    border-color: #5c2b2b;
    color: #ffb3b3;
}

html[data-tema="escuro"] .btn-mini.perigo:hover {
    background: #472222;
}


/* ── Logo dentro do avatar ──────────────────────────────────────────── */

/* O avatar tem fundo azul e conteudo branco. O logo e preto: sobre o azul
   ficaria quase invisivel. `brightness(0)` forca tudo a preto e `invert(1)`
   passa a branco puro — assim o resultado nao depende da cor do ficheiro,
   e trocar o logo nao obriga a mexer aqui. */
.avatar-logo img {
    width: 58%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

/* Na pre-visualizacao do editor o avatar e maior; o logo acompanha. */
.avatar-preview.avatar-logo img {
    width: 52%;
}
