/* ============================================================
   ALPHAVAULT CODE IDE — code-ide.css v1.0
   Layout, Sidebar, Editor, Tabs, Panels, Components
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   1. CSS VARIABLES
══════════════════════════════════════════════════════════ */
:root {
    --avc-bg:             #0f172a;
    --avc-sidebar-bg:     #080f1e;
    --avc-sidebar-width:  280px;
    --avc-header-h:       48px;
    --avc-tabbar-h:       38px;
    --avc-status-h:       24px;
    --avc-panel-h:        230px;

    --avc-card:           rgba(255,255,255,0.03);
    --avc-card-hover:     rgba(255,255,255,0.06);
    --avc-border:         rgba(255,255,255,0.08);
    --avc-border-strong:  rgba(255,255,255,0.12);

    --avc-primary:        #667eea;
    --avc-primary-dim:    rgba(102,126,234,0.15);
    --avc-primary-glow:   rgba(102,126,234,0.3);

    --avc-text:           #e2e8f0;
    --avc-text-dim:       #64748b;
    --avc-text-muted:     #475569;

    --avc-green:          #10b981;
    --avc-red:            #ef4444;
    --avc-amber:          #f59e0b;
    --avc-purple:         #a78bfa;

    --avc-input-bg:       rgba(255,255,255,0.05);
    --avc-input-border:   rgba(255,255,255,0.1);

    --avc-radius:         10px;
    --avc-radius-lg:      16px;
    --avc-radius-sm:      7px;
    --avc-transition:     all 0.2s ease;
    --avc-shadow:         0 8px 32px rgba(0,0,0,0.4);
    --avc-shadow-lg:      0 20px 60px rgba(0,0,0,0.5);
}

/* Light mode overrides */
body.avc-light-mode {
    --avc-bg:             #f8fafc;
    --avc-sidebar-bg:     #f1f5f9;
    --avc-card:           rgba(255,255,255,0.85);
    --avc-card-hover:     rgba(255,255,255,0.95);
    --avc-border:         rgba(0,0,0,0.08);
    --avc-border-strong:  rgba(0,0,0,0.12);
    --avc-text:           #1e293b;
    --avc-text-dim:       #475569;
    --avc-text-muted:     #94a3b8;
    --avc-input-bg:       rgba(255,255,255,0.9);
    --avc-input-border:   rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════════════════════════
   2. RESET & BASE
══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--avc-bg);
    color: var(--avc-text);
    -webkit-font-smoothing: antialiased;
}

body.avc-page { overflow: hidden; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════
   3. MAIN LAYOUT
══════════════════════════════════════════════════════════ */
#avcIDEApp {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────── */
#avcSidebar {
    width: var(--avc-sidebar-width);
    min-width: var(--avc-sidebar-width);
    background: var(--avc-sidebar-bg);
    border-right: 1px solid var(--avc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: width 0.28s ease, min-width 0.28s ease;
    z-index: 100;
    flex-shrink: 0;
}

#avcSidebar.collapsed {
    width: 52px;
    min-width: 52px;
}

#avcSidebar.collapsed .avc-sidebar-btn-text,
#avcSidebar.collapsed .avc-sidebar-tab-label,
#avcSidebar.collapsed .avc-sidebar-panels-wrap,
#avcSidebar.collapsed .avc-sidebar-status-bar span,
#avcSidebar.collapsed .avc-sidebar-status-bar button,
#avcSidebar.collapsed .avc-project-name-section,
#avcSidebar.collapsed .avc-sidebar-file-actions span,
#avcSidebar.collapsed .avc-sidebar-logo-text,
#avcSidebar.collapsed .avc-sidebar-user-trigger div,
#avcSidebar.collapsed .avc-sidebar-user-trigger span:not(.avc-status-dot) {
    display: none;
}

#avcSidebar.collapsed .avc-sidebar-logo-icon { display: block !important; }
#avcSidebar.collapsed .avc-sidebar-tabbar { justify-content: center; flex-direction: column; gap: 4px; }
#avcSidebar.collapsed .avc-sidebar-tab { justify-content: center; padding: 8px; }

/* ── Sidebar resize handle ───────────────────────── */
.avc-resize-handle-h {
    width: 4px;
    background: transparent;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.15s;
    z-index: 50;
}
.avc-resize-handle-h:hover { background: var(--avc-primary); }

/* ── Main area ───────────────────────────────────── */
#avcMain {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--avc-bg);
}

/* ══════════════════════════════════════════════════════════
   4. SIDEBAR COMPONENTS
══════════════════════════════════════════════════════════ */

/* Mobile close button */
.avc-mobile-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--avc-border);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    color: var(--avc-text-dim);
    font-size: 12px;
}

/* Logo */
.avc-logo-wrap {
    display: flex;
    align-items: center;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--avc-border);
    margin-bottom: 6px;
    text-decoration: none;
    gap: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.avc-sidebar-logo-icon { display: none; }

/* Project name section */
.avc-project-name-section {
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-project-name-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--avc-input-bg);
    border: 1px solid var(--avc-input-border);
    border-radius: var(--avc-radius-sm);
    padding: 6px 10px;
}

.avc-project-name-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--avc-text);
    font-family: inherit;
}
.avc-project-name-input::placeholder { color: var(--avc-text-muted); font-weight: 400; }

.avc-dirty-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--avc-amber);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.avc-project-name-actions {
    display: flex;
    gap: 6px;
}

.avc-save-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: var(--avc-radius-sm);
    border: 1px solid rgba(102,126,234,0.3);
    background: rgba(102,126,234,0.1);
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 700;
    transition: var(--avc-transition);
}
.avc-save-btn:hover { background: rgba(102,126,234,0.2); }
.avc-save-btn.success {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.1);
    color: #34d399;
}
.avc-save-btn.success:hover { background: rgba(16,185,129,0.2); }

