﻿/* =========================================================
   DMB FinCore - Contas BancÃ¡rias
   Escopo: somente pÃ¡ginas com .accounts-page
   ========================================================= */

.accounts-page {
    width: 100%;
}

.accounts-page .module-header {
    align-items: flex-start;
}

.accounts-page .module-header-actions {
    flex-shrink: 0;
}

.accounts-page .accounts-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.accounts-page .summary-card {
    min-height: 116px;
}

.accounts-page .summary-content {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.accounts-page .summary-content strong {
    margin-top: 0.35rem;
    font-size: clamp(1.3rem, 1.65vw, 1.7rem);
    white-space: nowrap;
}

.accounts-page .summary-content small {
    margin-top: 0.25rem;
    line-height: 1.25;
}

.accounts-page .summary-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.accounts-page .account-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(4px);
}

.accounts-page .account-modal {
    width: min(1120px, 96vw);
    max-height: calc(100vh - 3rem);
    margin: auto;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.accounts-page .account-modal .form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.accounts-page .account-modal .form-card-header h2 {
    margin: 0;
}

.accounts-page .account-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.accounts-page .account-modal-close:hover {
    border-color: #1d4ed8;
    background: #dbeafe;
}

.accounts-page .account-modal-feedback {
    margin: 0 0 1.25rem;
}

.accounts-page .field-validation-message {
    display: block;
    margin-top: 0.35rem;
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 700;
}

.accounts-page .form-field:has(.field-validation-message) > input,
.accounts-page .form-field:has(.field-validation-message) > select {
    border-color: #ef4444;
    background: #fff7f7;
}

.accounts-page .feature-card,
.accounts-page .form-section,
.accounts-page .feature-filters,
.accounts-page .feature-table-card {
    border-color: #dbe3ef;
}

.accounts-page .feature-table tbody tr:hover {
    background: #f8fbff;
}

.accounts-page .feature-status-active,
.accounts-page .status-active {
    color: #059669;
    font-weight: 900;
}

.accounts-page .feature-status-inactive,
.accounts-page .status-inactive {
    color: #64748b;
    font-weight: 900;
}

.accounts-page .feature-money-positive {
    color: #047857;
    font-weight: 900;
}

.accounts-page .feature-money-negative {
    color: #dc2626;
    font-weight: 900;
}

/* A tabela segue o mesmo padrão aprovado em Unidades. */
.accounts-page .table-card,
.accounts-page .table-responsive,
.accounts-page .data-table {
    overflow: visible;
}

.accounts-page .data-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    vertical-align: middle;
}

.accounts-page .data-table th,
.accounts-page .data-table td {
    line-height: 1.35;
}

.accounts-page .data-table th:nth-child(7),
.accounts-page .data-table td:nth-child(7) {
    width: 100px;
    min-width: 100px;
    text-align: center;
}

.accounts-page .data-table th:last-child,
.accounts-page .data-table td:last-child {
    width: 96px;
    min-width: 96px;
    text-align: center;
}

.accounts-page .account-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.accounts-page .account-status-badge.active {
    color: #047857;
    background: #d1fae5;
}

.accounts-page .account-status-badge.inactive {
    color: #b91c1c;
    background: #fee2e2;
}

.accounts-page .actions-cell {
    position: relative;
    z-index: 1;
    overflow: visible;
}

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

.accounts-page .kebab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    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: none;
}

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

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

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

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

.accounts-page .kebab-menu button.danger {
    color: #b91c1c;
}

.accounts-page .kebab-menu button.danger:hover {
    background: #fff1f2;
    color: #b91c1c;
}

.accounts-page .kebab-menu button.success {
    color: #047857;
}

.accounts-page .kebab-menu button.success:hover {
    background: #ecfdf5;
    color: #047857;
}

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

.accounts-page .data-table tbody tr {
    position: relative;
    z-index: 0;
}

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

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

.accounts-page .pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.accounts-page .pagination-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    color: #1d4ed8;
    background: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
}

.accounts-page .pagination-controls button:disabled {
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .accounts-page .accounts-summary-grid {
        grid-template-columns: 1fr;
    }

    .accounts-page .feature-title {
        font-size: 2.25rem;
    }

    .accounts-page .module-header-actions,
    .accounts-page .module-header-actions .btn {
        width: 100%;
    }

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

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

    .accounts-page .account-modal-overlay {
        align-items: flex-start;
        padding: 0.5rem;
    }

    .accounts-page .account-modal {
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }
}

@media (min-width: 761px) and (max-width: 1350px) {
    .accounts-page .accounts-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
