/* Sidebar items */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.70);
    font-size: 13px;
    font-weight: 400;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-item.active {
    background: rgba(102,126,234,0.25);
    color: #fff;
    font-weight: 500;
}

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(31,38,135,0.10);
    padding: 22px;
    transition: transform 300ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 250ms;
}
.glass-card:hover {
/*    transform: translateY(-2px);*/
    box-shadow: 0 8px 32px rgba(31,38,135,0.12);
}

/* KPI card variants */
.kpi-card { position: relative; border-radius: 14px; padding: 22px; overflow: hidden; transition: transform 350ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 250ms; }
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(31,38,135,0.16); }
.kpi-card::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.60); backdrop-filter: blur(20px); z-index: 0; }
.kpi-card > * { position: relative; z-index: 1; }
.kpi-card--purple { background: linear-gradient(135deg, rgba(102,126,234,0.25), rgba(118,75,162,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--green { background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,182,212,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--indigo { background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--amber { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(249,115,22,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }

/* Badge */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 9999px; }
.badge--success { background: rgba(16,185,129,0.08); color: #10B981; border: 1px solid rgba(16,185,129,0.20); }
.badge--warning { background: rgba(245,158,11,0.08); color: #F59E0B; border: 1px solid rgba(245,158,11,0.20); }
.badge--error { background: rgba(239,68,68,0.08); color: #EF4444; border: 1px solid rgba(239,68,68,0.20); }
.badge--info { background: rgba(102,126,234,0.08); color: #667EEA; border: 1px solid rgba(102,126,234,0.20); }
.badge--neutral { background: rgba(148,163,184,0.08); color: #94A3B8; border: 1px solid rgba(148,163,184,0.20); }

/* Table inside glass card */
.glass-card table { width: 100%; border-collapse: collapse; }
.glass-card th { text-align: left; font-size: 12px; font-weight: 500; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; border-bottom: 1px solid #E2E8F0; }
.glass-card td { padding: 12px 14px; border-bottom: 1px solid #F1F5F9; font-size: 13px; color: #0F172A; }
.glass-card tr:last-child td { border-bottom: none; }
.glass-card tr:hover td { background: rgba(102,126,234,0.03); }

/* Btn primary gradient */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; border: none; cursor: pointer; transition: all 200ms; background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 0 24px rgba(102,126,234,0.20); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,38,135,0.08), 0 0 28px rgba(102,126,234,0.30); }

.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #0F172A; border: 1px solid #E2E8F0; cursor: pointer; transition: all 200ms; background: rgba(255,255,255,0.65); backdrop-filter: blur(8px); }
.btn-secondary:hover { background: rgba(255,255,255,0.80); border-color: rgba(102,126,234,0.20); }

.btn-danger { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; border: none; cursor: pointer; background: #EF4444; }
.btn-danger:hover { background: #DC2626; }

/* Form inputs */
.form-input { width: 100%; padding: 8px 12px; border: 1px solid #E2E8F0; border-radius: 10px; font-size: 13px; background: rgba(255,255,255,0.80); backdrop-filter: blur(8px); transition: border-color 200ms; }
.form-input:focus { outline: none; border-color: #667EEA; box-shadow: 0 0 0 3px rgba(102,126,234,0.10); }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 4px; }

/* Delete modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.40); backdrop-filter: blur(4px); z-index: 100; display: none; }
.modal-backdrop.show { display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 14px; padding: 24px; max-width: 400px; width: 100%; box-shadow: 0 16px 48px rgba(31,38,135,0.16); }

/* === Turbo Drive === */

/* Progress bar */
.turbo-progress-bar {
    height: 3px;
    background: linear-gradient(90deg, #667EEA 0%, #764BA2 50%, #FF6B6B 100%);
    box-shadow: 0 0 12px rgba(102,126,234,0.50);
    z-index: 9999;
}

/* Page transitions */
.page-content {
    animation: pageEnter 250ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.is-leaving .page-content {
    animation: pageLeave 150ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageLeave {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(6px); }
}

/* Button loading spinner */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    height: 14px;
    display: inline-block;
}
.skeleton-row td {
    padding: 14px !important;
}
.skeleton-wide { width: 70%; }
.skeleton-medium { width: 45%; }
.skeleton-short { width: 25%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth sidebar active transition */
.sidebar-item { position: relative; }
.sidebar-item::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    border-radius: 2px;
    background: linear-gradient(180deg, #667EEA, #764BA2);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Pagination */
.pagination { display: flex; gap: 4px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #475569; border: 1px solid #E2E8F0; background: rgba(255,255,255,0.65); }
.pagination a:hover { background: rgba(255,255,255,0.80); border-color: rgba(102,126,234,0.20); }
.pagination .active { background: linear-gradient(135deg, #667EEA, #764BA2); color: #fff; border-color: transparent; }

/* === Dashboard Gridstack === */
.grid-stack { min-height: 200px; }
.grid-stack-item { overflow: hidden; }
.grid-stack-item-content {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(226,232,240,0.6);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 16px;
    overflow: hidden;
    transition: box-shadow 250ms;
    display: flex;
    flex-direction: column;
}
.grid-stack-item-content:hover { box-shadow: 0 4px 12px rgba(31,38,135,0.08); }
.grid-stack-item-content .widget-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-shrink: 0;
}
.grid-stack-item-content .widget-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; color: #0F172A;
}
.grid-stack-item-content .widget-remove {
    width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent;
    color: #94A3B8; font-size: 14px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 150ms; opacity: 0;
}
.grid-stack-item-content:hover .widget-remove { opacity: 1; }
.grid-stack-item-content .widget-remove:hover { background: rgba(239,68,68,0.08); color: #EF4444; }
.grid-stack-item-content .widget-body { flex: 1; min-height: 0; overflow: hidden; }

/* KPI widget variant (gradient background) */
.grid-stack-item-content.kpi-widget { padding: 22px; }
.grid-stack-item-content.kpi-widget::before { display: none; }
.kpi-widget--purple { background: linear-gradient(135deg, rgba(102,126,234,0.25), rgba(118,75,162,0.15)) !important; }
.kpi-widget--green { background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,182,212,0.15)) !important; }
.kpi-widget--indigo { background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15)) !important; }
.kpi-widget--amber { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(249,115,22,0.15)) !important; }

/* Filter bar */
.filter-btn {
    padding: 6px 16px; border-radius: 10px; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 200ms; border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.50); backdrop-filter: blur(8px); color: #475569;
    font-family: 'Inter', sans-serif;
}
.filter-btn:hover { background: rgba(255,255,255,0.70); border-color: rgba(102,126,234,0.20); }
.filter-btn.active {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); color: #fff;
    border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 0 24px rgba(102,126,234,0.20);
}
.filter-select {
    padding: 6px 12px; border-radius: 10px; font-size: 12px; font-weight: 500; color: #475569;
    background: rgba(255,255,255,0.50); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.35); cursor: pointer; font-family: 'Inter', sans-serif;
}
.filter-select:hover { background: rgba(255,255,255,0.70); border-color: rgba(102,126,234,0.20); }
.widget-library-toggle {
    display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px;
    font-size: 12px; font-weight: 600; color: #fff; border: none; cursor: pointer;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 16px rgba(102,126,234,0.15);
    transition: all 200ms cubic-bezier(0.34,1.56,0.64,1);
}
.widget-library-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,38,135,0.12), 0 0 20px rgba(102,126,234,0.25); }

/* Widget library panel */
.widget-library-panel {
    position: fixed; right: 0; top: 0; width: 280px; height: 100vh; z-index: 200;
    background: rgba(26,26,46,0.92); backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255,255,255,0.08); padding: 24px 16px;
    overflow-y: auto; box-shadow: -8px 0 32px rgba(0,0,0,0.2);
    transform: translateX(0); transition: transform 300ms cubic-bezier(0.4,0,0.2,1);
}
.widget-library-panel.hidden { transform: translateX(100%); }
.widget-library-panel::before {
    content: ''; position: absolute; right: 0; top: 24px; bottom: 24px; width: 3px;
    background: linear-gradient(180deg, #667EEA 0%, #764BA2 50%, #FF6B6B 100%);
    border-radius: 2px; opacity: 0.5;
}
.widget-library-close {
    position: absolute; top: 20px; right: 16px; width: 28px; height: 28px; border-radius: 10px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.5); font-size: 16px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 200ms;
}
.widget-library-close:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.30); color: #EF4444; }
.widget-library-search {
    width: 100%; padding: 8px 12px; border-radius: 10px; font-size: 12px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.7); font-family: 'Inter', sans-serif; margin-bottom: 16px; outline: none;
}
.widget-library-search:focus { border-color: rgba(102,126,234,0.40); background: rgba(255,255,255,0.10); }
.widget-library-section { margin-bottom: 16px; }
.widget-library-section-title {
    font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px;
}
.widget-library-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8); font-size: 12px; cursor: grab; transition: all 200ms; margin-bottom: 6px;
}
.widget-library-item:hover { background: rgba(102,126,234,0.15); border-color: rgba(102,126,234,0.30); transform: translateX(-4px); }
.widget-library-item { cursor: pointer; }
.widget-library-item.on-grid { opacity: 0.45; cursor: default; pointer-events: none; }
.widget-library-item.on-grid:hover { transform: none; background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.widget-library-item .added-tag {
    margin-left: auto; font-size: 10px; font-weight: 600; padding: 2px 10px;
    border-radius: 9999px; background: rgba(16,185,129,0.20); color: #10B981;
    border: 1px solid rgba(16,185,129,0.30); white-space: nowrap;
}
.widget-library-item .add-to-grid-btn {
    margin-left: auto; width: 24px; height: 24px; border-radius: 6px; border: none;
    background: rgba(102,126,234,0.25); color: #667EEA; font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 200ms; flex-shrink: 0;
}
.widget-library-item:hover .add-to-grid-btn { background: rgba(102,126,234,0.5); color: #fff; }

/* Alert items in widget */
.alert-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: 10px; border-left: 3px solid; backdrop-filter: blur(4px); margin-bottom: 8px;
}
.alert-item--error { background: rgba(239,68,68,0.08); border-color: #EF4444; }
.alert-item--warning { background: rgba(245,158,11,0.08); border-color: #F59E0B; }
.alert-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; text-transform: uppercase; }
.alert-tag--ops { background: rgba(239,68,68,0.12); color: #EF4444; }
.alert-tag--biz { background: rgba(245,158,11,0.12); color: #F59E0B; }
.alert-count { margin-left: auto; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 700; }

/* === Drag & Drop UX === */

/* A: Drop zone placeholder — pulsing indigo zone */
.grid-stack-placeholder > .placeholder-content {
    background: rgba(102,126,234,0.08) !important;
    border: 2px dashed rgba(102,126,234,0.5) !important;
    border-radius: 14px;
    animation: gs-placeholder-pulse 1.5s ease-in-out infinite;
}
@keyframes gs-placeholder-pulse {
    0%, 100% { border-color: rgba(102,126,234,0.3); background: rgba(102,126,234,0.05); }
    50%      { border-color: rgba(102,126,234,0.7); background: rgba(102,126,234,0.12); }
}

/* A: Dragged widget — reduced opacity + elevated shadow */
.grid-stack-item.ui-draggable-dragging > .grid-stack-item-content {
    opacity: 0.4 !important;
    box-shadow: 0 12px 40px rgba(102,126,234,0.25) !important;
    border-color: rgba(102,126,234,0.3);
}

/* C: Resize handles — visible on hover */
.grid-stack-item > .ui-resizable-se {
    width: 16px !important;
    height: 16px !important;
    background: linear-gradient(135deg, #667EEA, #764BA2) !important;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 5px;
    opacity: 0;
    transition: opacity 200ms;
    z-index: 10;
    bottom: 2px !important;
    right: 2px !important;
    background-image: none !important;
    box-shadow: 0 0 8px rgba(102,126,234,0.4);
}
.grid-stack-item:hover > .ui-resizable-se {
    opacity: 1;
}
.grid-stack-item > .ui-resizable-e {
    width: 6px !important;
    right: 0 !important;
    top: 20% !important;
    bottom: 20% !important;
    background: rgba(102,126,234,0.4) !important;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 200ms;
    background-image: none !important;
}
.grid-stack-item:hover > .ui-resizable-e {
    opacity: 0.7;
}
.grid-stack-item > .ui-resizable-s {
    height: 6px !important;
    bottom: 0 !important;
    left: 20% !important;
    right: 20% !important;
    background: rgba(102,126,234,0.4) !important;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 200ms;
    background-image: none !important;
}
.grid-stack-item:hover > .ui-resizable-s {
    opacity: 0.7;
}

/* C: Grid overlay visible during resize */
#dashboardGrid.grid-resizing {
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(102,126,234,0.06) 0px,
            rgba(102,126,234,0.06) 1px,
            transparent 1px,
            transparent calc(100% / 12)
        );
    background-size: calc(100% / 12) 100%;
}
.grid-stack-item.ui-resizable-resizing > .grid-stack-item-content {
    border-color: rgba(102,126,234,0.4);
    box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}

/* C: Size badge during resize */
.gs-size-badge {
    position: absolute;
    bottom: -24px;
    right: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #667EEA;
    background: rgba(102,126,234,0.12);
    padding: 2px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    animation: gs-badge-in 150ms ease-out;
}
@keyframes gs-badge-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* B: Drag helper from library */
.gs-drag-helper {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(26,26,46,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(102,126,234,0.4);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 16px rgba(102,126,234,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 10001;
    white-space: nowrap;
}

/* D: Widget preview tooltip */
.widget-preview-tooltip {
    position: fixed;
    z-index: 300;
    width: 220px;
    background: rgba(26,26,46,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(102,126,234,0.3);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: none;
    animation: tooltip-in 150ms ease-out;
}
@keyframes tooltip-in {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.widget-preview-tooltip .wpt-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #F1F5F9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.widget-preview-tooltip .wpt-desc {
    font-size: 11px;
    color: #64748B;
    line-height: 1.5;
    margin-bottom: 10px;
}
.widget-preview-tooltip .wpt-mini {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
    height: 56px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    overflow: hidden;
}
.widget-preview-tooltip .wpt-mini-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #667EEA, #764BA2);
    opacity: 0.7;
}
.widget-preview-tooltip .wpt-mini-line {
    width: 100%;
    height: 100%;
    position: relative;
}
.widget-preview-tooltip .wpt-mini-line svg {
    width: 100%;
    height: 100%;
}
.widget-preview-tooltip .wpt-mini-donut {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 6px solid #667EEA;
    border-right-color: #764BA2;
    border-bottom-color: rgba(255,255,255,0.1);
    margin: 0 auto;
}
.widget-preview-tooltip .wpt-mini-gauge {
    width: 40px;
    height: 20px;
    border-radius: 40px 40px 0 0;
    border: 4px solid #667EEA;
    border-bottom: none;
    margin: auto auto 0;
    position: relative;
}
.widget-preview-tooltip .wpt-mini-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
.widget-preview-tooltip .wpt-mini-kpi-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.widget-preview-tooltip .wpt-mini-kpi-label {
    font-size: 9px;
    color: #64748B;
}
.widget-preview-tooltip .wpt-mini-table {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}
.widget-preview-tooltip .wpt-mini-table-row {
    height: 6px;
    border-radius: 3px;
    background: rgba(102,126,234,0.2);
}
.widget-preview-tooltip .wpt-mini-table-row:first-child {
    background: rgba(102,126,234,0.4);
}
.widget-preview-tooltip .wpt-mini-alert {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}
.widget-preview-tooltip .wpt-mini-alert-row {
    height: 8px;
    border-radius: 4px;
    border-left: 3px solid;
}
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(1) { background: rgba(239,68,68,0.15); border-color: #EF4444; width: 90%; }
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(2) { background: rgba(245,158,11,0.15); border-color: #F59E0B; width: 75%; }
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(3) { background: rgba(239,68,68,0.15); border-color: #EF4444; width: 60%; }
.widget-preview-tooltip .wpt-size {
    font-size: 10px;
    color: #475569;
    margin-top: 8px;
}

/* ── Custom Scrollbar: Glass & Branded ────────────────────────── */

/* Global defaults (light context) — WebKit (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: rgba(102,126,234,0.04);
    border-radius: 4px;
    margin: 4px 0;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(102,126,234,0.35), rgba(118,75,162,0.25));
    border-radius: 4px;
    transition: background 0.3s;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(102,126,234,0.55), rgba(118,75,162,0.45));
}

/* Auto-hide: transparent at rest, visible on container hover */
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, transparent, transparent);
}
*:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(102,126,234,0.35), rgba(118,75,162,0.25));
}
*:hover::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(102,126,234,0.55), rgba(118,75,162,0.45));
}

/* Firefox fallback */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
*:hover {
    scrollbar-color: rgba(102,126,234,0.35) rgba(102,126,234,0.04);
}

/* Dark context override (sidebar, widget library panel) */
.sidebar-nav::-webkit-scrollbar-track,
.widget-library-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.sidebar-nav::-webkit-scrollbar-thumb,
.widget-library-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, transparent, transparent);
}
.sidebar-nav:hover::-webkit-scrollbar-thumb,
.widget-library-panel:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(102,126,234,0.6), rgba(118,75,162,0.6));
    box-shadow: 0 0 6px rgba(102,126,234,0.25);
}
.sidebar-nav:hover::-webkit-scrollbar-thumb:hover,
.widget-library-panel:hover::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(102,126,234,0.85), rgba(118,75,162,0.85));
    box-shadow: 0 0 8px rgba(102,126,234,0.4);
}