/* File action buttons */
.avc-sidebar-file-actions {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-file-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: var(--avc-radius-sm);
    border: 1px solid var(--avc-border);
    background: var(--avc-card);
    color: var(--avc-text-dim);
    font-size: 11px;
    font-weight: 700;
    transition: var(--avc-transition);
    white-space: nowrap;
}
.avc-file-action-btn:hover {
    background: var(--avc-card-hover);
    color: var(--avc-text);
    border-color: var(--avc-border-strong);
}

/* Sidebar tab bar */
.avc-sidebar-tabbar {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    gap: 2px;
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
    overflow-x: auto;
}
.avc-sidebar-tabbar::-webkit-scrollbar { display: none; }

.avc-sidebar-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--avc-radius-sm);
    border: none;
    background: transparent;
    color: var(--avc-text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--avc-transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.avc-sidebar-tab:hover { background: var(--avc-card-hover); color: var(--avc-text); }
.avc-sidebar-tab.active {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-bottom: 2px solid var(--avc-primary);
}

.avc-sidebar-tab-label { font-size: 10px; }

/* Sidebar panels wrapper */
.avc-sidebar-panels-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Individual panel */
.avc-sidebar-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0 0;
}
.avc-sidebar-panel::-webkit-scrollbar { width: 3px; }

/* Panel section title */
.avc-panel-section-title {
    padding: 6px 12px 4px;
    font-size: 10px;
    color: var(--avc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Folder breadcrumb */
.avc-folder-breadcrumb {
    padding: 6px 12px;
    font-size: 11px;
    border-bottom: 1px solid var(--avc-border);
    margin-bottom: 4px;
    min-height: 32px;
    display: flex;
    align-items: center;
}

/* Project sub-tabs */
.avc-project-tabs {
    display: flex;
    border-bottom: 1px solid var(--avc-border);
    padding: 4px 8px 0;
    flex-shrink: 0;
    gap: 2px;
}

.avc-project-tab {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text-muted);
    cursor: pointer;
    border-radius: var(--avc-radius-sm) var(--avc-radius-sm) 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: var(--avc-transition);
}
.avc-project-tab:hover { color: var(--avc-text); }
.avc-project-tab.active {
    color: #a5b4fc;
    border-color: var(--avc-border);
    background: var(--avc-card);
    border-bottom-color: var(--avc-sidebar-bg);
}

.avc-project-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
}

/* Search box in search panel */
.avc-search-box-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--avc-input-bg);
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-search-box-icon { color: var(--avc-text-muted); font-size: 11px; }

.avc-search-box-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    color: var(--avc-text);
    font-family: inherit;
}
.avc-search-box-input::placeholder { color: var(--avc-text-muted); }

/* Git cards in git panel */
.avc-git-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius);
    padding: 12px 14px;
    transition: var(--avc-transition);
}
.avc-git-card:hover { background: var(--avc-card-hover); }

.avc-git-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avc-git-pages-banner {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(139,92,246,0.08));
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: var(--avc-radius);
    padding: 14px;
}

/* Status bar (bottom of sidebar) */
.avc-sidebar-status-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-top: 1px solid var(--avc-border);
    flex-shrink: 0;
    font-size: 10px;
    color: var(--avc-text-muted);
    background: rgba(0,0,0,0.15);
}

/* Sidebar footer */
.avc-sidebar-footer {
    border-top: 1px solid var(--avc-border);
    flex-shrink: 0;
    position: relative;
}

.avc-sidebar-user-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 8px;
    right: 8px;
    background: #1e293b;
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius-lg);
    padding: 8px;
    box-shadow: var(--avc-shadow-lg);
    display: none;
    z-index: 200;
}
.avc-sidebar-user-dropdown.open { display: block; }

.avc-sidebar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--avc-border);
    margin-bottom: 6px;
}

.avc-sidebar-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--avc-radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--avc-text-dim);
    transition: var(--avc-transition);
    cursor: pointer;
}
.avc-sidebar-dropdown-link:hover { background: var(--avc-card-hover); color: var(--avc-text); }
.avc-sidebar-dropdown-link i { width: 16px; text-align: center; color: var(--avc-text-muted); }

.avc-sidebar-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: none;
    border-radius: var(--avc-radius-sm);
    background: rgba(239,68,68,0.08);
    color: #f87171;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
}
.avc-sidebar-dropdown-logout:hover { background: rgba(239,68,68,0.15); }

.avc-sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--avc-transition);
}
.avc-sidebar-user-trigger:hover { background: var(--avc-card-hover); }

/* Sidebar collapse toggle */
.avc-sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #1e293b;
    border: 1px solid var(--avc-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 9px;
    color: var(--avc-text-muted);
    z-index: 200;
    transition: var(--avc-transition);
}
.avc-sidebar-toggle:hover { background: var(--avc-primary); color: #fff; border-color: var(--avc-primary); }

/* ══════════════════════════════════════════════════════════
   5. HEADER
══════════════════════════════════════════════════════════ */
#avcHeader {
    height: var(--avc-header-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: rgba(8,15,30,0.85);
    border-bottom: 1px solid var(--avc-border);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    z-index: 50;
}

/* Breadcrumb */
.avc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
    font-size: 12px;
    color: var(--avc-text-dim);
}
.avc-breadcrumb-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avc-breadcrumb-item.active { color: var(--avc-text); font-weight: 600; }

