/* ===== ADMIN PANEL CSS ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 12px; }
.login-header h1 { font-size: 22px; font-weight: 700; color: #0f172a; }
.login-header p { color: #64748b; font-size: 14px; }
.back-link { display: block; text-align: center; margin-top: 16px; color: #64748b; font-size: 13px; text-decoration: none; }
.back-link:hover { color: #1a56db; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 14px; font-family: inherit; color: #1e293b; background: #fff; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* BUTTONS */
.btn-primary { background: #1a56db; color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.2s; }
.btn-primary:hover { background: #1e40af; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; font-family: inherit; border: none; }
.btn-outline { background: transparent; border: 1px solid #e2e8f0; color: #475569; }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* LAYOUT */
.admin-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: 250px; background: #0f172a; color: #e2e8f0; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #1e293b; }
.sidebar-logo { width: 36px; height: 36px; object-fit: contain; }
.sidebar-header span { font-weight: 600; font-size: 15px; }
.sidebar-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-footer { padding: 12px; border-top: 1px solid #1e293b; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; color: #94a3b8; text-decoration: none; font-size: 14px; transition: all 0.2s; cursor: pointer; }
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: #1a56db; color: #fff; }
.nav-item.logout { color: #f87171; }
.nav-item.logout:hover { background: #451a1a; }

/* MAIN */
.admin-main { flex: 1; margin-left: 250px; padding: 0; }
.admin-header { padding: 20px 32px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; }
.admin-header h2 { font-size: 20px; font-weight: 700; }
.admin-user { color: #64748b; font-size: 13px; }

/* TABS */
.tab-content { display: none; padding: 24px 32px; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 24px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px 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: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-blue .stat-icon { background: #dbeafe; color: #3b82f6; }
.stat-green .stat-icon { background: #d1fae5; color: #10b981; }
.stat-orange .stat-icon { background: #fef3c7; color: #f59e0b; }
.stat-purple .stat-icon { background: #ede9fe; color: #8b5cf6; }
.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-label { font-size: 13px; color: #64748b; font-weight: 500; }
.stat-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ACTIVITY BARS */
.activity-bar-container { margin-top: 16px; }
.activity-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.activity-label { width: 100px; font-size: 13px; color: #475569; font-weight: 500; }
.activity-bar-bg { flex: 1; height: 24px; background: #f1f5f9; border-radius: 12px; overflow: hidden; }
.activity-bar { height: 100%; border-radius: 12px; transition: width 1s ease; min-width: 4px; }
.activity-value { width: 50px; text-align: right; font-size: 13px; font-weight: 600; color: #0f172a; }

/* CARDS */
.card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.text-muted { color: #94a3b8; font-size: 13px; }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-green { background: #d1fae5; color: #059669; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* TABLE */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 10px 12px; font-size: 12px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0; }
.admin-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.admin-table tr:hover td { background: #f8fafc; }
.actions-cell { display: flex; gap: 6px; }

/* BANNER FORM */
.banner-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; margin-bottom: 20px; }

/* NOTIFICATIONS */
.notif-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.notif { padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; }
.notif.success { background: #059669; }
.notif.error { background: #dc2626; }
.notif.info { background: #3b82f6; }
.notif.fade-out { opacity: 0; transition: opacity 0.3s; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* MSG */
.msg { font-size: 13px; padding: 8px; border-radius: 6px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header span, .nav-item span, .sidebar-nav a > *:not(svg) { display: none; }
    .sidebar-header { justify-content: center; }
    .admin-main { margin-left: 60px; }
    .tab-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* CONFIRM POPUP (remplace confirm()) */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.confirm-box p {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
