* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    margin: 0;
}

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

.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: rgba(255,255,255,0.5);
}

.sidebar-nav-link.active {
    background: rgba(255,255,255,0.2);
    border-left-color: white;
    font-weight: 600;
}

.sidebar-nav-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
}

.sidebar-nav-title {
    font-size: 15px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

.container {
    max-width: 1600px;
    width: 100%;
    margin: 30px auto;
    padding: 20px;
    flex: 1;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .sidebar-nav-title {
        font-size: 13px;
    }
    
    .sidebar-nav-icon {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar-nav-item {
        flex-shrink: 0;
    }
    
    .sidebar-nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 15px;
    }
    
    .sidebar-nav-link.active {
        border-left: none;
        border-bottom-color: white;
    }
}

.welcome {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.welcome h1 {
    color: #333;
    margin-bottom: 10px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    background: #f8f9ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.upload-label {
    display: block;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.overview-sections {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.overview-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.metric-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    min-width: 0;
}

.metric-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.metric-sub {
    font-size: 12px;
    color: #999;
}

/* Legacy nav-grid styles - kept for backward compatibility but not used in sidebar */
.nav-grid {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

#uploadResult {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
}

#uploadResult.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#uploadResult.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