/* Header controls */
.avc-header-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* Header buttons */
.avc-header-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--avc-radius-sm);
    background: transparent;
    color: var(--avc-text-dim);
    font-size: 12px;
    font-weight: 600;
    transition: var(--avc-transition);
    white-space: nowrap;
    font-family: inherit;
}
.avc-header-btn:hover {
    background: var(--avc-card-hover);
    color: var(--avc-text);
    border-color: var(--avc-border);
}
.avc-header-btn.primary {
    border-color: rgba(102,126,234,0.3);
    background: rgba(102,126,234,0.1);
    color: #a5b4fc;
}
.avc-header-btn.primary:hover { background: rgba(102,126,234,0.2); }
.avc-header-btn.success {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.1);
    color: #34d399;
}
.avc-header-btn.success:hover { background: rgba(16,185,129,0.2); }
.avc-header-btn.active { color: #f59e0b; }
.avc-header-btn.active i.far { display: none; }
.avc-header-btn.active i.fas { display: inline-block; color: #f59e0b; }

.avc-header-btn-text { font-size: 11px; }

.avc-user-avatar-header { cursor: pointer; border-radius: 50%; overflow: hidden; }

.avc-ctx-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--avc-text-dim);
    cursor: pointer;
    transition: var(--avc-transition);
}
.avc-ctx-item:hover { background: rgba(255,255,255,0.05); color: var(--avc-text); }
.avc-ctx-item.danger { color: #f87171; }
.avc-ctx-item.danger:hover { background: rgba(239,68,68,0.1); }
.avc-ctx-item i { width: 16px; text-align: center; }

/* ══════════════════════════════════════════════════════════
   6. FILE TAB BAR
══════════════════════════════════════════════════════════ */
.avc-tab-bar-container {
    height: var(--avc-tabbar-h);
    display: flex;
    align-items: stretch;
    background: #080f1e;
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
    overflow: hidden;
}

.avc-tab-bar {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    min-width: 0;
}
.avc-tab-bar::-webkit-scrollbar { height: 2px; }
.avc-tab-bar::-webkit-scrollbar-thumb { background: var(--avc-primary); }

.avc-tab-bar-end {
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-left: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-tab-end-btn {
    background: transparent;
    border: none;
    color: var(--avc-text-muted);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: var(--avc-transition);
}
.avc-tab-end-btn:hover { background: var(--avc-card-hover); color: var(--avc-text); }

/* Tab items */
.avc-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    min-width: 100px;
    max-width: 200px;
    cursor: pointer;
    font-size: 12px;
    color: var(--avc-text-muted);
    background: transparent;
    border-right: 1px solid var(--avc-border);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.avc-tab:hover { background: var(--avc-card); color: var(--avc-text); }
.avc-tab.active {
    background: var(--avc-bg);
    color: var(--avc-text);
    border-top: 2px solid var(--avc-primary);
}

.avc-tab-lang { font-size: 12px; flex-shrink: 0; }
.avc-tab-name { flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.avc-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--avc-amber);
    flex-shrink: 0;
}

.avc-tab-close {
    font-size: 13px;
    opacity: 0;
    color: var(--avc-text-muted);
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    transition: opacity 0.15s;
}
.avc-tab:hover .avc-tab-close { opacity: 1; }
.avc-tab-close:hover { color: var(--avc-red) !important; opacity: 1 !important; }

/* ══════════════════════════════════════════════════════════
   7. READ-ONLY BANNER
══════════════════════════════════════════════════════════ */
.avc-readonly-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(239,68,68,0.08);
    border-bottom: 1px solid rgba(239,68,68,0.2);
    font-size: 12px;
    color: #f87171;
    font-weight: 600;
    flex-shrink: 0;
}
.avc-readonly-banner i { font-size: 13px; }
.avc-readonly-banner span { flex: 1; }

/* ══════════════════════════════════════════════════════════
   8. EDITOR AREA
══════════════════════════════════════════════════════════ */
.avc-editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

#avcMonacoContainer {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* Panel vertical resize handle */
.avc-resize-handle-v {
    height: 4px;
    background: transparent;
    cursor: row-resize;
    flex-shrink: 0;
    transition: background 0.15s;
    z-index: 10;
    position: relative;
}
.avc-resize-handle-v::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 40px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
}
.avc-resize-handle-v:hover { background: var(--avc-primary); }

/* ══════════════════════════════════════════════════════════
   9. BOTTOM PANEL
══════════════════════════════════════════════════════════ */
.avc-bottom-panel {
    height: var(--avc-panel-h);
    display: flex;
    flex-direction: column;
    background: #090e1d;
    border-top: 1px solid var(--avc-border);
    flex-shrink: 0;
    overflow: hidden;
}

/* Panel tab bar */
.avc-panel-tabbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    border-bottom: 1px solid var(--avc-border);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    padding-right: 8px;
}

.avc-panel-tabs-wrap {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow-x: auto;
    flex: 1;
}
.avc-panel-tabs-wrap::-webkit-scrollbar { display: none; }

.avc-panel-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text-muted);
    cursor: pointer;
    border-right: 1px solid var(--avc-border);
    transition: var(--avc-transition);
    white-space: nowrap;
}
.avc-panel-tab:hover { color: var(--avc-text); background: var(--avc-card); }
.avc-panel-tab.active {
    color: #a5b4fc;
    border-top: 2px solid var(--avc-primary);
    background: rgba(102,126,234,0.06);
}

.avc-panel-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.avc-panel-ctrl-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--avc-text-muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--avc-transition);
}
.avc-panel-ctrl-btn:hover { background: var(--avc-card-hover); color: var(--avc-text); }

/* Panel content */
.avc-panel-content {
    flex: 1;
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.avc-panel-content.active { display: flex; }

/* Output welcome screen */
.avc-output-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 24px;
    color: var(--avc-text-muted);
}
.avc-output-welcome kbd {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--avc-border);
    border-radius: 5px;
    font-size: 11px;
    font-family: 'Cascadia Code', monospace;
    color: #a5b4fc;
}

