/* BlazorDataGrid Base Styles */

/* CSS Custom Properties (Theming) */
:root {
    /* Colors */
    --rg-border-color: #e0e0e0;
    --rg-header-bg: #f8f9fa;
    --rg-header-text: #333;
    --rg-row-bg: #fff;
    --rg-row-alt-bg: #f8f9fa;
    --rg-row-hover-bg: #f0f4f8;
    --rg-row-selected-bg: #e3f2fd;
    --rg-row-focused-outline: #2196f3;
    --rg-text-color: #333;
    --rg-text-muted: #666;
    --rg-primary: #1976d2;
    --rg-primary-hover: #1565c0;
    --rg-danger: #d32f2f;
    --rg-success: #388e3c;

    /* Sizing */
    --rg-header-height: 44px;
    --rg-row-height: 40px;
    --rg-font-size: 14px;
    --rg-cell-padding: 8px 12px;
    --rg-border-radius: 4px;

    /* Shadows */
    --rg-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --rg-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);

    /* Filter/Panel */
    --rg-panel-width: 320px;
    --rg-panel-bg: #fff;

    /* Transitions */
    --rg-transition: 150ms ease-in-out;
}

/* Base Container */
.rg-grid-container {
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow);
    overflow: hidden;
}

.rg-grid-fixed-height {
    height: 100%;
}

/* Toolbar */
.rg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--rg-header-bg);
    border-bottom: 1px solid var(--rg-border-color);
    gap: 8px;
    flex-wrap: wrap;
}

.rg-toolbar-start,
.rg-toolbar-center,
.rg-toolbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-color);
    transition: var(--rg-transition);
}

.rg-toolbar-btn:hover {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-primary);
}

.rg-toolbar-btn.rg-active {
    background: var(--rg-primary);
    border-color: var(--rg-primary);
    color: white;
}

.rg-toolbar-btn-wide {
    min-width: 160px;
    justify-content: flex-start;
    gap: 8px;
}

.rg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: var(--rg-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

/* Search Box */
.rg-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.rg-search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--rg-text-muted);
    pointer-events: none;
}

.rg-search-input {
    padding: 6px 32px 6px 32px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    width: 200px;
    transition: var(--rg-transition);
}

.rg-search-input:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    width: 260px;
}

.rg-search-input::placeholder {
    color: var(--rg-text-muted);
}

.rg-search-clear {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--rg-text-muted);
    transition: var(--rg-transition);
}

.rg-search-clear:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

/* Auto-width mode - grid sizes based on column content */
.rg-auto-width {
    width: fit-content;
    max-width: 100%;
    overflow: visible;
}

.rg-auto-width .rg-table {
    width: auto;
    table-layout: auto;
}

.rg-auto-width .rg-table-container {
    overflow-x: auto;
    overflow-y: visible;
}

/* Virtual scroll with auto-width needs overflow auto for vertical scrolling to work */
.rg-auto-width.rg-virtual-scroll .rg-table-container {
    overflow: auto;
}

.rg-auto-width .rg-th {
    overflow: visible;
}

/* Auto-width locked mode - prevents column width changes during scrolling */
.rg-auto-width.rg-auto-width-locked .rg-table {
    width: max-content;
    table-layout: fixed;
}

/* Icons */
.rg-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.rg-icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.rg-icon-xs {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Grid Wrapper */
.rg-grid-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Table Container */
.rg-table-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* Table */
.rg-table {
    min-width: 100%;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Header */
.rg-thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--rg-header-bg);
}

.rg-header-row {
    height: var(--rg-header-height);
}

.rg-th {
    padding: var(--rg-cell-padding);
    text-align: left;
    font-weight: 600;
    color: var(--rg-header-text);
    border-bottom: 2px solid var(--rg-border-color);
    position: relative;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.rg-th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rg-th-title {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.rg-th-title.rg-sortable {
    cursor: pointer;
}

.rg-th-title.rg-sortable:hover {
    color: var(--rg-primary);
}

.rg-th-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.rg-sort-indicator {
    display: inline-flex;
    color: var(--rg-primary);
}

.rg-th-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rg-th-btn {
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-muted);
    opacity: 0;
    transition: var(--rg-transition);
}

.rg-th:hover .rg-th-btn {
    opacity: 1;
}

.rg-th-btn:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-primary);
}

