/* ================================================================
   PADRÃO DO SITE (03/11/2026) — carregado por último em todas as páginas.
   Reúne o que é comum às telas: cores de referência, avisos (toasts),
   caixa de confirmação e botões das janelas. Cada área (lista, formulário,
   detalhes...) segue com o próprio CSS; aqui fica só o que tem de ser igual.
   Referência de cor = visual "escuro com cores" (o mesmo do app: tefra_ui.dart).
================================================================ */
:root {
    --tf-card: #0E2E66;
    --tf-interno: #0A285C;
    --tf-hover: #143A7C;
    --tf-borda: rgba(255, 255, 255, 0.08);
    --tf-acento: #00AEEF;
    --tf-acento-escuro: #0098E9;
    --tf-sobre-acento: #00122E;   /* texto escuro sobre o azul-claro */
    --tf-texto: #F4F7FC;
    --tf-texto-suave: #A9B6CF;
    --tf-perigo: #FF786E;
    --tf-ok: #46CD6E;
    --tf-raio: 18px;
    --tf-fundo-janela: rgba(0, 10, 30, 0.62);
    --tf-sombra-janela: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* ===== JANELAS (confirmação, filtros, anexar...) ===== */
.tf-fundo {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--tf-fundo-janela);
    font-family: Helvetica, Arial, sans-serif;
    animation: tf-fundo 0.18s ease;
}

.tf-popup {
    width: min(440px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 24px 20px;
    border: 1px solid var(--tf-borda);
    border-radius: 20px;
    background: var(--tf-card);
    color: var(--tf-texto);
    text-align: left;
    box-shadow: var(--tf-sombra-janela);
    animation: tf-entra 0.2s ease;
}

.tf-popup:focus {
    outline: none;
}

.tf-popup h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tf-popup p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--tf-texto-suave);
    white-space: pre-line;
}

.tf-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

@keyframes tf-fundo {
    from { opacity: 0; }
}

@keyframes tf-entra {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

/* ===== BOTÕES DAS JANELAS (azul liso, texto escuro) ===== */
.tf-btn {
    min-height: 46px;
    padding: 0 20px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tf-btn:focus-visible {
    outline: 2px solid var(--tf-texto);
    outline-offset: 2px;
}

.tf-btn-primario {
    background: var(--tf-acento);
    color: var(--tf-sobre-acento);
}

.tf-btn-primario:hover {
    background: var(--tf-acento-escuro);
}

.tf-btn-contorno {
    background: transparent;
    border-color: var(--tf-acento);
    color: var(--tf-acento);
}

.tf-btn-contorno:hover {
    background: rgba(0, 174, 239, 0.12);
}

.tf-btn-perigo {
    background: var(--tf-perigo);
    color: var(--tf-sobre-acento);
}

.tf-btn-perigo:hover {
    background: #FF8F86;
}

/* ===== AVISOS (no lugar do alert do navegador) ===== */
.tf-avisos {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 4000;
    transform: translateX(-50%);
    width: min(440px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.tf-aviso {
    position: relative;
    text-align: left;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 16px 14px;
    border: 1px solid var(--tf-borda);
    border-radius: 16px;
    background: var(--tf-card);
    color: var(--tf-texto);
    font-family: Helvetica, Arial, sans-serif;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: tf-aviso 0.22s ease;
}

.tf-aviso.ok { --cor: var(--tf-ok); }
.tf-aviso.erro { --cor: var(--tf-perigo); }
.tf-aviso.info { --cor: var(--tf-acento); }

.tf-aviso-icone {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--cor) 18%, transparent);
    color: var(--cor);
}

.tf-aviso-icone svg {
    width: 20px;
    height: 20px;
}

.tf-aviso-texto {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
}

.tf-aviso-texto b {
    font-size: 15px;
    font-weight: 700;
}

.tf-aviso-texto span {
    font-size: 14px;
    line-height: 1.4;
    color: var(--tf-texto-suave);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.tf-aviso-fechar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tf-texto-suave);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tf-aviso-fechar:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--tf-texto);
}

.tf-aviso-fechar:focus-visible {
    outline: 2px solid var(--tf-texto);
    outline-offset: 1px;
}

.tf-aviso-fechar svg {
    width: 16px;
    height: 16px;
}

/* Barrinha que mostra o tempo até o aviso sair; o mouse em cima pausa */
.tf-aviso-barra {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--cor);
    transform-origin: left center;
    animation: tf-barra var(--dur, 4500ms) linear forwards;
}

.tf-aviso:hover .tf-aviso-barra {
    animation-play-state: paused;
}

.tf-aviso.saindo {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes tf-aviso {
    from { opacity: 0; transform: translateY(12px); }
}

@keyframes tf-barra {
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .tf-fundo,
    .tf-popup,
    .tf-aviso {
        animation: none;
    }

    /* A barrinha continua: é ela que fecha o aviso */
    .tf-aviso-barra {
        animation: tf-barra var(--dur, 4500ms) linear forwards;
    }
}

/* ===== MESMA PELÍCULA ESCURA EM TODAS AS JANELAS ===== */
.date-modal,
.ag-modal,
.checklist-modal,
.cn-modal,
.dx-fundo,
.md-modal:not(.md-foto-modal) {
    background: var(--tf-fundo-janela);
}

.date-modal-content,
.ag-modal-caixa,
.checklist-modal-box,
.cn-modal-caixa,
.dx-modal,
.md-modal-caixa {
    box-shadow: var(--tf-sombra-janela);
}

/* ================================================================
   BOTÕES PARA ANEXAR (formulários e detalhes)
   Um cartão tracejado com ícone, o que fazer e uma linha de ajuda
   (o texto de ajuda vem do atributo data-dica do botão).
================================================================ */
.fm-anexar,
.tf-anexar {
    --anx: var(--fm-acento, var(--tf-acento));
    align-self: stretch;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    row-gap: 1px;
    width: 100%;
    height: auto;
    min-height: 68px;
    padding: 12px 18px 12px 14px;
    border: 1.5px dashed color-mix(in srgb, var(--anx) 65%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--anx) 7%, transparent);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.fm-anexar:hover,
.tf-anexar:hover {
    border-color: var(--anx);
    background: color-mix(in srgb, var(--anx) 15%, transparent);
}

.fm-anexar:focus-visible,
.tf-anexar:focus-visible {
    outline: 2px solid var(--tf-texto);
    outline-offset: 2px;
}

/* Ícone num círculo na cor do botão */
.fm-anexar > img,
.tf-anexar > img,
.fm-anexar > svg,
.tf-anexar > svg {
    grid-row: 1 / 3;
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 11px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--anx) 20%, transparent);
}

.fm-anexar > svg,
.tf-anexar > svg {
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 11px;
    color: var(--anx);
}

.tf-anexar > svg {
    stroke-width: 2.2;
}

.fm-anexar > span,
.tf-anexar > span {
    align-self: end;
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-texto);
}

.fm-anexar[data-dica]::after,
.tf-anexar[data-dica]::after {
    content: attr(data-dica);
    grid-column: 2;
    align-self: start;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--tf-texto-suave);
}

.fm-anexar:not([data-dica]) > span,
.tf-anexar:not([data-dica]) > span {
    grid-row: 1 / 3;
    align-self: center;
}

/* Dois jeitos de anexar lado a lado (Nova manutenção) */
.fm-anexar-opcoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

@media (max-width: 600px) {
    .fm-anexar,
    .tf-anexar {
        min-height: 64px;
    }
}

.fm-anexar:disabled,
.tf-anexar:disabled {
    opacity: 0.6;
    cursor: default;
}
