/* ============================================
   Business sur Cèze — Style Principal
   Mobile-first | Thème clair/sombre
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ── VARIABLES THÈME ── */
:root {
  --bg: #F7F5F0;
  --bg2: #EEEAE2;
  --surface: #FFFFFF;
  --surface2: #F2EFE8;
  --border: #DDD8CE;
  --text: #1C1A16;
  --text1: #1C1A16;
  --text2: #6B6357;
  --text3: #A09890;
  --accent: #2C2820;
  --accent2: #4A4238;
  --accent-light: #EDE8DE;
  --reco: #4A6741;
  --reco-light: #E2EDE0;
  --tat: #3A5275;
  --tat-light: #DDE6F0;
  --biz: #8B6914;
  --biz-light: #F5EDCF;
  --evt: #6B4A2A;
  --evt-light: #F0E4D4;
  --success: #4A6741;
  --success-bg: #E2EDE0;
  --error: #B8220A;
  --error-bg: #FDDDD8;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --top-h: 60px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg: #141210;
  --bg2: #1C1A16;
  --surface: #201E1A;
  --surface2: #272420;
  --border: #322E28;
  --text: #F0EDE6;
  --text1: #F0EDE6;
  --text2: #9C9488;
  --text3: #6A6258;
  --accent: #D4C4A0;
  --accent2: #E8D8B4;
  --accent-light: #2A2418;
  --reco: #6A9B60;
  --reco-light: #162410;
  --tat: #5A80B0;
  --tat-light: #101C2C;
  --biz: #C89A30;
  --biz-light: #281E04;
  --evt: #B07848;
  --evt-light: #221408;
  --success: #6A9B60;
  --success-bg: #162410;
  --error: #E83020;
  --error-bg: #2C0C08;
  --shadow: 0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  background: var(--accent-light);
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.topbar-title {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar-greet {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}
.back-btn:active { background: var(--surface2); }
.back-btn svg { width: 22px; height: 22px; }

/* ── NOTIFICATIONS ── */
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border: none; background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.notif-btn:active { background: var(--surface2); }
.notif-btn svg { width: 22px; height: 22px; }
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

.notif-panel {
  position: fixed;
  top: var(--top-h); right: 0;
  width: min(320px, 100vw);
  max-height: calc(100dvh - var(--top-h));
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.notif-panel.open { transform: translateX(0); }

.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.notif-overlay.open { opacity: 1; pointer-events: all; }

.notif-panel-header {
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
}
.notif-panel-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
}
.notif-panel-header button {
  background: none; border: none;
  color: var(--accent); font-size: 13px;
  cursor: pointer; font-weight: 500;
}

.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.notif-item.unread { background: var(--accent-light); }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px; flex-shrink: 0;
}
.notif-item:not(.unread) .notif-dot { background: var(--border); }
.notif-item p { font-size: 13px; line-height: 1.4; }
.notif-item time { font-size: 11px; color: var(--text3); }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text2); font-size: 14px; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 38px; height: 38px;
  border: none; background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.theme-toggle:active { background: var(--surface2); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ── MAIN CONTENT ── */
.main-content {
  padding-top: calc(var(--top-h) + 16px);
  padding-bottom: calc(var(--nav-h) + 24px);
  padding-left: 16px;
  padding-right: 16px;
}
.form-content { padding-top: calc(var(--top-h) + 60px); }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.stat-card:active { transform: scale(0.97); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; }
.reco-icon { background: var(--reco-light); color: var(--reco); }
.tat-icon  { background: var(--tat-light); color: var(--tat); }
.biz-icon  { background: var(--biz-light); color: var(--biz); }
.evt-icon  { background: var(--evt-light); color: var(--evt); }

.stat-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-label { font-size: 10px; color: var(--text2); margin-top: 2px; white-space: normal; line-height: 1.3; word-break: break-word; }
.stat-sublabel { font-size: 10px; color: var(--text3); font-weight: 500; margin-top: 2px; }

/* ── STATS GRID 6 (page statistiques admin) ── */
.stats-grid-6 {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
  /* Mobile : 2 colonnes × 3 lignes */
  grid-template-columns: repeat(2, 1fr);
}
.stats-grid-6 .stat-num {
  font-size: clamp(0.95rem, 4vw, 1.1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-grid-6 .stat-card {
  min-width: 0;
  padding: 12px 10px;
}

/* ── SECTION BLOCKS ── */
.section-block { margin-bottom: 20px; }
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 10px;
}

/* ── EVENT CARDS ── */
.event-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.event-date-badge {
  width: 48px;
  display: flex; flex-direction: column; align-items: center;
  background: var(--accent-light);
  border-radius: 10px;
  padding: 6px 4px;
  flex-shrink: 0;
}
.event-day { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; }
.event-month { font-size: 10px; font-weight: 600; color: var(--accent); text-transform: uppercase; }
.event-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.event-info strong { font-size: 14px; font-weight: 600; }
.event-info span { font-size: 12px; color: var(--text2); }
.event-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--evt-light);
  color: var(--evt);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── ACTIVITY ── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.activity-icon svg { width: 17px; height: 17px; }
.type-reco  { background: var(--reco-light); color: var(--reco); }
.type-tat   { background: var(--tat-light);  color: var(--tat); }
.type-merci { background: var(--biz-light);  color: var(--biz); }
.type-biz   { background: var(--biz-light);  color: var(--biz); }
.type-evt  { background: var(--evt-light); color: var(--evt); }
.activity-content { flex: 1; min-width: 0; }
.activity-content p { font-size: 13px; color: var(--text1); margin: 0 0 2px; line-height: 1.4; }
.activity-content p strong { font-weight: 600; }
.activity-detail { display: block; font-size: 12px; color: var(--text2); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-content time { font-size: 11px; color: var(--text3); }

.empty-state {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.admin-link {
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}
.admin-link:active { background: var(--border); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  touch-action: none;
  overscroll-behavior: none;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  flex: 1;
}
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; }
.nav-item span { font-size: 10px; font-weight: 500; }
.nav-item.active { color: var(--accent); }
.nav-item:active { color: var(--accent); }

.bottom-spacer { height: 20px; }

/* ── TABS ── */
.saisie-tabs {
  position: fixed;
  top: var(--top-h);
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  z-index: 99;
  overflow-x: auto;
  scrollbar-width: none;
}
.saisie-tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* ── FORMS ── */
.bsc-form { margin-top: 0; }
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 24px 28px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 16px;
}

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.req { color: var(--accent); }

.field-group input,
.field-group select,
.field-group textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif !important;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--surface);
}
.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--text3); }
.field-group textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field-group small { font-size: 11px; color: var(--text3); }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:active { background: var(--accent2); transform: scale(0.98); }
.btn-full { width: 100%; }

