/* --- SCOPED CSS FOR CSR-2 MANAGEMENT PAGE --- */
.csr2-wrapper {
    font-family: 'Inter', sans-serif;
    margin-bottom: 32px;
}

/* ── Header (light mint card with icon) ── */
.csr2-header {
    background-color: #F0FDF4;
    border: 1px solid #DCFCE7;
    border-radius: 12px;
    padding: 16px 22px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.csr2-header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .csr2-header-icon svg {
        width: 100%;
        height: 100%;
    }

.csr2-header-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.csr2-header-text p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ── Generic Card ── */
.csr2-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

/* ── Filters Card ── */
.csr2-filters-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F5F8F6;
    border: none;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .csr2-filters-toggle:hover {
        background-color: #EEF2F0;
    }

.csr2-filters-toggle-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.csr2-toggle-icon {
    color: #6b7280;
    transition: transform 0.2s;
}

    .csr2-toggle-icon.open {
        transform: rotate(180deg);
    }

.csr2-filters-body {
    padding: 18px 20px;
    border-top: 1px solid #f3f4f6;
}

.csr2-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 20px;
}

.csr2-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.csr2-form-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

/* ── Form Controls ── */
.csr2-form-control {
    appearance: none;
    background-color: #FAFAFA;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #374151;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .csr2-form-control::placeholder {
        color: #9CA3AF;
    }

    .csr2-form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        background-color: #ffffff;
    }

.csr2-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

    .csr2-input-with-icon .csr2-form-control {
        padding-right: 36px;
    }

.csr2-input-icon {
    position: absolute;
    right: 12px;
    color: #6B7280;
    pointer-events: none;
}

/* Select dropdowns */
.csr2-select {
    padding-right: 36px;
    cursor: pointer;
    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='%236b7280' 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;
}

/* ── Filter Actions ── */
.csr2-filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* ── Buttons ── */
.csr2-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.csr2-btn-ghost {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

    .csr2-btn-ghost:hover {
        background-color: #f9fafb;
    }

.csr2-btn-outline {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

    .csr2-btn-outline:hover {
        background-color: #f9fafb;
    }

.csr2-btn-primary {
    background-color: #2563EB;
    color: #ffffff;
}

    .csr2-btn-primary:hover {
        background-color: #1D4ED8;
    }

.csr2-btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
}

.csr2-btn-blue {
    background-color: #2563EB;
    color: #ffffff;
}

    .csr2-btn-blue:hover {
        background-color: #1D4ED8;
    }

.csr2-btn-red {
    background-color: #DC2626;
    color: #ffffff;
}

    .csr2-btn-red:hover {
        background-color: #B91C1C;
    }

/* ── Table Card Head ── */
.csr2-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
}

.csr2-table-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.csr2-table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Search ── */
.csr2-search {
    position: relative;
    display: flex;
    align-items: center;
}

    .csr2-search svg {
        position: absolute;
        left: 10px;
        color: #9ca3af;
        pointer-events: none;
    }

.csr2-search-input {
    width: 200px;
    background-color: #FAFAFA;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 8px 12px 8px 30px;
    font-size: 12px;
    color: #374151;
    outline: none;
    transition: border-color 0.2s;
}

    .csr2-search-input::placeholder {
        color: #9CA3AF;
    }

    .csr2-search-input:focus {
        border-color: #3b82f6;
        background-color: #ffffff;
    }

/* ── Table ── */
.csr2-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
    .csr2-table-wrap::-webkit-scrollbar {
        height: 6px;
    }
    .csr2-table-wrap::-webkit-scrollbar-track {
        background: #f9fafb;
    }
    .csr2-table-wrap::-webkit-scrollbar-thumb {
        background-color: #d1d5db;
        border-radius: 3px;
    }
        .csr2-table-wrap::-webkit-scrollbar-thumb:hover {
            background-color: #9ca3af;
        }

.csr2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

    .csr2-table thead th {
        text-align: left;
        padding: 12px 16px;
        background-color: #F9FAFB;
        font-size: 12px;
        font-weight: 600;
        color: #6B7280;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .csr2-table tbody td {
        padding: 14px 16px;
        color: #374151;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
    }

    .csr2-table tbody tr:last-child td {
        border-bottom: none;
    }

    .csr2-table tbody tr:hover {
        background-color: #FAFAFA;
    }

.csr2-cell-muted {
    color: #9ca3af;
    text-align: center;
}

.csr2-checkbox {
    width: 14px;
    height: 14px;
    accent-color: #2563EB;
    cursor: pointer;
}

.csr2-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}

/* ── Pills ── */
.csr2-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.csr2-pill-amber {
    background-color: #FEF3C7;
    color: #B45309;
}

.csr2-pill-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.csr2-pill-red {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.csr2-pill-blue {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

/* ── Pagination ── */
.csr2-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
}

.csr2-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6B7280;
}

.csr2-page-select {
    width: 70px;
    padding: 6px 26px 6px 10px;
    font-size: 12px;
}

.csr2-page-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.csr2-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background-color: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .csr2-page-btn:hover {
        background-color: #F9FAFB;
        border-color: #d1d5db;
    }

.csr2-page-active {
    background-color: #ffffff;
    border-color: #2563EB;
    color: #2563EB;
    font-weight: 700;
}

.csr2-page-ellipsis {
    color: #9ca3af;
    font-size: 12px;
    padding: 0 2px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1280px) {
    .csr2-filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .csr2-table-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .csr2-search-input {
        width: 100%;
    }

    .csr2-search {
        flex: 1;
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .csr2-header {
        padding: 14px;
    }

    .csr2-header-text h1 {
        font-size: 16px;
    }

    .csr2-header-text p {
        font-size: 12px;
    }

    .csr2-filters-grid {
        grid-template-columns: 1fr;
    }

    .csr2-table-head {
        padding: 14px;
    }

    .csr2-filters-body {
        padding: 16px;
    }

    .csr2-filters-actions {
        flex-direction: column-reverse;
    }

        .csr2-filters-actions .csr2-btn {
            width: 100%;
            justify-content: center;
        }

    .csr2-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .csr2-page-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    /* NOTE: Table stays as a horizontally-scrollable table on mobile.
       The .csr2-table-wrap already has overflow-x: auto and
       .csr2-table has min-width: 900px, so it scrolls naturally. */
}

@media (max-width: 480px) {
    .csr2-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .csr2-table-actions {
        flex-wrap: wrap;
    }

        .csr2-table-actions .csr2-btn {
            flex: 1;
            min-width: 100px;
            justify-content: center;
        }
}