/* --- SCOPED CSS FOR COMPANY SALES --- */
/* --- Header Section --- */
.cs-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cs-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .cs-header-text h1 {
        margin: 0;
        font-size: 24px;
        font-weight: 700;
        color: #334155;
    }

    .cs-header-text p {
        margin: 0;
        font-size: 14px;
        color: #475569;
    }

.cs-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cs-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;
    font-family: 'Inter', sans-serif;
}

.cs-btn-outline {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

    .cs-btn-outline:hover {
        background-color: #f8fafc;
        border-color: #94a3b8;
        color: #334155;
    }

.cs-btn-solid {
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

    .cs-btn-solid:hover {
        background-color: #2563eb;
    }

/* --- Statistics Grid --- */
.cs-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cs-stat-card {
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.cs-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.cs-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-stat-title {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.cs-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #334155;
    line-height: 1.1;
}

.cs-icon-box {
    width: 38px;
    height: 38px;
    background-color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

    .cs-icon-box svg {
        width: 16px;
        height: 16px;
    }

.cs-card-bottom {
    display: flex;
    align-items: center;
}

.cs-bottom-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.cs-col-right {
    padding-left: 16px;
}

.cs-divider {
    width: 1px;
    height: 32px;
}

.cs-bottom-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.cs-bottom-val {
    font-size: 16px;
    font-weight: 700;
}

.cs-text-green {
    color: #15803d;
}

.cs-text-blue {
    color: #1e3a8a;
}

/* Themes */
.cs-theme-cyan {
    border: 1px solid #cffafe;
    border-left: 4px solid #06b6d4;
    background: linear-gradient(90deg, #ecfeff 0%, #ffffff 80%);
}

    .cs-theme-cyan .cs-card-top {
        border-bottom: 1px solid #cffafe;
    }

    .cs-theme-cyan .cs-divider {
        background-color: #cffafe;
    }

    .cs-theme-cyan .cs-icon-box {
        color: #0891b2;
        border: 1px solid #e0f2fe;
    }

.cs-theme-orange {
    border: 1px solid #ffedd5;
    border-left: 4px solid #d97706;
    background: linear-gradient(90deg, #fffcf8 0%, #ffffff 80%);
}

    .cs-theme-orange .cs-card-top {
        border-bottom: 1px solid #ffedd5;
    }

    .cs-theme-orange .cs-divider {
        background-color: #ffedd5;
    }

    .cs-theme-orange .cs-icon-box {
        color: #b45309;
        border: 1px solid #ffedd5;
    }

.cs-theme-red {
    border: 1px solid #fee2e2;
    border-left: 4px solid #dc2626;
    background: linear-gradient(90deg, #fffcfc 0%, #ffffff 80%);
}

    .cs-theme-red .cs-card-top {
        border-bottom: 1px solid #fee2e2;
    }

    .cs-theme-red .cs-divider {
        background-color: #fee2e2;
    }

    .cs-theme-red .cs-icon-box {
        color: #dc2626;
        border: 1px solid #fee2e2;
    }

.cs-theme-yellow {
    border: 1px solid #fef08a;
    border-left: 4px solid #ca8a04;
    background: linear-gradient(90deg, #fffff8 0%, #ffffff 80%);
}

    .cs-theme-yellow .cs-card-top {
        border-bottom: 1px solid #fef08a;
    }

    .cs-theme-yellow .cs-divider {
        background-color: #fef08a;
    }

    .cs-theme-yellow .cs-icon-box {
        color: #a16207;
        border: 1px solid #fef08a;
    }

    .cs-theme-yellow .cs-stat-value {
        color: #854d0e;
    }


/* --- Status (By Age) Section --- */
.cs-status-section {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
}

.cs-status-header {
    margin-bottom: 20px;
}

    .cs-status-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #334155;
    }

.cs-status-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.cs-age-box {
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid transparent;
}

.cs-age-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-age-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.cs-age-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.cs-age-icon-box {
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    flex-shrink: 0;
}

    .cs-age-icon-box svg {
        width: 16px;
        height: 16px;
    }

.cs-age-green {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

    .cs-age-green .cs-age-icon-box {
        border-color: #bbf7d0;
        color: #22c55e;
    }

.cs-age-blue {
    background-color: #eff6ff;
    border-color: #bfdbfe;
}

    .cs-age-blue .cs-age-icon-box {
        border-color: #bfdbfe;
        color: #3b82f6;
    }

.cs-age-yellow {
    background-color: #fefce8;
    border-color: #fef08a;
}

    .cs-age-yellow .cs-age-icon-box {
        border-color: #fef08a;
        color: #ca8a04;
    }

.cs-age-orange {
    background-color: #fff7ed;
    border-color: #fed7aa;
}

    .cs-age-orange .cs-age-icon-box {
        border-color: #fed7aa;
        color: #d97706;
    }

.cs-age-red {
    background-color: #fef2f2;
    border-color: #fecaca;
}

    .cs-age-red .cs-age-icon-box {
        border-color: #fecaca;
        color: #dc2626;
    }

.cs-status-banner {
    background-color: #f5f3ff;
    border: 1px solid #ede9fe;
    border-left: 4px solid #8b5cf6;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-banner-icon {
    color: #8b5cf6;
    flex-shrink: 0;
}

.cs-banner-text {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}


/* --- Filters Section --- */
.cs-filter-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
}

.cs-filter-header {
    background-color: #f4f6f8;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.cs-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.cs-filter-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Shown for the first render only, until the page knows phone vs desktop. */
.cs-filter-placeholder {
    height: 50px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f4f6f8;
}

@media (max-width: 767.98px) {
    .cs-filter-placeholder {
        height: var(--tap-min, 44px);
        margin-bottom: 16px;
        border-radius: 12px;
        background: #ffffff;
    }
}

/* Collapsible filter card (desktop / tablet): the header toggles the body. */
.cs-filter-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.cs-filter-card--collapsed .cs-filter-chevron {
    transform: rotate(-90deg);
}

.cs-filter-card--collapsed .cs-filter-header {
    border-bottom: 0;
}

.cs-filter-card--collapsed .cs-filter-body {
    display: none;
}

/* Active-filter count shown next to "Filters" while the card is collapsed. */
.cs-filter-card .cs-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}

/* Date range: the two inputs share the cell and never overflow it. */
.cs-date-range .cs-form-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

.cs-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 20px;
}

.cs-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.cs-form-input, .cs-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;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

    .cs-form-input:focus, .cs-form-select:focus {
        border-color: #3b82f6;
    }

.cs-form-select {
    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;
}

.cs-input-calendar {
    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%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.cs-filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}


/* --- Table Section (EXPANDED WITH NEW COLUMNS) --- */
.cs-table-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 20px;
}

.cs-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.cs-tabs-wrapper {
    display: inline-flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.cs-tab {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .cs-tab:hover:not(.active) {
        color: #334155;
    }

    .cs-tab.active {
        background-color: #ffffff;
        color: #0f172a;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

.cs-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: 260px;
    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;
}

    .cs-search-input:focus {
        border-color: #3b82f6;
    }

.cs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

    .cs-table th {
        background-color: #f1f5f9;
        color: #475569;
        font-weight: 600;
        font-size: 13px;
        padding: 14px 16px;
        text-align: center;
        white-space: nowrap;
    }

    .cs-table td {
        padding: 16px;
        text-align: center;
        border-bottom: 1px solid #f1f5f9;
        font-size: 13px;
        color: #334155;
        vertical-align: middle;
    }

    .cs-table tr:last-child td {
        border-bottom: none;
    }

.cs-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;
}

    .cs-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;
    }

/* Badges & Pills */
.cs-pill-solid {
    background-color: #ede9fe;
    color: #7c3aed;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.cs-pill-outline-purple {
    background-color: #ffffff;
    border: 1px solid #ddd6fe;
    color: #7c3aed;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.cs-pill-outline-orange {
    background-color: #ffffff;
    border: 1px solid #fed7aa;
    color: #ea580c;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.cs-pill-outline-green {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Ack Age Status Badges */
.cs-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

    .cs-status-badge .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

.cs-badge-red {
    background: #fee2e2;
    color: #ef4444;
}

    .cs-badge-red .dot {
        background: #ef4444;
    }

.cs-badge-yellow {
    background: #fef9c3;
    color: #ca8a04;
}

    .cs-badge-yellow .dot {
        background: #ca8a04;
    }

.cs-badge-blue {
    background: #eff6ff;
    color: #3b82f6;
}

    .cs-badge-blue .dot {
        background: #3b82f6;
    }

.cs-badge-orange {
    background: #ffedd5;
    color: #ea580c;
}

    .cs-badge-orange .dot {
        background: #ea580c;
    }

.cs-badge-green {
    background: #dcfce7;
    color: #16a34a;
}

    .cs-badge-green .dot {
        background: #16a34a;
    }

/* Pending Ack Age Text Colors */
.cs-age-text-red {
    color: #ef4444;
    font-weight: 500;
}

.cs-age-text-yellow {
    color: #ca8a04;
    font-weight: 500;
}

.cs-age-text-green {
    color: #16a34a;
    font-weight: 500;
}

.cs-age-text-orange {
    color: #ea580c;
    font-weight: 500;
}

.cs-age-text-gray {
    color: #94a3b8;
    font-weight: 500;
}

/* Simple Pills for Status Column */
.cs-pill-simple {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.cs-pill-blue {
    background: #eff6ff;
    color: #3b82f6;
}

.cs-pill-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.cs-pill-green {
    background: #dcfce7;
    color: #16a34a;
}

/* Action Icons */
.cs-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cs-action-btn-blue {
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.cs-action-btn-green {
    color: #16a34a;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .cs-action-btn-blue:hover, .cs-action-btn-green:hover {
        opacity: 0.7;
    }

/* Stacked Text (State/District) */
.cs-stacked-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cs-stacked-primary {
    font-weight: 600;
    color: #1e293b;
}

.cs-stacked-secondary {
    font-size: 11px;
    color: #94a3b8;
}

/* Pagination */
.cs-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 4px;
}

.cs-page-size {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.cs-page-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cs-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;
}

    .cs-page-btn:hover:not(.dots) {
        background-color: #f8fafc;
    }

    .cs-page-btn.active {
        background-color: #f1f5f9;
        border-color: #e2e8f0;
        font-weight: 600;
        color: #1e293b;
    }

    .cs-page-btn.dots {
        border: none;
        background: transparent;
        cursor: default;
    }

/* Global Box Sizing */
.spic-sr-container,
.spic-sr-container *,
.spic-sr-container *::before,
.spic-sr-container *::after {
    box-sizing: border-box;
}

/* Tooltip Hover Logic for Company Sales Chart */
.cs-bar-group {
    width: 50px;
    height: calc(100% - 24px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border-left: 1px dashed #e2e8f0;
    border-right: 1px dashed #e2e8f0;
    cursor: pointer;
    flex-shrink: 0; /* CRITICAL: Prevents bars from squishing on mobile */
}

.cs-chart-tooltip {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
    transform: translateY(5px);
    z-index: 20 !important;
}

.cs-bar-group:hover .cs-chart-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Makes the dashed background column highlight on hover */
.cs-bar-bg {
    opacity: 0 !important;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background-color: #fef2f2;
}

.cs-bar-group:hover .cs-bar-bg {
    opacity: 0.6 !important;
}

/* Chart Scroll Wrappers */
.cs-chart-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px; /* Prevents scrollbar from covering labels */
}

.cs-chart-inner-area {
    min-width: 800px; /* CRITICAL: Forces minimum width so it scrolls instead of squishing */
    display: flex;
    height: 320px;
    font-family: sans-serif;
    color: #94a3b8;
    font-size: 11px;
}

/* Table Scroll Wrapper */
.cs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px; /* Forces table to scroll on mobile */
}

/* Tabs Styling */
.cs-table-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.cs-tabs-wrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cs-tab {
    padding: 8px 16px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

    .cs-tab.active {
        background: #f1f5f9;
        color: #0f172a;
        font-weight: 600;
    }

    .cs-tab:hover:not(.active) {
        background: #f8fafc;
    }

/* Mobile specifically */
@media (max-width: 768px) {
    .cs-table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cs-search-input {
        width: 100%;
        max-width: 100%;
    }
}


/* --- Responsive Queries --- */
@media (max-width: 1280px) {
    .cs-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-status-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .cs-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cs-header-container, .cs-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cs-action-buttons, .cs-search-input {
        width: 100%;
        justify-content: flex-start;
    }

    .cs-stats-grid {
        grid-template-columns: 1fr;
    }

    .cs-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cs-filter-grid {
        grid-template-columns: 1fr;
    }

    .cs-filter-actions {
        flex-direction: column;
        width: 100%;
    }

        .cs-filter-actions .cs-btn {
            width: 100%;
            justify-content: center;
        }

    .cs-status-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PENDING ACKNOWLEDGEMENT: INITIAL RENDER + SELECT2 + LOADING UI
   ============================================================ */

.cs-page-container,
.cs-page-container *,
.cs-page-container *::before,
.cs-page-container *::after {
    box-sizing: border-box;
}

.cs-btn:disabled,
.cs-tab:disabled,
.cs-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

    .cs-btn:disabled:hover {
        transform: none;
    }

/* Hide the browser's expanded native multiple-select while Select2 attaches. */
.cs-form-group {
    position: relative;
    min-width: 0;
}

select.cs-form-select[multiple]:not(.select2-hidden-accessible) {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* Temporary closed-field visual. It disappears as soon as Select2 adds its class. */
.cs-form-group:has(> select.cs-form-select[multiple]:not(.select2-hidden-accessible))::after {
    content: "Select an option";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 40px 0 12px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    pointer-events: none;
}

.cs-form-group:has(> select.cs-form-select[multiple]:not(.select2-hidden-accessible))::before {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #94a3b8;
    border-bottom: 1.5px solid #94a3b8;
    transform: rotate(45deg);
    pointer-events: none;
}

/* Select2 sizing and appearance, scoped to this page. */
.cs-filter-body .select2-container {
    width: 100% !important;
    min-width: 0 !important;
}

.cs-page-container .select2-container--default .select2-selection--multiple {
    width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    padding: 3px 42px 3px 6px !important;
    color: #334155 !important;
    background-color: #fafafa !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='%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") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 8px !important;
    outline: none !important;
}

.cs-page-container .select2-container--default.select2-container--focus .select2-selection--multiple,
.cs-page-container .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #3b82f6 !important;
}

.cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.cs-page-container .select2-search--inline {
    display: block !important;
    flex: 1 1 120px !important;
    min-width: 80px !important;
    margin: 0 !important;
    padding: 0 !important;
}

    .cs-page-container .select2-search--inline .select2-search__field {
        width: 100% !important;
        min-width: 80px !important;
        height: 28px !important;
        margin: 0 !important;
        padding: 0 4px !important;
        color: #334155 !important;
        font-family: inherit !important;
        font-size: 13px !important;
        line-height: 28px !important;
        background: transparent !important;
        border: 0 !important;
        outline: none !important;
    }

/* Selected chip and right-aligned individual remove button. */
.cs-page-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% - 4px);
    min-height: 26px;
    margin: 1px 0 !important;
    padding: 3px 27px 3px 8px !important;
    overflow: hidden;
    color: #334155 !important;
    font-size: 12px !important;
    line-height: 18px !important;
    background-color: #e8eef7 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
}

.cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    display: block;
    max-width: 100%;
    padding: 0 !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: absolute !important;
    top: 50% !important;
    right: 3px !important;
    left: auto !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #64748b !important;
    font-size: 0 !important;
    line-height: 1 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    transform: translateY(-50%);
    cursor: pointer !important;
    z-index: 2;
}

    .cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__choice__remove::before {
        content: "\00D7";
        font-size: 16px;
        font-weight: 600;
        line-height: 1;
    }

    .cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
        color: #0f172a !important;
        background-color: #cbd5e1 !important;
    }

.cs-page-container .select2-container--default .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    top: 50% !important;
    right: 32px !important;
    height: 20px !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 16px !important;
    line-height: 20px !important;
    transform: translateY(-50%);
}

/* Initial loading and background-refresh behaviour. */
.cs-dashboard-skeleton,
.cs-dashboard-content {
    position: relative;
    min-height: 480px;
}

.cs-loading-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px 2px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.cs-inline-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid #dbeafe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: cs-spin 0.75s linear infinite;
}

.cs-refresh-indicator {
    position: sticky;
    top: 12px;
    z-index: 40;
    width: max-content;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px auto;
    padding: 7px 12px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    background: rgba(239, 246, 255, 0.96);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.cs-dashboard-warning,
.cs-empty-state {
    padding: 14px 16px;
    color: #b45309;
    font-size: 13px;
    text-align: center;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.cs-empty-state {
    margin-top: 8px;
    padding: 48px 20px;
    color: #64748b;
    background: #ffffff;
    border-color: #e2e8f0;
}

.cs-dashboard-warning {
    margin-bottom: 16px;
}

.cs-dashboard-content.is-refreshing > :not(.cs-refresh-indicator):not(.cs-dashboard-warning) {
    opacity: 0.62;
    filter: grayscale(12%);
    pointer-events: none;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Skeleton shimmer blocks. */
.cs-skeleton-block {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e8edf3;
    border-radius: 6px;
}

    .cs-skeleton-block::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 48%, transparent 100%);
        transform: translateX(-100%);
        animation: cs-skeleton-shimmer 1.35s ease-in-out infinite;
    }

.cs-skeleton-stat-card {
    min-height: 138px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.cs-skeleton-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.cs-skeleton-stat-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-skeleton-title {
    width: 48%;
    height: 12px;
}

.cs-skeleton-value {
    width: 30%;
    height: 23px;
}

.cs-skeleton-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.cs-skeleton-stat-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding-top: 14px;
}

    .cs-skeleton-stat-bottom .cs-skeleton-block {
        height: 28px;
    }

.cs-skeleton-chart-card {
    min-height: 395px;
}

.cs-skeleton-heading {
    width: 280px;
    max-width: 65%;
    height: 18px;
    margin-bottom: 28px;
}

.cs-skeleton-chart {
    height: 270px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 20px;
    padding: 20px 24px 0;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, #f1f5f9 54px);
}

    .cs-skeleton-chart .cs-skeleton-block {
        width: 26px;
        min-width: 18px;
        border-radius: 5px 5px 0 0;
    }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(1),
        .cs-skeleton-chart .cs-skeleton-block:nth-child(7) {
            height: 42%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(2),
        .cs-skeleton-chart .cs-skeleton-block:nth-child(10) {
            height: 68%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(3),
        .cs-skeleton-chart .cs-skeleton-block:nth-child(8) {
            height: 54%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(4),
        .cs-skeleton-chart .cs-skeleton-block:nth-child(11) {
            height: 82%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(5) {
            height: 61%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(6),
        .cs-skeleton-chart .cs-skeleton-block:nth-child(12) {
            height: 48%;
        }

        .cs-skeleton-chart .cs-skeleton-block:nth-child(9) {
            height: 74%;
        }

.cs-skeleton-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 22px;
}

    .cs-skeleton-legend .cs-skeleton-block {
        width: 92px;
        height: 12px;
    }

.cs-skeleton-table-card {
    overflow: hidden;
}

.cs-skeleton-tabs {
    width: 340px;
    max-width: 52%;
    height: 34px;
}

.cs-skeleton-search {
    width: 260px;
    max-width: 38%;
    height: 34px;
}

.cs-skeleton-table-head,
.cs-skeleton-table-row {
    min-width: 1200px;
    display: grid;
    grid-template-columns: 55px repeat(12, minmax(80px, 1fr));
    gap: 16px;
    padding: 14px 16px;
}

.cs-skeleton-table-head {
    background: #f1f5f9;
}

    .cs-skeleton-table-head .cs-skeleton-block {
        height: 12px;
    }

.cs-skeleton-table-body {
    width: 100%;
    overflow-x: hidden;
}

.cs-skeleton-table-row {
    border-bottom: 1px solid #f1f5f9;
}

    .cs-skeleton-table-row .cs-skeleton-block {
        height: 13px;
    }

.cs-skeleton-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

    .cs-skeleton-pagination .cs-skeleton-block:first-child {
        width: 150px;
        height: 32px;
    }

    .cs-skeleton-pagination .cs-skeleton-block:last-child {
        width: 205px;
        height: 32px;
    }

@keyframes cs-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes cs-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .cs-refresh-indicator {
        position: static;
        margin-left: auto;
    }

    .cs-skeleton-stat-bottom {
        gap: 8px;
    }

    .cs-skeleton-chart {
        min-width: 760px;
    }

    .cs-skeleton-chart-card {
        overflow-x: auto;
    }

    .cs-skeleton-tabs,
    .cs-skeleton-search {
        width: 100%;
        max-width: 100%;
    }
}
/* Add these rules to the existing CompanySales.razor.css file. */
.cs-badge-blue {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.cs-badge-purple {
    color: #7e22ce;
    background: #f3e8ff;
    border-color: #e9d5ff;
}

    .cs-badge-purple .dot {
        background: #9333ea;
    }

.cs-badge-gray {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

    .cs-badge-gray .dot {
        background: #64748b;
    }

.cs-age-text-blue {
    color: #2563eb;
    font-weight: 600;
}

.cs-age-text-purple {
    color: #9333ea;
    font-weight: 600;
}

.cs-age-text-green {
    color: #16a34a;
    font-weight: 600;
}

@media (max-width: 900px) {
    .cs-stat-card > div[style*="grid-template-columns:repeat(5"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    .cs-stat-card > div[style*="grid-template-columns:repeat(5"] {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================================
   PageHeader adoption: keep the desktop title row exactly as
   the old .cs-header-container looked (24px title, 14px subtitle).
   ======================================================== */
.cs-page-container .shell-page-header.cs-header-container {
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

    .cs-page-container .shell-page-header.cs-header-container .shell-page-title {
        margin: 0;
        font-size: 24px;
        font-weight: 700;
        line-height: 1.2;
        color: #334155;
    }

    .cs-page-container .shell-page-header.cs-header-container .shell-page-subtitle {
        margin: 4px 0 0;
        font-size: 14px;
        color: #475569;
    }

    .cs-page-container .shell-page-header.cs-header-container .shell-page-actions {
        gap: 10px;
        flex-wrap: wrap;
    }

/* "View" label next to the row action icon: phone only */
.cs-action-text {
    display: none;
}

.cs-empty-state .spic-empty {
    width: 100%;
}

/* native: phone */
@media (max-width: 767.98px) {
    .cs-page-container {
        padding-top: 12px !important;
        padding-bottom: calc(16px + var(--safe-bottom, 0px)) !important;
    }

    /* Header: title row, then the four actions as a 2 x 2 grid */
    /* Back arrow + title on one row (the old 768px rule stacked this header in a column,
       which put the arrow alone on top); actions drop to their own row. */
    .cs-page-container .shell-page-header.cs-header-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
    }

        .cs-page-container .shell-page-header.cs-header-container .shell-page-title {
            font-size: 1.15rem;
        }

        .cs-page-container .shell-page-header.cs-header-container .shell-page-subtitle {
            font-size: 0.8rem;
            margin-top: 2px;
        }

        .cs-page-container .shell-page-header.cs-header-container .shell-page-actions {
            flex-basis: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

    /* Header actions: same compact 2 x 2 buttons as RMD Validation Queue. */
    .cs-page-container .cs-btn {
        min-height: 36px;
        width: 100%;
        justify-content: center;
        gap: 6px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

        .cs-page-container .shell-page-actions > .cs-btn {
            min-height: 36px;
        }

        .cs-page-container .cs-btn svg,
        .cs-page-container .cs-btn i {
            width: 14px;
            height: 14px;
            font-size: 14px;
        }

    /* Filters trigger (opens the BottomSheet) */
    .cs-filter-trigger {
        width: 100%;
        min-height: var(--tap-min, 44px);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        margin-bottom: 16px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        color: #1e293b;
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-align: left;
    }

        .cs-filter-trigger:disabled {
            opacity: 0.6;
        }

    .cs-filter-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 7px;
        margin-left: 6px;
        border-radius: 999px;
        background: #3b82f6;
        color: #ffffff;
        font-size: 12px;
        font-weight: 600;
    }

    /* Filter fields inside the sheet: one column, native multi-selects visible */
    .cs-page-container .cs-filter-sheet .cs-filter-body {
        padding: 0;
        gap: 0;
    }

    .cs-page-container .cs-filter-sheet .cs-filter-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Date range: From / To stacked full width so neither input overflows the sheet.
       Not scoped to .cs-page-container in case the BottomSheet renders outside it. */
    .cs-filter-sheet .cs-date-range {
        flex-direction: column;
        width: 100%;
        min-width: 0;
    }

        .cs-filter-sheet .cs-date-range .cs-form-input {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
        }

    /* Select2 runs inside the sheet; each dropdown is attached to its field's form
       group (dropdownParent), which is its positioning context. The open field is
       lifted above the fields that follow so the list is not painted under them. */
    .cs-filter-sheet .cs-form-group {
        position: relative;
    }

    .cs-filter-sheet .cs-form-group:has(.select2-container--open) {
        z-index: 5;
    }

    .cs-filter-sheet .select2-container {
        width: 100% !important;
        min-width: 0 !important;
    }

    .cs-filter-sheet .select2-dropdown {
        font-size: 14px;
    }

    .cs-filter-sheet .select2-results__options {
        max-height: 220px;
    }

    /* Fallback only: a native multi-select that Select2 has not (yet) taken over. */
    .cs-page-container .cs-filter-sheet select.cs-form-select[multiple]:not(.select2-hidden-accessible) {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: var(--tap-min, 44px) !important;
        max-height: 168px;
        margin: 0 !important;
        padding: 6px 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: auto !important;
        pointer-events: auto !important;
        appearance: auto !important;
        -webkit-appearance: auto !important;
        background-image: none;
        color: #334155;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

        .cs-page-container .cs-filter-sheet select.cs-form-select[multiple] option {
            padding: 8px 6px;
        }

    .cs-page-container .cs-filter-sheet .cs-form-group::after,
    .cs-page-container .cs-filter-sheet .cs-form-group::before {
        content: none !important;
    }

    .cs-page-container .cs-filter-sheet .cs-form-input {
        min-height: var(--tap-min, 44px);
        color: #334155;
        font-size: 16px;
    }

    .cs-page-container .cs-filter-sheet .cs-btn {
        width: auto;
    }

    /* KPI cards: one per row (each already holds a 5-column breakdown) */
    .cs-stats-grid {
        gap: 12px;
        margin-bottom: 16px;
    }

    .cs-stat-card {
        padding: 14px 16px;
    }

    .cs-stat-value {
        font-size: 20px;
    }

    /* Chart: contained sideways scroll; hover tooltips hidden on touch */
    .cs-status-section {
        padding: 16px !important;
    }

    .cs-chart-inner-area {
        min-width: 640px;
        height: 260px;
    }

    .cs-chart-tooltip {
        display: none;
    }

    /* Table: tabs scroll sideways, one card per row, labels from data-label */
    .cs-table-card {
        padding: 16px;
        gap: 14px;
    }

    .cs-table-header {
        padding: 0;
        border-bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cs-tabs-wrapper {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }

    .cs-tab {
        min-height: 40px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .cs-search-input {
        width: 100%;
        min-height: var(--tap-min, 44px);
        font-size: 16px;
    }

    .cs-table-wrapper {
        overflow-x: hidden;
        border: 0;
    }

    .cs-table {
        min-width: 0;
    }

        .cs-table thead {
            display: none;
        }

        .cs-table tbody,
        .cs-table tr,
        .cs-table td {
            display: block;
            width: 100%;
        }

        .cs-table tr {
            padding: 6px 12px;
            margin-bottom: 10px;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            background: #ffffff;
        }

        .cs-table td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 8px 0;
            border-bottom: 1px solid #f1f5f9;
            font-size: 13px;
            text-align: right !important;
        }

            .cs-table td::before {
                content: attr(data-label);
                flex: 0 0 42%;
                color: #64748b;
                font-weight: 500;
                text-align: left;
            }

            .cs-table td:last-child {
                border-bottom: 0;
            }

            .cs-table td[data-label="S.No"] {
                display: none;
            }

            .cs-table td[data-label="Agency Name"] {
                font-weight: 600;
                color: #0f172a;
            }

        .cs-table tr.cs-empty-row td {
            display: block;
            text-align: center !important;
        }

            .cs-table tr.cs-empty-row td::before {
                content: none;
            }

    .cs-stacked-text {
        align-items: flex-end;
    }

    .cs-action-group {
        justify-content: flex-end;
    }

    .cs-action-btn-blue {
        min-height: var(--tap-min, 44px);
        min-width: var(--tap-min, 44px);
        gap: 6px;
        padding: 0 8px;
        font-size: 13px;
        font-weight: 600;
    }

    .cs-action-text {
        display: inline;
    }

    /* Pagination: one row, "Items Per Page" left and the pager right. Only prev /
       current / next are shown so the row always fits the phone width. */
    .cs-pagination {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .cs-page-size {
        gap: 6px;
        font-size: 12px;
        white-space: nowrap;
    }

        .cs-page-size select.cs-form-select {
            width: auto !important;          /* inline style sets 65px */
            height: 30px;
            min-height: 30px;
            padding: 0 24px 0 8px !important;
            font-size: 12px;
        }

    .cs-page-controls {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .cs-page-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 6px;
        font-size: 12px;
    }

        .cs-page-btn:not(.active):not(:first-child):not(:last-child) {
            display: none;
        }
}
