:root {
    --rb-primary: #4f46e5;
    --rb-primary-hover: #4338ca;
    --rb-bg: #f3f4f6;
    --rb-card-bg: #ffffff;
    --rb-border: #e5e7eb;
    --rb-text-main: #111827;
    --rb-text-secondary: #6b7280;
    --rb-danger: #ef4444;
}

.rb-bulk-wrap {
    max-width: none;   /* Full width */
    width: 99%;        /* Ensure it takes available space */
    margin: 10px 0;    /* Remove large margins */
    padding: 0;        /* Remove extra padding */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--rb-text-main);
    box-sizing: border-box;
}

.rb-bulk-wrap * {
    box-sizing: border-box;
}

/* Disabled state for action buttons (prevents confusing "clickable" look) */
.rb-bulk-wrap button:disabled,
.rb-bulk-wrap .rb-run-one:disabled,
.rb-bulk-wrap .rb-icon-btn-secondary:disabled,
.rb-bulk-wrap .rb-btn-auto-lg:disabled,
.rb-bulk-wrap [data-bulk-action]:disabled,
.rb-bulk-wrap [data-selected-action]:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.rb-sticky-bar.rb-locked {
    opacity: 0.7;
}

/* Active job row (queued/processing) */
.rb-row-active-job {
    background: #f8fafc;
}

/* Header */
.rb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px; /* More header spacing */
}

/* ... */
/* Styles for Status Tabs */
.rb-status-tabs {
    display: inline-flex;
    background: #f3f4f6; /* Lighter bg */
    padding: 4px; /* More breathing room */
    border-radius: 8px;
    gap: 4px;
    border: 1px solid var(--rb-border);
}
.rb-status-tab {
    position: relative;
    cursor: pointer;
}
.rb-status-tab input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.rb-status-tab .rb-tab-label {
    display: inline-block;
    padding: 8px 16px; /* Larger click targets */
    border-radius: 6px;
    font-size: 14px; /* Larger text */
    font-weight: 500;
    color: var(--rb-text-secondary);
    transition: all 0.2s;
}
.rb-status-tab input:checked + .rb-tab-label {
    background: #fff;
    color: var(--rb-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Softer shadow */
    font-weight: 600;
}

/* Dual Slider */
.rb-dual-slider {
    position: relative;
    height: 36px;
    width: 100%;
}
.rb-dual-slider input[type="range"] {
    position: absolute;
    pointer-events: none;
    -webkit-appearance: none;
    z-index: 2;
    height: 10px;
    width: 100%;
    opacity: 0;
    top: 5px; /* Alignment fix */
}
.rb-dual-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    -webkit-appearance: none;
    background-color: white;
    border: 2px solid var(--rb-primary);
    border-radius: 50%;
    cursor: pointer;
}
.rb-dual-slider .rb-slider-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    position: absolute;
    top: 15px;
    z-index: 1;
}
.rb-dual-slider .rb-slider-range {
    height: 6px;
    background: var(--rb-primary);
    border-radius: 99px;
    position: absolute;
    top: 15px;
    z-index: 1;
}
/* Visual thumbs using pseudo-elements logic will be JS controlled, but let's use standard range inputs with opacity trick or just rely on native inputs styled properly */
/* Simplifying: The inputs should be visible for interaction. We use JS to update visual bar, but inputs need to be clickable. */
.rb-dual-slider input[type="range"] {
    opacity: 1;
    background: none; /* Transparent track so we see our custom divs */
    z-index: 3;
    top: 12px;
    margin: 0;
}
.rb-dual-slider input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}
/* We need to offset the inputs slightly or handle pointer events cleverly so they don't block each other */
/* Actually, standard stacked range inputs are tricky. Let's assume JS will handle the z-index swapping or pointer events. */


.rb-filtered-grid .rb-filter-item {
    margin-bottom: 24px; /* More vertical space between rows if wrapped */
}

/* Card General */
.rb-card {
    background: var(--rb-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); /* Enhanced shadow */
    border: 1px solid var(--rb-border);
    overflow: visible; /* Changed for dropdowns/popovers if needed */
    margin-bottom: 32px; /* Increased margin below cards */
}

.rb-card-header {
    padding: 24px 32px; /* Increased padding */
    background: #fff;
    font-weight: 600;
    font-size: 16px; /* Larger header text */
    color: var(--rb-text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--rb-border);
}

.rb-card-body {
    padding: 32px; /* Increased padding */
    border-top: none; 
    background: #fff; /* Keep white for cleaner look, removed grey bg for filters */
}

/* Filter Grid Spacing */
.rb-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px; /* Increased gap */
    align-items: start;
}

/* Updated Sticky Bar */
.rb-sticky-bar {
    position: fixed;
    bottom: 40px; /* Higher */
    /* Left is set by JS now */
    left: 50%; 
    transform: translateX(-50%) translateY(200%);
    background: #111827; /* Darker */
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* Deep shadow */
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 480px; /* Even wider */
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.08);
}


.rb-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--rb-text-main);
    margin: 0;
}

/* Card General */
.rb-card {
    background: var(--rb-card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--rb-border);
    overflow: hidden;
    margin-bottom: 20px;
}