.btn-small {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-success { background: var(--success-bg); color: var(--success); }

/* ── ALERTS ── */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border-left: 3px solid currentColor;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }

/* ── HISTORY CARDS ── */
.history-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.hcard-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.hcard-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.hcard-badge.reco { background: var(--reco-light); color: var(--reco); }
.hcard-badge.tat  { background: var(--tat-light); color: var(--tat); }
.hcard-badge.biz  { background: var(--biz-light); color: var(--biz); }
.hcard-badge.evt  { background: var(--evt-light); color: var(--evt); }
.hcard-header time { font-size: 12px; color: var(--text3); }
.history-card p { font-size: 14px; line-height: 1.5; }
.hcard-desc { color: var(--text2); font-size: 13px; margin-top: 4px; }
.hcard-meta { font-size: 12px; color: var(--text2); margin-top: 4px; }
.hcard-meta.amount { color: var(--biz); font-weight: 700; font-size: 14px; }

/* ── PROFIL PAGE ── */
.profil-hero {
  text-align: center;
  padding: 24px 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.profil-big-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin-bottom: 12px;
}
.profil-big-initials {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-size: 30px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  border: 3px solid var(--accent);
}
.profil-hero h2 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; }
.profil-hero p { font-size: 14px; color: var(--text2); margin-top: 4px; }
.role-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 8px;
}
.role-badge.admin { background: var(--accent-light); color: var(--accent); }
.role-badge.membre { background: var(--reco-light); color: var(--reco); }

