/* Visualizador de arquivos do GED (VisualizadorArquivoGed.razor). Global porque o <dialog> é desenhado pelo ModalPadrao. */
dialog.modal-sistema.modal-previa-ged {
    width: min(100vw - 1.5rem, 90rem);
}

dialog.modal-sistema.modal-previa-ged .modal-sistema__cartao {
    height: calc(100vh - 2rem);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

dialog.modal-sistema.modal-previa-ged .modal-sistema__corpo {
    display: block;
    max-height: none;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.previa-ged {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: 100%;
    min-height: 0;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
}

.previa-ged__centro {
    display: grid;
    flex: 1 1 auto;
    place-content: center;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    color: var(--cor-texto-secundario);
    text-align: center;
}

.previa-ged__centro h3,
.previa-ged__centro p {
    margin: 0;
}

.previa-ged__centro h3 {
    color: var(--cor-texto);
    font-size: 1.05rem;
}

.previa-ged__centro p {
    max-width: 30rem;
    line-height: 1.45;
}

.previa-ged__centro--alerta {
    color: var(--cor-alerta, #b45309);
}

.previa-ged__icone-grande {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 1.4rem;
    background: var(--cor-fundo-secundario);
}

.previa-ged__giro {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--cor-borda);
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: previa-ged-giro 0.8s linear infinite;
}

@keyframes previa-ged-giro {
    to {
        transform: rotate(360deg);
    }
}

.previa-ged__midia {
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    min-height: 0;
    overflow: auto;
}

.previa-ged__midia img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.previa-ged__midia--audio {
    align-content: center;
}

.previa-ged__pdf {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
    background: #fff;
}

.previa-ged__nota {
    margin: 0;
    color: var(--cor-texto-secundario);
    font-size: 0.8rem;
}

.previa-ged__texto {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0.85rem 1rem;
    overflow: auto;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
    background: var(--cor-fundo-secundario);
    color: var(--cor-texto);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
}

.previa-ged__busca {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--cor-borda);
    border-radius: 999px;
    background: var(--cor-superficie-elevada, var(--cor-superficie));
    color: var(--cor-texto-secundario);
}

.previa-ged__busca input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--cor-texto);
    font: inherit;
}

.previa-ged__tabela {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
}

.previa-ged__linha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem 10rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid color-mix(in srgb, var(--cor-borda) 60%, transparent);
    font-size: 0.82rem;
}

.previa-ged__linha:last-child {
    border-bottom: 0;
}

.previa-ged__linha--cabecalho {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--cor-fundo-secundario);
    color: var(--cor-texto-secundario);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.previa-ged__nome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.previa-ged__nome > span:not([title]) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .previa-ged__linha {
        grid-template-columns: minmax(0, 1fr) 5rem;
    }

    .previa-ged__linha > span:nth-child(3) {
        display: none;
    }
}
