:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid var(--glass-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.sidebar-brand i { font-size: 1.8rem; }

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li { margin-bottom: 0.25rem; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

.sidebar-nav a.active { border-left: 3px solid var(--accent); }

.sidebar-footer { padding: 1rem; }

/* Main content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.main-content.full-width { margin-left: 0; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }

/* Glass panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.glass-input,
.glass-input:focus {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
}

.glass-input:focus {
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.glass-alert {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
}

.glass-table { --bs-table-bg: transparent; }
.glass-table th { border-color: var(--glass-border); color: var(--text-muted); font-weight: 500; }
.glass-table td { border-color: var(--glass-border); vertical-align: middle; }

.glass-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Stat cards */
.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-info h3 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.stat-info span { color: var(--text-muted); font-size: 0.85rem; }

/* Status grid */
.status-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.status-item .label { min-width: 100px; color: var(--text-muted); font-size: 0.9rem; }
.status-item .progress { flex: 1; }

/* Buttons */
.btn-glow {
    background: var(--accent);
    border: none;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-glow:hover { background: #4f46e5; box-shadow: 0 0 30px var(--accent-glow); }

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-icon { font-size: 3rem; color: var(--accent); }

/* Upload drop zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone i { font-size: 3rem; color: var(--accent); display: block; margin-bottom: 1rem; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.preview-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.progress-stats { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }

/* Training logs */
.log-panel {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.log-content {
    padding: 1rem;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a5f3fc;
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; min-height: auto; }
    .main-content { margin-left: 0; padding: 1rem; }
    .app-wrapper { flex-direction: column; }
}
