/* ========================================
   KI-Lernplattform – Complete Styles
   ======================================== */

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e1e3a;
    --bg-input: #252547;
    --text-primary: #e0e0ff;
    --text-secondary: #a0a0c0;
    --text-muted: #6a6a8a;
    --accent: #667eea;
    --accent-hover: #7c94ff;
    --accent-glow: rgba(102, 126, 234, 0.3);
    --success: #48bb78;
    --warning: #ecc94b;
    --danger: #fc8181;
    --info: #63b3ed;
    --border: #2d2d5e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}
.btn svg, .btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 20px var(--accent-glow); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #38a169; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e53e3e; }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}
.btn-icon:hover { color: var(--text-primary); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(252, 129, 129, 0.1);
    border-radius: var(--radius-sm);
}

/* ========== NAVIGATION ========== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}
.nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 30px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    white-space: nowrap;
}
.brand-icon { font-size: 24px; }
.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.nav-links a.active { color: var(--accent); }
.nav-links a svg { width: 18px; height: 18px; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}
#user-display {
    font-size: 14px;
    color: var(--text-secondary);
}
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========== SCREENS ========== */
.screen {
    display: none;
    min-height: 100vh;
    padding-top: var(--nav-height);
}
.screen.active { display: block; }
.hidden { display: none !important; }

/* ========== AUTH SCREEN ========== */
#auth-screen {
    display: none;
    min-height: 100vh;
    padding-top: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    align-items: center;
    justify-content: center;
}
#auth-screen.active {
    display: flex;
}
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.auth-logo { font-size: 48px; display: block; margin-bottom: 12px; }
.auth-header h1 { font-size: 24px; margin-bottom: 8px; }
.auth-header p { color: var(--text-secondary); font-size: 14px; }
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: var(--font);
}
.auth-tab.active {
    background: var(--accent);
    color: white;
}
.auth-demo {
    margin-top: 20px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-demo code {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ========== HOME SCREEN ========== */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
.home-hero {
    text-align: center;
    margin-bottom: 40px;
}
.home-hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.home-hero p { color: var(--text-secondary); font-size: 16px; }

.ai-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}
.ai-type-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.ai-type-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--accent-glow);
}
.ai-type-card .card-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}
.ai-type-card h3 { margin-bottom: 8px; font-size: 18px; }
.ai-type-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.ai-type-card .card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.my-projects h2 { margin-bottom: 20px; }
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.project-card:hover { border-color: var(--accent); }
.project-card h4 { margin-bottom: 6px; }
.project-card .project-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.project-card .project-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 8px;
}

/* ========== IDE ========== */
.ide-container {
    height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
}
.ide-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ide-tabs { display: flex; gap: 2px; overflow-x: auto; }
.ide-tab {
    padding: 6px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: var(--transition);
}
.ide-tab.active { background: var(--bg-card); color: var(--accent); }
.ide-tab-add {
    padding: 6px 12px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}
.ide-tab-add:hover { color: var(--accent); border-color: var(--accent); }
.ide-actions { display: flex; gap: 8px; }
.ide-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.ide-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
}
.ide-sidebar h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ide-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ide-editor-wrap {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}
.line-numbers {
    width: 50px;
    background: var(--bg-secondary);
    padding: 16px 8px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    overflow: hidden;
    user-select: none;
    flex-shrink: 0;
}
#code-editor {
    flex: 1;
    background: var(--bg-primary);
    color: #e0e0ff;
    border: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    tab-size: 4;
    overflow: auto;
}
#code-editor::placeholder { color: var(--text-muted); }
.ide-console {
    height: 200px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}
#console-output {
    flex: 1;
    padding: 12px 16px;
    background: #0a0a1a;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    color: var(--success);
    white-space: pre-wrap;
}

/* File Explorer Items */
.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.file-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.file-item.active { color: var(--accent); background: var(--bg-tertiary); }
.file-icon { font-size: 14px; }

/* Snippet Items */
.snippet-item {
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.snippet-item:hover { background: var(--bg-input); color: var(--accent); }
.snippet-item .snippet-name { font-weight: 600; display: block; margin-bottom: 2px; }
.snippet-item .snippet-desc { font-size: 11px; color: var(--text-muted); }

/* ========== DRAG & DROP ========== */
.dd-container {
    height: calc(100vh - var(--nav-height));
    display: flex;
}
.dd-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
}
.dd-sidebar h3 { margin-bottom: 12px; }
.dd-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 16px;
}
.dd-search input:focus { outline: none; border-color: var(--accent); }
.dd-category { margin-bottom: 16px; }
.dd-category-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
}
.dd-module {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: grab;
    transition: var(--transition);
    font-size: 13px;
}
.dd-module:hover { border-color: var(--accent); }
.dd-module:active { cursor: grabbing; opacity: 0.8; }
.dd-module .module-color {
    width: 8px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}