/* Commits list */
.avc-commits-list {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
}

/* ══════════════════════════════════════════════════════════
   10. OUTPUT / CONSOLE STYLES
══════════════════════════════════════════════════════════ */
.avc-output-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--avc-border);
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text-dim);
    flex-shrink: 0;
}

.avc-output-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--avc-border);
    background: var(--avc-card);
    color: var(--avc-text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
}
.avc-output-btn:hover { background: var(--avc-card-hover); color: var(--avc-text); }
.avc-output-btn.success {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.08);
    color: #34d399;
}

.avc-console {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.7;
    background: #05080f;
}

.avc-console-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.avc-console-line.error { background: rgba(239,68,68,0.04); }
.avc-console-line.warn  { background: rgba(245,158,11,0.04); }

.avc-console-icon { flex-shrink: 0; width: 14px; font-size: 10px; margin-top: 2px; }
.avc-console-text { flex: 1; white-space: pre-wrap; word-break: break-word; }

.avc-output-statusbar {
    padding: 4px 14px;
    font-size: 10px;
    color: var(--avc-text-muted);
    border-top: 1px solid var(--avc-border);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   11. STATUS BAR
══════════════════════════════════════════════════════════ */
.avc-status-bar {
    height: var(--avc-status-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(102,126,234,0.08);
    border-top: 1px solid rgba(102,126,234,0.15);
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
}

.avc-status-left,
.avc-status-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avc-status-item {
    color: #475569;
    padding: 0 4px;
    cursor: default;
    transition: color 0.15s;
}
.avc-status-item:hover { color: var(--avc-text-dim); }

.avc-status-sep { color: #334155; }

/* Status dot */
.avc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
    transition: var(--avc-transition);
}
.avc-status-dot.connected { background: var(--avc-green); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.avc-status-dot.syncing {
    background: var(--avc-amber);
    animation: avcPulse 1s ease infinite;
}
.avc-status-dot.error { background: var(--avc-red); }

@keyframes avcPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ══════════════════════════════════════════════════════════
   12. FILE TREE
══════════════════════════════════════════════════════════ */
.avc-tree-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    color: var(--avc-text-dim);
    border-radius: 6px;
    margin: 1px 4px;
    transition: background 0.1s;
    position: relative;
    user-select: none;
}
.avc-tree-item:hover { background: var(--avc-card-hover); color: var(--avc-text); }
.avc-tree-item.active {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    font-weight: 700;
}

.avc-tree-chevron {
    flex-shrink: 0;
    width: 12px;
    transition: transform 0.15s;
    color: var(--avc-text-muted);
}
.avc-tree-item.open .avc-tree-chevron { transform: rotate(90deg); }
.avc-tree-folder-icon { color: #f59e0b; flex-shrink: 0; }
.avc-tree-file-icon { flex-shrink: 0; width: 14px; text-align: center; }
.avc-tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avc-tree-modified {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--avc-amber);
    flex-shrink: 0;
}

.avc-tree-children { margin-left: 0; }

.avc-tree-actions {
    display: none;
    gap: 2px;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}
.avc-tree-item:hover .avc-tree-actions { display: flex; }

.avc-tree-action {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--avc-text-muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--avc-transition);
}
.avc-tree-action:hover { background: var(--avc-card); }
.avc-tree-action.delete:hover { color: var(--avc-red); }

/* ══════════════════════════════════════════════════════════
   13. NAV ITEMS (project list)
══════════════════════════════════════════════════════════ */
.avc-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--avc-radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--avc-text-dim);
    transition: var(--avc-transition);
    margin: 1px 4px;
    position: relative;
}
.avc-nav-item:hover { background: var(--avc-card-hover); color: var(--avc-text); }
.avc-nav-item.active {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    font-weight: 700;
}

.avc-tree-actions {
    display: none;
    gap: 2px;
    margin-left: auto;
}
.avc-nav-item:hover .avc-tree-actions { display: flex; }

/* ══════════════════════════════════════════════════════════
   14. FORMS, INPUTS, BUTTONS
══════════════════════════════════════════════════════════ */
.avc-form-group { margin-bottom: 14px; }
.avc-form-group:last-child { margin-bottom: 0; }

.avc-form-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--avc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 6px;
}

.avc-form-input,
.avc-form-select {
    width: 100%;
    padding: 9px 12px;
    background: var(--avc-input-bg);
    border: 1px solid var(--avc-input-border);
    border-radius: var(--avc-radius-sm);
    color: var(--avc-text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.avc-form-input:focus,
.avc-form-select:focus { border-color: var(--avc-primary); }

.avc-form-input::placeholder { color: var(--avc-text-muted); }
.avc-form-select option { background: #1e293b; }

/* Buttons */
.avc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--avc-radius-sm);
    border: 1px solid var(--avc-border);
    background: var(--avc-card);
    color: var(--avc-text-dim);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
    text-decoration: none;
}
.avc-btn:hover { background: var(--avc-card-hover); color: var(--avc-text); }

.avc-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
}
.avc-btn-primary:hover { opacity: 0.9; color: #fff; }

.avc-btn-secondary {
    background: rgba(255,255,255,0.05);
    border-color: var(--avc-border-strong);
    color: var(--avc-text-dim);
}
.avc-btn-secondary:hover { background: rgba(255,255,255,0.08); color: var(--avc-text); }

.avc-btn-sm { padding: 5px 11px; font-size: 11px; }

/* Toggle switch */
.avc-settings-toggles { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

.avc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--avc-text-dim);
    font-weight: 600;
    transition: var(--avc-transition);
}
.avc-toggle-row:hover { background: var(--avc-card-hover); color: var(--avc-text); }