.rg-th-btn.rg-active {
    opacity: 1;
    color: var(--rg-primary);
}

/* Resize Handle */
.rg-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    cursor: col-resize;
    background: linear-gradient(to right,
        transparent 0px,
        rgba(0, 0, 0, 0.08) 1px,
        rgba(255, 255, 255, 0.5) 2px,
        rgba(0, 0, 0, 0.08) 3px,
        transparent 4px
    );
    z-index: 5;
    transition: background var(--rg-transition), box-shadow var(--rg-transition);
}

.rg-resize-handle:hover,
body.rg-resizing .rg-resize-handle {
    background: var(--rg-primary);
    box-shadow: 0 0 4px rgba(25, 118, 210, 0.4);
}

body.rg-resizing {
    cursor: col-resize !important;
    user-select: none;
}

/* Drag & Drop */
.rg-th.rg-dragging {
    opacity: 0.5;
}

.rg-th.rg-drag-over {
    background: var(--rg-row-selected-bg);
}

/* Body */
.rg-tbody {
    background: var(--rg-row-bg);
}

.rg-row {
    height: var(--rg-row-height);
    transition: background var(--rg-transition);
}

.rg-row-hover:hover {
    background: var(--rg-row-hover-bg);
}

.rg-row.row-selected,
.rg-row.rg-selected {
    background: var(--rg-row-selected-bg);
}

.rg-row.rg-focused {
    outline: 2px solid var(--rg-row-focused-outline);
    outline-offset: -2px;
}

.rg-striped .rg-row:nth-child(even) {
    background: var(--rg-row-alt-bg);
}

.rg-striped .rg-row:nth-child(even):hover {
    background: var(--rg-row-hover-bg);
}

.rg-striped .rg-row.row-selected:nth-child(even),
.rg-striped .rg-row.rg-selected:nth-child(even) {
    background: var(--rg-row-selected-bg);
}

/* Placeholder Row (for virtual scroll loading) */
.rg-placeholder-row {
    height: var(--rg-row-height);
}

.rg-placeholder-cell {
    text-align: center;
    color: var(--rg-text-muted, #999);
}

.rg-loading-text {
    display: inline-block;
    animation: rg-pulse 1.5s ease-in-out infinite;
}

@keyframes rg-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Cells */
.rg-td {
    padding: var(--rg-cell-padding);
    border-bottom: 1px solid var(--rg-border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    box-sizing: border-box;
}

.rg-bordered .rg-td,
.rg-bordered .rg-th {
    border-right: 1px solid var(--rg-border-color);
}

.rg-bordered .rg-td:last-child,
.rg-bordered .rg-th:last-child {
    border-right: none;
}

/* Horizontal Alignment */
.rg-align-left {
    text-align: left;
}

.rg-align-center {
    text-align: center;
}

.rg-align-right {
    text-align: right;
}

/* Vertical Alignment */
.rg-valign-top {
    vertical-align: top;
}

.rg-valign-middle {
    vertical-align: middle;
}

.rg-valign-bottom {
    vertical-align: bottom;
}

/* Text Rotation */
.rg-rotate {
    display: inline-block;
    white-space: nowrap;
}

.rg-rotate-90 {
    transform: rotate(90deg);
    transform-origin: center center;
}

.rg-rotate-neg90 {
    transform: rotate(-90deg);
    transform-origin: center center;
}

.rg-rotate-45 {
    transform: rotate(45deg);
    transform-origin: center center;
}

.rg-rotate-neg45 {
    transform: rotate(-45deg);
    transform-origin: center center;
}

.rg-rotate-180 {
    transform: rotate(180deg);
    transform-origin: center center;
}

/* Pinned Columns */
.rg-pinned-left,
.rg-pinned-right {
    position: sticky;
    z-index: 5;
}

.rg-pinned-left {
    left: 0;
}

.rg-pinned-right {
    right: 0;
}

/* Ensure pinned header cells maintain the same border */
.rg-th.rg-pinned-left,
.rg-th.rg-pinned-right {
    border-bottom: 2px solid var(--rg-border-color);
}

/* Pinned column shadow indicator using pseudo-element */
.rg-td.rg-pinned-left::after,
.rg-th.rg-pinned-left::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.15), transparent);
    pointer-events: none;
    transform: translateX(100%);
}

.rg-td.rg-pinned-right::before,
.rg-th.rg-pinned-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.15), transparent);
    pointer-events: none;
    transform: translateX(-100%);
}

