/* --- SCOPED CSS FOR SALES REPORT --- */
.sr-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.sr-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .sr-header-text h1 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
        color: #1e293b;
    }

    .sr-header-text p {
        margin: 0;
        font-size: 13px;
        color: #64748b;
    }

.sr-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sr-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sr-btn-outline {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

    .sr-btn-outline:hover {
        background-color: #f8fafc;
        border-color: #94a3b8;
        color: #334155;
    }

.sr-btn-solid {
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

    .sr-btn-solid:hover {
        background-color: #2563eb;
    }

/* --- Statistics Grid (Auto-Responsive) --- */
.sr-stats-grid {
    display: grid;
    /* Automatically creates 1 col on mobile, 2 on tablet, 4 on desktop */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.sr-stat-card {
    border-radius: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
    border-left-width: 4px;
    position: relative;
    overflow: hidden;
}

.sr-card-green {
    border-left-color: #22c55e;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 70%);
}

.sr-card-blue {
    border-left-color: #3b82f6;
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 70%);
}

.sr-card-orange {
    border-left-color: #b45309;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 70%);
}

.sr-card-red {
    border-left-color: #dc2626;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 70%);
}

.sr-stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sr-stat-title {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.sr-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.sr-stat-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

.sr-trend-positive {
    color: #10b981;
}

.sr-trend-negative {
    color: #ef4444;
}

.sr-stat-icon-box {
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

    .sr-stat-icon-box svg {
        width: 18px;
        height: 18px;
    }

.sr-icon-green {
    color: #22c55e;
}

.sr-icon-blue {
    color: #3b82f6;
}

.sr-icon-orange {
    color: #b45309;
}

.sr-icon-red {
    color: #dc2626;
}

/* --- Charts Section Grid (Auto-Responsive) --- */
.sr-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    font-family: 'Inter', sans-serif;
}

.sr-chart-card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
}

    .sr-chart-card h3 {
        margin: 0 0 20px 0;
        font-size: 15px;
        font-weight: 600;
        color: #334155;
    }

.sr-chart-area {
    position: relative;
    width: 100%;
    height: 260px;
}

/* Custom HTML Legends */
.custom-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.custom-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.leg-orange {
    color: #d97706;
}

.leg-purple {
    color: #9333ea;
}

.leg-blue {
    color: #3b82f6;
}

.leg-green {
    color: #10b981;
}

/* --- Filters Section (Auto-Responsive) --- */
.sr-filter-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 24px;
    font-family: 'Inter', sans-serif;
}

.sr-filter-header {
    background-color: #f1f5f9;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.sr-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.sr-filter-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sr-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px 24px;
}

.sr-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sr-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.sr-form-select {
    appearance: none;
    background-color: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #94a3b8;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    outline: none;
    width: 100%;
}

    .sr-form-select:focus {
        border-color: #3b82f6;
    }

.sr-filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Table Section --- */
.sr-table-card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    max-width: 100%;
    overflow: hidden;
}

.sr-table-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

    .sr-table-top h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #334155;
    }

.sr-search-input {
    appearance: none;
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 8px 16px 8px 36px;
    font-size: 13px;
    color: #334155;
    width: 240px;
    max-width: 100%;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    transition: border-color 0.2s;
}

    .sr-search-input:focus {
        border-color: #3b82f6;
    }

.sr-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

    .sr-table th {
        background-color: #f1f5f9;
        color: #475569;
        font-weight: 600;
        font-size: 13px;
        padding: 12px 16px;
        text-align: center;
        white-space: nowrap;
    }

    .sr-table td {
        padding: 16px;
        text-align: center;
        border-bottom: 1px solid #f1f5f9;
        font-size: 13px;
        color: #334155;
        vertical-align: middle;
    }

    .sr-table tr:last-child td {
        border-bottom: none;
    }

.sr-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

    .sr-checkbox:checked {
        background-color: #3b82f6;
        border-color: #3b82f6;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
        background-position: center;
        background-repeat: no-repeat;
    }

.txt-red {
    color: #ef4444;
    font-weight: 600;
}

.txt-yellow {
    color: #ca8a04;
    font-weight: 600;
}

.txt-green {
    color: #22c55e;
    font-weight: 600;
}

.txt-orange {
    color: #f97316;
    font-weight: 600;
}

.sr-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

    .sr-status .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

.st-red {
    background: #fee2e2;
    color: #ef4444;
}

    .st-red .dot {
        background: #ef4444;
    }

.st-yellow {
    background: #fef9c3;
    color: #ca8a04;
}

    .st-yellow .dot {
        background: #ca8a04;
    }

.st-green {
    background: #dcfce7;
    color: #22c55e;
}

    .st-green .dot {
        background: #22c55e;
    }

.st-orange {
    background: #ffedd5;
    color: #f97316;
}

    .st-orange .dot {
        background: #f97316;
    }

.sr-action-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: opacity 0.2s;
}

    .sr-action-btn:hover {
        opacity: 0.7;
    }

/* Pagination */
.sr-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 4px;
}

.sr-page-size {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.sr-page-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.sr-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

    .sr-page-btn:hover:not(.dots) {
        background-color: #f8fafc;
    }

    .sr-page-btn.active {
        background-color: #f1f5f9;
        border-color: #e2e8f0;
        font-weight: 600;
        color: #1e293b;
    }

    .sr-page-btn.dots {
        border: none;
        background: transparent;
        cursor: default;
    }


/* --- Explicit Mobile Safeties --- */
@@media (max-width: 640px) {
    .sr-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sr-action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 10px;
    }

        .sr-action-buttons .sr-btn {
            justify-content: center;
            width: 100%;
        }

    .sr-table-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sr-search-input {
        width: 100%;
    }

    .sr-filter-actions {
        flex-direction: column;
        width: 100%;
    }

        .sr-filter-actions .sr-btn {
            width: 100%;
            justify-content: center;
        }

    .sr-pagination {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
}

