.credflow-app {
    width: 100%;
}

.credflow-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #1565C0;
    color: #ffffff;
    box-sizing: border-box;
}

.credflow-header-brand {
    padding-left: 70px;
    font-size: 22px;
}

.credflow-header-title {
    font-size: 14px;
    opacity: 0.9;
}

.credflow-layout {
    display: flex;
    min-height: 650px;
    background: #f5f7fa;
}

.credflow-button-danger {
    background: #c62828;
    color: #ffffff;
    border: 1px solid #c62828;
}

.credflow-button-danger:hover {
    background: #a61f1f;
    border-color: #a61f1f;
    color: #ffffff;
}

.credflow-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.credflow-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d9dee5;
    border-radius: 6px;
    background: #ffffff;
    color: #1565c0;
    text-decoration: none;
    font-weight: 600;
}

.credflow-pagination-link:hover {
    background: #f3f7fc;
    color: #1565c0;
}

.credflow-pagination-link-active {
    background: #1565c0;
    border-color: #1565c0;
    color: #ffffff;
}

.credflow-customer-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f8fafc;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    flex-wrap: wrap;
}

.credflow-customer-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credflow-customer-filter-field label {
    font-size: 14px;
    font-weight: 600;
}

.credflow-customer-filter-field input,
.credflow-customer-filter-field select {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #cfd6de;
    border-radius: 6px;
    background: #ffffff;
    font-size: 15px;
}

.credflow-customer-filter-field input {
    min-width: 320px;
}

.credflow-customer-filter-actions {
    display: flex;
    gap: 8px;
}

.credflow-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.credflow-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.credflow-status-deleted {
    background: #ffebee;
    color: #c62828;
}

.credflow-button-restore {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.credflow-button-restore:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
.credflow-customer-filter-actions .credflow-button:not(.credflow-button-secondary) {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
    font-weight: 600;
    cursor: pointer;
}

.credflow-customer-filter-actions .credflow-button:not(.credflow-button-secondary):hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.credflow-customer-filter-actions .credflow-button-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.credflow-notice {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
}

.credflow-notice-success {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.credflow-notice-success strong {
    margin-right: 5px;
}
.credflow-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e1e5ea;
}

.credflow-sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid #e1e5ea;
}

.credflow-sidebar-brand strong {
    display: block;
    font-size: 20px;
    color: #1565C0;
}

.credflow-sidebar-brand span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.credflow-sidebar-menu {
    padding: 12px;
}

.credflow-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: 6px;
    color: #4b5563;
    font-size: 14px;
}

.credflow-menu-item.active {
    background: #e8f1fb;
    color: #1565C0;
    font-weight: 600;
}

.credflow-menu-icon {
    width: 20px;
    text-align: center;
}

.credflow-main {
    flex: 1;
    min-width: 0;
}

.credflow-page-header {
    padding: 28px 32px 10px;
}

.credflow-page-header h1 {
    margin: 0;
    font-size: 28px;
    color: #1f2937;
}

.credflow-content {
    padding: 20px 20px 32px;
}


.credflow-footer {
    display: flex;
    justify-content: space-between;
    padding: 18px 32px;
    color: #6b7280;
    font-size: 12px;
}

.credflow-dashboard {
    width: 100%;
}

.credflow-dashboard-welcome {
    margin-bottom: 24px;
}

.credflow-dashboard-welcome h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1f2937;
}

.credflow-dashboard-welcome p {
    margin: 0;
    color: #6b7280;
}

.credflow-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.credflow-dashboard-card {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
}

.credflow-dashboard-card-label {
    display: block;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 13px;
}

.credflow-dashboard-card-value {
    display: block;
    color: #1f2937;
    font-size: 22px;
}

@media (max-width: 1000px) {

    .credflow-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .credflow-layout {
        display: block;
    }

    .credflow-sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #e1e5ea;
    }

    .credflow-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .credflow-content {
        padding: 20px;
    }

    .credflow-page-header {
        padding: 10px 10px 10px;
    }

}


/* =========================================================
   CredFlow - Clientes / Frontend
   ========================================================= */

.credflow-page {
    width: 100%;
}

