/* Management Console Styles */

/* Reset any max-width constraints from parent styles */
body, html {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override any container constraints */
main, .container, .content, .wrapper {
    max-width: none !important;
    width: 100% !important;
}

/* Ensure header spans full width */
header {
    max-width: none !important;
    width: 100vw !important;
}

/* Header Jobs Button */
.header-jobs-button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0.3125rem 0.625rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: inherit;
    font-family: inherit;
}

.header-jobs-button:hover {
    background: var(--surface-hover-color);
}

/* Layout Container */
.management-console {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 3.75rem)); /* Subtract header height */
    background: var(--surface-color);
    position: fixed;
    top: var(--header-height, 3.75rem);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw; /* Ensure full viewport width */
    box-sizing: border-box;
    max-width: none !important;
}

/* Main content area - horizontal layout for tree and tabs */
.main-content {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0; /* Important for nested flexbox */
    position: relative;
    width: 100%;
    max-width: none; /* Remove any width constraints */
}

/* Tree Panel (Left) */
.tree-panel {
    width: 18.75rem;
    min-width: 3.75rem;
    max-width: 50rem;
    background: var(--surface-color);
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: none; /* Remove native resize, we'll handle it manually */
    flex-shrink: 0; /* Don't shrink */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

/* Disable transitions during resize */
.tree-panel.resizing,
.tree-panel.resizing ~ .content-panel {
    transition: none !important;
}

/* Disable transitions during initial load */
.tree-panel.no-transition,
.tree-panel.no-transition ~ .content-panel {
    transition: none !important;
}

/* Collapsed state */
.tree-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    resize: none;
    border-right: none;
    overflow: hidden;
}

/* Collapse Toggle Button (also resize handle) */
.tree-collapse-toggle {
    position: relative;
    width: 0.5rem;
    background: var(--surface-color);
    border-left: none;
    border-right: 0.0625rem solid var(--border-color);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 3;
    flex-shrink: 0;
    user-select: none;
}

/* Change cursor to pointer when tree is collapsed */
.tree-panel.collapsed + .tree-collapse-toggle {
    cursor: pointer;
}

/* Invisible extended hit area for easier grabbing */
.tree-collapse-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -0.375rem;
    right: -0.375rem;
    z-index: -1;
}

/* Hover effect without scaling */
.tree-collapse-toggle:hover {
    background: var(--surface-hover-color);
}

/* Container for chevron and dots */
.toggle-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
}

/* Active resize state */
.tree-collapse-toggle.resizing {
    background: var(--primary-color);
    opacity: 0.8;
}

/* Resize overlay to capture mouse events during resize */
.resize-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* High z-index to cover iframes */
    cursor: col-resize;
    display: none;
    background: transparent; /* Invisible but captures events */
    pointer-events: auto; /* Ensure it captures mouse events */
}

.resize-overlay.active {
    display: block;
}

.collapse-icon {
    font-size: 0.875rem;
    color: var(--text-muted-color);
    transition: transform 0.3s ease, opacity 0.2s;
    user-select: none;
    pointer-events: none;
    font-family: Arial, sans-serif;
    line-height: 1;
    opacity: 0.5;
    font-weight: bold;
}

/* Resize handle dots */
.resize-handle-dots {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    pointer-events: none;
    align-items: center;
}

.tree-collapse-toggle:hover .resize-handle-dots {
    opacity: 0.8;
}

.tree-collapse-toggle:hover .collapse-icon {
    opacity: 0.8;
}

.resize-handle-dots span {
    width: 0.25rem;
    height: 0.25rem;
    background: var(--text-muted-color);
    border-radius: 50%;
}

.tree-panel.collapsed + .tree-collapse-toggle .collapse-icon {
    transform: rotate(180deg);
}

/* Style both chevrons consistently */
.collapse-icon:first-child {
    margin-bottom: 0.125rem;
}

.collapse-icon:last-child {
    margin-top: 0.125rem;
}

