/* --- SCOPED CSS FOR STOCK REPORT --- */
/* Global Box Sizing */
.spic-sr-container,
.spic-sr-container *,
.spic-sr-container *::before,
.spic-sr-container *::after {
    box-sizing: border-box;
}

/* Scoped Container */
.spic-sr-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #F5F8F9;
    padding: 24px;
    color: #334155;
    width: 100%;
    overflow-x: hidden;
}

/* Header Section */
.sr-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.sr-header-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.sr-header-text p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.sr-action-buttons {
    display: flex;
    gap: 12px;
}

.sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .sr-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
    }

.sr-btn-outline {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
}

    .sr-btn-outline:hover {
        background: #f8fafc;
    }

.sr-btn-solid {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: white;
}

    .sr-btn-solid:hover {
        background: #1d4ed8;
    }

/* Filters Section */
.sr-filter-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.sr-filter-header {
    background: #F8FAFC;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
}

.sr-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #334155;
}

.sr-filter-body {
    padding: 24px;
}

.sr-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.sr-form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Prevent the browser from showing native expanded <select multiple>
   controls before Select2 finishes initialization. */
.spic-sr-container select.sr-form-select[multiple]:not(.select2-hidden-accessible) {
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Temporary closed-dropdown appearance. It disappears automatically when
   Select2 adds the select2-hidden-accessible class to the native select. */
.spic-sr-container .sr-filter-grid .sr-form-group:has( > select.sr-form-select[multiple]:not(.select2-hidden-accessible) )::after {
    content: "Select an option";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 40px 0 12px;
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    background-color: #f8fafc;
    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='%2364748b' 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;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    pointer-events: none;
}

.sr-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #f8fafc;
    font-size: 14px;
    color: #334155;
    outline: none;
    appearance: none;
    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='%2364748b' 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;
    text-overflow: ellipsis;
}

/* Select2 overrides to match .sr-form-select exactly */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 42px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background-color: #f8fafc !important;
    font-size: 14px !important;
    color: #334155 !important;
    outline: none !important;
    position: relative !important;
    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='%2364748b' 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") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
}