.avc-toggle-wrap { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.avc-toggle-wrap input { opacity: 0; width: 0; height: 0; }

.avc-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 21px;
    transition: 0.3s;
    cursor: pointer;
}
.avc-toggle-slider::before {
    content: '';
    position: absolute;
    height: 15px;
    width: 15px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.avc-toggle-wrap input:checked + .avc-toggle-slider { background: var(--avc-primary); }
.avc-toggle-wrap input:checked + .avc-toggle-slider::before { transform: translateX(17px); }

/* ══════════════════════════════════════════════════════════
   15. MODALS
══════════════════════════════════════════════════════════ */
.avc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: avcFadeIn 0.2s ease;
}

@keyframes avcFadeIn { from { opacity: 0; } to { opacity: 1; } }

.avc-modal {
    background: #1a2235;
    border-radius: var(--avc-radius-lg);
    width: 480px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--avc-shadow-lg);
    border: 1px solid var(--avc-border-strong);
    animation: avcSlideUp 0.25s ease;
}

@keyframes avcSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.avc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--avc-border);
}

.avc-modal-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--avc-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.avc-modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--avc-border);
    color: var(--avc-text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: var(--avc-transition);
}
.avc-modal-close:hover { background: rgba(239,68,68,0.15); color: #f87171; }

.avc-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.avc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--avc-border);
}

/* Prompt overlay */
.avc-prompt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

/* ══════════════════════════════════════════════════════════
   16. EMPTY STATES & SKELETONS
══════════════════════════════════════════════════════════ */
.avc-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--avc-text-muted);
}
.avc-empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 14px;
    opacity: 0.2;
}
.avc-empty-title { font-size: 13px; font-weight: 700; color: var(--avc-text-dim); margin-bottom: 6px; }
.avc-empty-sub { font-size: 11px; color: var(--avc-text-muted); line-height: 1.7; }

/* Spinner */
.avc-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    font-size: 12px;
    color: var(--avc-text-muted);
}

/* ══════════════════════════════════════════════════════════
   17. LLM STUDIO
══════════════════════════════════════════════════════════ */
.avc-llm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--avc-border);
}

.avc-llm-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avc-llm-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.avc-llm-textarea {
    height: 70px;
    resize: vertical;
    font-family: 'Cascadia Code', monospace;
    font-size: 11px;
    line-height: 1.6;
}

.avc-dataset-drop {
    border: 2px dashed rgba(102,126,234,0.3);
    border-radius: var(--avc-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--avc-transition);
    background: rgba(102,126,234,0.03);
}
.avc-dataset-drop:hover,
.avc-dataset-drop.avc-drag-over {
    border-color: var(--avc-primary);
    background: var(--avc-primary-dim);
}

.avc-llm-train-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    border-radius: var(--avc-radius);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-family: inherit;
    transition: opacity 0.15s;
    box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.avc-llm-train-btn:hover { opacity: 0.88; }

/* Training progress */
.avc-training-progress-bar {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.avc-training-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #6d28d9);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.avc-training-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.avc-training-stat {
    text-align: center;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 8px 4px;
}

.avc-training-stat-val {
    font-size: 18px;
    font-weight: 900;
    color: #a78bfa;
    line-height: 1.2;
}

.avc-training-stat-lbl {
    font-size: 9px;
    color: var(--avc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 3px;
}

.avc-training-log {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    max-height: 120px;
    overflow-y: auto;
    font-family: 'Cascadia Code', monospace;
    font-size: 10px;
    line-height: 1.7;
    color: #64748b;
}

.avc-training-status {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(245,158,11,0.12);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.25);
}
.avc-training-status.running {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border-color: rgba(16,185,129,0.25);
    animation: avcPulse 1.5s ease infinite;
}

/* ══════════════════════════════════════════════════════════
   18. CONTEXT MENU
══════════════════════════════════════════════════════════ */
.avc-context-menu {
    background: #1e293b;
    border: 1px solid var(--avc-border-strong);
    border-radius: var(--avc-radius);
    padding: 6px;
    min-width: 180px;
    box-shadow: var(--avc-shadow-lg);
    z-index: 9999;
}

