﻿/* =========================================================
   DMB FinCore - Módulo Financeiro
   Estilos exclusivos das telas financeiras.

   O padrão geral de cores, fonte, botões e layout principal
   continua vindo do app.css.
   ========================================================= */

/* Página */

.finance-page {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

/* Cabeçalho da tela */

.finance-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

    .finance-page-header h1 {
        margin: 0;
        color: var(--fincore-navy);
        font-size: clamp(2rem, 3vw, 3rem);
        font-weight: 900;
        line-height: 1;
    }

    .finance-page-header p {
        margin: 0.65rem 0 0;
        color: var(--fincore-muted);
        font-size: 1.05rem;
        line-height: 1.45;
    }

.finance-page-header-compact {
    margin-bottom: 1rem;
}

    .finance-page-header-compact h1 {
        margin-bottom: 0.25rem;
    }

/* Cards de resumo */

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.finance-summary-card {
    min-height: 82px;
    padding: 0.95rem 1rem;
    align-items: center;
}

    .finance-summary-card .summary-icon {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        font-size: 1.25rem;
    }

.summary-content {
    gap: 0.08rem;
}

    .summary-content span {
        font-size: 0.86rem;
    }

    .summary-content strong {
        color: var(--fincore-navy);
        font-size: clamp(1.18rem, 1.5vw, 1.48rem);
        font-weight: 900;
        line-height: 1.05;
    }

    .summary-content small {
        font-size: 0.78rem;
        line-height: 1.25;
    }

/* Filtros */

.finance-filters-card {
    background: var(--fincore-white);
    border: 1px solid var(--fincore-border);
    border-radius: 18px;
    box-shadow: var(--fincore-shadow);
    padding: 1.1rem;
}

.finance-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.25fr auto;
    gap: 0.9rem;
    align-items: end;
}

.finance-filter-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

    .finance-filter-actions .secondary-button,
    .finance-filter-actions .primary-button {
        min-height: 52px;
        white-space: nowrap;
    }

/* Tabela */

.finance-table-card {
    overflow: visible;
}

.finance-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
}

    .finance-table-header > div:first-child {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .finance-table-header h2 {
        margin: 0;
        color: var(--fincore-navy);
        font-size: 1.6rem;
        font-weight: 900;
    }

    .finance-table-header span {
        display: block;
        margin-top: 0.25rem;
        color: var(--fincore-muted);
        font-weight: 800;
    }

/* Botões do card de movimentações */

.finance-table-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

    .finance-table-actions .primary-button,
    .finance-table-actions a.primary-button,
    .finance-table-actions button.primary-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 0;
        min-height: 46px;
        padding: 0 1.15rem;
        border: none;
        border-radius: 0.75rem;
        background: var(--fincore-blue);
        color: #ffffff;
        font-weight: 800;
        white-space: nowrap;
        text-decoration: none;
        cursor: pointer;
    }

    .finance-table-actions a {
        color: #ffffff;
        text-decoration: none;
    }

/* Área responsiva da tabela */

.finance-responsive-table {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.finance-table {
    width: 100%;
    table-layout: fixed;
}

    .finance-table th,
    .finance-table td {
        vertical-align: middle;
    }

        .finance-table th:nth-child(1),
        .finance-table td:nth-child(1) {
            width: 120px;
        }

        .finance-table th:nth-child(2),
        .finance-table td:nth-child(2) {
            width: 28%;
        }

        .finance-table th:nth-child(3),
        .finance-table td:nth-child(3) {
            width: 140px;
        }

        .finance-table th:nth-child(4),
        .finance-table td:nth-child(4) {
            width: 180px;
        }

        .finance-table th:nth-child(5),
        .finance-table td:nth-child(5) {
            width: 150px;
        }

        .finance-table th:nth-child(6),
        .finance-table td:nth-child(6) {
            width: 150px;
        }

        .finance-table th:nth-child(7),
        .finance-table td:nth-child(7) {
            width: 140px;
        }

        .finance-table th:nth-child(8),
        .finance-table td:nth-child(8) {
            width: 88px;
        }

.finance-dashboard-table {
    min-width: 980px;
}

.date-cell {
    white-space: nowrap;
}

.account-cell {
    word-break: normal;
    overflow-wrap: anywhere;
}

.center-cell {
    text-align: center;
}

.money-cell {
    text-align: right;
    white-space: nowrap;
}

.finance-description-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .finance-description-cell strong {
        color: var(--fincore-navy);
        font-weight: 900;
        line-height: 1.25;
    }

    .finance-description-cell span {
        color: var(--fincore-muted);
        font-size: 0.92rem;
        line-height: 1.35;
    }

/* Etiquetas de tipo */

.finance-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.9rem;
}

    .finance-type-pill.entrada {
        color: #047857;
        background: #d1fae5;
    }

    .finance-type-pill.saida {
        color: #b91c1c;
        background: #fee2e2;
    }

    .finance-type-pill.transferencia {
        color: #1d4ed8;
        background: #dbeafe;
    }

/* Valores */

.value-positive {
    color: #047857;
}

.value-negative {
    color: #dc2626;
}

