.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;
    gap: 10px;
    align-items: center;
}

.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(3, 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;
}

.source-counts-panel {
    background: #fff;
    margin: 12px 24px 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.source-counts-title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.source-counts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
}

.source-count-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}

.source-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.source-value {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.kpi-grid {
    margin: 20px 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 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: 24px;
    font-weight: 800;
    color: #111827;
}

.kpi-card.income { border-left: 4px solid #15803d; }
.kpi-card.expense { border-left: 4px solid #b91c1c; }
.kpi-card.gross { border-left: 4px solid #1d4ed8; }
.kpi-card.net { border-left: 4px solid #7c3aed; }
.kpi-card.margin { border-left: 4px solid #0f766e; }

.content-grid {
    margin: 0 24px 24px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 16px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.card h3 {
    margin: 0 0 14px;
    font-size: 16px;
    color: #111827;
    display: flex;
    gap: 8px;
    align-items: center;
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.statement-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.statement-table td:last-child {
    text-align: right;
    font-weight: 700;
}

.statement-table tr.section td {
    background: #f8fafc;
    font-weight: 800;
    color: #334155;
}

.statement-table tr.total td,
.statement-table tr.subtotal td {
    font-weight: 800;
}

.statement-table tr.final td {
    background: #ecfeff;
    color: #0f172a;
}

.negative {
    color: #b91c1c !important;
}

.chart-card canvas {
    width: 100%;
    min-height: 280px;
}

.table-card {
    grid-column: span 1;
}

.table-wrap {
    overflow-x: auto;
    max-height: 320px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th,
table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}

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;
}

.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;
}

@media (max-width: 1300px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-panel {
        grid-template-columns: 1fr;
        margin: 12px;
    }

    .source-counts-panel {
        margin: 0 12px;
    }

    .source-counts-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .kpi-grid {
        margin: 12px;
        grid-template-columns: 1fr;
    }

    .content-grid {
        margin: 0 12px 12px;
    }
}