.profil-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pstat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pstat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.pstat-icon svg { width: 15px; height: 15px; }
.pstat-reco .pstat-icon { background: var(--reco-light); color: var(--reco); }
.pstat-tat  .pstat-icon { background: var(--tat-light);  color: var(--tat); }
.pstat-biz  .pstat-icon { background: var(--biz-light);  color: var(--biz); }
.pstat-evt  .pstat-icon { background: var(--evt-light);  color: var(--evt); }
.pstat-num {
  font-family: 'Syne', sans-serif;
  font-size: 18px; font-weight: 800;
  display: block; line-height: 1;
  color: var(--text1);
}
.pstat-label {
  font-size: 10px; color: var(--text2); line-height: 1.2;
  display: block;
}
/* legacy compat */
.pstat span:not(.pstat-num) { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; display: block; line-height: 1; color: var(--text1); }
.pstat small:not(.pstat-label) { font-size: 10px; color: var(--text2); line-height: 1.2; }

/* ── PROFIL FORM ── */
.profil-form { display: flex; flex-direction: column; gap: 12px; }

.profil-photo-section {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.profil-photo-wrap {
  position: relative; flex-shrink: 0;
  width: 72px; height: 72px;
}
.profil-photo-edit {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
  display: block;
}
.profil-photo-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border);
}
.profil-photo-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; cursor: pointer;
}
.profil-photo-overlay svg { width: 20px; height: 20px; color: #fff; stroke: #fff; }
.profil-photo-wrap:hover .profil-photo-overlay { opacity: 1; }
.profil-photo-info { flex: 1; min-width: 0; }
.profil-photo-hint { font-size: 13px; font-weight: 600; display: block; margin-bottom: 2px; }
.profil-photo-info small { font-size: 11px; color: var(--text3); }

.profil-section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.profil-section-head {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--text2); text-transform: uppercase; letter-spacing: .08em;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

/* ── ADMIN ── */
.admin-member-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-member-card.inactive { opacity: 0.5; }
.admin-member-info {
  display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0;
}
.admin-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-avatar-initials {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-member-info > div {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.admin-member-info strong { font-size: 14px; font-weight: 600; }
.admin-member-info span { font-size: 12px; color: var(--text2); }
.admin-member-info small { font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; }

/* ── LOGIN PAGE ── */
.login-page { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.login-container {
  width: 100%; max-width: 380px;
  padding: 24px 20px;
  margin: auto;
}
.login-logo { text-align: center; margin-bottom: 40px; }
.logo-emblem {
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px;
  background: var(--surface);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-size: 18px; font-weight: 800; letter-spacing: 0.05em;
  border-radius: 50%;
  border: 2px solid var(--accent);
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}
.login-logo h1 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.login-logo p { font-size: 12px; color: var(--text3); margin-top: 6px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; }
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ── TRANSITIONS THÈME ── */
body, .topbar, .bottom-nav, .surface, .form-card, .stat-card { transition: background 0.25s, border-color 0.25s, color 0.25s; }

.btn-agenda-link {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-agenda-link:hover { border-color: var(--evt); color: var(--evt); background: var(--evt-light); }
.btn-participer {
  width: 34px; height: 34px;
  min-width: 34px; min-height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-sizing: border-box;
  font-size: 0;
  line-height: 1;
}
.btn-participer svg {
  width: 16px; height: 16px;
  display: block; flex-shrink: 0;
  pointer-events: none;
}
.btn-participer:hover {
  border-color: var(--reco);
  color: var(--reco);
  background: var(--reco-light);
}
.btn-participer.active {
  background: var(--reco);
  border-color: var(--reco);
  color: #fff;
}
.btn-participer:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Fix centrage onglets historique */
.saisie-tabs .tab { min-width: 0; }

/* ── ANNUAIRE ── */
.search-form { margin-bottom: 16px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.search-box svg { width: 18px; height: 18px; color: var(--text3); flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; background: none;
  font-size: 15px; font-family: 'DM Sans', sans-serif;
  color: var(--text); outline: none;
}
.search-clear { color: var(--text3); text-decoration: none; font-size: 14px; }

.membre-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.membre-avatar-wrap { position: relative; flex-shrink: 0; }
.membre-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.membre-avatar-initials {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.membre-admin-dot { position: absolute; bottom: 0; right: 0; font-size: 12px; }
.membre-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.membre-info > strong { font-size: 14px; font-weight: 600; }
.membre-info > span  { font-size: 12px; color: var(--text2); }
.membre-societe { font-size: 12px; color: var(--accent); font-weight: 500; }
.profil-societe { font-size: 14px; color: var(--accent); font-weight: 500; margin-top: 2px; }

/* Ligne nom · société */
.membre-nom-ligne {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
}
.membre-nom-ligne strong {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text1);
}
.membre-sep {
  font-size: 13px;
  color: var(--text3);
  flex-shrink: 0;
  margin: 0 6px;
  line-height: 1;
  user-select: none;
  display: inline-block;
}
.membre-societe-inline {
  font-size: 12px;
  color: var(--text3);
  font-weight: 400;
  white-space: nowrap;
}
.membre-metier {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.3;
}
.membre-contact {
  font-size: 12px; color: var(--text2);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 1px;
  transition: color .15s;
}
.membre-contact:hover { color: var(--accent); }
.membre-contact svg { flex-shrink: 0; opacity: .6; }
.profil-nom-ligne { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.profil-nom-ligne h2 { margin: 0; }
.profil-societe-inline { font-size: 14px; color: var(--text3); font-weight: 400; }

/* Upload photo widget */
.photo-upload-wrap { display: flex; align-items: center; gap: 16px; }
.photo-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.photo-preview-placeholder { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.photo-upload-actions { display: flex; flex-direction: column; gap: 6px; }
.btn-upload { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text1); transition: border-color .2s; }
.btn-upload:hover { border-color: var(--accent); color: var(--accent); }
.membre-mini-stats { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.membre-mini-stats span {
  font-size: 12px; color: var(--text2);
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 500;
}
.membre-mini-stats span svg { flex-shrink: 0; }
.membre-mini-stats .ms-reco { color: var(--reco); }
.membre-mini-stats .ms-tat  { color: var(--tat); }
.membre-mini-stats .ms-biz  { color: var(--biz); }
.membre-msg-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0;
  transition: background 0.2s;
}
.membre-msg-btn:active { background: var(--accent); color: #fff; }
.membre-msg-btn svg { width: 18px; height: 18px; }

/* ── STATS ── */
.stats-summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--text2);
}
.top-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.top-rank {
  font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
  color: var(--text3); width: 24px; text-align: center; flex-shrink: 0;
}
.top-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.top-avatar-initials {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.top-info { flex: 1; min-width: 0; }
.top-info strong { font-size: 14px; font-weight: 600; display: block; }
.top-info span { font-size: 12px; color: var(--text2); }
.top-score {
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; flex-shrink: 0;
}
.top-score.reco { background: var(--reco-light); color: var(--reco); }
.top-score.tat  { background: var(--tat-light); color: var(--tat); }
.top-score.biz  { background: var(--biz-light); color: var(--biz); }
.top-score-double { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.top-ca { font-size: 11px; font-weight: 700; color: var(--biz); }

/* ── ACCORDÉON SAISIE ── */
.nav-accordion { width: 100%; display: contents; }
.nav-accordion-trigger { background: none; border: none; cursor: pointer; width: 100%; text-align: left; }
.accordion-arrow { width: 14px !important; height: 14px !important; margin-left: auto; transition: transform 0.2s; flex-shrink: 0; display: none; }
.nav-sub { display: none; }
.nav-sub-item { display: none; text-decoration: none; }
.nav-mobile-only { display: flex; }
.nav-desktop-only { display: none; }
.sidebar-user { display: none; }

/* ═══════════════════════════════════════
   DESKTOP ≥ 768px
   ═══════════════════════════════════════ */
@media (min-width: 768px) {

  html, body { height: 100%; overflow: hidden; }
  body { max-width: 100%; box-shadow: none; background: var(--bg2); }

  .topbar {
    left: 260px; right: 0; transform: none;
    max-width: none; width: auto;
    padding: 0 24px;
    z-index: 100;
  }

  .topbar::before {
    content: 'BSC';
    position: fixed; top: 0; left: 0;
    width: 260px; height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800; color: var(--accent);
    letter-spacing: 0.18em;
    display: flex; align-items: center; justify-content: center;
    z-index: 200; pointer-events: none;
  }

  .bottom-nav {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px; height: 100%; max-width: 260px;
    border-top: none; border-right: 1px solid var(--border);
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    padding: 0 10px 16px; gap: 2px;
    box-shadow: 2px 0 16px rgba(0,0,0,0.06);
    transform: none; overflow-y: auto; overflow-x: hidden;
    z-index: 150; background: var(--surface);
  }

  .sidebar-user { display: block; padding: 76px 4px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .sidebar-user-inner { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 8px; border-radius: var(--radius-sm); transition: background 0.15s; }
  .sidebar-user-inner:hover { background: var(--surface2); }
  .sidebar-user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex-shrink: 0; }
  .sidebar-user-initials { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid var(--accent); }
  .sidebar-user-info { min-width: 0; }
  .sidebar-user-info strong { font-size: 13px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-user-info span { font-size: 11px; color: var(--text2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 10px; flex: none; width: 100%; color: var(--text2); }
  .nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  .nav-item span { font-size: 14px; font-weight: 500; }
  .nav-item.active { background: var(--accent-light); color: var(--accent); }
  .nav-item:hover:not(.active) { background: var(--surface2); color: var(--text); }

  .nav-accordion { display: block; width: 100%; }
  .accordion-arrow { display: block !important; }
  .nav-sub { display: none; flex-direction: column; gap: 1px; padding: 4px 0 6px 14px; margin-left: 14px; border-left: 2px solid var(--border); }
  .nav-accordion.open .nav-sub { display: flex; }
  .nav-accordion.open .accordion-arrow { transform: rotate(180deg); }
  .nav-sub-item {
    display: block; text-align: left;
    padding: 7px 12px; border-radius: 7px;
    font-size: 12px; font-weight: 500;
    color: var(--text3);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
  }
  .nav-sub-item:hover { background: var(--surface2); color: var(--text); }
  .nav-sub-item.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }

  .nav-logout { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; color: var(--text3) !important; }
  .nav-mobile-only { display: none !important; }
  .nav-desktop-only { display: flex; }

  .main-content {
    position: fixed; top: 60px; left: 260px; right: 0; bottom: 0;
    overflow-y: auto; overflow-x: hidden;
    padding: 32px 40px 40px; margin: 0;
  }
  .form-content { padding-top: 56px; }

  .saisie-tabs { position: fixed; top: 60px; left: 260px; right: 0; width: auto; max-width: none; transform: none; padding: 0 40px; z-index: 99; }

  /* Grilles desktop */
  .stats-grid { grid-template-columns: repeat(4,1fr); gap: 16px; }
  .stat-num { font-size: 15px; }

  /* Stats-grid-6 desktop : 3 colonnes × 2 lignes, cartes larges */
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stats-grid-6 .stat-num { font-size: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stats-grid-6 .stat-label { font-size: 11px; white-space: normal; }
  .stats-grid-6 .stat-card { padding: 18px 16px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .stats-grid-6 .stat-icon { width: 44px; height: 44px; }
  .stats-grid-6 .stat-icon svg { width: 22px; height: 22px; }
  .stats-grid-6 .stat-info { width: 100%; }

  .home-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .membres-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .membres-list .membre-card { margin-bottom: 0; }
  .admin-two-cols { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }
  .bsc-form { max-width: 680px; margin: 0 auto; }
  .form-card { max-width: 680px; margin: 0 auto; }
  .profil-stats { grid-template-columns: repeat(5,1fr); }
  .profil-hero { max-width: 560px; margin: 0 auto 16px; }
  .back-btn { display: none; }
  .bottom-spacer { height: 0; }
  .section-block { margin-bottom: 28px; }
  .top-card { padding: 14px 18px; }
}

@media (min-width: 1200px) {
  .main-content { padding: 32px 56px 40px; }
  .stats-grid { gap: 20px; }
  .home-two-cols { gap: 32px; }
}

/* Force police globale sur tous les éléments de formulaire */
input, select, textarea, button {
  font-family: 'DM Sans', sans-serif !important;
}

/* ── LOGS ACTIVITÉ ── */
.log-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.log-item:last-child { border-bottom: none; }
.log-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.log-icon svg { width: 16px; height: 16px; }
.log-icon.type-reco  { background: var(--reco-light); color: var(--reco); }
.log-icon.type-tat   { background: var(--tat-light);  color: var(--tat); }
.log-icon.type-merci { background: var(--biz-light);  color: var(--biz); }
.log-icon.type-event { background: var(--evt-light);  color: var(--evt); }
.log-content { flex: 1; min-width: 0; }
.log-content strong { font-size: 13px; font-weight: 600; display: block; }
.log-content p { font-size: 12px; color: var(--text2); margin-top: 1px; }
.log-item time { font-size: 11px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }

/* ── NOTIF ITEM cliquable ── */
.notif-item { transition: background 0.15s; }
.notif-item[style*="pointer"]:hover { background: var(--surface2); }

/* ═══════════════════════
   MOBILE NAV — 5 items
   ═══════════════════════ */
@media (max-width: 767px) {
  .bottom-nav { display: none !important; }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  html { height: 100%; height: 100dvh; }
  body {
    height: 100%; height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    position: relative;
    flex-shrink: 0;
    left: auto; right: auto; top: auto;
    transform: none;
    max-width: 100%;
    width: 100%;
  }

  .main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    position: relative;
    min-height: 0;
  }
  .form-content { padding-top: 56px; }

  .mobile-nav { flex-shrink: 0; position: relative; }
  .bottom-spacer { display: none; }

  .saisie-tabs {
    position: fixed;
    top: var(--top-h);
    left: 0; right: 0;
    width: 100%;
    transform: none;
    z-index: 99;
  }

  /* Stats-grid-6 mobile : 2 colonnes × 3 lignes */
  .stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stats-grid-6 .stat-card {
    padding: 10px 8px;
    gap: 7px;
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-grid-6 .stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
  }
  .stats-grid-6 .stat-icon svg {
    width: 14px;
    height: 14px;
  }
  .stats-grid-6 .stat-num {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
  }
  .stats-grid-6 .stat-label {
    font-size: 10px;
    white-space: normal;
    line-height: 1.2;
    word-break: break-word;
  }
}

@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: flex; flex-direction: column; }
  .more-menu, .more-menu-overlay { display: none !important; }
}

/* Barre mobile */
.mobile-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  touch-action: none;
  overscroll-behavior: none;
}
.mob-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  text-decoration: none; color: var(--text3);
  padding: 6px 4px; flex: 1;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.mob-item svg { width: 22px; height: 22px; stroke: currentColor; flex-shrink: 0; }
.mob-item span { font-size: 10px; font-weight: 500; }
.mob-item.active { color: var(--accent); }

/* Menu Plus bottom sheet */
.more-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.more-menu-overlay.open { opacity: 1; pointer-events: all; }
.more-menu {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 201;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 24px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 80dvh;
  overflow-y: auto;
}
.more-menu.open { transform: translateY(0); }
.more-menu-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.more-menu-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.more-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text2);
  padding: 14px 8px; border-radius: var(--radius-sm);
  background: var(--surface2);
  font-size: 11px; font-weight: 500; text-align: center;
  transition: background 0.15s;
}
.more-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.more-item:active, .more-item.active { background: var(--accent-light); color: var(--accent); }

/* Nouveaux composants */
.doc-card { display:flex;gap:12px;align-items:flex-start;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin-bottom:10px;box-shadow:var(--shadow); }
.doc-icon { width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;background:var(--surface2); }
.doc-content { flex:1;min-width:0; }
.doc-content strong { font-size:14px;font-weight:600;display:block; }
.doc-content p { font-size:13px;color:var(--text2);margin-top:4px;line-height:1.5; }
.doc-link { display:inline-block;margin-top:8px;font-size:13px;font-weight:600;color:var(--accent);text-decoration:none; }
.doc-admin-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:14px;margin-bottom:10px; }
.doc-admin-card.unpublished { opacity:0.5; }
.doc-admin-header { display:flex;justify-content:space-between;margin-bottom:6px; }
.doc-type-tag { font-size:11px;font-weight:600;color:var(--text2); }
.doc-admin-actions { display:flex;gap:8px;margin-top:10px; }
.absence-card { display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin-bottom:8px; }
.absence-card.declared { border-left:3px solid var(--error); }
.absence-card.past { opacity:0.6; }
.absence-date-badge { text-align:center;background:var(--error-bg);border-radius:10px;padding:6px 10px;flex-shrink:0; }
.absence-date-badge span { font-family:'Syne',sans-serif;font-size:20px;font-weight:800;color:var(--error);display:block;line-height:1; }
.absence-date-badge small { font-size:10px;font-weight:700;color:var(--error);text-transform:uppercase; }
.absence-info { flex:1;min-width:0; }
.absence-info strong { font-size:14px;font-weight:600;display:block; }
.absence-info span { font-size:12px;color:var(--text2); }
.absent-count { font-size:11px;color:var(--error);font-weight:600; }

/* ══════════════════════════════════
   CLASSES UTILITAIRES — BOUTONS
══════════════════════════════════ */
.btn-add {
  padding: 8px 14px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  transition: opacity .15s;
}
.btn-add:hover { opacity: .85; }

.btn-danger-outline {
  width: 100%; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--error); background: transparent;
  color: var(--error); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center;
  gap: 6px; transition: all .15s;
}
.btn-danger-outline:hover { background: var(--error-bg); }

.btn-danger-sm {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--error); background: transparent;
  color: var(--error); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.btn-danger-sm:hover { background: var(--error-bg); }

.btn-panel-close {
  margin-top: 10px; width: 100%; padding: 10px;
  border-radius: 10px; border: none;
  background: var(--surface2); color: var(--text2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: background .15s;
}
.btn-panel-close:hover { background: var(--border); }

.ev-doc-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--text1); text-decoration: none;
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
  transition: border-color .15s;
}
.ev-doc-link:hover { border-color: var(--accent); }
.ev-doc-link svg:first-child { color: var(--accent); }
.ev-doc-link .ev-doc-arrow { margin-left: auto; opacity: .4; }

.ev-abs-link {
  text-align: center; font-size: 12px;
  color: var(--text3); text-decoration: underline;
  display: block; margin-top: 6px;
}

.btn-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--text2); cursor: pointer; padding: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
}
.btn-modal-close:hover { border-color: var(--text2); background: var(--border); }