/* Pinned header cells */
.rg-th.rg-pinned-left,
.rg-th.rg-pinned-right {
    background: var(--rg-header-bg);
}

/* Pinned body cells */
.rg-td.rg-pinned-left,
.rg-td.rg-pinned-right {
    background: var(--rg-row-bg);
}

/* Pinned cells in striped rows */
.rg-striped .rg-row:nth-child(even) .rg-td.rg-pinned-left,
.rg-striped .rg-row:nth-child(even) .rg-td.rg-pinned-right {
    background: var(--rg-row-alt-bg);
}

/* Pinned cells in selected rows */
.rg-row.rg-selected .rg-td.rg-pinned-left,
.rg-row.rg-selected .rg-td.rg-pinned-right,
.rg-row.row-selected .rg-td.rg-pinned-left,
.rg-row.row-selected .rg-td.rg-pinned-right {
    background: var(--rg-row-selected-bg);
}

/* Pinned cells in hovered rows */
.rg-row-hover:hover .rg-td.rg-pinned-left,
.rg-row-hover:hover .rg-td.rg-pinned-right {
    background: var(--rg-row-hover-bg);
}

/* Checkbox Cell */
.rg-checkbox-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
}

.rg-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--rg-primary);
}

/* Empty State */
.rg-empty-row {
    height: auto;
}

.rg-empty-cell {
    padding: 40px;
    text-align: center;
    color: var(--rg-text-muted);
}

/* Loading */
.rg-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 20;
}

.rg-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--rg-border-color);
    border-top-color: var(--rg-primary);
    border-radius: 50%;
    animation: rg-spin 1s linear infinite;
}

@keyframes rg-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.rg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--rg-header-bg);
    border-top: 1px solid var(--rg-border-color);
    font-size: 13px;
    color: var(--rg-text-muted);
}

.rg-footer-info {
    flex: 1;
}

/* Pagination */
.rg-pagination {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rg-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-page-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-color);
    transition: var(--rg-transition);
}

.rg-page-btn:hover:not(:disabled) {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-border-color);
}

.rg-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rg-page-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rg-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-color);
    font-size: 13px;
    transition: var(--rg-transition);
}

.rg-page-num:hover {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-border-color);
}

.rg-page-num.rg-active {
    background: var(--rg-primary);
    border-color: var(--rg-primary);
    color: white;
}

.rg-page-ellipsis {
    padding: 0 4px;
    color: var(--rg-text-muted);
}

/* Select */
.rg-select {
    padding: 6px 28px 6px 10px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.rg-select:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.rg-select-sm {
    padding: 4px 24px 4px 8px;
    font-size: 13px;
}

/* Input */
.rg-input {
    padding: 8px 12px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    width: 100%;
}

.rg-input:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.rg-input::placeholder {
    color: var(--rg-text-muted);
}

/* Buttons */
.rg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--rg-font-size);
    font-weight: 500;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    transition: var(--rg-transition);
    border: 1px solid transparent;
}

.rg-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rg-btn-primary {
    background: var(--rg-primary);
    color: white;
    border-color: var(--rg-primary);
}

.rg-btn-primary:hover:not(:disabled) {
    background: var(--rg-primary-hover);
    border-color: var(--rg-primary-hover);
}

.rg-btn-secondary {
    background: var(--rg-row-bg);
    color: var(--rg-text-color);
    border-color: var(--rg-border-color);
}

.rg-btn-secondary:hover:not(:disabled) {
    background: var(--rg-row-hover-bg);
}

.rg-btn-link {
    background: transparent;
    border: none;
    color: var(--rg-primary);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
}

.rg-btn-link:hover {
    text-decoration: underline;
}

.rg-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-muted);
    transition: var(--rg-transition);
}

.rg-btn-icon:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

.rg-btn-icon.rg-btn-danger:hover {
    background: rgba(211, 47, 47, 0.1);
    color: var(--rg-danger);
}

/* Dropdowns */
.rg-dropdown {
    position: relative;
}

.rg-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 150px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    z-index: 1000;
    padding: 4px 0;
    margin-top: 4px;
}

/* Column header dropdown - needs higher z-index to appear above footer/scrollbar and above drawer backdrop */
.rg-th .rg-dropdown-menu {
    z-index: 1002;
}