.credflow-page-title {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.25;
    color: #1f2937;
}

.credflow-page-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.credflow-panel {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.credflow-panel-title {
    margin: 0 0 18px;
    font-size: 18px;
    color: #1f2937;
}

.credflow-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.credflow-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 14px;
}

.credflow-table th {
    padding: 13px 14px;
    text-align: left;
    background: #f8fafc;
    border-bottom: 1px solid #e1e5ea;
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
}

.credflow-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #eef1f4;
    color: #374151;
    vertical-align: middle;
}

.credflow-table tbody tr:last-child td {
    border-bottom: 0;
}

.credflow-table tbody tr:hover {
    background: #f8fbff;
}

.credflow-empty {
    padding: 30px 20px;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border: 1px dashed #d8dee6;
    border-radius: 6px;
}

.credflow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.credflow-button-primary {
    background: #1565C0;
    color: #ffffff;
}

.credflow-button-primary:hover {
    background: #0d56a6;
    color: #ffffff;
}

.credflow-button-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.credflow-button-secondary:hover {
    background: #f8fafc;
    color: #1f2937;
}

.credflow-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.credflow-form-field {
    min-width: 0;
}

.credflow-form-field-full {
    grid-column: 1 / -1;
}

.credflow-form-label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.credflow-form-input,
.credflow-form-select,
.credflow-form-textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    box-sizing: border-box;
}

.credflow-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.credflow-form-input:focus,
.credflow-form-select:focus,
.credflow-form-textarea:focus {
    outline: none;
    border-color: #1565C0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, .12);
}

.credflow-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.credflow-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credflow-search {
    max-width: 320px;
}

.credflow-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.credflow-badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.credflow-badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

@media (max-width: 700px) {
    .credflow-panel {
        padding: 18px;
    }

    .credflow-form-grid {
        grid-template-columns: 1fr;
    }

    .credflow-form-field-full {
        grid-column: auto;
    }

    .credflow-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .credflow-toolbar-actions {
        width: 100%;
    }

    .credflow-search {
        max-width: none;
    }

    .credflow-table th,
    .credflow-table td {
        padding: 11px 10px;
    }
}
/* =========================================================
   CredFlow - Empréstimos
   ========================================================= */

.credflow-loan-page {
    width: 100%;
}

.credflow-loan-header {
    margin-bottom: 24px;
}

.credflow-loan-header h2 {
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 24px;
}

.credflow-loan-header p {
    margin: 0;
    color: #6b7280;
}


/* =========================================================
   Seções do empréstimo
   ========================================================= */

