.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.module-header h1 {
    margin: 0;
    font-size: 28px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-header p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    background: #fff;
    margin: 20px 24px 0;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
}

.kpi-grid {
    margin: 20px 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.kpi-title {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 700;
}

.kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.tab-buttons {
    margin: 0 24px;
    display: flex;
    gap: 10px;
}

.tab-btn {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.tab-btn.active {
    background: #0d47a1;
    color: #fff;
    border-color: #0d47a1;
}

.content-grid {
    margin: 16px 24px 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card canvas {
    width: 100%;
    min-height: 270px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-wrap {
    overflow: auto;
    max-height: 420px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th,
table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    white-space: nowrap;
}

table th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

table td.amount {
    text-align: right;
    font-weight: 700;
}

.empty {
    text-align: center;
    color: #64748b;
}

.account-filter-row {
    margin-bottom: 12px;
    max-width: 320px;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: #0d47a1;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-warning {
    background: #b45309;
    color: #fff;
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
}

@media (max-width: 980px) {
    .filter-panel {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 768px) {
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-panel,
    .kpi-grid,
    .tab-buttons,
    .content-grid {
        margin-left: 12px;
        margin-right: 12px;
    }

    .filter-panel {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .tab-buttons {
        flex-wrap: wrap;
    }
}