/* Upward-positioned dropdown (when not enough space below) */
.rg-dropdown-menu.rg-dropdown-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.rg-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    transition: var(--rg-transition);
}

.rg-dropdown-item:hover {
    background: var(--rg-row-hover-bg);
}

.rg-dropdown-item.rg-selected {
    background: var(--rg-row-selected-bg);
    color: var(--rg-primary);
}

/* Menu icon in dropdown items */
.rg-menu-icon {
    margin-right: 8px;
    flex-shrink: 0;
}

.rg-dropdown-item {
    display: flex;
    align-items: center;
}

/* Menu sections for combined menus */
.rg-menu-section {
    padding: 4px 0;
}

.rg-menu-section-title {
    padding: 4px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--rg-text-muted);
    letter-spacing: 0.5px;
}

.rg-menu-divider {
    height: 1px;
    background: var(--rg-border-color);
    margin: 4px 0;
}

/* Column options menu (wider for filter content) */
.rg-column-options-menu {
    min-width: 220px;
    max-width: 280px;
}

.rg-column-filter-menu {
    min-width: 200px;
    max-width: 250px;
}

/* Column filter content inside header menu */
.rg-column-filter-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    box-sizing: border-box;
    width: 100%;
}

.rg-column-filter-content .rg-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.rg-column-filter-content .rg-select,
.rg-column-filter-content .rg-select-sm {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 4px 24px 4px 8px;
    font-size: 12px;
}

.rg-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* Filter indicator in header */
.rg-filter-indicator {
    color: var(--rg-primary);
    margin-left: 4px;
}

/* Select filter content */
.rg-select-filter-content {
    max-height: 200px;
    overflow-y: auto;
}

.rg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

.rg-checkbox-label:hover {
    background: var(--rg-row-hover-bg);
}

/* Small button variant */
.rg-btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Hierarchical Menu with Submenus */
.rg-hierarchical-menu {
    min-width: 160px;
}

.rg-menu-item-with-submenu {
    position: relative;
}

.rg-has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.rg-submenu-arrow {
    width: 12px;
    height: 12px;
    margin-left: auto;
    padding-left: 8px;
    flex-shrink: 0;
}

.rg-submenu {
    position: absolute;
    top: -4px;
    min-width: 200px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    z-index: 1003;
}

.rg-submenu-right {
    left: 100%;
    margin-left: 4px;
}

.rg-submenu-left {
    right: 100%;
    left: auto;
    margin-right: 4px;
}

.rg-submenu-content {
    padding: 4px 0;
}

/* Standard filter options in submenu need padding */
.rg-submenu-content .rg-column-filter-content {
    padding: 8px 12px;
}

/* AutoFilter in submenu - remove duplicate borders */
.rg-submenu .rg-autofilter-dropdown {
    position: static;
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-width: auto;
    max-width: none;
}

/* Disabled menu items */
.rg-dropdown-item.rg-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rg-dropdown-item.rg-disabled:hover {
    background: transparent;
}

.rg-dropdown-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rg-dropdown-item:disabled:hover {
    background: transparent;
}

.rg-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 280px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    z-index: 100;
}

/* Filter Panel */
.rg-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 29;
}

.rg-filter-panel, .rg-cc-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rg-panel-width);
    background: var(--rg-panel-bg);
    border-right: 1px solid var(--rg-border-color);
    box-shadow: var(--rg-shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.rg-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-filter-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rg-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-filter-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--rg-text-muted);
    border-radius: var(--rg-border-radius);
}

.rg-filter-close:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

.rg-filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rg-filter-group {
    margin-bottom: 20px;
}

.rg-filter-group:last-child {
    margin-bottom: 0;
}

.rg-filter-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--rg-text-color);
}

.rg-filter-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-filter-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-filter-separator {
    color: var(--rg-text-muted);
    font-size: 13px;
}

.rg-filter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--rg-border-color);
}

/* Filter Content (for Dialog/Drawer modes) */
.rg-filter-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rg-filter-content .rg-filter-group {
    margin-bottom: 0;
}

/* Filter Dialog */
.rg-filter-dialog {
    max-width: 480px;
}

.rg-filter-dialog .rg-modal-body {
    max-height: 60vh;
}

/* Filter Drawer */
.rg-filter-drawer .rg-drawer-body {
    padding: 16px;
}

.rg-drawer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--rg-border-color);
}