.credflow-loan-section {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.credflow-loan-section-title {
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}


/* =========================================================
   Informações do empréstimo
   ========================================================= */

.credflow-loan-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.credflow-loan-detail {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 6px;
}

.credflow-loan-detail-label {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.credflow-loan-detail-value {
    display: block;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   Resumo financeiro
   ========================================================= */

.credflow-loan-summary {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.credflow-loan-summary-table {
    width: 100%;
    overflow-x: auto;
}

.credflow-loan-summary .credflow-table {
    width: 100%;
}

.credflow-loan-summary .credflow-table td {
    padding: 15px 14px;
    font-size: 15px;
}

.credflow-loan-summary .credflow-table td:first-child {
    width: 50%;
    color: #4b5563;
    font-weight: 500;
}

.credflow-loan-summary .credflow-table td:last-child {
    color: #1f2937;
    font-weight: 600;
}


/* =========================================================
   Valores do resumo
   ========================================================= */

.credflow-loan-value-paid {
    color: #2e7d32;
}

.credflow-loan-value-pending {
    color: #996800;
}

.credflow-loan-value-overdue {
    color: #c62828;
}


/* =========================================================
   Tabela de parcelas
   ========================================================= */

.credflow-installments {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}


.credflow-installments .credflow-table {
    min-width: 800px;
}

.credflow-payment-value {
    font-weight: 600;
    color: #243447;
}

.credflow-payment-value-paid {
    color: #2e7d32;
}

.credflow-payment-value-pending {
    color: #996800;
}

.credflow-payment-value-overdue {
    color: #c62828;
}
/* =========================================================
   Status das parcelas
   ========================================================= */

.credflow-installment-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.credflow-installment-status-pending {
    background: #fff7e6;
    color: #996800;
}

.credflow-installment-status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.credflow-installment-status-overdue {
    background: #ffebee;
    color: #c62828;
}


/* =========================================================
   Responsividade
   ========================================================= */

@media (max-width: 900px) {

    .credflow-loan-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .credflow-loan-section,
    .credflow-loan-summary,
    .credflow-installments {
        padding: 18px;
    }

    .credflow-loan-details-grid {
        grid-template-columns: 1fr;
    }

    .credflow-loan-section-title {
        font-size: 18px;
    }

}

/*
|--------------------------------------------------------------------------
| Detalhes do empréstimo
|--------------------------------------------------------------------------
*/

.credflow-loan-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.credflow-loan-page-header h1 {
    margin: 0;
}

.credflow-loan-page-subtitle {
    margin: 6px 0 0;
    color: #667085;
}

/* =========================================================
   DETALHES DO EMPRÉSTIMO - TOPO E CLIENTE
   ========================================================= */

.credflow-loan-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.credflow-loan-page-title h1 {
    margin: 0;
}

.credflow-loan-page-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
}

.credflow-customer-card {
    margin-bottom: 24px;
}

.credflow-card-header {
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.credflow-customer-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.credflow-customer-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.credflow-customer-label {
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.credflow-customer-value {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
}
/* =========================================================
   RESPONSIVIDADE - DETALHES DO EMPRÉSTIMO
   ========================================================= */

@media (max-width: 768px) {

    .credflow-loan-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .credflow-loan-page-header .credflow-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .credflow-customer-details {
        grid-template-columns: 1fr;
    }

}

/*
|--------------------------------------------------------------------------
| Cards
|--------------------------------------------------------------------------
*/

.credflow-loan-card {
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}


/*
|--------------------------------------------------------------------------
| Status
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
| Histórico de pagamentos
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
/* Utilidades preservadas */
.credflow-text-right {
    text-align: right;
}

.credflow-payment-delete-form {
    margin: 0;
}

| Valores vazios
|--------------------------------------------------------------------------
*/

.credflow-empty-value {
    color: #98a2b3;
}


/*
|--------------------------------------------------------------------------
| Responsividade
|--------------------------------------------------------------------------
*/

@media (max-width: 768px) {

    .credflow-loan-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .credflow-loan-card {
        padding: 18px;
    }

}

/* =========================================
   EMPRÉSTIMOS - PARCELAS E PAGAMENTOS
========================================= */

.credflow-installments-card {
    background: #ffffff;
    border: 1px solid #dcdfe4;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 24px;
}

.credflow-installments-card h2 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 20px;
    font-weight: 600;
    color: #243447;
}

/* TABELA DE PARCELAS */

.credflow-installments-table {
    width: 100%;
    border-collapse: collapse;
}

.credflow-installments-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
}

.credflow-installments-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #edf0f3;
    vertical-align: middle;
}

.credflow-installments-table tr:last-child td {
    border-bottom: none;
}

.credflow-installments-table tbody tr:hover {
    background: #fafcff;
}

/* COLUNA PAGAMENTOS */

.credflow-payment-column {
    min-width: 150px;
}

.credflow-payment-summary {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credflow-payment-summary strong {
    color: #243447;
    font-size: 14px;
}

.credflow-payment-summary span {
    color: #64748b;
    font-size: 13px;
}

/* =========================================
   BOTÃO - HISTÓRICO DE PAGAMENTO
========================================= */

.credflow-payment-history-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 12px 12px;
    margin-top: 6px;

    border: 1px solid #2f64a3;
    border-radius: 6px;

    background: #ffffff;
    color: #2f64a3;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.credflow-payment-history-toggle:hover {
    background: #2f64a3;
    border-color: #2f64a3;
    color: #ffffff;
}
/* =========================================
   STATUS DAS PARCELAS
========================================= */

.credflow-status {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.credflow-status-paid {
    background: #e8f5ec;
    color: #2e7d32;
}

.credflow-status-overdue {
    background: #fdecec;
    color: #c62828;
}

.credflow-status-pending {
    background: #fff5df;
    color: #996800;
}


/* =========================================
   HISTÓRICO DE PAGAMENTOS
========================================= */

.credflow-payment-history-row td {
    padding: 0 12px 20px;
    background: #f8fafc;
}

.credflow-payment-history-panel {
    width: 100%;
    max-width: 760px;
    box-sizing: border-box;

    margin: 12px 0 0;
    padding: 20px;

    background: #ffffff;

    border: 1px solid #dbe3ec;
    border-radius: 10px;

    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.06);
}

/* Cabeçalho */

.credflow-payment-history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding-bottom: 16px;
    margin-bottom: 18px;

    border-bottom: 1px solid #e5eaf0;
}

.credflow-payment-history-header h3 {
    margin: 0 0 5px;

    color: #243447;

    font-size: 18px;
    font-weight: 600;
}

.credflow-payment-history-header p {
    margin: 0;

    color: #64748b;

    font-size: 13px;
}

/* Botão fechar */

.credflow-payment-history-close {
    flex-shrink: 0;

    padding: 7px 14px;

    background: #ffffff;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    color: #475569;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.credflow-payment-history-close:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Lista de pagamentos */

.credflow-payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cada pagamento */

.credflow-payment-history-item {
    width: 100%;
    box-sizing: border-box;

    padding: 18px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Cabeçalho do pagamento */

.credflow-payment-history-item-header {
    padding-bottom: 12px;
    margin-bottom: 14px;

    border-bottom: 1px solid #dfe5ec;

    color: #243447;

    font-size: 15px;
}

/* Tabela */

.credflow-payment-history-table {
    width: 100%;

    border-collapse: collapse;

    background: transparent;
}

.credflow-payment-history-table td {
    padding: 11px 10px;

    border-bottom: 1px solid #e7ebef;

    background: transparent;

    color: #475569;

    font-size: 14px;
}

.credflow-payment-history-table tr:last-child td {
    border-bottom: none;
}

/* Valores à direita */

.credflow-payment-history-table .credflow-text-right {
    color: #243447;

    font-weight: 600;

    text-align: right;
}

/* Valor total */

.credflow-payment-history-table
.credflow-payment-history-total td {
    padding: 13px 10px;

    background: #ffffff;

    border-top: 1px solid #dbe3ec;
    border-bottom: 1px solid #dbe3ec;

    color: #243447;
}

.credflow-payment-history-table
.credflow-payment-history-total
.credflow-text-right {
    color: #2e7d32;

    font-size: 15px;
}

/* Observação */

.credflow-payment-history-table
.credflow-payment-history-notes td {
    padding: 14px 10px;

    background: #fffbeb;

    color: #5f4b13;

    border-bottom: none;

    line-height: 1.6;
}

/* Área de ações */

.credflow-payment-history-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 16px;
    padding-top: 14px;

    border-top: 1px solid #e2e8f0;
}

.credflow-payment-delete-form {
    margin: 0;
}

/* Botão excluir pagamento */

.credflow-button-danger-outline {
    background: #ffffff;

    border: 1px solid #dc2626;

    color: #c62828;
}

.credflow-button-danger-outline:hover {
    background: #dc2626;

    border-color: #dc2626;

    color: #ffffff;
}

/* Responsivo */

@media (max-width: 768px) {

    .credflow-payment-history-panel {
        padding: 15px;
    }

    .credflow-payment-history-header {
        align-items: flex-start;
        gap: 12px;
    }

    .credflow-payment-history-item {
        padding: 14px;
    }

    .credflow-payment-history-table td {
        padding: 9px 5px;

        font-size: 13px;
    }

}
/* =========================================================
   MENU RESPONSIVO
   ========================================================= */

/* Botão do menu mobile - escondido no desktop */

.credflow-mobile-menu-toggle {
    display: none;
}


/* Botão fechar - escondido no desktop */

.credflow-sidebar-close {
    display: none;
}


/* Overlay - escondido por padrão */

.credflow-sidebar-overlay {
    display: none;
}


/* =========================================================
   TABLET E MOBILE
   ========================================================= */

@media (max-width: 768px) {

    /* Estrutura principal */

    .credflow-layout {
        display: block;
        min-height: 100vh;
    }


    /* Botão Menu */

    .credflow-mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 18px;
    left: 14px;

    width: 42px;
    height: 42px;

    padding: 0;

    background: transparent;
    border: none;
    border-radius: 6px;

    color: #ffffff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    box-shadow: none;

    z-index: 1002;
}


    .credflow-mobile-menu-icon {
        font-size: 38px;
        line-height: 1;
    }


    /* Conteúdo principal */

    .credflow-main {
        width: 100%;
        margin-left: 0;
        padding-top: 72px;
    }


    /* Sidebar */

    .credflow-sidebar {
        position: fixed;

        top: 0;
        left: 0;

        width: 280px;
        max-width: 85vw;

        height: 100vh;

        transform: translateX(-100%);

        transition: transform 0.25s ease;

        z-index: 1004;

        overflow-y: auto;
    }


    /* Sidebar aberta */

    .credflow-layout.credflow-sidebar-open
        .credflow-sidebar {

        transform: translateX(0);
    }


    /* Cabeçalho da sidebar */

    .credflow-sidebar-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }


    /* Botão fechar */

    .credflow-sidebar-close {
        display: flex;

        align-items: center;
        justify-content: center;

        width: 36px;
        height: 36px;

        padding: 0;

        border: 0;
        border-radius: 8px;

        background: rgba(255, 255, 255, 0.12);
        color: inherit;

        font-size: 26px;
        line-height: 1;

        cursor: pointer;
    }


    /* Overlay */

    .credflow-sidebar-overlay {
        display: block;

        position: fixed;

        inset: 0;

        background: rgba(0, 0, 0, 0.45);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;

        z-index: 1003;
    }


    /* Overlay ativo */

    .credflow-layout.credflow-sidebar-open
        .credflow-sidebar-overlay {

        opacity: 1;
        visibility: visible;
    }


    /* Evita rolagem do fundo */

    body.credflow-menu-open {
        overflow: hidden;
    }

}
/* =========================================================
   RESPONSIVIDADE - PARCELAS E PAGAMENTOS
   ========================================================= */