/* Adjust content panel when tree is collapsed */
.content-panel {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-panel.collapsed ~ .content-panel {
    width: calc(100% - 0.5rem); /* Full width minus toggle button */
}

.tree-header {
    padding: 0.375rem 0.5rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tree-header-row {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    width: 100%;
}

.tree-view-mode {
    padding: 0.25rem 0.5rem;
    background: var(--surface-color);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.1875rem;
    color: var(--text-color);
    font-size: 0.75rem;
    height: 1.5rem;
    cursor: pointer;
    min-width: 6.25rem;
}

.tree-view-mode:hover {
    background: var(--surface-hover-color);
}

.tree-search {
    width: 100%;
    padding: 0.25rem 0.5rem;
    background: var(--surface-color);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.1875rem;
    color: var(--text-color);
    font-size: 0.8125rem;
    height: 1.75rem;
}

.tree-refresh,
.tree-dashboard,
.tree-terminal-sessions {
    padding: 0.25rem;
    background: transparent;
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.1875rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    height: 1.5rem;
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
}

.tree-refresh:hover,
.tree-dashboard:hover,
.tree-terminal-sessions:hover {
    background: var(--surface-hover-color);
}

.tree-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.tree-loading {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted-color);
}

/* Tree Items */
.tree-node {
    user-select: none;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 0.0625rem 0.25rem;
    cursor: pointer;
    border-radius: 0.125rem;
    position: relative;
    font-size: 0.8125rem;
    line-height: 1.375rem;
    height: 1.375rem;
}

.tree-item:hover {
    background: var(--surface-hover-color);
}

.tree-item.selected {
    background: var(--primary-color);
    color: white;
}

.tree-item.selected .tree-arrow {
    color: var(--text-color);
}

.tree-arrow {
    width: 0.75rem;
    text-align: center;
    color: var(--text-muted-color);
    font-size: 0.75rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tree-arrow i {
    display: block;
}

.tree-icon {
    margin: 0 0.25rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.tree-icon > i.codicon {
    display: block;
}

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

.tree-actions {
    display: none;
    gap: 0.25rem;
    align-items: center;
}

.tree-item:hover .tree-actions {
    display: flex;
}

.tree-action {
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.125rem;
    cursor: pointer;
    font-size: 0.6875rem;
    transition: all 0.2s;
}

.tree-action:hover {
    background: var(--surface-hover-color);
    border-color: var(--primary-color);
}

.tree-children {
    margin-left: 0;
}

/* Depth-based indentation system */
.tree-depth-1 {
    padding-left: 1rem;
}
.tree-depth-2 {
    padding-left: 2rem;
}
.tree-depth-3 {
    padding-left: 3rem;
}
.tree-depth-4 {
    padding-left: 4rem;
}
.tree-depth-5 {
    padding-left: 5rem;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.375rem;
}

.status-running,
.status-online { color: #4caf50; }
.status-stopped,
.status-offline { color: #f44336; }
.status-warning { color: #ff9800; }
.status-creating { color: #2196f3; }
.status-error { color: #f44336; }
.status-unknown { color: #666; }

/* Content Panel (Right) */
.content-panel {
    flex: 1 1 0%; /* Take all remaining space */
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    min-width: 0;
    min-height: 0; /* Critical for nested flexbox */
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: calc(100% - 18.75rem - 0.5rem); /* Full width minus tree panel and toggle button */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab Bar Container */
.tab-bar-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border-bottom: 0.0625rem solid var(--border-color);
    height: 2rem;
    flex-shrink: 0;
    z-index: auto;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    position: relative;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.tab-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Tab Scroll Buttons */
.tab-scroll-button {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.875rem;
    background: var(--surface-color);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-color);
    font-size: 0.75rem;
    z-index: 10;
    transition: all 0.2s ease;
}

.tab-scroll-button:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.tab-scroll-button.left {
    left: 0;
    background: linear-gradient(to right, var(--surface-color) 70%, transparent);
}

.tab-scroll-button.right {
    right: 0;
    background: linear-gradient(to left, var(--surface-color) 70%, transparent);
}

.tab-scroll-button.visible {
    display: flex;
}

/* Tab List Dropdown */
.tab-list-button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1.875rem;
    background: var(--surface-color);
    border: none;
    border-left: 0.0625rem solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-color);
    font-size: 0.75rem;
    z-index: 11;
    transition: all 0.2s ease;
}

.tab-list-button:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.tab-list-dropdown {
    position: fixed;
    top: calc(var(--header-height, 3.75rem) + 2rem);
    right: 0;
    background: var(--surface-color);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    min-width: 12.5rem;
    max-width: 18.75rem;
    max-height: 25rem;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    pointer-events: auto;
}

.tab-list-dropdown.open {
    display: block;
}

.tab-list-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    gap: 0.5rem;
    color: var(--text-color);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.tab-list-item:hover {
    background: var(--surface-hover-color);
}

.tab-list-item.active {
    background: var(--surface-hover-color);
    font-weight: 500;
}

/* Overlay for dropdown menus */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1000;
    display: none;
    pointer-events: auto;
}

.dropdown-overlay.active {
    display: block;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 0.625rem;
    background: var(--surface-color);
    border-right: 0.0625rem solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.8125rem;
    transition: all 0.2s;
    height: 100%;
    min-width: 7.5rem;
    max-width: 18.75rem;
    flex-shrink: 1;
    gap: 0.25rem;
    position: relative;
}

.tab:hover {
    background: var(--surface-hover-color);
}

.tab.active {
    background: var(--surface-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-icon {
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tab-close {
    margin-left: auto;
    padding: 0.125rem 0.25rem;
    border-radius: 0.1875rem;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 0.6;
}

.tab-close:hover {
    opacity: 1;
    background: var(--surface-hover-color);
}

/* Temporary (unpinned) tab styles */
.tab:not(.pinned) {
    font-style: normal;
    opacity: 0.9;
}

/* Visual separator between temporary and pinned tabs */
.tab.pinned:first-of-type {
    position: relative;
    margin-left: 1.25rem;
}

.tab.pinned:first-of-type::before {
    content: '';
    position: absolute;
    left: -0.625rem;
    top: 25%;
    bottom: 25%;
    width: 0.0625rem;
    background: var(--border-color);
    opacity: 0.5;
}

/* Pin button styles */
.tab-pin {
    margin-left: 0.5rem;
    padding: 0.125rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    line-height: 1;
    color: var(--text-color);
}

.tab-pin:hover {
    opacity: 1;
    background: var(--surface-hover-color);
}

/* Pinned indicator styles */
.tab-pinned-indicator {
    margin-left: 0.5rem;
    padding: 0.125rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    line-height: 1;
    color: var(--text-color);
}

.tab-pinned-indicator:hover {
    opacity: 1;
    background: var(--surface-hover-color);
}

/* Adjust close button when following pin button or pinned indicator */
.tab-pin + .tab-close,
.tab-pinned-indicator + .tab-close {
    margin-left: 0.25rem;
}

.tab-bar-placeholder {
    padding: 0 1.25rem;
    color: var(--text-muted-color);
    font-style: italic;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Tab Content Area */
#tabContent {
    flex: 1 1 auto;
    position: relative;
    background: var(--surface-color);
    overflow: hidden;
    min-height: 0; /* Critical for flexbox children */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    visibility: hidden;
    z-index: 0;
    margin: 0;
    padding: 0;
}

.tab-pane.active {
    visibility: visible;
    z-index: 1;
}

.tab-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--surface-color);
    display: block;
    margin: 0;
    padding: 0;
}

/* Tab Drag and Drop Styles */
.tab {
    user-select: none;
    position: relative;
}

.tab.dragging {
    opacity: 0;
    cursor: grabbing !important;
}

.tab-drag-clone {
    background: #2d2d2d !important;
    background-color: #2d2d2d !important;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
    opacity: 1 !important;
    cursor: grabbing !important;
    transform-origin: center center;
    border: none !important;
    border-left: 0.0625rem solid #3e3e3e !important;
    border-right: 0.0625rem solid #3e3e3e !important;
    border-bottom: 0.0625rem solid #3e3e3e !important;
}

/* Active tab drag clone */
.tab-drag-clone.active {
    background: #1e1e1e !important;
    background-color: #1e1e1e !important;
    border-bottom: 0.125rem solid var(--primary-color) !important;
}

/* Light theme override */
.light-theme .tab-drag-clone {
    background: #f3f3f3 !important;
    background-color: #f3f3f3 !important;
    border: none !important;
    border-left: 0.0625rem solid #d4d4d4 !important;
    border-right: 0.0625rem solid #d4d4d4 !important;
    border-bottom: 0.0625rem solid #d4d4d4 !important;
}

.light-theme .tab-drag-clone.active {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-bottom: 0.125rem solid var(--primary-color) !important;
}

body.dragging-tab {
    cursor: grabbing !important;
}

body.dragging-tab * {
    cursor: grabbing !important;
}

/* Disable transitions during drag */
body.dragging-tab .tab {
    transition: none !important;
}

/* Visual drop indicator */
.tab-drop-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0.125rem;
    background: var(--primary-color);
    pointer-events: none;
    z-index: 9999;
    transition: left 0.1s ease-out;
}

/* Invalid drop visual feedback */
.tab-drag-clone.invalid-drop {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
    border-color: #ff6b6b !important;
}

.tab-drag-clone.invalid-drop::after {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    pointer-events: none;
}

.welcome-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    padding: 2.5rem;
    text-align: center;
}

.welcome-message h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.welcome-message p {
    font-size: 1rem;
    color: var(--text-muted-color);
    margin-bottom: 2rem;
    max-width: 37.5rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
}


/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-hover-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tree-panel {
        width: 15.625rem;
        min-width: 3.75rem;
    }
    
    .content-panel {
        width: calc(100% - 15.625rem - 0.5rem);
    }
    
    /* Auto-collapse on tablets */
    .tree-panel {
        width: 0;
        min-width: 0;
        border-right: none;
    }
    
    .tree-panel.expanded {
        width: 15.625rem;
        min-width: 3.75rem;
        border-right: none;
    }
    
    /* Fix for tablet collapsed state */
    .tree-panel.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        border-right: none;
    }
    
    .tree-panel.expanded + .tree-collapse-toggle .collapse-icon,
    .tree-panel:not(.collapsed) + .tree-collapse-toggle .collapse-icon {
        transform: rotate(0deg);
    }
    
    .tree-panel:not(.expanded) + .tree-collapse-toggle .collapse-icon,
    .tree-panel.collapsed + .tree-collapse-toggle .collapse-icon {
        transform: rotate(180deg);
    }
    
    .tree-panel:not(.expanded) ~ .content-panel,
    .tree-panel.collapsed ~ .content-panel {
        width: calc(100% - 0.5rem);
    }
    
    .tree-panel.expanded ~ .content-panel {
        width: calc(100% - 15.625rem - 0.5rem);
    }
    
    /* Change cursor for collapsed state on tablets */
    .tree-panel:not(.expanded) + .tree-collapse-toggle {
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    /* Hide collapse toggle on mobile - use overlay instead */
    .tree-collapse-toggle {
        display: none;
    }
    
    .tree-panel {
        position: fixed;
        left: -18.75rem;
        top: var(--header-height, 3.75rem);
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
        width: 18.75rem !important;
        max-width: 80vw;
        min-width: 18.75rem !important;
        border-right: 0.0625rem solid var(--border-color) !important;
    }
    
    .tree-panel.open {
        left: 0;
        box-shadow: 0.125rem 0 0.625rem rgba(0, 0, 0, 0.2);
    }
    
    .content-panel {
        width: 100% !important;
    }
    
    /* Add mobile menu button */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        bottom: 1.25rem;
        left: 1.25rem;
        z-index: 1001;
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 50%;
        background: var(--primary-color);
        color: white;
        border: none;
        box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
        cursor: pointer;
        font-size: 1.5rem;
    }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: var(--surface-color);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 31.25rem;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 0.0625rem solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted-color);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 0.0625rem solid var(--border-color);
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--surface-secondary);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface-color);
}

