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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.hidden { display: none; }

.loading { text-align: center; padding: 40px 20px; }
.spinner {
    border: 4px solid rgba(37,99,235,0.3);
    border-top-color: #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
    color: #ef4444;
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 100%;
    margin: 100px auto;
    text-align: center;
}
.login-container h1 {
    color: #2563eb;
    margin-bottom: 30px;
    font-size: 2rem;
}
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}
.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: #2563eb;
}
.btn-login {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-login:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.admin-app {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    padding: 20px 0;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 2px solid rgba(255,255,255,0.2); margin-bottom: 20px; }
.sidebar-header h2 { font-size: 1.5rem; font-weight: 700; }
.sidebar-nav { padding: 0 10px; }
.nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; transform: translateX(5px); }
.nav-item.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }
.nav-item.logout { margin-top: 30px; background: rgba(239,68,68,0.2); color: white; }
.nav-item.logout:hover { background: rgba(239,68,68,0.3); transform: translateX(0); }
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}
.main-header h1 { font-size: 2rem; color: #2563eb; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.stat-icon { font-size: 3rem; }
.stat-info { flex: 1; }
.stat-label { color: #64748b; font-size: 0.9rem; margin-bottom: 5px; }
.stat-value { font-size: 2rem; font-weight: 700; color: #1e293b; }

@media (max-width: 768px) {
    .admin-app { flex-direction: column; }
    .sidebar { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
}