.dd-module .module-info { flex: 1; }
.dd-module .module-name { font-weight: 600; display: block; }
.dd-module .module-desc { font-size: 11px; color: var(--text-muted); }

.dd-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dd-canvas-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.dd-canvas {
    flex: 1;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    position: relative;
    overflow: auto;
    min-height: 400px;
}
.dd-canvas-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
}
.dd-canvas-hint svg { width: 48px; height: 48px; margin-bottom: 12px; }
.dd-canvas-hint p { font-size: 14px; }

/* Canvas Nodes */
.canvas-node {
    position: absolute;
    min-width: 200px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: move;
    user-select: none;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}
.canvas-node.selected { border-color: var(--accent); }
.canvas-node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 600;
    font-size: 13px;
}
.canvas-node-body {
    padding: 12px 14px;
    font-size: 12px;
}
.canvas-node-port {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    position: absolute;
    cursor: crosshair;
}
.canvas-node-port.input { left: -6px; top: 50%; }
.canvas-node-port.output { right: -6px; top: 50%; }

.dd-properties {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
}
.dd-properties h3 { margin-bottom: 16px; }
.dd-prop-hint { color: var(--text-muted); font-size: 13px; }

/* ========== TUTORIALS ========== */
.tutorial-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}
.tutorial-list h1 { margin-bottom: 8px; }
.tutorial-list > p { color: var(--text-secondary); margin-bottom: 30px; }
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.tutorial-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
}
.tutorial-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tutorial-card .tut-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.tutorial-card h3 { margin-bottom: 8px; font-size: 16px; }
.tutorial-card p { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.tutorial-card .tut-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
.tutorial-card .tut-difficulty {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.tut-difficulty.beginner { background: rgba(72, 187, 120, 0.2); color: var(--success); }
.tut-difficulty.intermediate { background: rgba(236, 201, 75, 0.2); color: var(--warning); }
.tut-difficulty.advanced { background: rgba(252, 129, 129, 0.2); color: var(--danger); }

.tutorial-viewer { }
.tutorial-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.tutorial-progress { display: flex; align-items: center; gap: 12px; }
.progress-bar {
    width: 200px;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 4px;
    transition: width 0.3s;
}
.tutorial-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    min-height: 400px;
    line-height: 1.7;
}
.tutorial-content h2 { margin-bottom: 16px; color: var(--accent); }
.tutorial-content p { margin-bottom: 14px; color: var(--text-secondary); }
.tutorial-content pre {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    margin: 16px 0;
    border: 1px solid var(--border);
}
.tutorial-content code {
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.tutorial-content .interactive-task {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 20px 0;
}
.tutorial-content .interactive-task h4 { color: var(--accent); margin-bottom: 8px; }
.tutorial-nav-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

/* ========== ADMIN ========== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}
.admin-container h1 { margin-bottom: 24px; }
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.admin-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.admin-tab.active { background: var(--accent); color: white; }
.admin-tab:hover:not(.active) { color: var(--text-primary); }

.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}
.admin-toolbar input {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    flex: 1;
    max-width: 300px;
}
.admin-toolbar input:focus { outline: none; border-color: var(--accent); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}
.admin-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.admin-table td { border-top: 1px solid var(--border); }
.admin-table tr:hover td { background: var(--bg-tertiary); }
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.role-badge.admin { background: rgba(102, 126, 234, 0.2); color: var(--accent); }
.role-badge.user { background: rgba(72, 187, 120, 0.2); color: var(--success); }

.admin-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Settings */
.settings-group { max-width: 600px; }
.settings-group h3 { margin-bottom: 20px; }
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.setting-item label { font-size: 14px; }
.setting-item input[type="text"],
.setting-item input[type="number"] {
    width: 200px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    text-align: right;
}
.setting-item input:focus { outline: none; border-color: var(--accent); }

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-input);
    border-radius: 26px;
    transition: var(--transition);
}
.slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ========== TOAST ========== */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--info); color: white; }
.toast.warning { background: var(--warning); color: #1a1a2e; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ========== LOADING ========== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 35, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    gap: 16px;
}
.loading-overlay.hidden { display: none; }
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== UTILITIES ========== */
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        z-index: 999;
    }
    .mobile-menu-toggle { display: block; }
    .nav-user { display: none; }

    .ide-sidebar { display: none; }
    .ide-toolbar { flex-wrap: wrap; }
    .ide-actions { width: 100%; justify-content: flex-end; }

    .dd-container { flex-direction: column; }
    .dd-sidebar { width: 100%; height: auto;