.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .tree-panel.open ~ .mobile-menu-overlay {
        display: block;
    }
}

/* Hide mobile button by default */
.mobile-menu-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted-color);
}

.loading::after {
    content: "";
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.625rem;
    border: 0.125rem solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tree Create Button */
.tree-create-pool {
    margin-top: 0.5rem;
    border-top: 0.0625rem solid var(--border-color);
    padding-top: 0.5rem;
}

.tree-create-pool .tree-item {
    color: var(--primary-color);
    font-weight: 500;
}

.tree-create-pool .tree-item:hover {
    background: var(--primary-color);
    color: white;
}

/* File Menu Styles - VS Code Style */
.file-menu {
    padding: 0 0.25rem;
    border-bottom: 0.0625rem solid var(--border-color);
    background: transparent;
    position: relative;
    height: 1.875rem;
    display: flex;
    align-items: center;
}

.file-menu-button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 400;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background 0.1s;
    position: relative;
}

.file-menu-button:hover {
    background: #3C3C3C; /* Opaque gray instead of transparent white */
}

.file-menu.open .file-menu-button {
    background: #505050; /* Slightly lighter opaque gray */
}

.file-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #252526;
    background-color: rgb(37, 37, 38); /* Ensure full opacity */
    border: 0.0625rem solid #454545;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.4);
    min-width: 13.75rem;
    display: none;
    z-index: 1000;
    margin-top: 0.125rem;
    padding: 0.375rem;
    opacity: 1; /* Ensure full opacity */
}

