/* =========================================================
   AVPL — Styles de l'espace d'administration
   ========================================================= */

.admin-body { background: var(--gris-clair); }

.admin-wrap { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.admin-sidebar {
    width: 260px; flex: none;
    background: linear-gradient(180deg, var(--vert-fonce), #0b421f);
    color: #fff; display: flex; flex-direction: column;
    padding: 22px 18px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.admin-brand img { height: 40px; border-radius: 6px; background:#fff; padding:2px; }
.admin-brand strong { display:block; font-size: 1rem; }
.admin-brand span { font-size: .72rem; color: #b7cabd; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a { color: #d6e6da; padding: 11px 14px; border-radius: 10px; font-size: .92rem; font-weight: 600; transition: var(--transition); }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.12); color: #fff; }

.admin-user-box { display: flex; align-items: center; gap: 10px; padding: 14px 8px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 14px; margin-bottom: 12px; }
.admin-user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--rouge); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.admin-user-box strong { display: block; font-size: .85rem; }
.admin-user-box span { font-size: .72rem; color: #b7cabd; }

/* ---------- Main ---------- */
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; padding: 18px 30px; box-shadow: 0 2px 10px rgba(0,0,0,.04); display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 50; }
.admin-topbar h1 { margin: 0; font-size: 1.25rem; }
.admin-burger { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; }
.admin-content { padding: 28px 30px 60px; }

/* ---------- Cartes stats ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: var(--ombre); border-left: 5px solid var(--vert); }
.stat-card.rouge { border-left-color: var(--rouge); }
.stat-card.jaune { border-left-color: var(--jaune); }
.stat-card.gris { border-left-color: var(--gris); }
.stat-card .n { font-size: 2rem; font-weight: 800; color: var(--vert-fonce); }
.stat-card .l { color: var(--gris); font-size: .85rem; }

/* ---------- Panneaux ---------- */
.panel { background: #fff; border-radius: 14px; box-shadow: var(--ombre); padding: 26px; margin-bottom: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }

/* ---------- Tableaux ---------- */
table.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.admin-table th { text-align: left; padding: 12px 14px; background: var(--gris-clair); color: var(--gris-fonce); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.admin-table td { padding: 13px 14px; border-bottom: 1px solid #eef1ee; vertical-align: middle; }
table.admin-table tr:hover td { background: #fafcfb; }
.table-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-vert { background: var(--vert-clair); color: var(--vert-fonce); }
.badge-rouge { background: #fdeceb; color: var(--rouge-fonce); }
.badge-gris { background: #eef1ee; color: var(--gris); }
.table-actions { display: flex; gap: 8px; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--gris-clair); }
.icon-btn:hover { background: var(--vert-clair); }
.icon-btn.danger:hover { background: #fdeceb; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(120deg, var(--vert-fonce), var(--vert)); padding: 20px; }
.login-box { background: #fff; border-radius: 18px; padding: 42px 36px; width: 100%; max-width: 420px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.login-box .logo-row { text-align: center; margin-bottom: 22px; }
.login-box .logo-row img { height: 60px; margin: 0 auto 10px; border-radius: 8px; }
.login-box h1 { text-align: center; font-size: 1.3rem; }
.login-box p.sub { text-align: center; color: var(--gris); margin-bottom: 26px; font-size: .9rem; }

@media (max-width: 900px) {
    .admin-sidebar { position: fixed; left: -280px; z-index: 300; transition: var(--transition); box-shadow: 10px 0 30px rgba(0,0,0,.2); }
    .admin-sidebar.open { left: 0; }
    .admin-burger { display: block; }
    .stat-cards { grid-template-columns: repeat(2,1fr); }
    .admin-content { padding: 20px 16px 40px; }
    table.admin-table { display: block; overflow-x: auto; }
}
