/* Lemmings White UI - Main Stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-bg: #f8f9fa;
    --sidebar-icon-bg: #ffffff;
    --sidebar-icon-active: #e3f2fd;
    --sidebar-icon-hover: #f0f0f0;
    --border-color: #e0e0e0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent-blue: #1976d2;
    --accent-blue-light: #e3f2fd;
    --user-message-bg: #1976d2;
    --agent-message-bg: #f5f5f5;
    --toolbar-bg: #fafafa;
    --spreadsheet-header: #f5f5f5;
    --spreadsheet-cell-selected: #e8f4fd;
    --green-excel: #217346;
    --markdown-bg: #ffffff;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    --body-bg: #ffffff;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --code-bg: #f5f5f5;
    --hover-bg: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
html.dark-theme {
    --sidebar-bg: #1a1a1a;
    --sidebar-icon-bg: #252525;
    --sidebar-icon-active: #1e3a5f;
    --sidebar-icon-hover: #333333;
    --border-color: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent-blue: #1976d2;
    --accent-blue-light: #1e3a5f;
    --user-message-bg: #1976d2;
    --agent-message-bg: #2a2a2a;
    --toolbar-bg: #1e1e1e;
    --spreadsheet-header: #252525;
    --spreadsheet-cell-selected: #1e3a5f;
    --green-excel: #2e8b57;
    --markdown-bg: #1e1e1e;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    --body-bg: #121212;
    --card-bg: #1e1e1e;
    --input-bg: #252525;
    --modal-bg: #1e1e1e;
    --code-bg: #2a2a2a;
    --hover-bg: #333333;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* Dark theme specific overrides for elements with hard-coded colors */