/* Status */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 900;
}

    .status-pill.active {
        color: #047857;
        background: #d1fae5;
    }

    .status-pill.pending {
        color: #b45309;
        background: #fef3c7;
    }

    .status-pill.inactive {
        color: #64748b;
        background: #e2e8f0;
    }

/* Estado vazio */

.empty-table-message {
    padding: 2rem;
    text-align: center;
    color: var(--fincore-muted);
    font-weight: 800;
}

/* Menu de ações */

.actions-cell {
    position: relative;
    overflow: visible;
    text-align: center;
}

.actions-menu {
    position: relative;
    display: inline-flex;
    justify-content: center;
}

    .actions-menu summary {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        border: 1px solid #dbe4f0;
        background: #ffffff;
        color: var(--fincore-navy);
        font-size: 1.35rem;
        font-weight: 900;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        list-style: none;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    }

        .actions-menu summary::-webkit-details-marker {
            display: none;
        }

    .actions-menu[open] summary {
        border-color: var(--fincore-blue);
        color: var(--fincore-blue);
        background: #ffffff;
    }

.actions-menu-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 9999;
    min-width: 190px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

    .actions-menu-content button {
        width: 100%;
        border: none;
        background: transparent;
        color: var(--fincore-navy);
        font-size: 0.92rem;
        font-weight: 700;
        text-align: left;
        padding: 10px 12px;
        border-radius: 10px;
        cursor: pointer;
        white-space: nowrap;
    }

        .actions-menu-content button:hover {
            background: #f1f5f9;
        }

        .actions-menu-content button.danger {
            color: #dc2626;
            border-top: 1px solid #eef2f7;
            margin-top: 4px;
            padding-top: 12px;
        }

            .actions-menu-content button.danger:hover {
                background: #fef2f2;
            }

/* Paginação */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

    .pagination button {
        min-width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 1px solid var(--fincore-border);
        background: #ffffff;
        color: var(--fincore-navy);
        cursor: pointer;
        font-weight: 700;
    }

        .pagination button.active {
            background: var(--fincore-blue);
            color: #ffffff;
            border-color: var(--fincore-blue);
        }

        .pagination button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

/* Campos obrigatórios */

.required-mark {
    color: #dc2626;
    font-weight: 800;
}

/* Área futura para lote de pagamento */

.finance-lot-card {
    background: var(--fincore-white);
    border: 1px solid var(--fincore-border);
    border-radius: 18px;
    box-shadow: var(--fincore-shadow);
    padding: 1.25rem;
}

    .finance-lot-card h2 {
        margin: 0 0 0.35rem;
        color: var(--fincore-navy);
        font-size: 1.45rem;
        font-weight: 900;
    }

    .finance-lot-card p {
        margin: 0;
        color: var(--fincore-muted);
        line-height: 1.45;
    }

/* Responsividade */

@media (max-width: 1320px) {
    .finance-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-filter-actions {
        justify-content: stretch;
    }

        .finance-filter-actions .secondary-button,
        .finance-filter-actions .primary-button {
            width: 100%;
        }

    .finance-table {
        min-width: 1120px;
    }

    .finance-dashboard-table {
        min-width: 980px;
    }
}

