/*
 * PlanejaDEF — aproveitamento global da área útil
 *
 * Páginas do Filament usam 94% da largura útil em desktop/tablet grande.
 * Em telas pequenas, continuam usando 100%.
 *
 * Tabelas:
 * - permitem quebra de linha em textos longos;
 * - permitem quebra das ações em mais de uma linha;
 * - reduzem a necessidade de scrolling horizontal sem esconder informação.
 */

@media (min-width: 768px) {
    .fi-main > .fi-page,
    .fi-main .fi-page {
        width: 94% !important;
        max-width: 94% !important;
        margin-inline: auto !important;
    }
}

@media (max-width: 767px) {
    .fi-main > .fi-page,
    .fi-main .fi-page {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/*
 * Evita que textos de tabelas imponham larguras excessivas.
 * Mantém todo o conteúdo visível por quebra de linha.
 */
.fi-ta-table th,
.fi-ta-table td,
.fi-ta-table .fi-ta-text,
.fi-ta-table .fi-ta-text-item,
.fi-ta-table .fi-ta-text-item-label {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

/*
 * Ações laterais das listagens:
 * permanecem em uma única linha e não se empilham/sobrepõem.
 * Os textos das demais colunas continuam podendo quebrar linha.
 */
.fi-ta-table .fi-ta-actions,
.fi-ta-table .fi-ta-actions-cell > div {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: .55rem !important;
    white-space: nowrap !important;
}

.fi-ta-table .fi-ta-actions-cell {
    width: 1% !important;
    min-width: max-content !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

.fi-ta-table .fi-ta-actions .fi-ac-action,
.fi-ta-table .fi-ta-actions a,
.fi-ta-table .fi-ta-actions button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}



/*
 * PlanejaDEF — acabamento do zebrado NATIVO do Filament.
 *
 * O zebrado em si é habilitado globalmente por:
 * Table::configureUsing(... ->striped())
 *
 * Aqui tratamos apenas o tom e a inversão no hover.
 */
.fi-ta-table tbody tr:nth-child(even) {
    --planejadef-row-bg: #f1f3f5;
}

.fi-ta-table tbody tr:nth-child(odd) {
    --planejadef-row-bg: #ffffff;
}

.fi-ta-table tbody tr:nth-child(even) > td,
.fi-ta-table tbody tr:nth-child(even) .fi-ta-cell {
    background-color: #f1f3f5 !important;
}

.fi-ta-table tbody tr:nth-child(odd) > td,
.fi-ta-table tbody tr:nth-child(odd) .fi-ta-cell {
    background-color: #ffffff !important;
}

/* Hover: branco vira cinza. */
.fi-ta-table tbody tr:nth-child(odd):hover > td,
.fi-ta-table tbody tr:nth-child(odd):hover .fi-ta-cell {
    background-color: #f1f3f5 !important;
}

/* Hover: zebrado vira branco. */
.fi-ta-table tbody tr:nth-child(even):hover > td,
.fi-ta-table tbody tr:nth-child(even):hover .fi-ta-cell {
    background-color: #ffffff !important;
}
