﻿/* =========================================================
   DMB FinCore - ClassificaÃ§Ãµes Financeiras
   Escopo: somente pÃ¡ginas com .financial-classifications-page
   ========================================================= */

.financial-classifications-page {
    width: 100%;
}

.financial-classifications-page .module-header {
    align-items: center;
}

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

.financial-classifications-page .classification-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.financial-classifications-page .summary-card {
    min-height: 104px;
}

.financial-classifications-page .summary-content {
    flex: 1;
    text-align: center;
}

.financial-classifications-page .summary-content strong {
    margin-top: .4rem;
    font-size: 1.75rem;
}

.financial-classifications-page .summary-icon svg,
.financial-classifications-page .row-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

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

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

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

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

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

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

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

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

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

.financial-classifications-page .classification-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;
}

.financial-classifications-page .classification-status-badge.active {
    color: #047857;
    background: #d1fae5;
}

.financial-classifications-page .classification-status-badge.inactive {
    color: #b91c1c;
    background: #fee2e2;
}

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

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

.financial-classifications-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);
}

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

.financial-classifications-page .kebab-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    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);
}

.financial-classifications-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;
}

.financial-classifications-page .kebab-menu button.danger {
    color: #dc2626;
}

.financial-classifications-page .kebab-menu button.success {
    color: #059669;
}

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

.financial-classifications-page .data-table tbody tr:nth-last-child(-n+2) .kebab-menu {
    top: auto;
    bottom: calc(100% + .45rem);
}

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

.classification-modal {
    width: min(980px, 96vw);
    max-height: calc(100vh - 4rem);
    margin: 0;
    overflow-y: auto;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .3);
}

.classification-modal .form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.financial-classifications-page .field-validation-message {
    display: block;
    margin-top: .35rem;
    color: #b91c1c;
    font-size: .8rem;
    font-weight: 700;
}

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

.classification-pagination {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #0b1f3a;
}

.classification-pagination button {
    width: 40px;
    height: 40px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    color: #1d4ed8;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.classification-pagination button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.financial-classifications-page .table-footer {
    align-items: center;
}

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

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

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

.financial-classifications-page .actions-cell.is-open,
.financial-classifications-page .actions-cell.is-open .classification-actions-menu {
    z-index: 120;
}

@media (max-width: 1050px) {
    .financial-classifications-page .classification-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .financial-classifications-page .feature-title {
        font-size: 2.25rem;
    }

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

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

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

    .financial-classifications-page .classification-summary-grid {
        grid-template-columns: 1fr;
    }

    .classification-modal-overlay {
        padding: .5rem;
    }

    .classification-modal {
        width: 100%;
        max-height: calc(100vh - 1rem);
    }
}
