/* --- DESKTOP STICKY & LAYOUT --- */
.ab-tab-instance-wrapper { overflow: visible !important; display: block; width: 100%; }
.ab-tab-source-hidden { display: none !important; }
.ab-tab-row-counter { background: #e0e0e0; font-weight: bold; min-width: 110px !important; height: 32px; font-size:16px !important; display: flex; align-items: center; justify-content: center; border: 1px solid #bbb;}

.ab-tab-bridge-container { 
    width: 100%; 
    position: relative; 
    background: #fff; 
    overflow: visible !important; 
    display: flex;
    flex-direction: column;
}

.ab-tab-controls { 
    position: sticky !important; 
    z-index: 1000; 
    background: #f1f1f1 !important; 
    border: 1px solid #ccc; 
    display: flex;
    flex-direction: column;
    padding: 10px;
    z-index: 1;
}

.ab-tab-custom-bar-row { width: 100%; border-bottom: 1px solid #ddd; padding-bottom: 8px; margin-bottom: 8px; }
.ab-tab-search-row { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.tabulator { overflow: visible !important; border: none !important; background: transparent !important; }
.tabulator-header { 
    position: sticky !important; 
    z-index: 999 !important; 
    background: #e9e9e9 !important;
    border-bottom: 2px solid #333 !important;
}

.tabulator-tableholder { overflow: hidden !important; }

.tabulator-row { border-bottom: 1px solid #ddd; position: relative !important; }

/* Ghost Link Logic - Restored */
.tabulator-cell { position: relative; overflow: visible !important; }
.ab-tab-row-link { color: inherit; text-decoration: none; }
.ab-tab-row-link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2000px; 
    height: 100%;
    z-index: 10;
}

/* --- UI ELEMENTS --- */
.ab-tab-row-counter { font-size: 12px; color: #666; min-width: 60px; text-align: center; }
.ab-tab-search-input { flex: 1; min-width: 200px; height: 30px; padding: 0 10px; border: 1px solid #bbb; font-size: 12px; }
.ab-tab-action-btn, .ab-tab-page-size-select { height: 32px; padding: 0 8px; background: #fff; border: 1px solid #bbb; cursor: pointer; font-size: 16px; font-weight: 600; }
.ab-tab-action-btn:hover { background-color: #ddd; }
.ab-tab-btn-group { display: flex; gap: 4px; }

/* 🔥 NEW: Hide custom bar until JS ready - NO CONFLICTS with existing */
.ab-tab-custom-bar-row {
    display: none !important;
}

.ab-tab-custom-bar-row.js-ready {
    display: block !important;  /* Change to 'flex' if your layout uses flex */
}

/* --- MOBILE: CARD UI --- */
@media screen and (max-width: 782px) {
    .ab-tab-controls { padding: 8px; }
    .ab-tab-search-row { flex-direction: column; align-items: stretch; gap: 5px; }
    .ab-tab-search-input, .ab-tab-page-size-select, .ab-tab-row-counter { width: 100% !important; }
    .ab-tab-btn-group { display: flex; width: 100%; gap: 2px; }
    .ab-tab-action-btn { flex: 1; justify-content: center; }
	a.ab-tab-row-link {	font-size: 12px; }
	span.ab-tab-cell-content { font-size: 12px; }
	.tabulator-responsive-collapse { display:none; }
    .tabulator-table { width: 100%; }
    .tabulator-header { display: none !important; }
    .tabulator-col-resize-handle { display: none !important; }
	.tabulator-cell { height: 20px !important; }

    .tabulator-row {
        display: block !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-left: 6px solid #333 !important;
        margin-bottom: 10px !important;
        padding: 4px 0 !important;
        position: relative !important;  /* Critical: positions link context */
    }

    .tabulator-cell {
        display: flex !important;
        width: 100% !important;
        border: none !important;
        padding: 4px 12px !important;
        align-items: center;
        position: static !important;  /* Reset cell positioning */
    }

    .tabulator-cell::before {
        content: attr(data-title);
        font-weight: bold;
        width: 35%;
        min-width: 100px;
        font-size: 11px;
        color: #777;
    }
	
    /* Full card link overlay - positioned to row */
    .tabulator-row .ab-tab-row-link::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
    }
}