html.dark-theme .search-input input,
html.dark-theme .panel-search input,
html.dark-theme .chat-input,
html.dark-theme .config-search input,
html.dark-theme textarea,
html.dark-theme input[type="text"],
html.dark-theme input[type="email"],
html.dark-theme input[type="password"],
html.dark-theme input[type="number"],
html.dark-theme select {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

html.dark-theme .search-input input::placeholder,
html.dark-theme .panel-search input::placeholder,
html.dark-theme .chat-input::placeholder,
html.dark-theme textarea::placeholder,
html.dark-theme input::placeholder {
    color: var(--text-muted);
}

/* Dark theme scrollbars */
html.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html.dark-theme ::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

html.dark-theme ::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

html.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Dark theme toggle switch knobs - keep white */
html.dark-theme .graph-toggle-switch::after,
html.dark-theme .toggle-slider::before {
    background: white;
}

/* Dark theme popular dropdown items */
html.dark-theme .dropdown-item.popular {
    background: #2d2a1a;
}

html.dark-theme .dropdown-item.popular:hover {
    background: #3d3a2a;
}

/* Dark theme chat area - black background with white agent bubbles */
html.dark-theme .chat-messages {
    background-color: #000000;
}

html.dark-theme .message.agent .message-bubble {
    background: #ffffff;
    color: #000000;
}

html.dark-theme .message.agent .message-bubble a {
    color: #1976d2;
}

html.dark-theme .message.agent .message-bubble code {
    background: #f0f0f0;
    color: #333333;
}

html.dark-theme .message.agent .message-bubble pre {
    background: #f5f5f5;
    color: #333333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Main Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Left Icon Sidebar */
.icon-sidebar {
    width: 56px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    transition: width 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 0;
}

.icon-sidebar.expanded {
    width: 200px;
    align-items: flex-start;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.icon-sidebar.expanded .sidebar-icon {
    width: calc(100% - 16px);
    justify-content: flex-start;
    padding-left: 12px;
}

.sidebar-icon:hover {
    background: var(--sidebar-icon-hover);
}

.sidebar-icon.active {
    background: var(--sidebar-icon-active);
    color: var(--accent-blue);
}

/* Menu toggle icon in sidebar */
.sidebar-icon.menu-toggle {
    color: var(--text-primary);
}

.sidebar-icon.menu-toggle:hover {
    background: var(--sidebar-icon-hover);
}

/* Canvas toggle icon in sidebar */
.sidebar-icon.canvas-toggle {
    color: var(--text-primary);
}

.sidebar-icon.canvas-toggle:hover {
    background: var(--sidebar-icon-hover);
}

.sidebar-icon.canvas-toggle.active {
    background: var(--sidebar-icon-active);
    color: var(--accent-blue);
}

/* Chat-only mode - app container adjustments */
/* Icon sidebar always visible, main content hidden, but context panel can be opened */
.app-container.chat-only-mode .main-content {
    display: none !important;
}

/* Context panel in chat-only mode: uses flex layout to push chat */
.app-container.chat-only-mode #contextPanel {
    /* Panel is part of flex layout, collapsed state handled by .panel.collapsed */
}

/* When context panel is opened in chat-only mode, it takes space and chat adjusts */
.app-container.chat-only-mode #contextPanel:not(.collapsed) {
    display: flex !important;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

/* Chat panel fills remaining space in chat-only mode */
.app-container.chat-only-mode .copilot-panel {
    flex: 1;
    min-width: 300px;
    border-left: none;
    transition: flex 0.2s ease;
}

/* Split view mode (70% tabs - 30% chat) */
.app-container:not(.chat-only-mode) .main-content {
    flex: 7;
}

.app-container:not(.chat-only-mode) .copilot-panel {
    flex: 3;
}

/* Sidebar Badge (notification count) */
.sidebar-icon .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #f44336;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Tooltips */
.sidebar-icon[data-tooltip]:not(.icon-sidebar.expanded .sidebar-icon)::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 6px 12px;
    background: var(--text-primary);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

.sidebar-icon[data-tooltip]:not(.icon-sidebar.expanded .sidebar-icon)::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    border: 6px solid transparent;
    border-right-color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
}

.icon-sidebar:not(.expanded) .sidebar-icon[data-tooltip]:hover::after,
.icon-sidebar:not(.expanded) .sidebar-icon[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.sidebar-icon i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-icon .icon-label {
    display: none;
    margin-left: 12px;
    font-size: 13px;
    white-space: nowrap;
}

.icon-sidebar.expanded .sidebar-icon .icon-label {
    display: inline;
}

.sidebar-divider {
    width: 32px;
    height: 1px;
    background: var(--border-color);
    margin: 8px auto;
}

.icon-sidebar.expanded .sidebar-divider {
    width: calc(100% - 32px);
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.icon-sidebar.expanded .sidebar-bottom {
    align-items: flex-start;
}

/* Panel Base Styles */
.panel {
    width: 300px;
    min-width: 200px;
    max-width: 600px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    transition: width 0.25s ease, opacity 0.25s ease;
}

.panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border-right: none !important;
    opacity: 0;
    overflow: hidden;
    transition: width 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

.panel.resizing {
    transition: none;
    user-select: none;
}

/* Panel Resize Handle */
.panel-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    background: transparent;
}

.panel-resize-handle:hover,
.panel-resize-handle.active {
    background: var(--accent-blue);
    opacity: 0.3;
}

.panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: var(--border-color);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s;
}

.panel-resize-handle:hover::after {
    opacity: 1;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    min-height: 48px;
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-collapse-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
}

.panel-collapse-btn:hover {
    background: var(--sidebar-icon-hover);
}

/* Panel Toolbar */
.panel-toolbar {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 8px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
}

.panel-toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.panel-search {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    gap: 6px;
    width: 100%;
}

.panel-search i {
    color: var(--text-muted);
    font-size: 12px;
}

.panel-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
    padding: 4px 0;
}

.panel-search input::placeholder {
    color: var(--text-muted);
}

.panel-toolbar-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 12px;
}

.panel-toolbar-btn:hover {
    background: var(--sidebar-icon-hover);
    color: var(--accent-blue);
}

.panel-toolbar-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.panel-toolbar-btn.active:hover {
    background: #1565c0;
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: width 0.2s ease, opacity 0.2s ease, flex 0.2s ease;
}

.main-content.hidden {
    flex: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    padding: 0 !important;
}

/* When main content is hidden, copilot panel takes full remaining space */
.main-content.hidden ~ .copilot-panel {
    flex: 1;
    width: auto !important;
    max-width: none !important;
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
}

.menu-btn:hover {
    background: var(--sidebar-icon-hover);
}

.app-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
}

.header-icon-btn:hover {
    background: var(--sidebar-icon-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #223963;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Content Area */
.content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    height: 36px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    cursor: pointer;
    font-size: 13px;
    position: relative;
    top: 1px;
}

.tab.active {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-bg);
}

.tab:not(.active) {
    background: var(--toolbar-bg);
}

.tab .close-btn {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 10px;
}

.tab .close-btn:hover {
    color: var(--text-primary);
}

.tab-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tab-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--error-color);
}

.tab-more {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
}