/* Firefox dark context */
.sidebar-nav,
.widget-library-panel {
    scrollbar-color: transparent transparent;
}
.sidebar-nav:hover,
.widget-library-panel:hover {
    scrollbar-color: rgba(102,126,234,0.6) rgba(255,255,255,0.05);
}

/* Compact variant (dropdowns, small containers) */
.dropdown-scroll::-webkit-scrollbar {
    width: 5px;
}

/* === Collapsible Sidebar === */

/* Transition on sidebar and main */
.sidebar-nav {
    transition: width 300ms ease;
}
#main-content {
    transition: margin-left 300ms ease;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar-nav {
    width: 64px !important;
    padding: 20px 6px;
}
body.sidebar-collapsed #main-content {
    margin-left: 64px !important;
}

/* Hide text elements in collapsed mode */
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-item-label,
body.sidebar-collapsed .sidebar-backoffice-label,
body.sidebar-collapsed .sidebar-section-toggle,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-country-full,
body.sidebar-collapsed .sidebar-lang-full {
    display: none !important;
}

/* Center icons in collapsed mode */
body.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding: 8px;
}
body.sidebar-collapsed .sidebar-item svg {
    margin: 0;
}

/* Logo in collapsed mode: just the icon */
body.sidebar-collapsed .sidebar-logo-full {
    display: none !important;
}
body.sidebar-collapsed .sidebar-logo-icon {
    margin: 0 auto;
}