/* Filter Header Actions (for title row with Clear All link) */
.rg-filter-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Boolean Filter */
.rg-boolean-filter .rg-radio-group {
    display: flex;
    gap: 16px;
}

.rg-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rg-radio {
    width: 16px;
    height: 16px;
    accent-color: var(--rg-primary);
}

/* Select Filter Options */
.rg-select-filter-options {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    padding: 8px;
}

.rg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

/* Column Chooser */
.rg-cc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 99;
}

.rg-cc-dropdown {
    overflow-y: auto;
    z-index: 100;
}

.rg-column-chooser-content {
    padding: 12px;
}

.rg-cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rg-cc-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.rg-cc-actions {
    display: flex;
    gap: 8px;
}

.rg-cc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rg-cc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: var(--rg-border-radius);
    transition: var(--rg-transition);
    user-select: none;
}

.rg-cc-item:hover {
    background: var(--rg-row-hover-bg);
}

.rg-cc-item.rg-cc-hidden {
    opacity: 0.6;
}

.rg-cc-item.rg-cc-dragging {
    opacity: 0.5;
    background: var(--rg-row-hover-bg);
}

.rg-cc-item.rg-cc-drag-over {
    background: var(--rg-row-selected-bg);
    border: 2px dashed var(--rg-primary);
}

.rg-cc-drag-handle {
    cursor: grab;
    color: var(--rg-text-muted);
    padding: 4px;
    margin: -4px;
    border-radius: var(--rg-border-radius);
    transition: var(--rg-transition);
}

.rg-cc-drag-handle svg {
    pointer-events: none;
}

.rg-cc-drag-handle:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

.rg-cc-drag-handle:active {
    cursor: grabbing;
}

.rg-cc-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
}

.rg-cc-label {
    flex: 1;
}

.rg-cc-label.rg-cc-required {
    color: var(--rg-text-muted);
    font-style: italic;
}

.rg-cc-pin-controls {
    display: flex;
    gap: 2px;
}

.rg-cc-pin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-muted);
    transition: var(--rg-transition);
}

.rg-cc-pin-btn:hover {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-border-color);
}

.rg-cc-pin-btn.rg-active {
    background: var(--rg-primary);
    border-color: var(--rg-primary);
    color: white;
}

/* Drawer */
.rg-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--rg-panel-width);
    background: var(--rg-panel-bg);
    box-shadow: var(--rg-shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.rg-drawer-right {
    right: 0;
}

.rg-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-drawer-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rg-drawer-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--rg-text-muted);
    border-radius: var(--rg-border-radius);
}

.rg-drawer-close:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

.rg-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rg-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* Modal */
.rg-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.rg-modal {
    background: var(--rg-panel-bg);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.rg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rg-modal-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--rg-text-muted);
    border-radius: var(--rg-border-radius);
}

.rg-modal-close:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-text-color);
}

.rg-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.rg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--rg-border-color);
}

/* Sort Dialog */
.rg-sort-dialog {
    max-width: 520px;
}

.rg-sort-dialog .rg-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.rg-sort-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rg-sort-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-sort-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
}

.rg-sort-item-priority {
    font-size: 13px;
    font-weight: 600;
    color: var(--rg-text-muted);
    min-width: 24px;
}

.rg-sort-item-column {
    flex: 1;
    min-width: 140px;
}

.rg-sort-item-direction {
    min-width: 140px;
}

.rg-sort-item-actions {
    display: flex;
    gap: 4px;
}

.rg-sort-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    margin-top: 8px;
    background: transparent;
    border: 1px dashed var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    color: var(--rg-primary);
    cursor: pointer;
    transition: var(--rg-transition);
    width: 100%;
    font-size: 14px;
}

.rg-sort-add-btn:hover {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-primary);
}

.rg-sort-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rg-sort-empty {
    padding: 20px;
    text-align: center;
    color: var(--rg-text-muted);
}

.rg-sort-empty p {
    margin: 0;
}

/* Form Elements */
.rg-form-group {
    margin-bottom: 16px;
}

.rg-form-group:last-child {
    margin-bottom: 0;
}

.rg-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.rg-error {
    display: block;
    color: var(--rg-danger);
    font-size: 13px;
    margin-top: 4px;
}

/* Dropdown Menu Enhanced Styles */
.rg-dropdown-menu-end {
    right: 0;
    left: auto;
}