@media (max-width: 1100px) {
    .finance-table-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .finance-table-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 1024px) {
    .finance-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .finance-page {
        gap: 1rem;
    }

    .finance-page-header h1 {
        font-size: 2rem;
    }

    .finance-page-header p {
        font-size: 0.98rem;
    }

    .finance-filter-grid {
        grid-template-columns: 1fr;
    }

    .finance-summary-grid {
        grid-template-columns: 1fr;
    }

    .finance-summary-card {
        min-height: 78px;
    }

    .finance-table-header {
        align-items: stretch;
    }

    .finance-table-actions {
        flex-direction: column !important;
        align-items: stretch;
    }

        .finance-table-actions .primary-button,
        .finance-table-actions a.primary-button,
        .finance-table-actions button.primary-button {
            width: 100%;
        }

    .table-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .actions-menu-content {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}
/* =========================================================
   Refinamento visual - Financeiro
   Reduz peso visual e melhora hierarquia da tela.
   ========================================================= */

.finance-page {
    gap: 1rem;
}

/* Cards superiores menores */

.finance-summary-grid {
    gap: 0.85rem;
}

.finance-summary-card {
    min-height: 72px;
    padding: 0.8rem 0.95rem;
}

    .finance-summary-card .summary-icon {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        font-size: 1.1rem;
    }

.summary-content span {
    font-size: 0.84rem;
    font-weight: 600;
}

.summary-content strong {
    font-size: clamp(1.25rem, 1.45vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.summary-content small {
    font-size: 0.76rem;
    font-weight: 400;
    white-space: nowrap;
}

/* Filtros mais leves */

.finance-filters-card {
    padding: 0.95rem 1rem;
}

.finance-filter-grid {
    gap: 0.75rem;
}

    .finance-filter-grid label,
    .form-field label {
        font-size: 0.86rem;
        font-weight: 600;
    }

    .finance-filter-grid input,
    .finance-filter-grid select {
        min-height: 44px;
        font-size: 0.95rem;
    }

.finance-filter-actions .secondary-button {
    min-height: 44px;
    background: #ffffff;
    color: var(--fincore-blue);
    border: 1px solid #bfdbfe;
}

/* Card da tabela */

.finance-table-card {
    background: #ffffff;
    border: 1px solid var(--fincore-border);
    border-radius: 18px;
    box-shadow: var(--fincore-shadow);
    overflow: visible;
}

.finance-table-header {
    padding: 1.15rem 1.35rem;
}

    .finance-table-header h2 {
        font-size: 1.45rem;
        font-weight: 750;
    }

    .finance-table-header span {
        font-size: 0.9rem;
        font-weight: 500;
    }

/* Botões da tabela */

.finance-table-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

    .finance-table-actions .primary-button,
    .finance-table-actions a.primary-button,
    .finance-table-actions button.primary-button {
        min-height: 42px;
        padding: 0 1rem;
        border-radius: 0.7rem;
        font-size: 0.92rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .finance-table-actions .secondary-button,
    .finance-table-actions a.secondary-button,
    .finance-table-actions button.secondary-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 0 1rem;
        border-radius: 0.7rem;
        border: 1px solid #bfdbfe;
        background: #ffffff;
        color: var(--fincore-blue);
        font-size: 0.92rem;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }

/* Tabela mais leve */

.finance-table th {
    height: 48px;
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.finance-table td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    font-size: 0.92rem;
}

.finance-description-cell strong {
    font-weight: 700;
    text-transform: none;
}

.finance-description-cell span {
    font-size: 0.86rem;
}

/* Badges menores */

.finance-type-pill,
.status-pill {
    min-width: 82px;
    min-height: 30px;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Valores */

.money-cell,
.value-positive,
.value-negative {
    font-weight: 700;
}

/* Botão de três pontos menor */

.actions-menu summary {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #f8fafc;
    color: var(--fincore-navy);
    border: 1px solid #dbe4f0;
    box-shadow: none;
}

.actions-menu[open] summary {
    background: #eff6ff;
    color: var(--fincore-blue);
}

/* Rodapé da tabela */

.table-footer {
    padding: 0.9rem 1.25rem;
}

/* Responsividade */

@media (max-width: 1100px) {
    .finance-table-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .finance-table-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .summary-content small {
        white-space: normal;
    }

    .finance-table-actions {
        width: 100%;
        flex-direction: column !important;
        align-items: stretch;
    }

        .finance-table-actions .primary-button,
        .finance-table-actions .secondary-button {
            width: 100%;
        }
}

/* =========================================================
   Lote de pagamento
   ========================================================= */

.finance-lot-card {
    background: #ffffff;
    border: 1px solid var(--fincore-border);
    border-radius: 18px;
    box-shadow: var(--fincore-shadow);
    padding: 1.25rem;
}

.finance-lot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .finance-lot-header h2 {
        margin: 0;
        color: var(--fincore-navy);
        font-size: 1.45rem;
        font-weight: 750;
    }

    .finance-lot-header p {
        margin: 0.35rem 0 0;
        color: var(--fincore-muted);
    }

.finance-lot-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.finance-lot-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

    .finance-lot-summary div {
        border: 1px solid var(--fincore-border);
        border-radius: 14px;
        padding: 0.85rem;
        background: #f8fafc;
    }

    .finance-lot-summary span {
        display: block;
        color: var(--fincore-muted);
        font-size: 0.85rem;
        font-weight: 600;
    }

    .finance-lot-summary strong {
        display: block;
        margin-top: 0.25rem;
        color: var(--fincore-navy);
        font-size: 1.35rem;
        font-weight: 800;
    }

.finance-lot-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.finance-lot-dialog .finance-lot-footer {
    position: sticky;
    bottom: -1.5rem;
    z-index: 5;
    margin-inline: -1.5rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #dbeafe;
    background: #ffffff;
    box-shadow: 0 -10px 22px rgba(15, 23, 42, 0.07);
}

.finance-lot-action-feedback {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 800;
}

.finance-lot-action-feedback .processing {
    color: #1d4ed8;
}

.finance-lot-action-feedback .error {
    display: block;
    padding: 0.7rem 0.85rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    background: #fef2f2;
}

.finance-lot-toast {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1.25rem;
    z-index: 1800;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: min(460px, calc(100vw - 2rem));
    padding: 0.9rem 1rem;
    border: 1px solid #86efac;
    border-radius: 14px;
    color: #047857;
    background: #ecfdf5;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
    font-weight: 800;
    animation: finance-lot-toast-hide 6s ease forwards;
}

.finance-lot-toast span {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 999px;
    color: #ffffff;
    background: #059669;
}

@keyframes finance-lot-toast-hide {
    0%, 78% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 900px) {
    .finance-lot-header {
        flex-direction: column;
    }

    .finance-lot-filters {
        grid-template-columns: 1fr;
    }

    .finance-lot-summary {
        grid-template-columns: 1fr;
    }

    .finance-lot-footer .primary-button,
    .finance-lot-header .secondary-button {
        width: 100%;
    }

    .finance-lot-dialog .finance-lot-footer {
        align-items: stretch;
        flex-direction: column;
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .finance-lot-dialog .finance-lot-footer .btn-primary {
        width: 100%;
    }
}

.finance-lot-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

    .finance-lot-summary > div {
        padding: 1rem;
        border: 1px solid var(--fincore-border);
        border-radius: 14px;
        background: #f8fafc;
    }

.selection-cell {
    width: 48px;
    text-align: center;
}

    .selection-cell input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

.finance-lot-table {
    margin-top: 1rem;
}

.finance-lot-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* === Padrão consolidado de filtros, listagem completa e ações === */
.finance-dashboard-page .module-header-actions {
    flex-shrink: 0;
}

.finance-dashboard-page .finance-table-card,
.finance-dashboard-page .finance-responsive-table,
.finance-dashboard-page .finance-table {
    overflow: visible;
}

.finance-dashboard-page .actions-cell {
    position: relative;
    z-index: 1;
    width: 88px;
    min-width: 88px;
    text-align: center;
    overflow: visible;
}

.finance-dashboard-page .finance-actions-menu {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.finance-dashboard-page .kebab-button {
    width: 46px;
    height: 42px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.finance-dashboard-page .kebab-button:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.finance-dashboard-page .kebab-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 130;
    min-width: 190px;
    padding: 0.45rem;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.finance-dashboard-page .kebab-menu button {
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0b1f3a;
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.finance-dashboard-page .kebab-menu button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.finance-dashboard-page .actions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    background: transparent;
    cursor: default;
}

.finance-dashboard-page .finance-dashboard-table tbody tr {
    position: relative;
    z-index: 0;
}

.finance-dashboard-page .finance-dashboard-table tbody tr.actions-row-open {
    z-index: 110;
}

.finance-dashboard-page .actions-cell.is-open,
.finance-dashboard-page .actions-cell.is-open .finance-actions-menu {
    z-index: 120;
}

.finance-dashboard-page .settlement-dialog-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0 var(--sidebar-width);
    z-index: 920;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.finance-dashboard-page .settlement-dialog {
    width: min(620px, calc(100% - 2rem));
    max-height: calc(100dvh - var(--header-height) - 2rem);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.finance-dashboard-page .settlement-dialog-header h2 {
    margin: 0;
    color: #0b1f3a;
}

.finance-dashboard-page .settlement-dialog-header p {
    margin-top: 0.4rem;
}

.finance-dashboard-page .settlement-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    margin: 1.2rem 0;
    padding: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
}

.finance-dashboard-page .settlement-summary span,
.finance-dashboard-page .settlement-summary strong {
    display: block;
}

.finance-dashboard-page .settlement-summary span {
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.finance-dashboard-page .settlement-account-field {
    margin-bottom: 1rem;
}

.finance-dashboard-page .settlement-account-field select {
    min-height: 150px;
    padding: 0.35rem;
}

.finance-dashboard-page .settlement-account-field option {
    padding: 0.7rem 0.6rem;
    border-radius: 8px;
}

.finance-dashboard-page .settlement-warning,
.finance-dashboard-page .settlement-error {
    color: #b91c1c;
    font-size: 0.88rem;
    font-weight: 700;
}

.finance-dashboard-page .settlement-error {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
}

.finance-dashboard-page .settlement-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.finance-dashboard-page .pagination-current {
    color: var(--fincore-navy);
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .finance-dashboard-page .module-header-actions,
    .finance-dashboard-page .module-header-actions .btn {
        width: 100%;
    }

    .finance-dashboard-page .actions-cell {
        width: 72px;
        min-width: 72px;
    }

    .finance-dashboard-page .kebab-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .finance-dashboard-page .settlement-dialog {
        width: 100%;
        padding: 1rem;
    }

    .finance-dashboard-page .settlement-summary {
        grid-template-columns: 1fr;
    }

    .finance-dashboard-page .settlement-dialog-actions,
    .finance-dashboard-page .settlement-dialog-actions button {
        width: 100%;
    }

    .finance-dashboard-page .settlement-dialog-actions {
        flex-direction: column-reverse;
    }
}

@media (max-width: 900px) {
    .finance-dashboard-page .settlement-dialog-backdrop {
        inset: var(--header-height) 0 0 0;
    }
}

/* Tabelas e modais sem barras visuais, mantendo rolagem por mouse e toque. */
.finance-overlay-backdrop,
.finance-overlay-dialog,
.finance-payment-backdrop,
.finance-payment-dialog {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.finance-overlay-backdrop::-webkit-scrollbar,
.finance-overlay-dialog::-webkit-scrollbar,
.finance-payment-backdrop::-webkit-scrollbar,
.finance-payment-dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.finance-dashboard-page .payment-batches-scroll {
    max-height: none;
    overflow: visible;
    scrollbar-width: none;
}

.finance-dashboard-page .payment-batches-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.finance-dashboard-page .payment-batches-table th:nth-child(1),
.finance-dashboard-page .payment-batches-table td:nth-child(1) { width: 11%; }
.finance-dashboard-page .payment-batches-table th:nth-child(2),
.finance-dashboard-page .payment-batches-table td:nth-child(2) { width: 12%; }
.finance-dashboard-page .payment-batches-table th:nth-child(3),
.finance-dashboard-page .payment-batches-table td:nth-child(3) { width: 17%; }
.finance-dashboard-page .payment-batches-table th:nth-child(4),
.finance-dashboard-page .payment-batches-table td:nth-child(4) { width: 8%; }
.finance-dashboard-page .payment-batches-table th:nth-child(5),
.finance-dashboard-page .payment-batches-table td:nth-child(5) { width: 13%; }
.finance-dashboard-page .payment-batches-table th:nth-child(6),
.finance-dashboard-page .payment-batches-table td:nth-child(6) {
    width: 18%;
    padding-right: 1rem;
}
.finance-dashboard-page .payment-batches-table th:nth-child(7),
.finance-dashboard-page .payment-batches-table td:nth-child(7) {
    width: 21%;
    padding-left: 1rem;
}

/* Regras finais dos painéis, mantidas no fim para prevalecer sobre o legado. */
.finance-all-movements-dialog {
    width: min(1440px, calc(100% - 1.5rem));
    height: calc(100dvh - var(--header-height) - 2rem);
    max-height: calc(100dvh - var(--header-height) - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.finance-all-movements-dialog > .finance-table-header,
.finance-all-movements-dialog > .table-footer {
    flex: 0 0 auto;
}

.finance-all-movements-dialog > .finance-responsive-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: scroll;
    scrollbar-width: auto;
    scrollbar-color: #475569 #e2e8f0;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar {
    display: block;
    width: 16px;
    height: 14px;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-thumb {
    border: 3px solid #e2e8f0;
    border-radius: 999px;
    background: #475569;
}

.finance-all-movements-dialog > .finance-responsive-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

.finance-dashboard-page .batch-items-feedback,
.finance-dashboard-page .batch-items-feedback-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.finance-dashboard-page .batch-items-feedback summary,
.finance-dashboard-page .batch-items-feedback-list strong,
.finance-dashboard-page .batch-items-feedback-list small,
.finance-dashboard-page .batch-items-feedback-list p {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.finance-dashboard-page .batch-items-feedback-list article {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.finance-dashboard-page .batch-items-feedback-list .item-decision {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 900px) {
    .finance-all-movements-dialog {
        width: 100%;
        height: calc(100dvh - var(--header-height) - 1rem);
        max-height: calc(100dvh - var(--header-height) - 1rem);
    }
}

/* Barras sempre visíveis e largas para navegação por teclado/touchpad. */
.finance-overlay-backdrop,
.finance-overlay-dialog,
.finance-payment-backdrop,
.finance-payment-dialog,
.finance-dashboard-page .payment-batches-scroll {
    scrollbar-width: auto;
    scrollbar-color: #64748b #e2e8f0;
    -ms-overflow-style: scrollbar;
}

.finance-overlay-backdrop::-webkit-scrollbar,
.finance-overlay-dialog::-webkit-scrollbar,
.finance-payment-backdrop::-webkit-scrollbar,
.finance-payment-dialog::-webkit-scrollbar,
.finance-dashboard-page .payment-batches-scroll::-webkit-scrollbar {
    display: block;
    width: 14px;
    height: 14px;
}

.finance-overlay-backdrop::-webkit-scrollbar-track,
.finance-overlay-dialog::-webkit-scrollbar-track,
.finance-payment-backdrop::-webkit-scrollbar-track,
.finance-payment-dialog::-webkit-scrollbar-track,
.finance-dashboard-page .payment-batches-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.finance-overlay-backdrop::-webkit-scrollbar-thumb,
.finance-overlay-dialog::-webkit-scrollbar-thumb,
.finance-payment-backdrop::-webkit-scrollbar-thumb,
.finance-payment-dialog::-webkit-scrollbar-thumb,
.finance-dashboard-page .payment-batches-scroll::-webkit-scrollbar-thumb {
    border: 3px solid #e2e8f0;
    border-radius: 999px;
    background: #64748b;
}

.finance-dashboard-page .payment-batches-scroll {
    max-height: min(58vh, 640px);
    overflow-y: scroll;
    overflow-x: auto;
}

/* Todas as movimentações: cabeçalho/rodapé fixos e rolagem somente na lista. */
.finance-all-movements-dialog {
    width: min(1440px, calc(100% - 1.5rem));
    height: calc(100dvh - var(--header-height) - 2rem);
    max-height: calc(100dvh - var(--header-height) - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.finance-all-movements-dialog > .finance-table-header,
.finance-all-movements-dialog > .table-footer {
    flex: 0 0 auto;
}

.finance-all-movements-dialog > .finance-responsive-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: scroll;
    scrollbar-width: auto;
    scrollbar-color: #475569 #e2e8f0;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar {
    display: block;
    width: 16px;
    height: 14px;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-thumb {
    border: 3px solid #e2e8f0;
    border-radius: 999px;
    background: #475569;
}

.finance-all-movements-dialog > .finance-responsive-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* O resultado por conta nunca pode ultrapassar a coluna de devolutiva. */
.finance-dashboard-page .batch-items-feedback,
.finance-dashboard-page .batch-items-feedback-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.finance-dashboard-page .batch-items-feedback summary {
    white-space: normal;
    overflow-wrap: anywhere;
}

.finance-dashboard-page .batch-items-feedback-list article {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.finance-dashboard-page .batch-items-feedback-list article > div,
.finance-dashboard-page .batch-items-feedback-list strong,
.finance-dashboard-page .batch-items-feedback-list small,
.finance-dashboard-page .batch-items-feedback-list p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.finance-dashboard-page .batch-items-feedback-list .item-decision {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 900px) {
    .finance-all-movements-dialog {
        width: 100%;
        height: calc(100dvh - var(--header-height) - 1rem);
        max-height: calc(100dvh - var(--header-height) - 1rem);
    }
}

.finance-dashboard-page .payment-batches-table td,
.finance-dashboard-page .payment-batches-table th {
    overflow-wrap: anywhere;
}

.finance-dashboard-page .payment-batches-table .status-pill {
    display: inline-flex;
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

@media (max-width: 900px) {
    .finance-dashboard-page .payment-batches-card {
        overflow-x: hidden;
    }

    .finance-dashboard-page .payment-batches-table {
        font-size: .78rem;
    }

    .finance-dashboard-page .payment-batches-table th,
    .finance-dashboard-page .payment-batches-table td {
        padding-right: .45rem;
        padding-left: .45rem;
    }
}

/* Acompanhamento da aprovação dos lotes no Financeiro. */
.finance-dashboard-page .payment-batches-card {
    overflow: visible;
}

.finance-dashboard-page .payment-batches-table {
    min-width: 1220px;
    table-layout: fixed;
}

.finance-dashboard-page .payment-batches-table th:nth-child(1),
.finance-dashboard-page .payment-batches-table td:nth-child(1) {
    width: 130px;
}

.finance-dashboard-page .payment-batches-table th:nth-child(2),
.finance-dashboard-page .payment-batches-table td:nth-child(2) {
    width: 180px;
}

.finance-dashboard-page .payment-batches-table th:nth-child(3),
.finance-dashboard-page .payment-batches-table td:nth-child(3) {
    width: 190px;
}

.finance-dashboard-page .payment-batches-table th:nth-child(4),
.finance-dashboard-page .payment-batches-table td:nth-child(4) {
    width: 90px;
    text-align: center;
}

.finance-dashboard-page .payment-batches-table th:nth-child(5),
.finance-dashboard-page .payment-batches-table td:nth-child(5) {
    width: 140px;
}

.finance-dashboard-page .payment-batches-table th:nth-child(6),
.finance-dashboard-page .payment-batches-table td:nth-child(6) {
    width: 150px;
    text-align: center;
}

.finance-dashboard-page .payment-batches-table th:nth-child(7),
.finance-dashboard-page .payment-batches-table td:nth-child(7) {
    width: auto;
}

.finance-dashboard-page .payment-batches-table th:nth-child(8),
.finance-dashboard-page .payment-batches-table td:nth-child(8) {
    width: 180px;
    text-align: center;
}

.finance-dashboard-page .batch-submit-button {
    min-height: 38px;
    padding: 0.55rem 0.8rem;
    border: 1px solid #2563eb;
    border-radius: 11px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
}

.finance-dashboard-page .batch-submit-button:hover {
    background: #dbeafe;
}

.finance-dashboard-page .batch-operation-message {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 1.35rem 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
}

.finance-dashboard-page .batch-operation-message span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
}

.finance-dashboard-page .batch-operation-message.success {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.finance-dashboard-page .batch-operation-message.success span {
    color: #ffffff;
    background: #059669;
}

.finance-dashboard-page .batch-operation-message.error {
    color: #991b1b;
    border-color: #fecaca;
    background: #fef2f2;
}

.finance-dashboard-page .batch-operation-message.error span {
    color: #ffffff;
    background: #dc2626;
}

.finance-dashboard-page .status-pill.neutral {
    color: #475569;
    background: #e2e8f0;
}

.finance-dashboard-page .batch-manager-feedback {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.finance-dashboard-page .batch-manager-feedback.success {
    color: #047857;
    background: #ecfdf5;
}

.finance-dashboard-page .batch-manager-feedback.danger {
    color: #991b1b;
    background: #fef2f2;
}

.finance-dashboard-page .batch-manager-feedback.pending {
    color: #92400e;
    background: #fffbeb;
}

.finance-dashboard-page .batch-manager-feedback.neutral {
    color: #475569;
    background: #f8fafc;
}

.finance-dashboard-page .batch-items-feedback {
    margin-top: 0.55rem;
}

.finance-dashboard-page .batch-items-feedback summary {
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.finance-dashboard-page .batch-items-feedback-list {
    display: grid;
    gap: 0.55rem;
    min-width: 300px;
    margin-top: 0.65rem;
}

/* Camadas de trabalho do Financeiro: permanecem acima do conteúdo e não alongam a página. */
.finance-overlay-backdrop,
.finance-payment-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0 var(--sidebar-width);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
}

.finance-payment-backdrop {
    z-index: 1250;
}

.finance-overlay-dialog,
.finance-payment-dialog {
    width: min(1440px, 96%);
    max-height: calc(100dvh - var(--header-height) - 2.5rem);
    overflow: auto;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.34);
}

.finance-lot-dialog {
    padding: 1.5rem;
}

.finance-all-movements-dialog {
    margin: 0;
}

.finance-movements-container {
    display: contents;
}

.finance-attachment-dialog {
    width: min(1180px, 96%);
    padding: 1.25rem;
    overflow: hidden;
}

.finance-attachment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.finance-attachment-header h2,
.finance-attachment-header p {
    margin: 0;
}

.finance-attachment-header p {
    margin-top: .25rem;
    color: #64748b;
}

.finance-attachment-viewer {
    display: grid;
    place-items: center;
    width: 100%;
    height: min(72vh, 780px);
    overflow: auto;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fafc;
}

.finance-attachment-viewer img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    object-fit: contain;
}

.finance-attachment-viewer object {
    width: 100%;
    height: 100%;
    border: 0;
}

.finance-dashboard-page .payment-batches-scroll {
    max-height: min(56vh, 620px);
    overflow: auto;
    border-top: 1px solid #dbe3ef;
}

.finance-dashboard-page .payment-batches-scroll thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

@media (max-width: 900px) {
    .finance-overlay-backdrop,
    .finance-payment-backdrop {
        inset: var(--header-height) 0 0 0;
        padding: .65rem;
    }

    .finance-overlay-dialog,
    .finance-payment-dialog {
        width: 100%;
        max-height: calc(100dvh - var(--header-height) - 1.3rem);
        border-radius: 15px;
    }

    .finance-attachment-header {
        align-items: stretch;
        flex-direction: column;
    }
}

.finance-dashboard-page .batch-items-feedback-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    padding: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.finance-dashboard-page .batch-items-feedback-list strong,
.finance-dashboard-page .batch-items-feedback-list small {
    display: block;
}

.finance-dashboard-page .batch-items-feedback-list small {
    margin-top: 0.2rem;
    color: #64748b;
}

.finance-dashboard-page .batch-items-feedback-list p {
    grid-column: 1 / -1;
    margin: 0;
    color: #991b1b;
    font-size: 0.8rem;
    font-weight: 700;
}

.finance-dashboard-page .item-decision {
    align-self: start;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.finance-dashboard-page .item-decision.approved {
    color: #047857;
    background: #d1fae5;
}

.finance-dashboard-page .item-decision.rejected {
    color: #b91c1c;
    background: #fee2e2;
}

.finance-dashboard-page .item-decision.pending {
    color: #92400e;
    background: #fef3c7;
}

/* Ajuste final do acompanhamento: sem barras, sem coluna ociosa e com colunas próximas. */
.finance-dashboard-page .payment-batches-scroll {
    max-height: none;
    overflow: visible;
}

.finance-dashboard-page .payment-batches-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.finance-dashboard-page .payment-batches-table th:nth-child(1),
.finance-dashboard-page .payment-batches-table td:nth-child(1) { width: 11%; }
.finance-dashboard-page .payment-batches-table th:nth-child(2),
.finance-dashboard-page .payment-batches-table td:nth-child(2) { width: 12%; }
.finance-dashboard-page .payment-batches-table th:nth-child(3),
.finance-dashboard-page .payment-batches-table td:nth-child(3) { width: 17%; }
.finance-dashboard-page .payment-batches-table th:nth-child(4),
.finance-dashboard-page .payment-batches-table td:nth-child(4) { width: 8%; }
.finance-dashboard-page .payment-batches-table th:nth-child(5),
.finance-dashboard-page .payment-batches-table td:nth-child(5) { width: 13%; }
.finance-dashboard-page .payment-batches-table th:nth-child(6),
.finance-dashboard-page .payment-batches-table td:nth-child(6) {
    width: 18%;
    padding-right: 1rem;
}
.finance-dashboard-page .payment-batches-table th:nth-child(7),
.finance-dashboard-page .payment-batches-table td:nth-child(7) {
    width: 21%;
    padding-left: 1rem;
}

/* Contenção definitiva das janelas e do detalhamento por conta. */
.finance-all-movements-dialog {
    width: min(1440px, calc(100% - 1.5rem));
    height: calc(100dvh - var(--header-height) - 2rem);
    max-height: calc(100dvh - var(--header-height) - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.finance-all-movements-dialog > .finance-table-header,
.finance-all-movements-dialog > .table-footer { flex: 0 0 auto; }

.finance-all-movements-filter {
    display: flex;
    flex: 0 0 auto;
    align-items: end;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #dbe5f1;
    background: #f8fbff;
}

.finance-all-movements-filter .form-field {
    width: min(260px, 100%);
    margin: 0;
}

.finance-all-movements-filter .finance-all-movements-classification-filter {
    width: min(360px, 100%);
}

.finance-all-movements-filter .secondary-button {
    min-height: 46px;
}

.finance-all-movements-dialog > .finance-responsive-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: scroll;
    scrollbar-width: auto;
    scrollbar-color: #475569 #e2e8f0;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar {
    display: block;
    width: 16px;
    height: 14px;
}

.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-track { background: #e2e8f0; }
.finance-all-movements-dialog > .finance-responsive-table::-webkit-scrollbar-thumb {
    border: 3px solid #e2e8f0;
    border-radius: 999px;
    background: #475569;
}

.finance-all-movements-dialog > .finance-responsive-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

.finance-dashboard-page .batch-items-feedback,
.finance-dashboard-page .batch-items-feedback-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.finance-dashboard-page .batch-items-feedback summary,
.finance-dashboard-page .batch-items-feedback-list strong,
.finance-dashboard-page .batch-items-feedback-list small,
.finance-dashboard-page .batch-items-feedback-list p {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.finance-dashboard-page .batch-items-feedback-list article {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.finance-dashboard-page .batch-items-feedback-list .item-decision {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 900px) {
    .finance-all-movements-dialog {
        width: 100%;
        height: calc(100dvh - var(--header-height) - 1rem);
        max-height: calc(100dvh - var(--header-height) - 1rem);
    }

    .finance-all-movements-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .finance-all-movements-filter .form-field,
    .finance-all-movements-filter .secondary-button {
        width: 100%;
    }
}
.finance-document-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dbe5f1;
    background: #f8fbff;
}

.finance-document-tabs button {
    padding: 0.55rem 0.85rem;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 800;
    cursor: pointer;
}

.finance-document-tabs button.is-active {
    color: #fff;
    border-color: #1d4ed8;
    background: #1d4ed8;
}

/* Devolutiva dos lotes: resumo compacto na tabela e detalhes sob demanda. */
.finance-dashboard-page .batch-feedback-cell {
    vertical-align: middle;
}

.finance-dashboard-page .batch-feedback-summary {
    display: block;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.3;
}

.finance-dashboard-page .batch-feedback-summary.success { color: #047857; }
.finance-dashboard-page .batch-feedback-summary.danger { color: #b91c1c; }
.finance-dashboard-page .batch-feedback-summary.pending { color: #92400e; }

.finance-dashboard-page .batch-feedback-button {
    margin-top: 0.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.finance-dashboard-page .batch-feedback-button:hover {
    color: #1e40af;
}

.batch-feedback-dialog {
    width: min(980px, 96%);
    padding: 0;
    overflow: hidden;
}

.batch-feedback-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #dbe5f1;
}

.batch-feedback-dialog-header h2,
.batch-feedback-dialog-header p {
    margin: 0;
}

.batch-feedback-dialog-header h2 {
    margin-top: 0.15rem;
    color: #0a1f3d;
}

.batch-feedback-dialog-header p {
    margin-top: 0.25rem;
    color: #64748b;
}

.batch-feedback-dialog-kicker {
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.batch-feedback-dialog-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #f8fbff;
}

.batch-feedback-dialog-summary > div {
    padding: 0.8rem;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: #fff;
}

.batch-feedback-dialog-summary span,
.batch-feedback-dialog-summary strong {
    display: block;
}

.batch-feedback-dialog-summary span {
    color: #64748b;
    font-size: 0.75rem;
}

.batch-feedback-dialog-summary strong {
    margin-top: 0.2rem;
    color: #0a1f3d;
}

.batch-feedback-general {
    margin: 1rem 1.5rem 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
}

.batch-feedback-general span,
.batch-feedback-general strong {
    display: block;
}

.batch-feedback-general span {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.batch-feedback-general.danger {
    color: #991b1b;
    background: #fef2f2;
}

.batch-feedback-general.success {
    color: #047857;
    background: #ecfdf5;
}

.batch-feedback-general.pending {
    color: #92400e;
    background: #fffbeb;
}

.batch-feedback-dialog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-height: min(48vh, 520px);
    padding: 1rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.batch-feedback-dialog-item {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #dbe5f1;
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
    background: #fff;
}

.batch-feedback-dialog-item.approved { border-left-color: #10b981; }
.batch-feedback-dialog-item.rejected { border-left-color: #ef4444; }
.batch-feedback-dialog-item.pending { border-left-color: #f59e0b; }

.batch-feedback-dialog-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.batch-feedback-dialog-item-heading strong,
.batch-feedback-dialog-item-heading small {
    display: block;
    overflow-wrap: anywhere;
}

.batch-feedback-dialog-item-heading small {
    margin-top: 0.25rem;
    color: #64748b;
}

.batch-feedback-reason {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    color: #991b1b;
    background: #fef2f2;
}

.batch-feedback-reason span {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.batch-feedback-reason p {
    margin: 0.25rem 0 0;
    font-weight: 700;
}

@media (max-width: 700px) {
    .batch-feedback-dialog-header,
    .batch-feedback-dialog-item-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-feedback-dialog-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-feedback-dialog-list {
        grid-template-columns: minmax(0, 1fr);
    }
}