.tab-more:hover {
    color: var(--text-primary);
}

/* Tab Menu */
.tab-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 100;
    padding: 4px 0;
}

.tab-menu.show {
    display: block;
}

.tab-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.tab-menu-item:hover {
    background: var(--sidebar-icon-hover);
}

.tab-menu-item i {
    color: var(--text-muted);
    width: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Content Toolbar */
.content-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
}

.toolbar-btn:hover {
    background: var(--sidebar-icon-hover);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* Co-Pilot/Chat Panel */
.copilot-panel {
    width: 50%;
    min-width: 320px;
    max-width: 60%;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    position: relative;
    transition: width 0.25s ease, flex 0.25s ease;
}

.copilot-panel.expanded {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: calc(100% - 56px) !important;
    max-width: none;
    z-index: 100;
}

.icon-sidebar.expanded ~ .panel ~ .main-content ~ .copilot-panel.expanded,
.icon-sidebar.expanded ~ .main-content ~ .copilot-panel.expanded {
    width: calc(100% - 200px) !important;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    background: transparent;
    z-index: 100;
}

.resize-handle:hover,
.resize-handle.dragging {
    background: var(--accent-blue);
}

/* When resizing, override flex constraints */
.copilot-panel[style*="width"] {
    flex: none !important;
    max-width: none !important;
}

.copilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.copilot-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copilot-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.chat-session-info {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.chat-session-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.chat-project-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: none;
}

.chat-project-link:hover {
    text-decoration: underline;
}

.copilot-header-btns {
    display: flex;
    gap: 8px;
}

.copilot-header-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
}

.copilot-header-btn:hover {
    background: var(--sidebar-icon-hover);
}

/* Theme toggle button */
.theme-toggle-btn {
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--accent-blue);
    transform: rotate(15deg);
}

html.dark-theme .theme-toggle-btn {
    color: #ffc107;
}

html.dark-theme .theme-toggle-btn:hover {
    color: #ffca28;
}

.expand-btn {
    font-size: 11px;
    padding: 0 6px;
    width: auto;
    gap: 2px;
}

.expand-btn .expand-icon {
    display: flex;
    align-items: center;
}

.copilot-panel.expanded .expand-btn .fa-chevron-left {
    display: none;
}

.copilot-panel:not(.expanded) .expand-btn .fa-chevron-right {
    display: none;
}

/* Divider in copilot header */
.copilot-header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

/* User avatar in copilot header */
.copilot-header-btns .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
    cursor: pointer;
}

/* Dropdown Select */
.dropdown-select {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    cursor: pointer;
    width: 100%;
}

.dropdown-select:hover {
    border-color: var(--accent-blue);
}

.dropdown-select .select-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-select .select-icon i {
    color: white;
    font-size: 14px;
}

.dropdown-select .select-icon.model-icon {
    background: #223963;
}

.dropdown-select .select-content {
    flex: 1;
    min-width: 0;
}

.dropdown-select .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dropdown-select .value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-select .chevron {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* Model Shortcut Buttons */
.model-shortcuts {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
    container-type: inline-size;
    container-name: model-shortcuts;
}

.model-shortcut-btn {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 6px 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
}

.model-shortcut-btn:hover {
    border-color: var(--accent-blue);
    transform: scale(1.02);
}

.model-shortcut-btn.active {
    border-color: var(--accent-blue);
    background: rgba(33, 150, 243, 0.1);
}

.model-shortcut-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.model-shortcut-label {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.model-shortcut-btn:hover .model-shortcut-label {
    color: var(--accent-blue);
}

.model-shortcut-btn.active .model-shortcut-label {
    color: var(--accent-blue);
}

/* Hide labels when container is narrow (less than 450px) */
@container model-shortcuts (max-width: 450px) {
    .model-shortcut-label {
        display: none;
    }

    .model-shortcut-btn {
        padding: 4px;
    }

    .model-shortcut-btn img {
        width: 32px;
        height: 32px;
    }
}

/* Dark mode adjustments for model shortcuts */
body.dark-mode .model-shortcut-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .model-shortcut-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(33, 150, 243, 0.15);
}

body.dark-mode .model-shortcut-btn.active {
    border-color: var(--accent-blue);
    background: rgba(33, 150, 243, 0.2);
}

body.dark-mode .model-shortcut-label {
    color: var(--text-muted);
}

/* Selectors Area */
.selectors-area {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Settings Button */
.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent-blue);
    cursor: pointer;
    font-size: 13px;
    color: #ffffff;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: #1565c0;
}