.btn-declare-absence {
  width: 100%; padding: 13px; border-radius: 12px;
  border: none; background: var(--error-bg); color: var(--error);
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Syne', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 2px; transition: all .15s;
}
.btn-declare-absence:hover { background: var(--error); color: #fff; }

/* ══════════════════════════════════
   TABLETTE 768px – 1024px
══════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  .bottom-nav { width: 200px !important; }
  body { max-width: 100% !important; margin: 0 !important; width: 100% !important; }
  .topbar { left: 200px !important; right: 0 !important; width: auto !important; max-width: none !important; transform: none !important; padding: 0 20px !important; }
  .main-content { left: 200px !important; right: 0 !important; width: auto !important; padding: 24px 28px !important; }
  .topbar::before { width: 200px !important; }
  .nav-item span { font-size: 13px; }
  .sidebar-user-info strong { font-size: 12px; }
  .sidebar-user-info span { font-size: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  /* Stats-grid-6 tablette : 3 colonnes */
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr) !important; }
  .stats-grid-6 .stat-num { font-size: clamp(0.85rem, 2vw, 1rem) !important; }
  .membres-list { grid-template-columns: 1fr !important; }
  .cal-cell { min-height: 52px !important; }
  .cal-event { font-size: 9px !important; }
  .pa-left { width: 180px !important; }
  .bsc-form { max-width: 100% !important; }
  .form-card { max-width: 100% !important; }
  .profil-stats { grid-template-columns: repeat(2,1fr) !important; }
  .topbar-sub { font-size: 11px; }
  .msg-wrapper,
  .act-bar,
  .saisie-tabs,
  .abs-layout,
  .pa-wrap { left: 200px !important; }
}