@media (max-width: 768px) {

    /*
     * Remove o cabeçalho tradicional da tabela
     */

    .credflow-installments-table thead {
        display: none;
    }


    /*
     * Tabela ocupa toda a largura
     */

    .credflow-installments-table,
    .credflow-installments-table tbody,
    .credflow-installments-table tr,
    .credflow-installments-table td {
        display: block;
        width: 100%;
    }


    /*
     * Cada parcela vira um card
     */

    .credflow-installments-table
    tbody
    > tr:not(.credflow-payment-history-row) {

        margin-bottom: 16px;
        padding: 16px;

        border: 1px solid #e5e7eb;
        border-radius: 12px;

        background: #ffffff;

        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.05);
    }


    /*
     * Cada informação da parcela
     */

    .credflow-installments-table
    tbody
    > tr:not(.credflow-payment-history-row)
    > td {

        display: flex;

        align-items: center;
        justify-content: space-between;
        gap: 16px;

        min-height: 44px;

        padding: 10px 0;

        border: 0;
        border-bottom: 1px solid #f1f3f5;

        text-align: right;
    }


    /*
     * Nome do campo
     */

    .credflow-installments-table
    tbody
    > tr:not(.credflow-payment-history-row)
    > td::before {

        content: attr(data-label);

        flex-shrink: 0;

        color: #6b7280;

        font-size: 12px;
        font-weight: 600;

        text-transform: uppercase;

        text-align: left;
    }


    /*
     * Última linha sem separador
     */

    .credflow-installments-table
    tbody
    > tr:not(.credflow-payment-history-row)
    > td:last-child {

        border-bottom: 0;
        padding-bottom: 0;
    }


    /*
     * Primeira informação da parcela
     */

    .credflow-installments-table
    tbody
    > tr:not(.credflow-payment-history-row)
    > td:first-child {

        padding-top: 0;

        font-size: 17px;
        font-weight: 700;
        color: #1f2937;
    }


    /*
     * Coluna de pagamento
     */

    .credflow-payment-column {

        align-items: flex-end !important;
        flex-direction: column;

        gap: 8px !important;

        text-align: right;
    }


    .credflow-payment-column::before {

        align-self: flex-start;
    }


    /*
     * Resumo do pagamento
     */

    .credflow-payment-summary {

        display: flex;

        align-items: flex-end;
        flex-direction: column;

        gap: 2px;
    }


    /*
     * Botão histórico
     */

    .credflow-payment-history-toggle {

        width: 100%;
        margin-top: 4px;
    }


    /*
     * Coluna de ação
     */

    .credflow-installment-action {

        align-items: stretch !important;
        flex-direction: column;

        gap: 10px !important;

        text-align: left !important;
    }


    .credflow-installment-action::before {

        align-self: flex-start;
    }


    .credflow-installment-action .button {

        width: 100%;

        min-height: 42px;

        display: flex;
        align-items: center;
        justify-content: center;
    }

    /*
     * Linha do histórico
     * Mantém o comportamento separado da parcela
     */
    .credflow-payment-history-row {

        display: block !important;

        margin-top: -8px;
        margin-bottom: 16px;

        border: 0 !important;
        background: transparent !important;
    }
    .credflow-payment-history-row td {

        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
    }
    .credflow-payment-history-row td::before {

        display: none !important;
    }
}

