.opn-custom-navbar {
    position: fixed;
    left: 24px;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 16px;
    border-radius: 16px;
    z-index: 99999;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.3);
    width: 260px;
    max-height: 85vh;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    overflow-x: hidden;
    box-sizing: border-box;
    cursor: default;
}

/* Sidebar shell */
.opn-custom-navbar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate3d(24px, 80px, 0);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 290px;
    max-height: 85vh;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.35);
    will-change: transform;
}

.opn-custom-navbar::-webkit-scrollbar {
    width: 6px;
}

.opn-custom-navbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
     margin: 4px 0;
}

.opn-custom-navbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.opn-custom-navbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


.opn-navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.opn-navbar-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.opn-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: grab;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.opn-drag-handle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.opn-custom-navbar.opn-navbar-dragging {
    cursor: grabbing;
    user-select: none;
    transition: none;
}

.opn-navbar-header h3 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.opn-navbar-controls {
    display: flex;
    gap: 8px;
}

.opn-nav-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.opn-nav-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Navbar layout */
.opn-navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.opn-navbar-header h3 {
    margin: 0;
    font-size: 14px;
    color: #f9fafb;
}

.opn-navbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.opn-collapse-panel,
.opn-collapse-nav,
.opn-collapse-rows {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #f9fafb;
    cursor: pointer;
    font-size: 11px;
}

.opn-custom-navbar.opn-navbar-collapsed {
    width: 154px;
    padding: 10px;
    max-height: none;
}

.opn-custom-navbar.opn-navbar-collapsed .opn-navbar-tree,
.opn-custom-navbar.opn-navbar-collapsed .opn-collapse-nav,
.opn-custom-navbar.opn-navbar-collapsed .opn-collapse-rows,
.opn-custom-navbar.opn-navbar-collapsed .opn-navbar-header h3 {
    display: none;
}

.opn-custom-navbar.opn-navbar-collapsed .opn-navbar-header {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.opn-navbar-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opn-tree-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opn-tree-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    cursor: grab;
}

.opn-tree-node.is-selected {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(99, 102, 241, 0.45);
}

.opn-tree-node.is-drag-over {
    outline: 2px dashed #60a5fa;
    outline-offset: 2px;
}

.opn-tree-toggle {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.opn-tree-label {
    flex: 1;
    font-size: 13px;
    line-height: 1.35;
    user-select: none;
}

.opn-tree-children {
    display: none;
    margin-left: 14px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    flex-direction: column;
    gap: 8px;
}

.opn-tree-children.is-expanded {
    display: flex;
}

.opn-insert-line {
    position: fixed;
    height: 2px;
    background: linear-gradient(90deg, #60a5fa, #818cf8);
    z-index: 999999;
    display: none;
    pointer-events: none;
}

.opn-drag-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.28);
    font-size: 12px;
    white-space: nowrap;
}

/* VC row active state */
.opn-row-active {
    outline: 2px solid #f59e0b !important;
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.25) !important;
    background: rgba(245, 158, 11, 0.12) !important;
}



/* Nav Items */
.opn-custom-navbar a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin: 6px 0;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.opn-custom-navbar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.opn-custom-navbar a:hover::before {
    left: 100%;
}

.opn-image-text-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.opn-custom-navbar a span {
    font-size: 13px;
    text-transform: capitalize;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.opn-nav-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;

}

.opn-custom-navbar a.active,
.opn-custom-navbar a:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    border-color: transparent;
}

/* .custom-navbar a.active .nav-icon,
.custom-navbar a:hover .nav-icon {
    filter: brightness(0) invert(1);
    opacity: 1;
} */

/* Highlight Animation */
.add-active-highlight {
    transition: all 0.3s ease;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
    }
}

/* Tree Nodes */
.opn-tree-node {
    margin-bottom: 8px;
    animation: slideIn 0.2s ease;
     cursor: grab;
   
}

.opn-tree-node.opn-dragging {
    opacity: 0.4;
}
.opn-tree-node.active-node {
   display: block;
}
.opn-tree-node.opn-drag-over {
    border: 2px dashed #0073aa;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tree Label */
.opn-tree-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
  
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    color: #fff;
}

.opn-tree-label:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    transform: translateX(4px);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Selected State */
.opn-tree-label.selected {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.opn-tree-label.selected .opn-toggle-btn {
    color: white;
}

/* Toggle Button */
.opn-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    padding: 4px;
    border-radius: 4px;
    color: #94a3b8;
    transition: all 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opn-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    color: #fff;
}

.opn-tree-label .opn-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Children Container */
.opn-tree-children {
    display: none;
    margin-left: 16px;
    margin-top: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
    transition: all 0.3s ease;
}
.opn-tree-children.active-node{
    display: block;
}

/* Node Badge (optional - add this to your JS) */
.opn-node-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #94a3b8;
    margin-left: 8px;
}

.opn-tree-label:hover .opn-node-badge,
.opn-tree-label.selected .opn-node-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Custom Navbar a .toggle-btn */
.opn-custom-navbar a .opn-toggle-btn {
    color: #94a3b8;
    margin-left: 8px;
}

.opn-custom-navbar a:hover .opn-toggle-btn {
    color: #fff;
}

/* Drag and Drop Styles */
.opn-tree-node.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.opn-tree-node.drag-over {
    border: 2px solid #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    margin: 4px 0;
    padding: 4px;
}

/* Tree Container Animation */
.opn-tree-container {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .opn-custom-navbar {
        width: 240px;
        right: 10px;
        padding: 12px;
        gap: 8px;
    }
    
    .opn-custom-navbar a {
        padding: 8px 10px;
    }
    
    .opn-custom-navbar a span {
        font-size: 12px;
    }
    
    .opn-tree-label {
        padding: 6px 8px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}
/* Drag/Drop */

.opn-tree-node,
.opn-custom-navbar > a {
    position: relative;
}

.drop-before::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #0073aa;
}

.drop-after::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #0073aa;
}

.drop-inside {
    outline: 2px dashed #0073aa;
    background: rgba(0, 115, 170, 0.08);
}

.opn-dragging {
    opacity: 0.5;
}

.custom-navbar.loading {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Tooltip Styles (optional) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1e293b;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    display: none;
    z-index: 10000;
}

[data-tooltip]:hover:before {
    display: block;
}