body {
    padding: 15px;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

@media (min-width: 768px) {
    body {
        padding: 20px;
    }
}

.nav-tabs, .nav-pills {
    margin-bottom: 20px;
}

/* Horizontal scrolling for tabs on mobile */
@media (max-width: 991px) {
    .navbar-nav.nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .navbar-nav.nav-pills::-webkit-scrollbar {
        display: none;
    }
    .navbar-nav.nav-pills .nav-item {
        flex-shrink: 0;
    }
}

/* User wall horizontal scroll on small screens */
@media (max-width: 575px) {
    #user-wall-items {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start !important;
    }
    #user-wall-items::-webkit-scrollbar {
        display: none;
    }
    #user-wall-items .col-auto {
        flex-shrink: 0;
    }
}

.user-avatar-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 80px;
}

.user-avatar-btn:hover {
    transform: translateY(-5px);
}

.forget-user-btn {
    opacity: 0;
    transition: all 0.2s ease;
    transform: translate(10px, -10px);
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 10px !important;
    border: 2px solid #212529 !important;
}

.user-card-container:hover .forget-user-btn {
    opacity: 1;
    transform: translate(0, 0);
}

.avatar-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.select-avatar {
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-avatar-btn:hover .select-avatar {
    border-color: #0d6efd;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.4) !important;
}

.avatar-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 110, 253, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.user-avatar-btn:hover .avatar-hover-overlay {
    opacity: 1;
}

.form-section {
    margin-bottom: 20px;
}

/* Quick Actions Toolbar & Glassmorphism */
.glass-panel, .glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-card.bg-dark {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .glass-card {
        padding: 1.5rem !important;
    }
}

.qa-toolbar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1015;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .qa-toolbar-container {
        gap: 12px;
        padding: 10px 15px;
        border-radius: 100px;
        margin-bottom: 2rem;
    }
}

.qa-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 10px;
    flex-grow: 1;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;    /* Firefox */
}

