/* --- SCOPED CSS FOR CSR-2 PROGRAM EXECUTION (DESIGN ONLY) --- */

.csr2x-wrapper {
    font-family: 'Inter', sans-serif;
}

/* Header */
.csr2x-header {
    margin-bottom: 20px;
}

    .csr2x-header h1 {
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        margin: 0 0 6px 0;
    }

    .csr2x-header p {
        font-size: 14px;
        font-weight: 400;
        color: #64748b;
        margin: 0;
    }

/* --- Upcoming CSR Program Banner --- */
.csr2x-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background-color: #fdf6e3;
    border: 1px solid #fbe8b6;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.csr2x-banner-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 260px;
}

.csr2x-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: #f59e0b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.csr2x-banner-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #b45309;
}

.csr2x-banner-text p {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
}

.csr2x-banner-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
}

    .csr2x-banner-meta span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

.csr2x-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.csr2x-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

    .csr2x-btn-outline:hover {
        background-color: #f8fafc;
        border-color: #cbd5e1;
    }

.csr2x-btn-solid-green {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #166534;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

    .csr2x-btn-solid-green:hover {
        background-color: #14532d;
    }

.csr2x-banner-dismiss {
    background: none;
    border: none;
    padding: 4px;
    color: #b45309;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

    .csr2x-banner-dismiss:hover {
        opacity: 1;
    }

/* --- Summary Cards --- */
.csr2x-stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.csr2x-stat-card {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-top-width: 4px;
    border-top-style: solid;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background-color: #ffffff;
}

.csr2x-card-body {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1;
}

.csr2x-stat-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .csr2x-stat-text h2 {
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        margin: 0;
        line-height: 1.1;
    }

    .csr2x-stat-text p {
        font-size: 13px;
        color: #94a3b8;
        font-weight: 500;
        margin: 0;
    }

.csr2x-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    background-color: #ffffff;
    flex-shrink: 0;
}

.csr2x-card-footer {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .csr2x-card-footer:hover {
        color: #64748b;
    }

.csr2x-theme-blue {
    border-top-color: #3b82f6;
}

    .csr2x-theme-blue .csr2x-card-body {
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    }

    .csr2x-theme-blue .csr2x-stat-icon {
        border-color: #e0e7ff;
        color: #3b82f6;
    }

    .csr2x-theme-blue .csr2x-card-footer {
        background-color: #f4f8ff;
        border-top: 1px solid #eef2ff;
    }

.csr2x-theme-green {
    border-top-color: #10b981;
}

    .csr2x-theme-green .csr2x-card-body {
        background: linear-gradient(180deg, #ffffff 0%, #f4fdf8 100%);
    }

    .csr2x-theme-green .csr2x-stat-icon {
        border-color: #d1fae5;
        color: #10b981;
    }

    .csr2x-theme-green .csr2x-card-footer {
        background-color: #ebfbf2;
        border-top: 1px solid #ecfdf5;
    }

.csr2x-theme-orange {
    border-top-color: #f59e0b;
}

    .csr2x-theme-orange .csr2x-card-body {
        background: linear-gradient(180deg, #ffffff 0%, #fffbf2 100%);
    }

    .csr2x-theme-orange .csr2x-stat-icon {
        border-color: #fef3c7;
        color: #f59e0b;
    }

    .csr2x-theme-orange .csr2x-card-footer {
        background-color: #fff9ea;
        border-top: 1px solid #fffbeb;
    }

.csr2x-theme-gray {
    border-top-color: #94a3b8;
}

    .csr2x-theme-gray .csr2x-card-body {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    }

    .csr2x-theme-gray .csr2x-stat-icon {
        border-color: #e2e8f0;
        color: #64748b;
    }

    .csr2x-theme-gray .csr2x-card-footer {
        background-color: #f1f5f9;
        border-top: 1px solid #f8fafc;
    }

/* --- Filters Card --- */
.csr2x-filter-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.csr2x-filter-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    background-color: #f5f8f6;
}

.csr2x-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.csr2x-filter-chevron {
    transition: transform 0.2s ease;
}

.csr2x-chevron-open {
    transform: rotate(180deg);
}

.csr2x-filter-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.csr2x-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.csr2x-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csr2x-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.csr2x-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.csr2x-form-control,
.csr2x-form-select {
    width: 100%;
    appearance: none;
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #94a3b8;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

    .csr2x-form-control:focus,
    .csr2x-form-select:focus {
        border-color: #3b82f6;
        background-color: #ffffff;
    }

.csr2x-form-select {
    padding-right: 36px;
    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 14px center;
    cursor: pointer;
}

.csr2x-input-icon {
    position: absolute;
    right: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.csr2x-filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.csr2x-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: 1px solid transparent;
}

.csr2x-btn-outline {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.csr2x-btn-solid {
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    color: #ffffff;
}

    .csr2x-btn-solid:hover {
        background-color: #2563eb;
    }

/* --- Assigned Programs Table --- */
.csr2x-table-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    overflow: hidden;
}

.csr2x-table-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

    .csr2x-table-top h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #334155;
    }

.csr2x-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.csr2x-search-input {
    appearance: none;
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 10px 16px 10px 38px;
    font-size: 13px;
    color: #334155;
    width: 260px;
    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: 14px center;
    transition: border-color 0.2s;
}

    .csr2x-search-input:focus {
        border-color: #3b82f6;
    }

.csr2x-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

    .csr2x-btn-outline:hover {
        background-color: #f8fafc;
        color: #1e293b;
    }

.csr2x-btn-outline-green {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #10b981;
    border-radius: 6px;
    background-color: #ffffff;
    color: #059669;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

    .csr2x-btn-outline-green:hover {
        background-color: #ecfdf5;
    }

.csr2x-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.csr2x-main-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

    .csr2x-main-table th {
        background-color: #f5f8f6;
        color: #475569;
        font-weight: 600;
        font-size: 13px;
        padding: 14px 16px;
        text-align: center;
        white-space: nowrap;
        border-bottom: 1px solid #e2e8f0;
    }

    .csr2x-main-table td {
        padding: 16px;
        text-align: center;
        border-bottom: 1px solid #f1f5f9;
        font-size: 13px;
        color: #334155;
        vertical-align: middle;
        white-space: nowrap;
    }

        .csr2x-main-table th:first-child,
        .csr2x-main-table td:first-child {
            width: 50px;
        }

    .csr2x-main-table tr:last-child td {
        border-bottom: none;
    }

.csr2x-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;
}

    .csr2x-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;
    }

/* Report Completion progress bar */
.csr2x-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.csr2x-progress-track {
    flex: 1;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.csr2x-progress-fill {
    height: 100%;
    background-color: #0d9488;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.csr2x-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    min-width: 30px;
    text-align: right;
}

/* Status badge */
.csr2x-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.csr2x-badge-amber {
    background-color: #fef3c7;
    color: #b45309;
}

/* Action buttons inside table */
.csr2x-actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.csr2x-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: opacity 0.2s;
}

    .csr2x-action-btn:hover {
        opacity: 0.7;
    }

.csr2x-icon-view {
    color: #3b82f6;
}

.csr2x-icon-delete {
    color: #ef4444;
}

.csr2x-btn-execution {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background-color: #166534;
    color: #ffffff;
    border: 1px solid #166534;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

    .csr2x-btn-execution:hover {
        background-color: #14532d;
    }

/* --- Pagination --- */
.csr2x-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 4px;
}

.csr2x-page-size {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.csr2x-page-size-select {
    appearance: none;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 32px 6px 12px;
    width: 65px;
    font-size: 13px;
    color: #334155;
    outline: 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='%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 8px center;
}

.csr2x-page-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.csr2x-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;
}

    .csr2x-page-btn:hover:not(.dots) {
        background-color: #f8fafc;
    }

    .csr2x-page-btn.active {
        background-color: #f1f5f9;
        border-color: #e2e8f0;
        font-weight: 600;
        color: #1e293b;
    }

    .csr2x-page-btn.dots {
        border: none;
        background: transparent;
        cursor: default;
    }

/* --- Responsive --- */
@media (max-width: 1400px) {
    .csr2x-stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .csr2x-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .csr2x-stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .csr2x-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .csr2x-banner-actions {
        justify-content: flex-end;
    }

    .csr2x-filter-grid {
        grid-template-columns: 1fr;
    }

    .csr2x-filter-actions {
        flex-direction: column;
        width: 100%;
    }

        .csr2x-filter-actions .csr2x-btn {
            width: 100%;
        }

    /* Pagination: one row - Items Per Page left, pager right - same as the
       other list pages. Only prev / current / next stay visible. */
    .csr2x-pagination {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .csr2x-page-size {
        white-space: nowrap;
    }

    .csr2x-page-controls {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .csr2x-page-btn {
        min-width: 28px;
        height: 28px;
        flex: 0 0 auto;
    }

    .csr2x-page-controls .csr2x-page-btn:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
}