/* ── Scrollbar personnalisée ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── Input date stylisé ── */
input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: var(--text1);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box;
    outline: none;
    height: 38px;
    cursor: pointer;
}
input[type="date"]:focus { border-color: var(--accent); }
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: var(--date-icon-filter, none);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ── Liste participants modal ── */
.membre-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.membre-row:last-child { border-bottom: none; }
.membre-av {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0; display: block;
}
.membre-av-init {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 800;
    background: var(--accent-light); color: var(--accent);
}
.membre-row-name { font-size: 13px; font-weight: 600; display: block; }
.membre-row-meta { font-size: 11px; color: var(--text2); margin-top: 1px; display: block; }

/* ══ MODAL GLOBAL (ev-modal, participants) ══ */
.ev-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 9999;
    align-items: flex-end; justify-content: center;
}
.ev-modal-overlay.open { display: flex; }
.ev-modal-sheet {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px 20px 28px; width: 100%;
    max-height: 85dvh; overflow-y: auto;
    position: relative; box-sizing: border-box;
}
.ev-modal-handle {
    width: 36px; height: 4px; background: var(--border);
    border-radius: 2px; margin: 0 auto 16px;
}
@media (min-width: 768px) {
    .ev-modal-overlay {
        left: 260px;
        align-items: center;
        justify-content: center;
    }
    .ev-modal-sheet {
        border-radius: var(--radius) !important;
        max-width: 480px;
        width: calc(100% - 80px);
        max-height: 80vh;
    }
}