/* =========================================================
   RESPONSIVIDADE - TABELA DE EMPRÉSTIMOS
   ========================================================= */

@media (max-width: 768px) {

    /*
     * Oculta o cabeçalho tradicional
     */

    .credflow-loans-table thead {
        display: none;
    }


    /*
     * Estrutura da tabela
     */

    .credflow-loans-table,
    .credflow-loans-table tbody,
    .credflow-loans-table tr,
    .credflow-loans-table td {
        display: block;
        width: 100%;
    }


    /*
     * Cada empréstimo vira um card
     */

    .credflow-loans-table
    tbody
    > tr:not(:has(.credflow-table-empty)) {

        margin-bottom: 16px;
        padding: 16px;

        background: #ffffff;

        border: 1px solid #e5e7eb;
        border-radius: 12px;

        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.05);
    }


    /*
     * Cada informação dentro do card
     */

    .credflow-loans-table
    tbody
    > tr
    > td:not(.credflow-table-empty) {

        display: flex;

        align-items: center;
        justify-content: space-between;

        gap: 16px;

        min-height: 44px;

        padding: 10px 0;

        border: 0;
        border-bottom: 1px solid #f1f3f5;

        text-align: right;
    }


    /*
     * Rótulo do campo
     */

    .credflow-loans-table
    tbody
    > tr
    > td:not(.credflow-table-empty)::before {

        content: attr(data-label);

        flex-shrink: 0;

        color: #6b7280;

        font-size: 12px;
        font-weight: 600;

        text-transform: uppercase;

        text-align: left;
    }


    /*
     * Cliente em destaque
     */

    .credflow-loans-table
    tbody
    > tr
    > td:first-child {

        padding-top: 0;

        font-size: 16px;
        font-weight: 700;

        color: #1f2937;
    }


    /*
     * Última linha sem separador
     */

    .credflow-loans-table
    tbody
    > tr
    > td:last-child {

        border-bottom: 0;

        padding-bottom: 0;
    }


    /*
     * Status
     */

    .credflow-loans-table .credflow-status {
        white-space: nowrap;
    }


    /*
     * Área de ações
     */

    .credflow-loan-actions {

        align-items: stretch !important;

        flex-direction: column;

        gap: 10px !important;

        text-align: left !important;
    }


    .credflow-loan-actions::before {

        align-self: flex-start;
    }
    .credflow-loan-actions .credflow-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 42px;
    }
    /*
     * Mensagem de tabela vazia
     */
    .credflow-loans-table .credflow-table-empty {

        display: block;
        padding: 20px !important;
        text-align: center !important;
    }
    .credflow-loans-table .credflow-table-empty::before {
        display: none;
    }

}