:root {
    --primary: #5e747f;
    --primary-dark: #4a5d66;
    --primary-light: #7a9aa8;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    line-height: 1.6;
}

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

.app-header {
    background: var(--primary); color: var(--white);
    padding: 0 24px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-md); position: sticky; top: 0; z-index: 100;
}
.app-header .logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.app-header .logo span { opacity: 0.7; font-weight: 400; margin-left: 8px; font-size: 14px; }
.app-header nav { display: flex; gap: 12px; align-items: center; }
.app-header nav a {
    color: var(--white); text-decoration: none; padding: 6px 14px;
    border-radius: var(--radius); font-size: 14px; opacity: 0.85; transition: all 0.2s;
}
.app-header nav a:hover { background: rgba(255,255,255,0.15); opacity: 1; }
.app-header .user-info { font-size: 14px; opacity: 0.8; margin-left: 12px; margin-right: 12px; }

.main-content { flex: 1; padding: 32px; max-width: 1400px; margin: 0 auto; width: 100%; }

.login-container {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.login-box {
    background: var(--white); padding: 48px 40px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
}
.login-box h1 { text-align: center; color: var(--primary); margin-bottom: 8px; font-size: 28px; }
.login-box .subtitle { text-align: center; color: var(--gray-500); margin-bottom: 32px; font-size: 14px; }

.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-200);
}
.card-header h2 { font-size: 20px; color: var(--gray-900); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--gray-700); }
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: 15px; transition: border-color 0.2s, box-shadow 0.2s; background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: none;
    border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.project-card {
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    padding: 32px; text-align: center; transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer; text-decoration: none; color: inherit; border: 2px solid transparent;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.project-card .project-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: var(--white);
    display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 16px;
}
.project-card h3 { font-size: 18px; margin-bottom: 8px; }
.project-card p { color: var(--gray-500); font-size: 14px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.data-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); position: sticky; top: 0; z-index: 10; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.alert { padding: 14px 20px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

.upload-area {
    border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
    padding: 48px; text-align: center; transition: all 0.2s; cursor: pointer;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: #eff6ff; }
.upload-area .upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-area p { color: var(--gray-500); }

.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid var(--gray-300); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.8);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; flex-direction: column; gap: 12px;
}
.loading-overlay.active { display: flex; }

.table-container { overflow-x: auto; max-height: 70vh; overflow-y: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }

@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .app-header { padding: 0 16px; }
    .app-header nav { gap: 4px; }
    .app-header nav a { padding: 4px 8px; font-size: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px; }
    .btn-group { flex-direction: column; }
}