.qa-toolbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.qa-btn {
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 12px !important;
    border-radius: 50px !important;
    letter-spacing: 0.3px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.qa-btn.btn-primary { background: linear-gradient(135deg, #4f46e5, #8b5cf6) !important; }
.qa-btn.btn-success { background: linear-gradient(135deg, #10b981, #0ea5e9) !important; }
.qa-btn.btn-info { background: linear-gradient(135deg, #06b6d4, #3b82f6) !important; color: #fff !important; }
.qa-btn.btn-warning { background: linear-gradient(135deg, #f59e0b, #e11d48) !important; color: #fff !important; }
.qa-btn.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
.qa-btn.btn-dark { background: linear-gradient(135deg, #334155, #0f172a) !important; color: #fff !important; }

.qa-btn.btn-primary:hover { box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45) !important; }
.qa-btn.btn-success:hover { box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45) !important; }
.qa-btn.btn-info:hover { box-shadow: 0 8px 24px rgba(6, 182, 212, 0.45) !important; }
.qa-btn.btn-warning:hover { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45) !important; }
.qa-btn.btn-danger:hover { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45) !important; }
.qa-btn.btn-dark:hover { box-shadow: 0 8px 24px rgba(30, 41, 59, 0.45) !important; }

@media (min-width: 768px) {
    .qa-btn {
        font-size: 0.85rem;
        padding: 8px 18px !important;
    }
}

.qa-btn:hover {
    transform: translateY(-3px) scale(1.03);
    filter: brightness(1.08);
    position: relative;
    z-index: 1020;
}

.qa-btn i {
    font-size: 1rem;
    margin-right: 6px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.qa-btn:hover i {
    transform: scale(1.22) rotate(5deg);
}

.qa-btn-more {
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #475569 !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.qa-btn-more:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Glassmorphic Dropdown Overflow Menu */
#qaMoreMenu {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    padding: 6px 0;
}

.qa-dropdown-item {
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.85rem;
    color: #475569 !important;
    border-radius: 8px;
    margin: 2px 6px;
    padding: 8px 16px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.qa-dropdown-item:hover {
    transform: translateX(4px);
}

.qa-dropdown-item.qa-item-primary { border-left-color: #4f46e5; }
.qa-dropdown-item.qa-item-primary i { color: #4f46e5; }
.qa-dropdown-item.qa-item-primary:hover { background-color: rgba(99, 102, 241, 0.08) !important; color: #4f46e5 !important; }

.qa-dropdown-item.qa-item-success { border-left-color: #10b981; }
.qa-dropdown-item.qa-item-success i { color: #10b981; }
.qa-dropdown-item.qa-item-success:hover { background-color: rgba(16, 185, 129, 0.08) !important; color: #10b981 !important; }

.qa-dropdown-item.qa-item-info { border-left-color: #06b6d4; }
.qa-dropdown-item.qa-item-info i { color: #06b6d4; }
.qa-dropdown-item.qa-item-info:hover { background-color: rgba(6, 182, 212, 0.08) !important; color: #06b6d4 !important; }

.qa-dropdown-item.qa-item-warning { border-left-color: #f59e0b; }
.qa-dropdown-item.qa-item-warning i { color: #f59e0b; }
.qa-dropdown-item.qa-item-warning:hover { background-color: rgba(245, 158, 11, 0.08) !important; color: #f59e0b !important; }

.qa-dropdown-item.qa-item-danger { border-left-color: #ef4444; }
.qa-dropdown-item.qa-item-danger i { color: #ef4444; }
.qa-dropdown-item.qa-item-danger:hover { background-color: rgba(239, 68, 68, 0.08) !important; color: #ef4444 !important; }

.qa-dropdown-item.qa-item-dark { border-left-color: #1e293b; }
.qa-dropdown-item.qa-item-dark i { color: #1e293b; }
.qa-dropdown-item.qa-item-dark:hover { background-color: rgba(30, 41, 59, 0.08) !important; color: #1e293b !important; }

/* Task Cards & Logic */
.task-row {
    transition: all 0.2s ease;
    cursor: pointer;
}

.task-row:hover {
    background-color: rgba(13, 110, 253, 0.03) !important;
}

.fade-transform {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.tab-pane.fade:not(.show) {
    transform: translateY(10px);
}

.sticky-sidebar {
    position: sticky;
    top: 90px;
}

.fs-7 { font-size: 0.85rem; }
.fs-8 { font-size: 0.75rem; }

.color-header {
    color: #2b3445;
}

.outfit-font {
    font-family: 'Outfit', sans-serif;
}

/* Unread Task Recognition (Gmail Style) */
.unread-dot {
    width: 10px;
    height: 10px;
    background-color: #0d6efd;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.4);
}

.task-row.task-unread {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.task-row.fw-bold {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.task-row.fw-bold:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

.badge.smaller {
    font-size: 0.7rem;
    padding: 0.35em 0.65em;
}

/* Glassmorphism Modals */
.glass-modal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dashboard Treeview Styles */
.monitor-group-header {
    transition: all 0.2s ease;
    user-select: none;
}
.monitor-group-header:hover {
    background-color: #fffbeb !important;
    transform: translateX(5px);
}
.monitor-group-header .chevron-icon {
    transition: transform 0.3s ease;
}
.monitor-group-header:not(.collapsed) .chevron-icon {
    transform: rotate(180deg);
}
.monitor-clickable:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}

/* Task Manager Sub-Navigation */
.nav-pills-custom .nav-link {
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.nav-pills-custom .nav-link.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}
.nav-pills-custom .nav-link:hover:not(.active) {
    background: #f1f5f9;
    color: #334155;
}

/* Sub-tabs horizontal scrolling on mobile */
@media (max-width: 767px) {
    #tm-sub-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #tm-sub-tabs::-webkit-scrollbar {
        display: none;
    }
    #tm-sub-tabs .nav-item {
        flex-shrink: 0;
    }
}

/* Modal Enhancements */
.modal-header.bg-dark {
    background: #1e293b !important;
}

/* Alignment Utils */
.fs-9 { font-size: 0.65rem; }
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.bg-light-blue { background-color: #f0f7ff !important; }

/* Extra Small Button (Bootstrap 5 Parity) */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 50px;
}

.extra-small {
    font-size: 0.7rem;
}

/* Showroom & Store Areas UI Overhaul */
.showroom-config-item {
    transition: all 0.3s ease;
    border-left: 5px solid #dee2e6 !important;
}

.sr-type-display { border-left-color: #10b981 !important; background: rgba(16, 185, 129, 0.02) !important; } /* Green */
.sr-type-storage { border-left-color: #3b82f6 !important; background: rgba(59, 130, 246, 0.02) !important; } /* Blue */
.sr-type-warehouse { border-left-color: #f59e0b !important; background: rgba(245, 158, 11, 0.02) !important; } /* Orange */
.sr-type-virtual { border-left-color: #8b5cf6 !important; background: rgba(139, 92, 246, 0.02) !important; } /* Purple */

.rule-builder-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
}

.rule-item-card {
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInSlide 0.2s ease-out;
}

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

.rule-type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.rule-points-input {
    width: 60px !important;
    text-align: center;
    font-weight: 700;
    color: #0d6efd;
}

.sr-rules-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

/* AI Supervisor UI Fixes */
.offcanvas.show ~ #aiFloatingBubble {
    display: none !important;
}

#aiFloatingBubble {
    transition: all 0.3s ease;
}

/* Touch-friendly list items & tables on mobile */
@media (max-width: 767px) {
    .list-group-item {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    .table td, .table th {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    .h3, h3 {
        font-size: 1.5rem;
    }
}

/* Custom Utilities */
.border-dashed {
    border: 2px dashed #cbd5e1 !important;
    background-clip: padding-box;
}

/* Workflow Editor Customizations */
.node-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent !important;
}

.node-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12) !important;
}

.node-card.active-editing {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15), 0 15px 35px rgba(0,0,0,0.1) !important;
}

.form-control-xs {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    height: calc(1.4em + 0.4rem + 2px);
}
.form-select-xs {
    font-size: 0.75rem;
    padding: 0.2rem 1.5rem 0.2rem 0.4rem;
    height: calc(1.4em + 0.4rem + 2px);
}

/* ──────────────────────────────────────────────────────────────────────────
   INTERACTIVE VISUAL WORKFLOW EDITOR STYLES
   ────────────────────────────────────────────────────────────────────────── */

/* Figma-style Canvas Dot-Grid Background */
#workflowVisualCanvas {
    background-color: #f0f8f5;
    background-image: radial-gradient(#bdcfc5 1px, transparent 1px);
    background-size: 24px 24px;
    position: relative;
    width: 100%;
    height: 650px;
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    user-select: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* Canvas Viewport (Handles Panning & Zooming) */
.wf-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 3000px;
    height: 3000px;
    transform-origin: 0 0;
    cursor: grab;
}

.wf-viewport:active {
    cursor: grabbing;
}

/* SVG Connection Overlay Layer */
.wf-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* SVG Connector Path */
.wf-connector-path {
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    transition: stroke 0.2s, stroke-width 0.2s;
    pointer-events: stroke;
    cursor: pointer;
}

.wf-connector-path:hover {
    stroke-width: 4.5 !important;
}

/* Floating HTML Node Bubble */
.wf-bubble {
    position: absolute;
    width: 220px;
    max-height: 54px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 12px 28px -8px rgba(13, 31, 74, 0.1), 
                0 4px 10px -4px rgba(0, 0, 0, 0.04), 
                0 1px 1px rgba(255, 255, 255, 0.8) inset;
    padding: 10px 12px 10px 18px;
    cursor: move;
    z-index: 2;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.3s, border-color 0.2s, background-color 0.3s;
}

.wf-bubble:not(.wf-bubble-expanded) .wf-bubble-body,
.wf-bubble:not(.wf-bubble-expanded) .wf-bubble-config-container {
    display: none !important;
}

.wf-bubble:not(.wf-bubble-expanded) .wf-bubble-header {
    margin-bottom: 0 !important;
}

.wf-bubble:hover {
    transform: scale(1.05);
    border-color: #0d6efd;
    box-shadow: 0 20px 35px -12px rgba(13, 31, 74, 0.15),
                0 0 0 2px rgba(13, 110, 253, 0.5) inset;
}

.wf-bubble.active-bubble {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15),
                0 20px 35px -12px rgba(13, 31, 74, 0.18) !important;
    z-index: 3;
}

/* Semi-transparent Tinted Backgrounds for floating nodes depending on type */
.wf-bubble.wf-bubble-type-task {
    background: rgba(240, 246, 255, 0.95) !important;
    border-color: rgba(13, 110, 253, 0.4) !important;
}
.wf-bubble.wf-bubble-type-quiz {
    background: rgba(236, 253, 255, 0.95) !important;
    border-color: rgba(13, 202, 240, 0.4) !important;
}
.wf-bubble.wf-bubble-type-condition {
    background: rgba(255, 247, 237, 0.95) !important;
    border-color: rgba(253, 126, 20, 0.4) !important;
}
.wf-bubble.wf-bubble-type-automatedaction {
    background: rgba(250, 245, 255, 0.95) !important;
    border-color: rgba(111, 66, 193, 0.4) !important;
}
.wf-bubble.wf-bubble-type-wait {
    background: rgba(254, 252, 232, 0.95) !important;
    border-color: rgba(255, 193, 7, 0.4) !important;
}
.wf-bubble.wf-bubble-type-foreach {
    background: rgba(240, 253, 250, 0.95) !important;
    border-color: rgba(32, 201, 151, 0.4) !important;
}
.wf-bubble.wf-bubble-type-subworkflow {
    background: rgba(245, 243, 255, 0.95) !important;
    border-color: rgba(102, 16, 242, 0.4) !important;
}
.wf-bubble.wf-bubble-type-monitoring {
    background: rgba(248, 250, 252, 0.95) !important;
    border-color: rgba(108, 117, 125, 0.4) !important;
}
.wf-bubble.wf-bubble-type-end {
    background: rgba(254, 242, 242, 0.95) !important;
    border-color: rgba(220, 53, 69, 0.4) !important;
}

/* Expanded visual configuration state */
.wf-bubble.wf-bubble-expanded {
    width: 1000px !important;
    max-height: 700px !important;
    padding: 18px 24px !important;
    overflow: auto !important;
    cursor: default !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.99) !important;
    border-color: #0d6efd !important;
    box-shadow: 0 25px 50px -12px rgba(13, 31, 74, 0.24),
                0 0 0 1px rgba(255, 255, 255, 1) inset !important;
}

.wf-bubble.wf-bubble-expanded:hover, .wf-bubble.wf-dragging {
    transform: none !important;
    box-shadow: 0 25px 50px -12px rgba(13, 31, 74, 0.26),
                0 0 0 1px rgba(255, 255, 255, 1) inset !important;
}

.wf-bubble-close-btn {
    color: #64748b;
    font-size: 1.1rem;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    border: none;
    background: transparent;
    padding: 0;
    margin-left: auto;
    cursor: pointer;
}

.wf-bubble-close-btn:hover {
    color: #ef4444;
    transform: scale(1.15);
}

.wf-bubble-config-container {
    animation: wfFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.wf-bubble.wf-bubble-expanded::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.wf-bubble.wf-bubble-expanded::-webkit-scrollbar-track {
    background: transparent;
}

.wf-bubble.wf-bubble-expanded::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

.wf-bubble.wf-bubble-expanded::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.24);
}

/* Node Accent Colored Strip */
.wf-bubble-accent {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 6px;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
}

/* Bubble Header & Icon */
.wf-bubble-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.wf-bubble-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.wf-bubble-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Outfit', sans-serif;
}

.wf-bubble-id {
    font-family: monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}

/* Bubble Body Text */
.wf-bubble-body {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Visual Connection Badge Pills (Conditions or Outcome Labels) */
.wf-connector-badge {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background-color 0.2s;
}

.wf-connector-badge:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: #f8fafc;
    color: #0f172a;
}

/* Visual Editor Zoom & Control Toolbar */
.wf-canvas-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.wf-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
}

.wf-control-btn:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* Sliding Visual Config Sidebar */
.wf-sidebar-drawer {
    position: fixed;
    top: 0;
    right: -460px;
    width: 460px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 35px rgba(15, 23, 42, 0.15);
    z-index: 2050;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
}

.wf-sidebar-drawer.drawer-open {
    right: 0;
}

.wf-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.wf-sidebar-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Port markers for visual connections */
.wf-port {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    z-index: 5;
    transition: background-color 0.2s, transform 0.2s;
}

.wf-port.port-in {
    left: -4px;
}

.wf-port.port-out {
    right: -4px;
}

.wf-bubble:hover .wf-port {
    background: #0d6efd;
    transform: translateY(-50%) scale(1.3);
}

.wf-start-node-badge {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #0d6efd;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
    z-index: 4;
    text-transform: uppercase;
}

/* Custom Notifications Enhancements */
#notificationsDropdownBtn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.hover-danger:hover {
    color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.15) !important;
}

/* Autocomplete suggestions dropdown styling */
.autocomplete-suggestions {
    position: absolute;
    z-index: 2000;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 4px 0;
    margin: 4px 0 0 0;
    width: 100%;
}

.autocomplete-suggestions li {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #2b3445;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.autocomplete-suggestions li:hover,
.autocomplete-suggestions li.highlighted {
    background-color: #f0f7ff;
    color: #0d6efd;
}

.autocomplete-suggestions .quick-create-item {
    border-top: 1px solid #e2e8f0;
    color: #10b981;
    font-weight: 600;
}

.autocomplete-suggestions .quick-create-item:hover,
.autocomplete-suggestions .quick-create-item.highlighted {
    background-color: #f0fdf4;
    color: #10b981;
}

.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s;
    z-index: 5;
}

.autocomplete-clear-btn:hover {
    color: #dc3545;
}

/* Workflow tree (Store Manager Hub) */
.wf-tree {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.wf-tree-folder {
    margin-bottom: 2px;
}

.wf-tree-folder-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
}

.wf-tree-folder-header:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.wf-tree-toggle {
    font-size: 0.7rem;
    color: #94a3b8;
    width: 0.875rem;
    flex-shrink: 0;
}

.wf-tree-label {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wf-tree-children {
    padding-left: 1.25rem;
}

.wf-tree-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    margin-bottom: 1px;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    text-align: left;
    font-size: 0.8125rem;
    color: inherit;
    cursor: pointer;
}

.wf-tree-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.wf-tree-item.active {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.wf-tree-item .wf-tree-meta {
    margin-left: auto;
    font-size: 0.7rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.wf-tree-item.active .wf-tree-meta {
    color: rgba(13, 110, 253, 0.7);
}

/* Custom Objects Dropdown Styling */
#custom-objects-dropdown-menu {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#custom-objects-dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    transition: all 0.2s ease;
}

#custom-objects-dropdown-menu .dropdown-item:hover,
#custom-objects-dropdown-menu .dropdown-item:focus {
    background: rgba(13, 110, 253, 0.15) !important;
    color: #0d6efd !important;
    transform: translateX(4px);
}

#custom-objects-dropdown-menu .dropdown-item.active {
    background: #0d6efd !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Quick Actions Dropdown Menu Styling */
#qaMoreMenu {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#qaMoreMenu .dropdown-item {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    transition: all 0.2s ease;
}

#qaMoreMenu .dropdown-item:hover,
#qaMoreMenu .dropdown-item:focus {
    background: rgba(13, 110, 253, 0.15) !important;
    color: #0d6efd !important;
    transform: translateX(4px);
}
