/**
 * Sales Summary Dashboard v4
 * Responsive & Modern Design
 */

/* Container */
.sales-summary-container-rtx247 {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Filter Section */
.sales-filter-section-rtx247 {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filter-controls-rtx247 {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-range-group-rtx247 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-range-group-rtx247 label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.date-input-rtx247 {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.date-input-rtx247:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-filter-rtx247 {
    background: #3b82f6;
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter-rtx247:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quick-filter-group-rtx247 {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-quick-rtx247 {
    padding: 8px 20px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #374151;
}

.btn-quick-rtx247:hover,
.btn-quick-rtx247.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* Loading Overlay */
.loading-overlay-rtx247 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-rtx247 {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin-rtx247 1s linear infinite;
}

@keyframes spin-rtx247 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay-rtx247 p {
    color: #fff;
    margin-top: 20px;
    font-size: 16px;
}

/* KPI Cards */
.kpi-cards-section-rtx247 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card-rtx247 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.kpi-card-rtx247:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.kpi-card-rtx247:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.kpi-card-rtx247:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.kpi-card-rtx247:hover {
    transform: translateY(-5px);
}

.kpi-icon-rtx247 {
    font-size: 40px;
    opacity: 0.9;
}

.kpi-content-rtx247 {
    flex: 1;
}

.kpi-title-rtx247 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    opacity: 0.9;
}

.kpi-value-rtx247 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.kpi-growth-rtx247,
.kpi-percentage-rtx247 {
    font-size: 13px;
    opacity: 0.8;
    display: inline-block;
    margin-top: 5px;
}

/* Charts Section */
.charts-section-rtx247 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container-rtx247 {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-title-rtx247 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.chart-container-rtx247 canvas {
    max-height: 300px;
}

/* Document Summary */
.document-summary-section-rtx247 {
    margin-bottom: 30px;
}

.section-title-rtx247 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.document-grid-rtx247 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.doc-card-rtx247 {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    border-left: 4px solid #3b82f6;
    transition: transform 0.3s;
}

.doc-card-rtx247:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.doc-card-rtx247 h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px 0;
}

.doc-count-rtx247 {
    font-size: 12px;
    color: #6b7280;
    margin: 5px 0;
}

.doc-amount-rtx247 {
    font-size: 18px;
    font-weight: 700;
    color: #3b82f6;
    margin: 5px 0 0 0;
}

/* Tables Section */
.table-section-rtx247 {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.table-responsive-rtx247 {
    overflow-x: auto;
    margin-top: 15px;
}

.data-table-rtx247 {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table-rtx247 thead {
    background: #f9fafb;
}

.data-table-rtx247 th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.data-table-rtx247 td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
}

.data-table-rtx247 tbody tr:hover {
    background: #f9fafb;
}

.data-table-rtx247 tbody tr:last-child td {
    border-bottom: none;
}

.amount-cell-rtx247 {
    font-weight: 600;
    color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sales-summary-container-rtx247 {
        padding: 15px;
    }

    .date-range-group-rtx247 {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input-rtx247,
    .btn-filter-rtx247 {
        width: 100%;
    }

    .kpi-cards-section-rtx247 {
        grid-template-columns: 1fr;
    }

    .charts-section-rtx247 {
        grid-template-columns: 1fr;
    }

    .kpi-value-rtx247 {
        font-size: 24px;
    }

    .data-table-rtx247 {
        font-size: 12px;
    }

    .data-table-rtx247 th,
    .data-table-rtx247 td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .kpi-card-rtx247 {
        flex-direction: column;
        text-align: center;
    }

    .document-grid-rtx247 {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sales-filter-section-rtx247 {
        display: none;
    }

    .kpi-card-rtx247 {
        break-inside: avoid;
    }

    .chart-container-rtx247,
    .table-section-rtx247 {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}