.file-menu.open .file-menu-dropdown {
    display: block;
}

/* Light theme adjustments */
.light-theme .file-menu-button:hover {
    background: #E8E8E8; /* Opaque light gray */
}

.light-theme .file-menu.open .file-menu-button {
    background: #D4D4D4; /* Slightly darker opaque gray */
}

.light-theme .file-menu-dropdown {
    background: #F3F3F3;
    background-color: rgb(243, 243, 243); /* Ensure full opacity */
    border-color: #D4D4D4;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.16);
    opacity: 1; /* Ensure full opacity */
}

.light-theme .file-menu-item {
    color: #424242;
}

.light-theme .file-menu-item:hover {
    background: #E8E8E8;
    color: #000000;
}

.file-menu-item {
    display: flex;
    align-items: center;
    width: calc(100% - 0.25rem);
    background: transparent;
    background-color: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
    color: #CCCCCC;
    padding: 0.5rem 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    transition: background-color 0.1s;
    white-space: nowrap;
    height: 1.75rem;
    line-height: 1.75rem;
    margin: 0.0625rem 0.125rem;
    border-radius: 0.25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Menu separator */
.file-menu-separator {
    height: 0.0625rem;
    background: #454545;
    margin: 0.25rem 0.375rem;
}

.light-theme .file-menu-separator {
    background: #D4D4D4;
}

.file-menu-item:hover {
    background: #094771;
    color: #FFFFFF;
    border-radius: 4px;
}

.file-menu-item:focus {
    outline: none;
}

/* Display Size Classes */
.management-console.display-compact {
    --tree-item-height: 1.25rem;
    --tree-item-padding: 0 0.25rem;
    --tree-font-size: 0.75rem;
    --tree-icon-size: 0.75rem;
    --tree-indent: 0.625rem;
}

.management-console.display-normal {
    --tree-item-height: 1.375rem;
    --tree-item-padding: 0.0625rem 0.25rem;
    --tree-font-size: 0.8125rem;
    --tree-icon-size: 0.875rem;
    --tree-indent: 0.75rem;
}

.management-console.display-large {
    --tree-item-height: 1.75rem;
    --tree-item-padding: 0.25rem 0.5rem;
    --tree-font-size: 0.875rem;
    --tree-icon-size: 1rem;
    --tree-indent: 1rem;
}

.management-console.display-xlarge {
    --tree-item-height: 2rem;
    --tree-item-padding: 0.375rem 0.625rem;
    --tree-font-size: 0.9375rem;
    --tree-icon-size: 1.125rem;
    --tree-indent: 1.25rem;
}

/* Apply display size variables */
.display-compact .tree-item,
.display-normal .tree-item,
.display-large .tree-item,
.display-xlarge .tree-item {
    height: var(--tree-item-height);
    line-height: var(--tree-item-height);
    padding: var(--tree-item-padding);
    font-size: var(--tree-font-size);
}

.display-compact .tree-icon,
.display-normal .tree-icon,
.display-large .tree-icon,
.display-xlarge .tree-icon {
    font-size: var(--tree-icon-size);
}

/* Display size depth indentations */
.display-compact .tree-depth-1 { padding-left: 0.625rem; }
.display-compact .tree-depth-2 { padding-left: 1.25rem; }
.display-compact .tree-depth-3 { padding-left: 1.875rem; }
.display-compact .tree-depth-4 { padding-left: 2.5rem; }
.display-compact .tree-depth-5 { padding-left: 3.125rem; }

.display-normal .tree-depth-1 { padding-left: 0.75rem; }
.display-normal .tree-depth-2 { padding-left: 1.5rem; }
.display-normal .tree-depth-3 { padding-left: 2.25rem; }
.display-normal .tree-depth-4 { padding-left: 3rem; }
.display-normal .tree-depth-5 { padding-left: 3.75rem; }

.display-large .tree-depth-1 { padding-left: 1rem; }
.display-large .tree-depth-2 { padding-left: 2rem; }
.display-large .tree-depth-3 { padding-left: 3rem; }
.display-large .tree-depth-4 { padding-left: 4rem; }
.display-large .tree-depth-5 { padding-left: 5rem; }

.display-xlarge .tree-depth-1 { padding-left: 1.25rem; }
.display-xlarge .tree-depth-2 { padding-left: 2.5rem; }
.display-xlarge .tree-depth-3 { padding-left: 3.75rem; }
.display-xlarge .tree-depth-4 { padding-left: 5rem; }
.display-xlarge .tree-depth-5 { padding-left: 6.25rem; }