.rg-dropdown-menu.rg-show {
    display: block;
}

.rg-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background-color: var(--rg-border-color);
}

.rg-dropdown-header {
    display: block;
    padding: 4px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--rg-text-muted);
    letter-spacing: 0.5px;
}

.rg-dropdown-item-text {
    display: block;
    padding: 8px 12px;
    color: var(--rg-text-muted);
    font-size: var(--rg-font-size);
}

.rg-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rg-btn-text {
    font-size: var(--rg-font-size);
}

.rg-icon-placeholder {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Utility classes */
.rg-me-2 {
    margin-right: 8px;
}

.rg-ms-auto {
    margin-left: auto;
}

.rg-text-warning {
    color: #f59e0b;
}

.rg-text-danger {
    color: var(--rg-danger);
}

.rg-text-success {
    color: #22c55e;
}

.rg-text-muted {
    color: var(--rg-text-muted);
}

/* View Selector */
.rg-view-selector {
    position: relative;
}

.rg-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    font-size: var(--rg-font-size);
}

.rg-view-btn:hover {
    border-color: var(--rg-primary);
}

.rg-view-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    z-index: 100;
}

.rg-view-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
}

.rg-view-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: var(--rg-font-size);
}

.rg-view-item:hover {
    background: var(--rg-row-hover-bg);
}

.rg-view-item.rg-active {
    background: var(--rg-row-selected-bg);
}

.rg-view-default-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--rg-primary);
    color: white;
    border-radius: 10px;
}

.rg-view-current-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #22c55e;
    color: white;
    border-radius: 10px;
    font-weight: 500;
}

.rg-view-empty {
    padding: 16px;
    text-align: center;
    color: var(--rg-text-muted);
}

.rg-view-menu-actions {
    border-top: 1px solid var(--rg-border-color);
    padding: 4px 0;
}

.rg-view-action {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
}

.rg-view-action:hover {
    background: var(--rg-row-hover-bg);
}

/* Manage Views Dialog */
.rg-view-list-manage {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-view-item-manage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
}

.rg-view-item-manage.rg-pending-delete {
    opacity: 0.5;
    background: rgba(211, 47, 47, 0.1);
    border-color: var(--rg-danger);
}

.rg-view-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-view-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty State */
.rg-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--rg-text-muted);
}

/* ===================================
   AutoFilter Styles
   =================================== */

.rg-autofilter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    max-width: 350px;
    background: var(--rg-panel-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow-lg);
    z-index: 1002;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

/* Upward-positioned autofilter dropdown (when not enough space below) */
.rg-autofilter-dropdown.rg-dropdown-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.rg-autofilter-search {
    padding: 12px;
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-autofilter-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    font-size: var(--rg-font-size);
    background: var(--rg-row-bg);
    color: var(--rg-text-color);
}

.rg-autofilter-search-input:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.rg-autofilter-select-all {
    padding: 8px 12px;
    border-bottom: 1px solid var(--rg-border-color);
    background: var(--rg-header-bg);
}

.rg-autofilter-select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.rg-autofilter-values {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
}

.rg-autofilter-value-list {
    padding: 4px 0;
}

.rg-autofilter-value-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: var(--rg-transition);
}

.rg-autofilter-value-item:hover {
    background: var(--rg-row-hover-bg);
}

.rg-autofilter-value-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rg-autofilter-value-count {
    font-size: 12px;
    color: var(--rg-text-muted);
    flex-shrink: 0;
}

.rg-autofilter-loading {
    padding: 20px;
    text-align: center;
    color: var(--rg-text-muted);
}

.rg-autofilter-empty {
    padding: 20px;
    text-align: center;
    color: var(--rg-text-muted);
    font-style: italic;
}

.rg-autofilter-type-menu {
    border-top: 1px solid var(--rg-border-color);
    padding: 8px 0;
}

.rg-autofilter-type-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--rg-font-size);
    color: var(--rg-text-color);
    text-align: left;
    transition: var(--rg-transition);
}

.rg-autofilter-type-menu-item:hover {
    background: var(--rg-row-hover-bg);
}

.rg-autofilter-type-menu-item svg {
    color: var(--rg-text-muted);
}

.rg-autofilter-type-submenu {
    padding: 12px;
    border-top: 1px solid var(--rg-border-color);
}