/* ══════════════════════════════════════════════════════════
   19. LIGHT MODE
══════════════════════════════════════════════════════════ */
body.avc-light-mode #avcSidebar { background: #f1f5f9; }
body.avc-light-mode #avcHeader { background: rgba(248,250,252,0.9); }
body.avc-light-mode .avc-tab-bar-container { background: #e2e8f0; }
body.avc-light-mode .avc-tab.active { background: #f8fafc; }
body.avc-light-mode .avc-bottom-panel { background: #f1f5f9; }
body.avc-light-mode .avc-console { background: #f8fafc; }
body.avc-light-mode .avc-modal { background: #fff; }
body.avc-light-mode #avcSidebarUserDropdown { background: #fff; }
body.avc-light-mode .avc-sidebar-user-dropdown { background: #fff; }

/* ══════════════════════════════════════════════════════════
   20. RESPONSIVE / MOBILE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #avcSidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: var(--avc-shadow-lg);
        width: 280px !important;
        min-width: 280px !important;
    }
    #avcSidebar.mobile-open { transform: translateX(0); }
    #avcSidebar.collapsed { transform: translateX(-100%); }

    .avc-mobile-close-btn { display: flex; }
    #avcSidebarResizer { display: none; }

    #avcMobileMenuBtn { display: flex !important; }

    .avc-header-btn-text,
    .avc-header-btn span:not(i) { display: none; }

    .avc-llm-config-grid { grid-template-columns: 1fr; }
    .avc-training-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .avc-header-controls > :nth-child(n+8):not(#avcBtnFavorite) { display: none; }
}

/* ══════════════════════════════════════════════════════════
   21. ANIMATIONS
══════════════════════════════════════════════════════════ */
@keyframes avcToastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes avcToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(12px); }
}

/* Monaco editor override — no border-radius */
.monaco-editor, .monaco-editor .overflow-guard { border-radius: 0 !important; }

/* ══════════════════════════════════════════════════════════
   22. WORKSPACE LAYOUT (Editor Column + Right Panel)
══════════════════════════════════════════════════════════ */
#avcWorkspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

#avcEditorColumn {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* ══════════════════════════════════════════════════════════
   23. HEADER EXTRAS
══════════════════════════════════════════════════════════ */
.avc-header-sep {
    width: 1px;
    height: 20px;
    background: var(--avc-border-strong);
    flex-shrink: 0;
    margin: 0 2px;
}

/* Status bar pills */
.avc-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--avc-border);
    background: rgba(255,255,255,0.03);
    color: var(--avc-text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
}
.avc-status-pill:hover {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-color: rgba(102,126,234,0.3);
}

/* ══════════════════════════════════════════════════════════
   24. BOTTOM PANEL EXTRAS
══════════════════════════════════════════════════════════ */

/* Panel tab badge */
.avc-panel-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    background: rgba(102,126,234,0.2);
    color: #a5b4fc;
}
.avc-panel-tab-badge.avc-badge-warn {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

/* Run button in panel controls */
.avc-panel-run-btn {
    background: rgba(16,185,129,0.1) !important;
    border: 1px solid rgba(16,185,129,0.25) !important;
    color: #34d399 !important;
    width: auto !important;
    padding: 0 10px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    gap: 5px;
}
.avc-panel-run-btn:hover {
    background: rgba(16,185,129,0.2) !important;
    color: #6ee7b7 !important;
}

/* JS Console toolbar */
.avc-console-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
    gap: 10px;
}

.avc-console-repl-input {
    flex: 1;
    background: var(--avc-input-bg);
    border: 1px solid var(--avc-input-border);
    border-radius: var(--avc-radius-sm);
    color: var(--avc-text);
    font-size: 11px;
    font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
    padding: 5px 10px;
    outline: none;
    min-width: 0;
    transition: border-color 0.15s;
}
.avc-console-repl-input:focus { border-color: var(--avc-primary); }
.avc-console-repl-input::placeholder { color: var(--avc-text-muted); }

/* ══════════════════════════════════════════════════════════
   25. RIGHT PANEL
══════════════════════════════════════════════════════════ */
#avcRightPanel,
.avc-right-panel {
    width: 440px;
    min-width: 300px;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    background: #0a1020;
    border-left: 1px solid var(--avc-border);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Right panel resize handle */
.avc-right-resizer {
    cursor: col-resize;
    flex-shrink: 0;
}

/* Right panel tab bar */
.avc-right-panel-tabbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
    padding-right: 6px;
}

.avc-right-panel-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.avc-right-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text-muted);
    border: none;
    border-right: 1px solid var(--avc-border);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.avc-right-tab:hover {
    background: var(--avc-card);
    color: var(--avc-text);
}
.avc-right-tab.active {
    background: rgba(102,126,234,0.07);
    color: #a5b4fc;
    border-top: 2px solid var(--avc-primary);
}

.avc-right-panel-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.avc-close-right-btn:hover {
    background: rgba(239,68,68,0.15) !important;
    color: #f87171 !important;
}

/* Right panel content */
.avc-right-content {
    flex: 1;
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-height: 0;
}
.avc-right-content.active {
    display: flex;
}

/* ══════════════════════════════════════════════════════════
   26. PREVIEW TAB
══════════════════════════════════════════════════════════ */
.avc-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-preview-url-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--avc-input-bg);
    border: 1px solid var(--avc-input-border);
    border-radius: var(--avc-radius-sm);
    padding: 5px 10px;
    min-width: 0;
    overflow: hidden;
}

.avc-preview-device-btns {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.avc-device-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--avc-border);
    background: transparent;
    color: var(--avc-text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
}
.avc-device-btn:hover {
    background: var(--avc-card-hover);
    color: var(--avc-text);
    border-color: var(--avc-border-strong);
}
.avc-device-btn.active {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-color: rgba(102,126,234,0.35);
}

.avc-preview-frame-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #fff;
}

.avc-preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avc-bg);
    z-index: 1;
}

.avc-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
    transition: width 0.25s ease;
}

/* ══════════════════════════════════════════════════════════
   27. PAGES TAB
══════════════════════════════════════════════════════════ */
.avc-pages-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--avc-border);
}

.avc-pages-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
    border: 1px solid rgba(102,126,234,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #a5b4fc;
    flex-shrink: 0;
}

.avc-pages-steps {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avc-pages-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius);
    padding: 14px;
    transition: var(--avc-transition);
}
.avc-pages-step:hover {
    background: var(--avc-card-hover);
    border-color: var(--avc-border-strong);
}

.avc-pages-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--avc-primary), #764ba2);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

.avc-pages-step-body { flex: 1; min-width: 0; }

.avc-pages-step-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--avc-text);
    margin-bottom: 5px;
}

.avc-pages-step-desc {
    font-size: 11px;
    color: var(--avc-text-dim);
    line-height: 1.7;
}

.avc-pages-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--avc-text-dim);
    text-decoration: none;
    transition: var(--avc-transition);
}
.avc-pages-link:hover {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-color: rgba(102,126,234,0.3);
}
.avc-pages-link i:first-child { color: var(--avc-primary); width: 14px; text-align: center; }

/* ══════════════════════════════════════════════════════════
   28. INFO TAB
══════════════════════════════════════════════════════════ */
.avc-info-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.avc-info-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius);
    padding: 12px 14px;
    transition: var(--avc-transition);
}
.avc-info-stat:hover { background: var(--avc-card-hover); }

.avc-info-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.avc-info-stat-val {
    font-size: 18px;
    font-weight: 900;
    color: var(--avc-text);
    line-height: 1.1;
}

.avc-info-stat-lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--avc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.avc-info-file-card {
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius);
    overflow: hidden;
}

.avc-lang-breakdown {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.avc-lang-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.avc-lang-bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--avc-text-dim);
}

.avc-lang-bar-track {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    overflow: hidden;
}

.avc-lang-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* ══════════════════════════════════════════════════════════
   29. COMMITS SIDEBAR PANEL
══════════════════════════════════════════════════════════ */
.avc-commits-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--avc-border);
}

.avc-commit-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    font-size: 10px;
    font-weight: 700;
    color: var(--avc-text-dim);
}

.avc-commits-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--avc-border);
    flex-shrink: 0;
}

.avc-commits-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: var(--avc-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--avc-text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--avc-transition);
}
.avc-commits-filter-btn:hover {
    background: var(--avc-card-hover);
    color: var(--avc-text);
}
.avc-commits-filter-btn.active {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-color: rgba(102,126,234,0.3);
}

.avc-commits-list-sidebar {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.avc-commit-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius-sm);
    cursor: pointer;
    transition: var(--avc-transition);
}
.avc-commit-item:hover {
    background: var(--avc-card-hover);
    border-color: var(--avc-border-strong);
}

.avc-commit-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}
.avc-commit-item-icon.success {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}
.avc-commit-item-icon.error {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

.avc-commit-item-body { flex: 1; min-width: 0; }

.avc-commit-item-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.avc-commit-item-meta {
    font-size: 10px;
    color: var(--avc-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ══════════════════════════════════════════════════════════
   30. SHORTCUTS MODAL
══════════════════════════════════════════════════════════ */
.avc-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--avc-border);
    gap: 10px;
}
.avc-shortcut-row:last-child { border-bottom: none; }

.avc-shortcut-desc {
    font-size: 11px;
    color: var(--avc-text-dim);
    font-weight: 600;
}

.avc-shortcut-keys {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

kbd {
    display: inline-block;
    padding: 2px 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: 10px;
    font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #a5b4fc;
    white-space: nowrap;
}
body.avc-light-mode kbd {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.15);
    color: #667eea;
}

/* ══════════════════════════════════════════════════════════
   31. SHARE MODAL
══════════════════════════════════════════════════════════ */
.avc-radio-card {
    display: block;
    background: var(--avc-card);
    border: 2px solid var(--avc-border);
    border-radius: var(--avc-radius);
    cursor: pointer;
    transition: var(--avc-transition);
    overflow: hidden;
}
.avc-radio-card:hover {
    background: var(--avc-card-hover);
    border-color: var(--avc-border-strong);
}
.avc-radio-card:has(input:checked) {
    border-color: var(--avc-primary);
    background: var(--avc-primary-dim);
}

/* Git import status message */
#avcGitImportStatus {
    padding: 10px 14px;
    border-radius: var(--avc-radius-sm);
    font-size: 12px;
    font-weight: 600;
    display: none;
}
#avcGitImportStatus.success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
    display: block;
}
#avcGitImportStatus.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    display: block;
}
#avcGitImportStatus.loading {
    background: rgba(102,126,234,0.1);
    border: 1px solid rgba(102,126,234,0.3);
    color: #a5b4fc;
    display: block;
}

/* Collaborators list */
#avcShareCollaboratorsList {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ══════════════════════════════════════════════════════════
   32. NEW FILE MODAL
══════════════════════════════════════════════════════════ */
.avc-preset-badge {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--avc-border);
    background: var(--avc-card);
    color: var(--avc-text-muted);
    font-size: 10px;
    font-weight: 700;
    font-family: 'Cascadia Code', monospace;
    cursor: pointer;
    transition: var(--avc-transition);
}
.avc-preset-badge:hover {
    background: var(--avc-primary-dim);
    color: #a5b4fc;
    border-color: rgba(102,126,234,0.4);
}

/* ══════════════════════════════════════════════════════════
   33. TEMPLATE GRID
══════════════════════════════════════════════════════════ */
.avc-template-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--avc-text-dim);
    transition: var(--avc-transition);
    margin-bottom: 5px;
}
.avc-template-item:hover {
    background: var(--avc-card-hover);
    color: var(--avc-text);
    border-color: var(--avc-border-strong);
    transform: translateX(2px);
}

.avc-template-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: rgba(102,126,234,0.1);
}

.avc-template-info { flex: 1; min-width: 0; }

.avc-template-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--avc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avc-template-lang {
    font-size: 9px;
    color: var(--avc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════
   34. MODEL GRID (LLM Studio)
══════════════════════════════════════════════════════════ */
.avc-model-card {
    background: var(--avc-card);
    border: 1px solid var(--avc-border);
    border-radius: var(--avc-radius);
    padding: 14px;
    margin-bottom: 10px;
    transition: var(--avc-transition);
}
.avc-model-card:hover {
    background: var(--avc-card-hover);
    border-color: rgba(139,92,246,0.3);
}

.avc-model-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.avc-model-card-name {
    font-size: 12px;
    font-weight: 800;
    color: #a78bfa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avc-model-card-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.25);
    flex-shrink: 0;
}

.avc-model-card-meta {
    font-size: 10px;
    color: var(--avc-text-muted);
    line-height: 1.7;
    margin-bottom: 10px;
}

.avc-model-card-actions {
    display: flex;
    gap: 6px;
}

/* ══════════════════════════════════════════════════════════
   35. LIGHT MODE EXTRAS
══════════════════════════════════════════════════════════ */
body.avc-light-mode #avcRightPanel,
body.avc-light-mode .avc-right-panel {
    background: #f8fafc;
    border-left-color: rgba(0,0,0,0.08);
}
body.avc-light-mode .avc-right-panel-tabbar {
    background: #f1f5f9;
}
body.avc-light-mode .avc-right-tab {
    color: #64748b;
}
body.avc-light-mode .avc-right-tab:hover {
    background: rgba(0,0,0,0.04);
    color: #1e293b;
}
body.avc-light-mode .avc-right-tab.active {
    background: rgba(102,126,234,0.06);
    color: #667eea;
}
body.avc-light-mode .avc-preview-frame-wrap { background: #e2e8f0; }
body.avc-light-mode .avc-preview-placeholder { background: #f8fafc; }
body.avc-light-mode .avc-pages-step { background: #fff; }
body.avc-light-mode .avc-pages-link { background: #fff; }
body.avc-light-mode .avc-commit-item { background: #fff; }
body.avc-light-mode .avc-template-item { background: #fff; }
body.avc-light-mode .avc-model-card { background: #fff; }
body.avc-light-mode .avc-radio-card { background: #fff; }
body.avc-light-mode .avc-console-toolbar { background: #f1f5f9; }
body.avc-light-mode .avc-console-repl-input { background: #fff; border-color: rgba(0,0,0,0.12); color: #1e293b; }

/* ══════════════════════════════════════════════════════════
   36. RESPONSIVE EXTRAS
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #avcRightPanel,
    .avc-right-panel {
        position: fixed;
        right: 0;
        top: var(--avc-header-h);
        bottom: var(--avc-status-h);
        width: 100vw !important;
        min-width: 100vw !important;
        z-index: 500;
        border-left: none;
        box-shadow: var(--avc-shadow-lg);
    }
    #avcRightPanelResizer { display: none !important; }

    .avc-llm-config-grid { grid-template-columns: 1fr; }
    .avc-info-stats-grid { grid-template-columns: 1fr 1fr; }
    .avc-pages-steps { padding: 10px 10px; }

    .avc-right-tab span { display: none; }
    .avc-right-tab { padding: 0 12px; }

    .avc-status-pill { display: none; }
}

@media (max-width: 480px) {
    .avc-info-stats-grid { grid-template-columns: 1fr 1fr; }
    .avc-training-stats { grid-template-columns: repeat(2, 1fr); }
    #avcShortcutsModal .avc-modal > .avc-modal-body > div {
        grid-template-columns: 1fr !important;
    }
}

/* ══════════════════════════════════════════════════════════
   37. TREE FOLDER TOGGLE FIX
   Problème : .avc-tree-children n'a aucune règle show/hide
══════════════════════════════════════════════════════════ */

/* Enfants cachés par défaut */
.avc-tree-children {
    display: none;
    margin-left: 14px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

/* Affichés quand le parent a la classe .open */
.avc-tree-item.open + .avc-tree-children {
    display: block;
}

/* Rotation de la flèche */
.avc-tree-item .avc-tree-chevron {
    transition: transform 0.18s ease;
    flex-shrink: 0;
    width: 12px;
    color: var(--avc-text-muted);
    font-size: 9px;
}

.avc-tree-item.open > .avc-tree-chevron,
.avc-tree-item.open .avc-tree-chevron {
    transform: rotate(90deg);
}

/* Indentation visuelle des niveaux imbriqués */
.avc-tree-children .avc-tree-children {
    margin-left: 12px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

/* Hover sur les items de l'arborescence projet (nav-items) */
.avc-nav-item.folder {
    cursor: pointer;
}

.avc-nav-item.folder .avc-tree-chevron {
    transition: transform 0.18s ease;
    font-size: 9px;
    color: var(--avc-text-muted);
    flex-shrink: 0;
}

.avc-nav-item.folder.open .avc-tree-chevron {
    transform: rotate(90deg);
}

.avc-nav-item.folder + .avc-tree-children {
    display: none;
    margin-left: 14px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.avc-nav-item.folder.open + .avc-tree-children {
    display: block;
}

/* ══════════════════════════════════════════════════════════
   38. AI PANEL — panneau bas
══════════════════════════════════════════════════════════ */
#avcAIPanel {
    flex: 1;
    overflow: hidden;
    display: none;
    flex-direction: column;
    background: #090e1d;
    height: 100%;
}

#avcAIPanel.active,
.avc-panel-content[data-panel="ai"].active {
    display: flex;
}

/* Chat messages area */
#avcAIChatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Chat input */
#avcAIChatInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 11px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}

#avcAIChatInput:focus {
    border-color: var(--avc-primary);
}

/* Bouton AI dans la tab bar */
.avc-panel-tab[data-panel="ai"] i {
    color: #a78bfa;
}

.avc-panel-tab[data-panel="ai"].active {
    color: #a78bfa;
    border-top-color: #a78bfa;
    background: rgba(167, 139, 250, 0.06);
}

/* ══════════════════════════════════════════════════════════
   39. USER AVATAR HEADER — fix affichage photo
══════════════════════════════════════════════════════════ */
#avcAvatarInitial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(102, 126, 234, 0.3);
    transition: border-color 0.2s;
}

#avcAvatarInitial:hover {
    border-color: rgba(102, 126, 234, 0.7);
}

#avcAvatarInitial img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Photo avatar sidebar */
#avcUserAvatarImg,
#avcDropdownPhoto {
    border: 2px solid rgba(102, 126, 234, 0.25);
    transition: border-color 0.2s;
}

#avcUserAvatarImg:hover {
    border-color: rgba(102, 126, 234, 0.6);
}

/* Plan badge couleurs */
#avcUserPlan {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════
   40. STATUS DOTS — fix double déclaration d'ID
══════════════════════════════════════════════════════════ */
.avc-status-dot-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}