.settings-btn i {
    font-size: 14px;
}

/* Pro Run Button in Header */
.pro-run-btn {
    width: auto !important;
    padding: 4px 10px !important;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.pro-run-btn i {
    font-size: 13px;
}

.pro-run-label {
    white-space: nowrap;
}

.pro-run-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.pro-run-btn.active:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f5f5f5;
}

.message {
    max-width: 90%;
}

.copilot-panel.expanded .message {
    max-width: 70%;
}

.message.user {
    align-self: flex-end;
}

.message.agent {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-bubble {
    background: var(--user-message-bg);
    color: white;
    border-bottom-right-radius: 4px;
    white-space: normal;
}

.message.agent .message-bubble {
    background: var(--agent-message-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    white-space: normal;
}

/* Reduce paragraph spacing in markdown-rendered content */
.response-content {
    white-space: normal;
}

.message-bubble p,
.response-content p {
    margin: 0 0 0.5em 0;
}

.message-bubble p:last-child,
.response-content p:last-child {
    margin-bottom: 0;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.response-content h1,
.response-content h2,
.response-content h3 {
    margin: 0.75em 0 0.25em 0;
}

.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child,
.response-content h1:first-child,
.response-content h2:first-child,
.response-content h3:first-child {
    margin-top: 0;
}

.message-bubble ul,
.message-bubble ol,
.response-content ul,
.response-content ol {
    margin: 0.25em 0;
    padding-left: 1.5em;
}

.message-bubble li,
.response-content li {
    margin: 0;
    padding: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-header-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 4px;
}

.message.user .message-header-row {
    flex-direction: row;
}

.message.user .message-header-row .message-time {
    margin-top: 0;
}

.message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-avatar i {
    color: white;
    font-size: 10px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
}

.thinking-label {
    font-size: 11px;
    color: var(--accent-blue);
    font-style: italic;
    margin-left: 8px;
}

/* Thinking log lines - shows recent activity during processing */
.thinking-log-lines {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    max-height: 80px;
    overflow: hidden;
}

.thinking-log-lines:empty {
    display: none;
}

.thinking-log-line {
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #666;
}

.thinking-log-line:last-child {
    color: var(--accent-blue);
    font-weight: 500;
}

.message-agent-name {
    font-size: 11px;
    color: var(--text-muted);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.message.user .message-actions {
    justify-content: flex-end;
}

.message.agent .message-actions {
    justify-content: flex-start;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--sidebar-icon-hover);
    color: var(--accent-blue);
}

.action-btn i {
    font-size: 11px;
}

/* Message Footer - Metadata */
.message-footer {
    margin-top: 6px;
    padding-top: 6px;
}

.message-metadata {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.star {
    font-size: 18px;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.2s ease;
}

.star:hover,
.star.active {
    color: #ffc107;
}

.star-rating:hover .star {
    color: var(--border-color);
}

.star-rating:hover .star:hover,
.star-rating:hover .star:hover ~ .star {
    color: var(--border-color);
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: var(--border-color);
}

.star-rating:hover .star:hover,
.star-rating:hover .star.hovered {
    color: #ffc107;
}

/* Rating Modal Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Detail Content Box for Task Details */
.detail-content-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

.detail-content-box h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.detail-content-box pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    flex: 0 0 140px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
}

/* Human Tasks Panel */
.human-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.human-task-item {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.human-task-item:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue);
}

.human-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.human-task-from {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.human-task-from i {
    margin-right: 4px;
    color: var(--accent-blue);
}

.human-task-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.human-task-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.human-task-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.human-task-btn-ui {
    background: #f3e8ff;
    border-color: #9333ea;
    color: #9333ea;
}

.human-task-btn-ui:hover {
    background: #9333ea;
    color: white;
    border-color: #9333ea;
}

.human-task-btn i {
    font-size: 12px;
}

.human-task-time {
    font-size: 11px;
    color: var(--text-muted);
}

.human-task-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.human-task-prompt {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.form-control-static {
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 0;
}

/* A2UI Form Styles */
.human-task-ui-modal {
    max-height: 70vh;
    overflow-y: auto;
}

.a2ui-form-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.a2ui-layout {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.a2ui-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
}

.a2ui-field:last-child {
    margin-bottom: 0;
}

.a2ui-label {
    flex: 0 0 140px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding-top: 10px;
    text-align: right;
}

.a2ui-field-control {
    flex: 1;
    min-width: 0;
}

.a2ui-input,
.a2ui-textarea,
.a2ui-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.a2ui-input:focus,
.a2ui-textarea:focus,
.a2ui-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.a2ui-input::placeholder,
.a2ui-textarea::placeholder {
    color: var(--text-muted);
}

.a2ui-textarea {
    resize: vertical;
    min-height: 100px;
}

.a2ui-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.a2ui-checkbox-group,
.a2ui-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.a2ui-checkbox-label,
.a2ui-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.a2ui-checkbox-label input,
.a2ui-radio-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.a2ui-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.a2ui-button {
    margin-top: 8px;
}

/* A2UI Form in Canvas Tab */
.human-task-ui-tab-container {
    max-width: 800px;
    margin: 0 auto;
}

.human-task-prompt-display {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.a2ui-form-tab {
    padding: 20px;
}

.a2ui-form-tab .a2ui-field {
    margin-bottom: 16px;
}

.a2ui-form-tab .a2ui-label {
    flex: 0 0 180px;
    font-size: 14px;
    padding-top: 12px;
}

.a2ui-form-tab .a2ui-input,
.a2ui-form-tab .a2ui-textarea,
.a2ui-form-tab .a2ui-select {
    padding: 10px 14px;
    font-size: 14px;
}

.a2ui-form-tab .a2ui-textarea {
    min-height: 120px;
}

/* Chat Input */
.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--input-bg);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-light);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    padding: 4px 0;
    resize: none;
    min-height: 20px;
    max-height: 150px;
    line-height: 1.4;
    font-family: inherit;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 50%;
}

.chat-input-btn:hover {
    background: var(--sidebar-icon-hover);
    color: var(--accent-blue);
}

.chat-input-btn.attach {
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-input-btn.attach:hover {
    color: var(--accent-blue);
    background: var(--sidebar-icon-hover);
}

.chat-input-btn.attach.uploading {
    color: var(--accent-blue);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-input-btn.send {
    background: var(--accent-blue);
    color: white;
}

.chat-input-btn.send:hover {
    background: #1565c0;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: var(--sidebar-icon-hover);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.dropdown-item.popular {
    background: #fffde7;
}

.dropdown-item.popular:hover {
    background: #fff9c4;
}

/* Dropdown Group Labels */
.dropdown-group-label {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--toolbar-bg);
    border-top: 1px solid var(--border-color);
}

.dropdown-group-label:first-child {
    border-top: none;
    border-radius: 8px 8px 0 0;
}

/* Dropdown Search */
.dropdown-search {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: var(--toolbar-bg);
}

.dropdown-search input:focus {
    border-color: var(--accent-blue);
    background: #fff;
}

.dropdown-search + .dropdown-group-label {
    border-top: none;
}

.dropdown-item.no-results {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    cursor: default;
}

.dropdown-item.no-results:hover {
    background: transparent;
}

.dropdown-item.selected {
    background: var(--accent-blue-light);
}

.dropdown-item.selected:hover {
    background: var(--accent-blue-light);
}

/* Position Relative for Dropdowns */
.dropdown-wrapper {
    position: relative;
}

/* Tooltip */
.icon-sidebar:not(.expanded) [data-tooltip] {
    position: relative;
}

.icon-sidebar:not(.expanded) [data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--toolbar-bg);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr:hover {
    background: var(--sidebar-icon-hover);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.status-completed,
.status-badge.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-running,
.status-badge.status-in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.status-pending,
.status-badge.status-assigned {
    background: #fff3e0;
    color: #ef6c00;
}

.status-badge.status-failed,
.status-badge.status-error {
    background: #ffebee;
    color: #c62828;
}

/* Tool badge with parameters tooltip */
.tool-badge {
    cursor: default;
    background: #e8eaf6;
    color: #3949ab;
}

.tool-badge.has-params {
    cursor: pointer;
    position: relative;
}

.tool-badge.has-params:hover {
    background: #c5cae9;
}

/* Native title tooltip enhancement - use CSS for multiline */
.tool-badge[title] {
    position: relative;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: #1565c0;
}

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

.btn-secondary:hover {
    background: var(--sidebar-icon-hover);
}

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

.btn-danger:hover {
    background: #d32f2f;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-icon {
    padding: 4px 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger-icon {
    background: transparent;
    color: var(--text-muted);
    border: none;
}

.btn-danger-icon:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-color);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 20px;
}

.modal-close:hover {
    background: var(--sidebar-icon-hover);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Agent Settings Modal */
.agent-settings-modal .modal-content {
    max-width: 800px;
    width: 95%;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--toolbar-bg);
    padding: 0 16px;
}

.settings-tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.settings-tab-btn:hover {
    color: var(--text-primary);
}

.settings-tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.settings-body {
    max-height: 60vh;
    overflow-y: auto;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-checklist {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
}

.settings-checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.settings-checklist-item:last-child {
    border-bottom: none;
}

.settings-checklist-item input[type="checkbox"] {
    margin-top: 4px;
    width: 16px;
    height: 16px;
}

.settings-checklist-item .item-info {
    flex: 1;
}

.settings-checklist-item .item-name {
    font-weight: 500;
    font-size: 14px;
}

.settings-checklist-item .item-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-policy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.settings-policy-files {
    margin-top: 12px;
}

.empty-state-mini {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--toolbar-bg);
    border-radius: 8px;
}

/* Chat Sessions List */
.chat-sessions-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.session-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.session-list-item:last-child {
    border-bottom: none;
}

.session-list-item:hover {
    background: var(--toolbar-bg);
}

.session-list-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent-blue);
}

.session-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.session-list-title {
    font-weight: 500;
    font-size: 14px;
}

.session-list-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--toolbar-bg);
    padding: 2px 6px;
    border-radius: 10px;
}

.session-list-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    display: block;
    margin-bottom: 4px;
}

.session-list-preview {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-list-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card.stat-blue .stat-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.stat-green .stat-icon { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.stat-card.stat-yellow .stat-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.stat-red .stat-icon { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }
.stat-card.stat-purple .stat-icon { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.stat-card.stat-orange .stat-icon { background: linear-gradient(135deg, #f5af19 0%, #f12711 100%); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dashboard-resources {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.resource-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.resource-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-header h3 i {
    color: var(--accent-blue);
}

.resource-badge {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--toolbar-bg);
    border-radius: 10px;
    color: var(--text-muted);
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-name {
    font-size: 13px;
    font-weight: 500;
}

.resource-more {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* Dashboard Grids (web-blue style) */
.dashboard-grids {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 20px 0;
}

.dashboard-grid-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.grid-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.grid-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dashboard-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.dashboard-card.empty {
    background: transparent;
    border: 1px dashed var(--border-color);
    cursor: default;
}

.dashboard-card.empty:hover {
    background: transparent;
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.dashboard-card.central {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.dashboard-card.central:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4295 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dashboard-card.central .card-icon {
    color: white;
}

.dashboard-card.central h3,
.dashboard-card.central p {
    color: white;
}

.dashboard-card.central.user {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.dashboard-card.central.user:hover {
    background: linear-gradient(135deg, #0e867a 0%, #2fd66e 100%);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.dashboard-card .card-icon {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--accent-blue);
}

.dashboard-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dashboard-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 1200px) {
    .dashboard-grids {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grid-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

.analytics-period-selector {
    display: flex;
    gap: 12px;
    align-items: center;
}

.analytics-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.last-updated {
    font-size: 12px;
    color: var(--text-muted);
}

/* Analytics Filters */
.analytics-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
}

.analytics-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-filters .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-filters .filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    min-width: 150px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Analytics Charts Row (for full-width charts) */
.analytics-charts-row {
    margin-bottom: 20px;
}

/* Analytics Charts Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    margin-bottom: 16px;
}

.chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 i {
    color: var(--accent-blue);
}

.chart-container {
    position: relative;
    height: 250px;
}

.chart-container.small {
    height: 200px;
}

@media (max-width: 1200px) {
    .analytics-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-card.full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }

    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-filters .filter-group select {
        width: 100%;
    }
}

.analytics-period-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-resources {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--toolbar-bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: var(--toolbar-bg);
}

.data-table tr.clickable-row {
    cursor: pointer;
}

.data-table tr.clickable-row:hover {
    background: var(--accent-blue-light);
}

/* File Tree */
.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    cursor: pointer;
    user-select: none;
}

.tree-item:hover {
    background: var(--sidebar-icon-hover);
}

.tree-item.selected {
    background: var(--accent-blue-light);
}

.tree-item i {
    margin-right: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.tree-item .fa-folder {
    color: #f9a825;
}

.tree-item .fa-file-excel {
    color: var(--green-excel);
}

.tree-item .fa-file-code {
    color: #5c6bc0;
}

.tree-item span {
    font-size: 13px;
    color: var(--text-primary);
}

.tree-item.indent-1 {
    padding-left: 32px;
}

.tree-item.indent-2 {
    padding-left: 48px;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    font-size: 10px;
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.list-item:hover {
    background: var(--sidebar-icon-hover);
}

.list-item.selected {
    background: var(--accent-blue-light);
}

.list-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.list-item-icon i {
    color: white;
    font-size: 14px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* Task ID prefix styling */
.task-id-prefix {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 10px;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-muted);
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.task-id-prefix:hover {
    background: var(--accent-blue);
    color: white;
}

.list-item-actions {
    display: flex;
    gap: 4px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--error-color);
}

.notification.warning {
    background: var(--warning-color);
}

.notification.info {
    background: var(--info-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 13px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Thin scrollbar for icon sidebar */
.icon-sidebar::-webkit-scrollbar {
    width: 4px;
}

.icon-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.icon-sidebar::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.icon-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Search Input */
.search-input {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
}

.search-input input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 13px;
}

.search-input i {
    color: var(--text-muted);
    margin-right: 8px;
}

/* Tabs (secondary level) */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Entity Detail Tabs */
.entity-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 4px;
}

.entity-tab-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.entity-tab-btn:hover {
    color: var(--text-primary);
    background: var(--toolbar-bg);
}

.entity-tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.entity-tab-content {
    min-height: 200px;
}

.code-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: var(--toolbar-bg);
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px;
}

/* Page Content Area */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: var(--toolbar-bg);
    border-radius: 8px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    min-width: 120px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Configuration/Settings Page */
.config-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.config-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.config-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-search input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    width: 250px;
}

.config-mode-toggle {
    display: flex;
    gap: 8px;
}

.config-view {
    padding: 16px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.config-view.active {
    display: block;
}

.config-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--sidebar-bg);
    border-radius: 8px;
}

.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.config-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-field label {
    min-width: 180px;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.config-field input[type="text"],
.config-field input[type="number"],
.config-field textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.config-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.config-field textarea {
    min-height: 60px;
    resize: vertical;
}

.config-help {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.config-editor {
    width: 100%;
    min-height: 500px;
    padding: 16px;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    background: #fafafa;
}

.loading-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* Details View (Provider, Model, etc.) */
.details-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.details-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.details-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
    .copilot-panel {
        width: 40%;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .icon-sidebar {
        width: 48px;
    }

    .panel {
        width: 100%;
        position: absolute;
        z-index: 50;
    }

    .copilot-panel {
        width: 100%;
        position: absolute;
        right: 0;
    }
}

/* ============================================
   Home Page Grids (Agent Ecosystem + User Workspace)
   ============================================ */
.home-grids {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.home-grids.stacked {
    grid-template-columns: 1fr;
    max-width: 900px;
}

.home-grid-column {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

.home-grid-label {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-blue);
}

.home-grid-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.home-card {
    background: var(--toolbar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-card:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--accent-blue);
}

.home-card.central {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.home-card.central:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.4);
}

.home-card.central p {
    color: rgba(255,255,255,0.8);
}

.home-card.central.user {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.home-card.central.user:hover {
    box-shadow: 0 8px 24px rgba(17,153,142,0.4);
}

.home-card.empty {
    background: transparent;
    border: none;
    cursor: default;
    box-shadow: none;
}

.home-card.empty:hover {
    transform: none;
    box-shadow: none;
}

.home-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.home-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.home-card p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================
   Quick Start Guide Styles
   ============================================ */
.quickstart-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.architecture-banner {
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
}

.architecture-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.quickstart-header {
    text-align: center;
    margin-bottom: 40px;
}

.quickstart-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.quickstart-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.quickstart-scenarios {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quickstart-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

.quickstart-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.quickstart-number {
    width: 36px;
    height: 36px;
    background: #223963;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.quickstart-card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.quickstart-description {
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-size: 14px;
    padding-left: 52px;
}

.quickstart-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-left: 52px;
}

.quickstart-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quickstart-step .step-number {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.quickstart-step span:last-child {
    color: var(--text-primary);
    font-size: 14px;
}

.quickstart-btn {
    margin-left: 52px;
    padding: 10px 20px;
    background: #223963;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.quickstart-btn:hover {
    transform: translateY(-2px);
    background: #1a2d4d;
    box-shadow: 0 4px 12px rgba(34,57,99,0.4);
}

.quickstart-btn i {
    font-size: 14px;
}

@media (max-width: 600px) {
    .quickstart-description,
    .quickstart-steps,
    .quickstart-btn {
        padding-left: 0;
        margin-left: 0;
    }

    .quickstart-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Task Details Tab Styles */
.task-tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
}

.task-tab-btn:hover {
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary);
}

.task-tab-btn.active {
    background: var(--accent-blue);
    color: white;
}

.task-tab-content {
    display: none;
}

.task-tab-content.active {
    display: block;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

@media (max-width: 1000px) {
    .home-grids {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .home-grid-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-card.empty {
        display: none;
    }
}

/* ============================================
   Dashboard Metric Cards
   ============================================ */
.metric-card-simple {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card-simple:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.metric-card-simple .metric-icon {
    font-size: 24px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.metric-card-simple .metric-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-card-simple .metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-card-simple .metric-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Card Header for Dashboard Tables */
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--toolbar-bg);
}

.card-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h4 i {
    color: var(--accent-blue);
}

/* Dashboard responsive adjustments */
@media (max-width: 900px) {
    .dashboard-tables {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   Skills File Browser
   =========================================== */

.skill-file-browser {
    min-height: 200px;
}

.skill-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
}

.skill-breadcrumb-item:hover {
    text-decoration: underline;
}

.skill-nav-up:hover {
    background: rgba(25, 118, 210, 0.08);
}

.skill-file-item {
    transition: background-color 0.15s ease;
}

.skill-file-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.skill-file-item .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.skill-file-item:hover .btn-sm {
    opacity: 1;
}

.skill-file-item .btn-danger {
    opacity: 0.5;
}

.skill-file-item:hover .btn-danger {
    opacity: 1;
}

/* ===========================================
   Graph Visualization
   =========================================== */

.graph-popup {
    position: fixed;
    z-index: 10000;
    min-width: 280px;
    max-width: 350px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: graphPopupFadeIn 0.15s ease-out;
}

@keyframes graphPopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.graph-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.graph-popup-header i:first-child {
    color: var(--primary-color);
    font-size: 16px;
}

.graph-popup-header span {
    flex: 1;
}

.graph-popup-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.graph-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.graph-popup-body {
    padding: 16px;
}

.graph-popup-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.graph-popup-field label {
    color: var(--text-muted);
    min-width: 50px;
}

.graph-popup-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.graph-popup-badge.type-coordinator {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.graph-popup-badge.type-worker {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.graph-popup-badge.type-validator {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.graph-popup-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Graph Toggle Switch */
.graph-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
    user-select: none;
}

.graph-toggle-label:hover {
    background: var(--bg-tertiary, rgba(0,0,0,0.05));
}

.graph-toggle-label input[type="checkbox"] {
    display: none;
}

.graph-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.graph-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.graph-toggle-label input[type="checkbox"]:checked + .graph-toggle-switch {
    background: var(--primary-color);
}

.graph-toggle-label input[type="checkbox"]:checked + .graph-toggle-switch::after {
    transform: translateX(16px);
}

/* Generic Toggle Switch for Lists */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success-color, #22c55e);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-switch:hover .toggle-slider {
    opacity: 0.9;
}

/* List item actions container */
.list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 8px;
}

/* Log line styling */
.log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.log-error {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.log-warning {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.log-info {
    color: var(--text-primary);
}

.log-debug {
    color: var(--text-muted);
    opacity: 0.8;
}

.logs-container {
    max-height: 400px;
    overflow-y: auto;
}

.graph-toggle-label span:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.graph-toggle-label span:last-child i {
    font-size: 12px;
}

/* Graph Task Input */
.graph-task-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.graph-task-input {
    width: 280px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-color);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.graph-task-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.graph-task-input::placeholder {
    color: var(--text-muted);
}

.graph-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ============================================
   Swagger Import Styles
   ============================================ */

.swagger-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.swagger-info {
    font-size: 14px;
}

.swagger-field {
    margin-bottom: 8px;
    line-height: 1.5;
}

.swagger-field strong {
    color: var(--text-primary);
}

.swagger-endpoints {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.swagger-endpoints ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.swagger-endpoints li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.swagger-endpoints code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: var(--accent-color);
}

.swagger-endpoints small {
    color: var(--text-muted);
    font-style: italic;
}

/* Status messages for import */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.info-message {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.warning-message {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.info-message i,
.success-message i,
.error-message i,
.warning-message i {
    margin-right: 8px;
}

.warning-message .btn {
    margin-top: 8px;
    margin-right: 8px;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}