.rg-autofilter-type-submenu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rg-autofilter-type-submenu-title {
    font-weight: 600;
    font-size: 13px;
}

.rg-autofilter-type-submenu-back {
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--rg-primary);
    font-size: 12px;
}

.rg-autofilter-type-submenu-back:hover {
    text-decoration: underline;
}

.rg-autofilter-type-submenu-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-autofilter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--rg-border-color);
    background: var(--rg-header-bg);
}

/* ===================================
   Advanced Filter Styles
   =================================== */

.rg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.rg-advfilter-dialog {
    min-width: 600px;
    max-width: 800px;
}

.rg-advfilter-description {
    padding: 0 0 16px;
    color: var(--rg-text-muted);
    font-size: 13px;
}

.rg-advfilter-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.rg-advfilter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rg-advfilter-row-label {
    min-width: 60px;
    padding-top: 8px;
    font-size: 13px;
    color: var(--rg-text-muted);
}

.rg-advfilter-or {
    font-weight: 600;
    color: var(--rg-primary);
}

.rg-advfilter-row-conditions {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--rg-row-alt-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
}

.rg-advfilter-and-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rg-text-muted);
    padding: 0 4px;
}

.rg-advfilter-condition {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
}

.rg-advfilter-column {
    min-width: 120px;
}

.rg-advfilter-operator {
    min-width: 140px;
}

.rg-advfilter-value {
    min-width: 100px;
    max-width: 150px;
}

.rg-advfilter-and {
    font-size: 12px;
    color: var(--rg-text-muted);
}

.rg-advfilter-remove {
    padding: 4px;
    color: var(--rg-text-muted);
}

.rg-advfilter-remove:hover {
    color: var(--rg-danger);
}

.rg-advfilter-add-condition {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.rg-advfilter-remove-row {
    flex-shrink: 0;
}

.rg-advfilter-add-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rg-modal-footer-spacer {
    flex: 1;
}

/* ===================================
   Slicer Styles
   =================================== */

.rg-slicer {
    display: flex;
    flex-direction: column;
    background: var(--rg-panel-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow);
    overflow: hidden;
}

.rg-slicer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--rg-header-bg);
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-slicer-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--rg-header-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rg-slicer-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-muted);
    transition: var(--rg-transition);
}

.rg-slicer-clear:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-danger);
}

.rg-slicer-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.rg-slicer-content {
    display: grid;
    gap: 4px;
}

.rg-slicer-content.rg-columns-1 { grid-template-columns: 1fr; }
.rg-slicer-content.rg-columns-2 { grid-template-columns: repeat(2, 1fr); }
.rg-slicer-content.rg-columns-3 { grid-template-columns: repeat(3, 1fr); }
.rg-slicer-content.rg-columns-4 { grid-template-columns: repeat(4, 1fr); }
.rg-slicer-content.rg-columns-5 { grid-template-columns: repeat(5, 1fr); }
.rg-slicer-content.rg-columns-6 { grid-template-columns: repeat(6, 1fr); }

.rg-slicer-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--rg-row-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--rg-text-color);
    transition: var(--rg-transition);
    text-align: left;
    overflow: hidden;
}

.rg-slicer-button:hover:not(.rg-no-data) {
    background: var(--rg-row-hover-bg);
    border-color: var(--rg-primary);
}

.rg-slicer-button.rg-selected {
    background: var(--rg-primary);
    border-color: var(--rg-primary);
    color: white;
}

.rg-slicer-button.rg-no-data {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--rg-row-alt-bg);
}

.rg-slicer-button-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rg-slicer-button-count {
    flex-shrink: 0;
    font-size: 11px;
    opacity: 0.8;
    margin-left: 8px;
}

.rg-slicer-loading {
    padding: 20px;
    text-align: center;
    color: var(--rg-text-muted);
}

.rg-slicer-empty {
    padding: 20px;
    text-align: center;
    color: var(--rg-text-muted);
    font-style: italic;
}

/* Slicer chip style */
.rg-slicer.rg-style-chip .rg-slicer-button {
    border-radius: 16px;
    padding: 6px 14px;
}

/* Slicer tile style */
.rg-slicer.rg-style-tile .rg-slicer-button {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    text-align: center;
}

.rg-slicer.rg-style-tile .rg-slicer-button-label {
    text-align: center;
    white-space: normal;
}

.rg-slicer.rg-style-tile .rg-slicer-button-count {
    margin-left: 0;
    margin-top: 4px;
}