/* User profile in collapsed mode: just initials */
body.sidebar-collapsed .sidebar-user-full {
    display: none !important;
}
body.sidebar-collapsed .sidebar-user-avatar {
    margin: 0 auto;
    cursor: pointer;
}
body.sidebar-collapsed #user-menu > div:first-child {
    justify-content: center;
    padding: 8px;
}

/* Toggle button */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 200ms;
    font-size: 14px;
    margin-top: 8px;
}
.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.8);
}

/* Tooltips in collapsed mode */
body.sidebar-collapsed .sidebar-item {
    position: relative;
}
body.sidebar-collapsed .sidebar-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26,26,46,0.95);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Collapsed admin sections: keep icons visible, hide toggle button */
body.sidebar-collapsed .sidebar-section-content {
    max-height: none !important;
}
body.sidebar-collapsed .sidebar-section-content .sidebar-item {
    display: flex !important;
}

/* Action icons in tables */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #475569;
    transition: all 150ms;
    cursor: pointer;
    border: none;
    background: none;
    text-decoration: none;
}
.action-icon:hover {
    background: rgba(0,0,0,0.05);
    color: #667EEA;
}
.action-icon--danger:hover {
    background: rgba(239,68,68,0.08);
    color: #EF4444;
}

/* Selection banner */
.selection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(102,126,234,0.08);
    border: 1px solid rgba(102,126,234,0.20);
    font-size: 13px;
    color: #667EEA;
    font-weight: 500;
}
.selection-banner.hidden {
    display: none;
}

/* List table column (generic alias) */
.list-col {}
