/* ============================================================
   ArtGreenTech — Mise en page partagée des espaces (donateur)
   Sidebar + contenu, KPI, panneaux, tableaux. Chargé après
   style.css. Réutilisé par toutes les sous-pages de l'espace.
   ============================================================ */
body { background: var(--bg-alt); }

.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 65px); }
@media (max-width: 900px) { .dash-layout { grid-template-columns: 1fr; } }

.sidebar-nav { background: #fff; border-right: 1px solid var(--line); padding: 28px 16px; }
.sidebar-nav h4 { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 24px 12px 8px; font-weight: 600; }
.sidebar-nav h4:first-child { margin-top: 0; }
.sidebar-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 7px; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; margin-bottom: 1px; transition: all 0.1s; }
.sidebar-nav a:hover { background: var(--bg-alt); color: var(--ink); }
.sidebar-nav a.active { background: var(--primary-light); color: var(--primary-deep); font-weight: 600; }
.sidebar-nav a .ico { width: 18px; text-align: center; color: var(--muted); font-size: 0.95rem; flex-shrink: 0; }
.sidebar-nav a.active .ico { color: var(--primary); }
.sidebar-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; font-weight: 700; }

.dash-main { padding: 40px 48px; }
@media (max-width: 900px) { .dash-main { padding: 28px 20px; } }

.dash-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; gap: 20px; flex-wrap: wrap; }
.dash-header h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.025em; }
.dash-header .sub { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.kpi-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.025em; margin-top: 8px; margin-bottom: 6px; }
.kpi-delta { font-size: 0.82rem; color: var(--success); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi-sub { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.015em; }
.panel-head a { font-size: 0.85rem; color: var(--primary); text-decoration: none; font-weight: 600; }
.panel-head a:hover { text-decoration: underline; }

/* Tableaux d'espace */
.e-table { width: 100%; border-collapse: collapse; }
.e-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.e-table td { padding: 14px 10px; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; vertical-align: middle; }
.e-table tr:last-child td { border-bottom: none; }
.e-proj { display: flex; align-items: center; gap: 10px; }
.e-proj img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.e-proj strong { font-weight: 600; color: var(--ink); }
.e-amount { font-weight: 700; color: var(--ink); white-space: nowrap; }
.e-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.e-link:hover { text-decoration: underline; }

/* Formulaire d'espace (profil, paramètres) */
.e-field { margin-bottom: 18px; }
.e-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.e-field input, .e-field select, .e-field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 0.95rem; font-family: inherit; background: #fff; }
.e-field textarea { min-height: 90px; resize: vertical; }
.e-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .e-row { grid-template-columns: 1fr; } }
.e-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.user-chip { display: flex; gap: 10px; align-items: center; background: #fff; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; }
.user-chip span { font-size: 0.85rem; font-weight: 600; }

/* Lignes de réglages (toggles) */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.set-row:last-child { border-bottom: none; }
.set-row .st { font-weight: 600; font-size: 0.95rem; }
.set-row .ss { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background 0.15s; cursor: pointer; }
.switch .track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }
