@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body { font-family: 'Inter', sans-serif; background: #f0f2f5; color: #333; }

/* ===== SHELL ===== */
.admin-shell { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.admin-sidebar {
    width: 240px; min-height: 100vh;
    background: #1e1e2e;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; box-shadow: 4px 0 16px rgba(0,0,0,0.2);
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon { font-size: 24px; }
.brand-name { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -0.5px; }

.sidebar-nav { display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none; font-size: 15px; font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(123,47,247,0.3); color: #c084fc; }
.nav-icon { font-size: 18px; }

/* ===== CONTENT AREA ===== */
.admin-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }

.admin-topbar {
    background: #fff; padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #e8eaed;
    position: sticky; top: 0; z-index: 50;
}

.page-title { font-size: 18px; font-weight: 600; color: #1a1a2e; }

.admin-badge {
    background: linear-gradient(135deg, #7b2ff7, #2fbbf7);
    color: #fff; font-size: 12px; font-weight: 700;
    padding: 4px 12px; border-radius: 20px; letter-spacing: 1px;
}

.admin-main { padding: 28px; flex: 1; }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px; margin-bottom: 32px;
}

.stat-card {
    background: #fff; border-radius: 16px;
    padding: 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 30px; font-weight: 700; color: #1a1a2e; line-height: 1; }
.stat-label { font-size: 13px; color: #8a8ea8; margin-top: 4px; }

/* ===== TABLE ===== */
.admin-section { background: #fff; border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-section h3 { font-size: 18px; font-weight: 600; color: #1a1a2e; }

.search-input {
    padding: 8px 16px; border-radius: 10px; border: 1px solid #e0e0e0;
    font-size: 14px; width: 260px; outline: none; font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: #7b2ff7; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { padding: 12px 16px; text-align: left; font-weight: 600; color: #8a8ea8; border-bottom: 2px solid #f0f2f5; background: #fafbfc; }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid #f0f2f5; color: #333; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafbfc; }

.user-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-admin { background: rgba(123,47,247,0.15); color: #7b2ff7; }
.badge-user { background: rgba(100,116,139,0.1); color: #64748b; }

.role-select {
    padding: 4px 8px; border-radius: 8px; border: 1px solid #e0e0e0;
    font-size: 13px; font-family: 'Inter', sans-serif; cursor: pointer;
}

.btn-danger-sm {
    padding: 6px 14px; border-radius: 8px;
    background: #fef2f2; color: #dc2626; border: none;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-danger-sm:hover { background: #dc2626; color: #fff; }

.table-footer { margin-top: 12px; font-size: 13px; color: #8a8ea8; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 14px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 500; z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}
.toast-success { background: #d1fae5; color: #065f46; }
.toast-error { background: #fee2e2; color: #991b1b; }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
