/* revenueInsights.css - Professional Financial SaaS Version */

/* ===== REVENUE INSIGHTS WRAPPER ===== */
.revenue-insights-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;

    max-width: 1200px; /* Maximum width for readability */
    margin: 0 auto; /* Center the content */}

.revenue-insights-wrapper .cvp-metrics-grid {
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: minmax(250px, 400px);
    justify-content: center;
    gap: 1rem;
}

/* ===== REVENUE INSIGHTS LAYOUT ===== */
.revenue-insights-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

/* ===== REVENUE CHART CONTAINER ===== */
.revenue-chart-container {
    flex: 1 1 350px;
    min-height: 300px;
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#revenueBreakdownChart {
    max-height: 350px;
}

/* ===== REVENUE TABLE CONTAINER ===== */
.revenue-table-container {
    flex: 2 1 400px;
    min-width: 300px;
}

/* ===== REVENUE DETAILS TABLE ===== */
.revenue-details-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.revenue-details-table th,
.revenue-details-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
}

.revenue-details-table thead th {
    background-color: #f9fafb;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.revenue-details-table tbody td {
    color: #1f2937;
}

.revenue-details-table .amount-column,
.revenue-details-table .percentage-column {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 400;
}

.revenue-details-table tfoot td {
    font-weight: 500;
    background-color: #f9fafb;
    color: #1f2937;
    border-top: 2px solid #d1d5db;
}

.revenue-details-table tfoot .amount-column,
.revenue-details-table tfoot .percentage-column {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.revenue-details-table tbody tr:hover {
    background-color: #f9fafb;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .revenue-insights-layout {
        flex-direction: column;
    }

    .revenue-chart-container {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .revenue-table-container {
        flex: 1 1 auto;
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .revenue-insights-wrapper .cvp-metrics-grid {
        grid-template-columns: 1fr;
        margin-bottom: 1.25rem;
    }

    .revenue-insights-layout {
        gap: 1rem;
    }

    .revenue-chart-container {
        padding: 0.875rem;
        min-height: 250px;
    }

    #revenueBreakdownChart {
        max-height: 300px;
    }

    .revenue-details-table {
        font-size: 0.8125rem;
    }

    .revenue-details-table th,
    .revenue-details-table td {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .revenue-chart-container {
        padding: 0.75rem;
        min-height: 200px;
    }

    #revenueBreakdownChart {
        max-height: 250px;
    }

    .revenue-details-table {
        font-size: 0.75rem;
    }

    .revenue-details-table th,
    .revenue-details-table td {
        padding: 0.5rem;
    }

    .revenue-details-table thead th {
        font-size: 0.75rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .revenue-insights-wrapper .cvp-metrics-grid {
        page-break-inside: avoid;
    }

    .revenue-insights-layout {
        display: block;
    }

    .revenue-chart-container {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        max-width: 100%;
        box-shadow: none;
        border: 1px solid #d1d5db;
    }

    .revenue-table-container {
        page-break-inside: avoid;
    }

    .revenue-details-table {
        page-break-inside: avoid;
        border: 1px solid #d1d5db;
    }

    .revenue-details-table thead th {
        background-color: #f3f4f6;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .revenue-details-table tfoot td {
        background-color: #f3f4f6;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .revenue-details-table tbody tr:hover {
        background-color: transparent;
    }
}

/* ===== ACCESSIBILITY ===== */
.revenue-chart-container:focus-within,
.revenue-details-table:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.revenue-details-table th,
.revenue-details-table td {
    position: relative;
}

.revenue-details-table tbody tr:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}