.rb-card-header {
    padding: 16px 24px;
    background: #fff;
    font-weight: 600;
    font-size: 15px;
    color: var(--rb-text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default summary marker */
}
.rb-card-header::-webkit-details-marker {
    display: none;
}

.rb-card-body {
    padding: 24px;
    border-top: 1px solid var(--rb-border);
    background: #f9fafb;
}

/* Filter Summary Chevron Animation */
.rb-summary-chevron {
    transition: transform 0.2s ease;
}
details[open] .rb-summary-chevron {
    transform: rotate(180deg);
}

/* Filter Grid */
.rb-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
}
.rb-filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rb-filter-item.rb-span-full {
    grid-column: 1 / -1; /* Full width */
}
/* Responsive Grid */
@media (max-width: 1200px) {
    .rb-filter-grid { grid-template-columns: repeat(2, 1fr); }
    .rb-filter-item.rb-span-full { grid-column: span 2; }
}
@media (max-width: 768px) {
    .rb-filter-grid { grid-template-columns: 1fr; }
}

/* Form Elements */
.rb-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rb-text-main);
}

.rb-input, .rb-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--rb-border);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
.rb-input:focus, .rb-select:focus {
    border-color: var(--rb-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Checkbox Pills */
.rb-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rb-checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--rb-border);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.rb-checkbox-pill:hover {
    border-color: #d1d5db;
    background: #fdfdfd;
}
.rb-checkbox-pill input:checked + span {
    font-weight: 500;
    color: var(--rb-primary);
}
.rb-checkbox-pill:has(input:checked) {
    border-color: var(--rb-primary);
    background: #eef2ff;
}

/* Filter Actions */
.rb-filter-actions {
    flex-direction: row;
    align-items: flex-end;
    height: 100%;
    padding-bottom: 2px;
}

/* Buttons */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: normal;
}
.rb-btn:focus {
    box-shadow: none;
    outline: 2px solid var(--rb-primary);
    outline-offset: 2px;
}

.rb-btn-primary {
    background: var(--rb-primary);
    color: white;
}
.rb-btn-primary:hover {
    background: var(--rb-primary-hover);
    color: white;
}
.rb-btn-secondary {
    background: white;
    border-color: var(--rb-border);
    color: var(--rb-text-main);
}
.rb-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.rb-btn-dark {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
}
.rb-btn-dark:hover {
    background: #1f2937;
}
.rb-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.rb-btn-icon {
    padding: 6px;
    color: var(--rb-text-secondary);
    background: transparent;
}
.rb-btn-icon:hover {
    background: #f3f4f6;
    color: var(--rb-primary);
}

/* Table */
.rb-table-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--rb-border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}
.rb-table {
    width: 100%;
    border-collapse: collapse;
}
.rb-table th {
    background: #f9fafb;
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--rb-border);
}
.rb-table td {
    padding: 14px 16px; /* slightly taller rows */
    border-bottom: 1px solid var(--rb-border);
    font-size: 14px;
    color: var(--rb-text-main);
    vertical-align: middle;
}
.rb-table tr:hover td {
    background: #fafafa;
}
.rb-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.rb-table tr:hover .rb-row-actions {
    opacity: 1;
}

/* Badges */
.rb-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
}
.rb-badge-blue { background: #eff6ff; color: #1e40af; }
.rb-badge-gray { background: #f3f4f6; color: #374151; }
.rb-badge-green { background: #ecfdf5; color: #065f46; }

/* Sticky Selection Bar */
.rb-sticky-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background: #1f2937;
    color: white;
    padding: 10px 20px;
    border-radius: 100px; /* Pill shape */
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 320px;
    border: 1px solid rgba(255,255,255,0.1);
}
.rb-sticky-bar.is-visible {
    transform: translateX(-50%) translateY(0);
}
.rb-sticky-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Progress Section */
.rb-progress-container {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.rb-progress-track {
    height: 10px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
}
.rb-progress-bar {
    height: 100%;
    background: var(--rb-primary);
    width: 0%;
    border-radius: 99px;
    transition: width 0.3s ease;
    background-image: linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
    background-size: 1rem 1rem;
    animation: rb-progress-stripes 1s linear infinite;
}
@keyframes rb-progress-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Pagination */
.rb-mini-pagination {
    display: flex;
    gap: 4px;
}
.rb-mini-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--rb-border);
    background: white;
    text-decoration: none;
    color: var(--rb-text-main);
    font-size: 13px;
}
.rb-mini-pagination .page-numbers.current {
    background: var(--rb-primary);
    color: white;
    border-color: var(--rb-primary);
}

/* Pagination Footer */
.rb-pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--rb-border);
}

.rb-per-page-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-label-sm {
    font-size: 13px;
    font-weight: 500;
    color: var(--rb-text-secondary);
}

.rb-input-number-sm {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--rb-border);
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    color: var(--rb-text-main);
}
.rb-input-number-sm:focus {
    border-color: var(--rb-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.rb-pagination-list {
    display: flex;
    gap: 6px;
}

.rb-pagination-list .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--rb-text-main);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--rb-border);
    transition: all 0.2s;
    font-weight: 500;
}

.rb-pagination-list .page-numbers.current {
    background: var(--rb-primary);
    border-color: var(--rb-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.rb-pagination-list .page-numbers:hover:not(.current) {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #000;
}

.rb-pagination-list .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--rb-text-secondary);
}