/* Slicer disabled items collapsible group */
.rg-slicer-disabled-group {
    margin-top: 8px;
    border-top: 1px solid var(--rg-border-color, #e0e0e0);
}

.rg-slicer-disabled-header {
    padding: 8px 12px;
    font-size: 0.85em;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.rg-slicer-disabled-header:hover {
    color: #333;
    background-color: #f5f5f5;
}

.rg-slicer-disabled-content {
    padding-top: 4px;
}

/* Remove default details marker styling */
.rg-slicer-disabled-group > summary {
    list-style: none;
}

.rg-slicer-disabled-group > summary::-webkit-details-marker {
    display: none;
}

/* Add custom expand/collapse indicator */
.rg-slicer-disabled-header::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 6px;
    font-size: 0.7em;
    transition: transform 0.2s;
}

.rg-slicer-disabled-group[open] > .rg-slicer-disabled-header::before {
    transform: rotate(90deg);
}

/* ===================================
   Timeline Styles
   =================================== */

.rg-timeline {
    display: flex;
    flex-direction: column;
    background: var(--rg-panel-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    box-shadow: var(--rg-shadow);
    overflow: hidden;
}

.rg-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--rg-header-bg);
    border-bottom: 1px solid var(--rg-border-color);
}

.rg-timeline-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--rg-header-text);
}

.rg-timeline-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-timeline-period-select {
    padding: 4px 24px 4px 8px;
    font-size: 12px;
}

.rg-timeline-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--rg-border-radius);
    cursor: pointer;
    color: var(--rg-text-muted);
    transition: var(--rg-transition);
}

.rg-timeline-clear:hover {
    background: var(--rg-row-hover-bg);
    color: var(--rg-danger);
}

.rg-timeline-body {
    flex: 1;
    padding: 16px 12px;
    min-height: 80px;
}

.rg-timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: var(--rg-text-muted);
}

.rg-timeline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: var(--rg-text-muted);
    font-style: italic;
}

.rg-timeline-track {
    position: relative;
    height: 60px;
    background: var(--rg-row-alt-bg);
    border: 1px solid var(--rg-border-color);
    border-radius: var(--rg-border-radius);
    overflow: hidden;
}

.rg-timeline-track-inner {
    display: flex;
    height: 100%;
    align-items: flex-end;
}

.rg-timeline-period {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 2px;
    cursor: pointer;
    transition: var(--rg-transition);
    border-right: 1px solid transparent;
}

.rg-timeline-period:hover:not(.rg-no-data) {
    background: rgba(25, 118, 210, 0.1);
}

.rg-timeline-period.rg-selected {
    background: rgba(25, 118, 210, 0.2);
}

.rg-timeline-period.rg-no-data {
    opacity: 0.4;
    cursor: default;
}

.rg-timeline-period-bar {
    width: 80%;
    max-width: 30px;
    background: var(--rg-primary);
    border-radius: 2px 2px 0 0;
    transition: var(--rg-transition);
    min-height: 2px;
}

.rg-timeline-period.rg-selected .rg-timeline-period-bar {
    background: var(--rg-primary-hover);
}

.rg-timeline-period.rg-no-data .rg-timeline-period-bar {
    background: var(--rg-border-color);
}

.rg-timeline-period-label {
    font-size: 10px;
    color: var(--rg-text-muted);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.rg-timeline-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(25, 118, 210, 0.15);
    border: 2px solid var(--rg-primary);
    border-radius: 4px;
    pointer-events: none;
}

.rg-timeline-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 24px;
    background: var(--rg-primary);
    border-radius: 4px;
    cursor: ew-resize;
    pointer-events: auto;
    transition: background var(--rg-transition);
}

.rg-timeline-handle:hover {
    background: var(--rg-primary-hover);
}

.rg-timeline-handle-left {
    left: -4px;
}

.rg-timeline-handle-right {
    right: -4px;
}

.rg-timeline-selection-info {
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--rg-text-muted);
    border-top: 1px solid var(--rg-border-color);
    background: var(--rg-header-bg);
}

/* ===================================
   Extra small button variant
   =================================== */

.rg-btn-xs {
    padding: 2px 6px;
    font-size: 11px;
}

.rg-input-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.rg-select-xs {
    padding: 2px 20px 2px 6px;
    font-size: 11px;
}