.select2-container--default .select2-selection--single {
    padding: 10px 12px !important;
    height: auto !important;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple {
    padding: 4px 45px 4px 6px !important;
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #334155 !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    line-height: normal !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: auto !important;
    max-width: 100% !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    color: #334155 !important;
    font-size: 13px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #64748b !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear,
.select2-container--default .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    right: 32px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    line-height: 1 !important;
}

.select2-search--inline {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 140px !important;
}

    .select2-search--inline .select2-search__field {
        width: 100% !important;
        min-width: 140px !important;
        max-width: 100% !important;
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: inherit !important;
        color: #334155 !important;
        height: 30px !important;
        line-height: 30px !important;
        vertical-align: middle !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: none !important;
    }

.sr-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

/* Dashboard initial-load and refresh states */
.sr-dashboard-skeleton,
.sr-dashboard-content {
    position: relative;
    width: 100%;
}

.sr-dashboard-content {
    transition: opacity 0.2s ease, filter 0.2s ease;
}

    .sr-dashboard-content.is-refreshing {
        opacity: 0.68;
        filter: grayscale(15%);
        pointer-events: none;
        user-select: none;
    }

.sr-loading-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    margin: -6px 0 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.sr-refresh-indicator {
    position: absolute;
    top: -14px;
    right: 0;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    font-size: 12px;
    font-weight: 600;
}

.sr-inline-spinner {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sr-spin 0.75s linear infinite;
}

.sr-dashboard-warning,
.sr-empty-state {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.sr-dashboard-warning {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.sr-empty-state {
    display: flex;
    min-height: 160px;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

/* Shared shimmer block */
.sr-skeleton-block {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e8eef5;
    border-radius: 6px;
}

    .sr-skeleton-block::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient( 90deg, transparent 0%, rgba(255, 255, 255, 0.68) 50%, transparent 100% );
        animation: sr-shimmer 1.35s ease-in-out infinite;
    }

.sr-skeleton-stat-card {
    min-height: 136px;
    background: #ffffff;
    border-left-color: #e2e8f0;
}

.sr-skeleton-stat-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 13px;
}

.sr-skeleton-title {
    width: 62%;
    height: 14px;
}

.sr-skeleton-value {
    width: 44%;
    height: 25px;
}

.sr-skeleton-trend {
    width: 72%;
    height: 12px;
}

.sr-skeleton-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
}

.sr-skeleton-chart-card {
    min-height: 348px;
}

.sr-skeleton-heading {
    width: min(230px, 58%);
    height: 17px;
    margin-bottom: 28px;
}

.sr-skeleton-bar-chart {
    display: flex;
    height: 228px;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;
    padding: 16px 12px 0;
    border-bottom: 1px solid #e2e8f0;
    background-image: linear-gradient(to bottom, transparent calc(25% - 1px), #edf2f7 25%, transparent calc(25% + 1px));
    background-size: 100% 25%;
}

    .sr-skeleton-bar-chart .sr-skeleton-block {
        width: clamp(12px, 2.2vw, 24px);
        border-radius: 5px 5px 0 0;
    }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(1),
        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(6) {
            height: 38%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(2),
        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(8) {
            height: 62%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(3) {
            height: 48%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(4),
        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(9) {
            height: 78%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(5) {
            height: 56%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(7) {
            height: 70%;
        }

        .sr-skeleton-bar-chart .sr-skeleton-block:nth-child(10) {
            height: 45%;
        }

.sr-skeleton-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
}

    .sr-skeleton-chart-legend .sr-skeleton-block {
        width: 110px;
        height: 13px;
    }

.sr-skeleton-donut-layout {
    display: flex;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.sr-skeleton-donut {
    position: relative;
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
    overflow: hidden;
    border: 26px solid #e8eef5;
    border-radius: 50%;
}

    .sr-skeleton-donut::after {
        content: "";
        position: absolute;
        inset: -28px;
        transform: translateX(-100%);
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
        animation: sr-shimmer 1.35s ease-in-out infinite;
    }

.sr-skeleton-donut-legend {
    display: flex;
    width: min(180px, 42%);
    flex-direction: column;
    gap: 18px;
}

    .sr-skeleton-donut-legend .sr-skeleton-block {
        width: 100%;
        height: 16px;
    }

        .sr-skeleton-donut-legend .sr-skeleton-block:nth-child(even) {
            width: 76%;
        }

.sr-skeleton-table-card {
    min-height: 350px;
}

.sr-skeleton-table-title {
    width: 165px;
    height: 19px;
}

.sr-skeleton-search {
    width: 250px;
    height: 36px;
}

.sr-skeleton-table-head,
.sr-skeleton-table-row {
    display: grid;
    grid-template-columns: 0.55fr 1fr 1.35fr 1.1fr 1fr 1fr 1fr 0.9fr 0.7fr;
    gap: 18px;
    align-items: center;
    padding: 13px 24px;
}

.sr-skeleton-table-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

    .sr-skeleton-table-head .sr-skeleton-block {
        height: 12px;
    }

.sr-skeleton-table-row {
    min-height: 52px;
    border-bottom: 1px solid #eef2f7;
}

    .sr-skeleton-table-row .sr-skeleton-block {
        height: 13px;
    }

.sr-skeleton-pagination {
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
}

    .sr-skeleton-pagination .sr-skeleton-block:first-child {
        width: 150px;
        height: 30px;
    }

    .sr-skeleton-pagination .sr-skeleton-block:last-child {
        width: 185px;
        height: 30px;
    }

@keyframes sr-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sr-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Stats Grid */
.sr-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.sr-stat-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    background: white;
}

.sr-stat-content {
    display: flex;
    flex-direction: column;
}

.sr-stat-title {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
    margin-bottom: 8px;
}

.sr-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.sr-stat-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.sr-trend-positive {
    color: #16a34a;
}

.sr-trend-negative {
    color: #dc2626;
}

.sr-stat-icon-box {
    width: 33px;
    height: 33px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.sr-card-green {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
}

.sr-icon-green {
    color: #22c55e;
    border: 1px solid #bbf7d0;
}

.sr-card-blue {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}

.sr-icon-blue {
    color: #3b82f6;
    border: 1px solid #bfdbfe;
}

.sr-card-orange {
    background-color: #fff7ed;
    border-left-color: #f97316;
}

.sr-icon-orange {
    color: #f97316;
    border: 1px solid #fed7aa;
}

.sr-card-red {
    background-color: #fef2f2;
    border-left-color: #ef4444;
}

.sr-icon-red {
    color: #ef4444;
    border: 1px solid #fecaca;
}

/* ======================================================== */
/* ADJUSTABLE CHART VIEWS (GRID LAYOUT MATCHING FIGMA)      */
/* ======================================================== */
.sr-charts-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr; /* Precise ratio for Bar vs Donut */
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.sr-chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allows grid items to shrink */
}

    .sr-chart-card h3 {
        font-size: 16px;
        font-weight: 600;
        margin: 0;
        color: #0f172a;
    }

.sr-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* PURE CSS BAR CHART */
.chart-scroll-wrapper {
    width: 100%;
    flex-grow: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pure-bar-chart {
    position: relative;
    height: 250px;
    width: 100%;
    min-width: 550px; /* Safe scroll width */
    display: flex;
    padding-left: 35px;
    padding-bottom: 30px;
    margin-top: 15px;
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding-right: 10px;
    color: #94a3b8;
    font-size: 11px;
    width: 35px;
}

.chart-grid {
    position: absolute;
    left: 35px;
    right: 0;
    top: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.chart-grid-line {
    width: 100%;
    height: 1px;
    background-image: linear-gradient(to right, #cbd5e1 50%, transparent 50%);
    background-size: 8px 1px;
    background-repeat: repeat-x;
}

.chart-bars-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 0 10px;
}

.chart-bar-group {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100%;
    position: relative;
    cursor: pointer;
    flex: 1;
    justify-content: center;
}

.chart-bar {
    width: clamp(10px, 1.5vw, 16px);
    border-radius: 4px 4px 0 0;
    transition: opacity 0.2s;
    position: relative;
}

    /* 3D Cylindrical Gradient matching Figma */
    .chart-bar.green {
        background: linear-gradient(to right, #dcfce7 0%, #86efac 35%, #4ade80 100%);
    }

    .chart-bar.purple {
        background: linear-gradient(to right, #ede9fe 0%, #a78bfa 35%, #8b5cf6 100%);
    }

.chart-bar-group:hover .chart-bar {
    opacity: 0.8;
}

.bar-val {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #64748b;
    font-weight: 500;
    opacity: 1;
    transition: all 0.2s;
}

.chart-bar-group:hover .bar-val {
    color: #0f172a;
    font-weight: 700;
}

.chart-x-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(9px, 1vw, 11px);
    color: #64748b;
    white-space: nowrap;
}

/* Tooltip */
.chart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    min-width: 180px;
    z-index: 20;
    pointer-events: none;
}

.chart-bar-group:hover .chart-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

.tt-header {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
}

.tt-row {
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

    .tt-row:last-child {
        margin-bottom: 0;
    }

.tt-label {
    flex-grow: 1;
    font-weight: 500;
}

.tt-val {
    font-weight: 700;
    color: #0f172a;
    margin-left: 8px;
}

.tt-unit {
    color: #64748b;
    margin-left: 4px;
    font-weight: 400;
}

/* DONUT CHART WRAPPER (Locked for Desktop, Flex for Mobile) */
.sr-donut-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    height: 100%;
    min-height: 250px;
    flex-wrap: nowrap; /* Ensures Legend stays on the right on Desktop */
}

/* Table Section */
.sr-table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.sr-table-top {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

    .sr-table-top h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

.sr-search-input {
    padding: 8px 16px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #f8fafc;
    width: 250px;
    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='%2364748b' 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;
}

.sr-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

    .sr-table th {
        background-color: #f8fafc;
        padding: 12px 24px;
        text-align: left;
        font-weight: 600;
        color: #475569;
        font-size: 13px;
        border-bottom: 1px solid #e2e8f0;
        white-space: nowrap;
    }

    .sr-table td {
        padding: 16px 24px;
        border-bottom: 1px solid #e2e8f0;
        color: #334155;
        font-size: 14px;
    }

.sr-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.st-red {
    background-color: #fecaca;
    color: #b91c1c;
}

.st-light-green {
    background-color: #dcfce7;
    color: #15803d;
}

.st-green {
    background-color: #bbf7d0;
    color: #166534;
}

.st-orange {
    background-color: #ffedd5;
    color: #c2410c;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.st-red .dot {
    background-color: #ef4444;
}

.st-light-green .dot {
    background-color: #22c55e;
}

.st-green .dot {
    background-color: #16a34a;
}

.st-orange .dot {
    background-color: #f97316;
}

.txt-red {
    color: #ef4444;
    font-weight: 500;
}

.txt-green {
    color: #22c55e;
    font-weight: 500;
}

.txt-orange {
    color: #f97316;
    font-weight: 500;
}

.sr-action-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
}

.sr-pagination {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sr-page-controls {
    display: flex;
    gap: 4px;
}

.sr-page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
}

    .sr-page-btn.active {
        background: #f1f5f9;
        font-weight: 600;
        border-color: #cbd5e1;
    }

    .sr-page-btn.dots {
        border: none;
        background: transparent;
        cursor: default;
    }


/* =========================================================
   SELECT2 SELECTED ITEM / CHIP REMOVE BUTTON FIX
   ========================================================= */

.spic-sr-container
.select2-container--default
.select2-selection--multiple
.select2-selection__choice {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    max-width: calc(100% - 8px);
    min-height: 28px;
    margin: 4px 4px 0 0 !important;
    /* Space on right side for remove button */
    padding: 4px 28px 4px 10px !important;
    background-color: #e8eef7 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
    color: #334155 !important;
    line-height: 18px !important;
    overflow: hidden;
}

/* Selected item text */
.spic-sr-container
.select2-container--default
.select2-selection--multiple
.select2-selection__choice__display {
    display: block;
    padding: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Individual selected-item cancel button */
.spic-sr-container
.select2-container--default
.select2-selection--multiple
.select2-selection__choice__remove {
    position: absolute !important;
    top: 50% !important;
    right: 4px !important;
    left: auto !important;
    transform: translateY(-50%);
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #64748b !important;
    cursor: pointer !important;
    /* Hide the original overlapping × */
    font-size: 0 !important;
    line-height: 1 !important;
    z-index: 2;
}

    /* Draw a clean × icon */
    .spic-sr-container
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove::before {
        content: "\00D7";
        font-size: 16px;
        font-weight: 600;
        line-height: 1;
    }

    /* Hover effect */
    .spic-sr-container
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove:hover {
        background-color: #cbd5e1 !important;
        color: #0f172a !important;
    }

/* ========================================================
       MEDIA QUERIES FOR RESPONSIVENESS
       ======================================================== */

/* iPad / Medium Laptop Screens */
@media (max-width: 1200px) {
    .sr-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sr-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stack the Charts vertically */
    .sr-charts-grid {
        grid-template-columns: 1fr;
    }
    /* Align Donut left when stacked */
    .sr-donut-wrapper {
        justify-content: flex-start;
    }
}

/* Tablets Portrait & Mobile */
@media (max-width: 768px) {
    .sr-skeleton-donut-layout {
        flex-wrap: wrap;
    }

    .sr-skeleton-donut-legend {
        width: 100%;
        max-width: 260px;
    }

    .sr-skeleton-table-head,
    .sr-skeleton-table-row {
        min-width: 900px;
    }

    .sr-skeleton-table-card {
        overflow-x: auto;
    }

    .sr-header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .sr-action-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .sr-action-buttons .sr-btn {
            width: 100%;
            justify-content: center;
        }

    .sr-filter-actions {
        justify-content: stretch;
        width: 100%;
    }

        .sr-filter-actions .sr-btn {
            flex: 1;
            justify-content: center;
        }

    /* Allow donut legend to wrap UNDER the chart on phones */
    .sr-donut-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .sr-refresh-indicator {
        position: static;
        width: fit-content;
        margin: 0 0 12px auto;
    }

    .sr-skeleton-search {
        width: 100%;
    }

    .sr-skeleton-donut {
        width: 150px;
        height: 150px;
        flex-basis: 150px;
    }

    .spic-sr-container {
        padding: 16px;
    }

    .sr-filter-grid {
        grid-template-columns: 1fr;
    }

    .sr-stats-grid {
        grid-template-columns: 1fr;
    }

    .sr-action-buttons {
        grid-template-columns: 1fr;
    }

    .sr-filter-actions {
        flex-direction: column;
    }

        .sr-filter-actions .sr-btn {
            width: 100%;
        }

    .sr-table-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sr-search-input {
        width: 100%;
        max-width: 100%;
    }

    .sr-pagination {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
    }

    .sr-page-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}
