/* ==========================================================================
   EVJC Management — Église la Vie en Jésus-Christ (E.V.J-C)
   Feuille de style MOBILE FIRST : styles de base pour téléphone,
   enrichis progressivement par des media queries min-width.
   Palette tirée du logo : bleu pétrole dominant, blanc, or.
   ========================================================================== */

:root {
  --brand-950: #071a28;
  --brand-900: #0b2233;
  --brand-800: #12344a;
  --brand-700: #1b4f73;
  --brand-600: #24679a;
  --brand-500: #3f82b8;
  --brand-400: #6aa1cc;
  --brand-200: #bfd8ec;
  --brand-100: #e2eef8;
  --brand-50:  #f1f7fc;
  --accent-600: #a88d35;
  --accent-500: #c2a74e;
  --accent-300: #e0cd8c;
  --accent-100: #f7f1dd;

  --white: #ffffff;
  --gray-900: #0f1c2a;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50:  #f8fafc;

  --success-600: #16a34a; --success-100: #dcfce7;
  --warning-600: #d97706; --warning-100: #fef3c7;
  --danger-600:  #dc2626; --danger-100:  #fee2e2;
  --info-600:    #0284c7; --info-100:    #e0f2fe;

  --bg: #f3f7fb;
  --surface: var(--white);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: #e3eaf2;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(11, 34, 51, .06);
  --shadow: 0 8px 24px rgba(11, 34, 51, .08);
  --shadow-lg: 0 18px 50px rgba(11, 34, 51, .18);
  --shadow-brand: 0 10px 30px rgba(36, 103, 154, .35);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --sidebar-w: 272px;
  --topbar-h: 60px;
  --tabbar-h: 66px;
  --gutter: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ------------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-600); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--gray-900); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-200); }

/* Transitions de page natives (navigateurs récents) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }

/* Barre de progression de navigation */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200; background: linear-gradient(90deg, var(--accent-500), var(--brand-400)); box-shadow: 0 0 10px var(--accent-500); transition: width .35s var(--ease), opacity .3s; opacity: 0; }
.progress.run { opacity: 1; width: 82%; transition: width 8s cubic-bezier(.1, .7, .2, 1); }

/* --------------------------------------------------------------- Layout */
.app { min-height: 100vh; }

/* Menu latéral : tiroir sur mobile, fixe sur grand écran */
.sidebar {
  width: min(86vw, var(--sidebar-w));
  background:
    radial-gradient(circle at 0% 0%, rgba(194, 167, 78, .18), transparent 40%),
    linear-gradient(180deg, var(--brand-900) 0%, var(--brand-800) 55%, var(--brand-700) 130%);
  color: #c9d9e8;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0;
  z-index: 60;
  transform: translateX(-104%);
  transition: transform .45s var(--ease), box-shadow .45s;
}
body.nav-open .sidebar { transform: translateX(0); box-shadow: 20px 0 60px rgba(7, 26, 40, .45); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: var(--white); font-weight: 800; font-size: 15px;
  box-shadow: 0 0 0 2px rgba(194,167,78,.65), 0 6px 16px rgba(0,0,0,.25);
  transition: transform .6s var(--ease-spring);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; background: transparent; }
.brand-logo.has-img { background: transparent; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.sidebar-brand:hover .brand-logo { transform: rotate(-12deg) scale(1.06); }
.brand-name { color: var(--white); font-weight: 800; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--accent-300); letter-spacing: .08em; text-transform: uppercase; }

.nav { padding: 10px 12px 20px; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7f9cb6; padding: 18px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; margin: 2px 0;
  color: #c9d9e8; font-weight: 600; font-size: 14.5px;
  transition: background .25s, color .25s, transform .3s var(--ease);
}
.nav a .icon { transition: transform .4s var(--ease-spring); }
.nav a:hover { background: rgba(255,255,255,.07); color: var(--white); transform: translateX(4px); }
.nav a:hover .icon { transform: scale(1.18) rotate(-6deg); }
.nav a.active { background: linear-gradient(90deg, rgba(63,130,184,.55), rgba(63,130,184,.18)); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-500); box-shadow: 0 0 12px var(--accent-500); }
.nav a.active .icon { color: var(--accent-300); }

.sidebar-footer { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who strong { display: block; color: var(--white); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who span { font-size: 11px; color: #7f9cb6; }

.overlay { position: fixed; inset: 0; background: rgba(7, 26, 40, .5); backdrop-filter: blur(3px); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .35s; }
body.nav-open .overlay { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(227,234,242,.8);
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--gutter);
  position: sticky; top: 0; z-index: 40;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--brand-800); }
.topbar-brand img { width: 34px; height: 34px; object-fit: contain; }
.topbar-search { display: none; flex: 1; max-width: 440px; position: relative; }
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.topbar-search input[type=search] { padding-left: 40px; background: var(--gray-50); border-color: transparent; }
.topbar-search input[type=search]:focus { background: var(--white); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.scope-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 12px; font-weight: 700; border: 1px solid var(--brand-100);
}
.scope-pill .label-text { display: none; }

.content { padding: 18px var(--gutter) calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-header { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.page-header p { margin: 0; color: var(--text-muted); }
.page-header > div:last-child:not(:first-child) { display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-600); }

/* Barre d'onglets inférieure (mobile) */
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 45;
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(11, 34, 51, .92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 22px; padding: 6px;
  box-shadow: 0 14px 40px rgba(7, 26, 40, .35);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #9fb8cd; font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: none; border: 0; border-radius: 16px; cursor: pointer;
  transition: color .25s, background .25s, transform .35s var(--ease-spring);
}
.tabbar a:active, .tabbar button:active { transform: scale(.9); }
.tabbar .active { color: var(--white); background: linear-gradient(160deg, var(--brand-500), var(--brand-700)); box-shadow: 0 6px 16px rgba(36,103,154,.45); }
.tabbar .active .icon { color: var(--accent-300); }

/* ------------------------------------------------------------ Composants */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-100), #d3e5f4); color: var(--brand-700);
  display: inline-grid; place-items: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
  transition: transform .35s var(--ease-spring);
}
a.avatar:hover, .cell-user:hover .avatar, li:hover > .avatar { transform: scale(1.1); }
.avatar.gold { background: linear-gradient(135deg, var(--accent-100), #efe2b6); color: #7c6420; }
.avatar.lg { width: 60px; height: 60px; font-size: 19px; box-shadow: 0 0 0 4px var(--white), var(--shadow); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
  overflow: hidden;
}
.card.lift:hover, .stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: var(--gray-50); }

.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-4 .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
.grid-4 .stat-value { font-size: 24px; }
.hero .hero-actions .btn { flex: 1 1 140px; }

.stat { padding: 16px; display: flex; gap: 14px; align-items: center; position: relative; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--brand-50), transparent 70%); transition: transform .6s var(--ease); }
.stat:hover::after { transform: scale(1.5); }
.stat > * { position: relative; z-index: 1; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex-shrink: 0; transition: transform .5s var(--ease-spring); }
.stat:hover .stat-icon, .list li:hover .stat-icon, tr:hover .stat-icon { transform: rotate(-10deg) scale(1.1); }
.stat-icon.gold { background: var(--accent-100); color: var(--accent-600); }
.stat-icon.green { background: var(--success-100); color: var(--success-600); }
.stat-icon.sky { background: var(--info-100); color: var(--info-600); }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-trend { font-size: 12px; font-weight: 700; color: var(--success-600); }
.stat-trend.down { color: var(--danger-600); }

/* Bandeau d'accueil animé */
.hero {
  position: relative; overflow: hidden;
  color: var(--white); border-radius: var(--radius-xl);
  padding: 22px 20px; margin-bottom: 18px;
  background: linear-gradient(120deg, var(--brand-900), var(--brand-700) 45%, var(--brand-500) 100%);
  background-size: 200% 200%;
  animation: gradient-pan 14s ease-in-out infinite;
  box-shadow: var(--shadow-brand);
  display: flex; flex-direction: column; gap: 16px;
}
.hero h1 { color: var(--white); margin-bottom: 4px; font-size: 22px; }
.hero p { color: #d6e6f4; margin: 0; }
.hero .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -80px; top: -110px; background: radial-gradient(circle, rgba(194,167,78,.35), transparent 65%); animation: float 9s ease-in-out infinite; }
.hero::after { width: 200px; height: 200px; left: -70px; bottom: -120px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%); animation: float 11s ease-in-out infinite reverse; }
.hero > * { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-300); }
@keyframes gradient-pan { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 16px); } }

/* Carte « Mot du visionnaire » */
.visionary {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--brand-900), var(--brand-800));
  color: var(--white); min-height: 280px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow-lg);
}
.visionary img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transition: transform 1.2s var(--ease); }
.visionary:hover img { transform: scale(1.06); }
.visionary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,26,40,0) 25%, rgba(7,26,40,.92) 88%); }
.visionary .caption { position: relative; z-index: 1; padding: 20px; }
.visionary .caption strong { display: block; font-size: 17px; }
.visionary .caption span { font-size: 12.5px; color: var(--accent-300); font-weight: 700; letter-spacing: .03em; }
.visionary .caption p { margin: 10px 0 0; font-style: italic; color: #d6e6f4; font-size: 13.5px; border-left: 3px solid var(--accent-500); padding-left: 12px; }

/* Boutons */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .25s, box-shadow .3s var(--ease), border-color .25s, transform .25s var(--ease), color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn .icon { transition: transform .4s var(--ease-spring); }
.btn:hover .icon { transform: scale(1.15); }
.btn::before { /* reflet lumineux au survol */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }
.btn-primary { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: var(--white); box-shadow: 0 6px 18px rgba(36,103,154,.35); }
.btn-primary:hover { color: var(--white); box-shadow: 0 10px 26px rgba(36,103,154,.45); }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { color: var(--brand-700); border-color: var(--brand-400); box-shadow: var(--shadow); }
.btn-accent { background: linear-gradient(135deg, var(--accent-300), var(--accent-500)); color: var(--brand-950); box-shadow: 0 6px 18px rgba(194,167,78,.4); }
.btn-accent:hover { color: var(--brand-950); }
.btn-light { background: rgba(255,255,255,.14); color: var(--white); border-color: rgba(255,255,255,.3); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255,255,255,.24); color: var(--white); }
.btn-danger { background: linear-gradient(135deg, #ef4444, var(--danger-600)); color: var(--white); box-shadow: 0 6px 18px rgba(220,38,38,.3); }
.btn-danger:hover { color: var(--white); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); transform: none; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; z-index: -1; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
.badge-blue { background: var(--brand-100); color: var(--brand-700); }
.badge-green { background: var(--success-100); color: #15803d; }
.badge-gold { background: var(--accent-100); color: #7c6420; }
.badge-red { background: var(--danger-100); color: #b91c1c; }
.badge-orange { background: var(--warning-100); color: #b45309; }

/* Formulaires (16px sur mobile : évite le zoom automatique iOS) */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.field .req { color: var(--danger-600); }
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .error { font-size: 12.5px; color: var(--danger-600); font-weight: 600; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  background: var(--white); color: var(--text);
  font: inherit; font-size: 16px;
  transition: border-color .2s, box-shadow .25s, background .2s;
  -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
textarea { min-height: 110px; padding: 12px 14px; resize: vertical; }
input[type=color] { padding: 4px; min-height: 46px; }
input[type=file] { padding: 10px; min-height: auto; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-400); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger-600); }
.checkbox { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--brand-600); -webkit-appearance: auto; appearance: auto; min-height: 0; }
.form-section-title { font-size: 12px; font-weight: 800; color: var(--brand-600); text-transform: uppercase; letter-spacing: .1em; margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--brand-100), transparent); }

/* Tableaux : cartes empilées sur mobile, tableau classique sur grand écran */
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.toolbar .search { position: relative; }
.toolbar .search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.toolbar .search input[type=search] { padding-left: 42px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead { display: none; }
.table, .table tbody, .table tr, .table td { display: block; }
.table tr { padding: 14px; border-bottom: 1px solid var(--border); position: relative; transition: background .25s; }
.table tbody tr:hover { background: var(--brand-50); }
.table td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.table td[data-label]::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.table td:first-child { padding-bottom: 8px; }
.table td.actions { justify-content: flex-end; padding-top: 6px; }
.table td.actions:empty { display: none; }
.table .hide-sm { display: none; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a.sorted { color: var(--brand-600); }
.table .cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table .cell-user strong { display: block; font-weight: 700; }
.table .cell-user span { display: block; }
.pagination { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; }
.pagination .pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .pages a, .pagination .pages span {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px;
  display: inline-grid; place-items: center; font-weight: 700; font-size: 13px;
  color: var(--gray-700); border: 1px solid var(--border); background: var(--white);
  transition: transform .3s var(--ease-spring), background .2s, color .2s, border-color .2s;
}
.pagination .pages a:hover { transform: translateY(-2px); border-color: var(--brand-400); color: var(--brand-700); }
.pagination .pages .current { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-color: transparent; color: var(--white); box-shadow: 0 6px 14px rgba(36,103,154,.35); }

.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-state > .icon { width: 52px; height: 52px; color: var(--brand-400); margin: 0 auto 10px; padding: 12px; background: var(--brand-50); border-radius: 50%; box-sizing: content-box; animation: float 5s ease-in-out infinite; }
.empty-state h3 { color: var(--gray-700); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--gray-100); transition: background .25s, padding-left .35s var(--ease); }
.list li:hover { background: var(--brand-50); padding-left: 22px; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Graphique en barres (CSS natif, animé) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 40px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--brand-400), var(--brand-700)); transform-origin: bottom; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 200ms); transition: filter .25s, transform .3s; }
.bars .bar:hover i { filter: brightness(1.15); transform: scaleX(1.08); }
.bars .bar.alt i { background: linear-gradient(180deg, var(--accent-300), var(--accent-600)); }
.bars .bar span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
@keyframes grow { from { transform: scaleY(0); } }

/* Alertes et notifications */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-size: 14px; font-weight: 600; animation: slide-down .5s var(--ease) both; }
.alert-success { background: var(--success-100); border-color: #bbf7d0; color: #166534; }
.alert-error { background: var(--danger-100); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-100); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-100); border-color: #bae6fd; color: #075985; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } }
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 24px); display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--gray-900); color: var(--white); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: toast-in .45s var(--ease-spring); }
.toast.success { border-left: 4px solid #4ade80; }
.toast.error { border-left: 4px solid #f87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }

/* Fenêtre de confirmation : feuille glissante sur mobile, modale centrée sur grand écran */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,26,40,.55); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--white); width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(100%); transition: transform .45s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-body { padding: 26px 22px 18px; }
.modal-body .modal-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--danger-100); color: var(--danger-600); display: grid; place-items: center; margin-bottom: 14px; animation: pulse-ring 1.8s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 70% { box-shadow: 0 0 0 14px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.modal-footer { padding: 14px 22px 18px; background: var(--gray-50); display: flex; flex-direction: column-reverse; gap: 10px; }
.modal-footer .btn { width: 100%; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 14px; overflow-x: auto; }
.tabs a { padding: 12px 14px; color: var(--text-muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

.details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; }
.details dt { color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
.details dd { margin: 0; font-weight: 600; }

/* Apparition progressive au défilement */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }

/* ------------------------------------------------------- Authentification */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--white); }
.auth-visual {
  position: relative; overflow: hidden; color: var(--white);
  background:
    radial-gradient(circle at 80% 10%, rgba(194,167,78,.2), transparent 42%),
    radial-gradient(circle at 10% 90%, rgba(106,161,204,.45), transparent 45%),
    linear-gradient(155deg, var(--brand-950) 0%, var(--brand-800) 50%, var(--brand-600) 100%);
  padding: 22px 20px 0; min-height: 300px;
  display: flex; flex-direction: column;
}
.auth-visual .brand-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.auth-visual .brand-row img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); animation: spin-slow 40s linear infinite; }
.auth-visual h1 { color: var(--white); font-size: 26px; margin: 14px 0 6px; max-width: 520px; position: relative; z-index: 2; }
.auth-visual .lead { color: #c9dcec; max-width: 460px; font-size: 14px; position: relative; z-index: 2; }
.auth-visual .verse { border-left: 3px solid var(--accent-500); padding-left: 14px; font-style: italic; color: #dbe9f5; max-width: 420px; position: relative; z-index: 2; font-size: 13.5px; }
.auth-visual .verse { display: none; }
@media (min-width: 768px) { .auth-visual .verse { display: block; } }
.auth-visual .ring { position: absolute; border-radius: 50%; border: 1px dashed rgba(255,255,255,.18); animation: spin-slow 60s linear infinite; }
.auth-portrait { position: absolute; right: -10px; bottom: 0; width: 46%; max-width: 360px; z-index: 1; filter: drop-shadow(-10px 10px 30px rgba(0,0,0,.4)); animation: rise 1.1s var(--ease) both .15s; }
.auth-portrait-tag { position: absolute; right: 12px; bottom: 36px; z-index: 3; background: rgba(7,26,40,.7); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15); padding: 8px 12px; border-radius: 12px; font-size: 11.5px; line-height: 1.3; animation: rise .9s var(--ease) both .6s; }
.auth-portrait-tag strong { display: block; color: var(--white); font-size: 12.5px; }
.auth-portrait-tag span { color: var(--accent-300); }
.auth-text { width: 56%; position: relative; z-index: 2; padding-bottom: 22px; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
.auth-form { display: flex; justify-content: center; padding: 26px 18px 40px; margin-top: -22px; position: relative; z-index: 3; background: var(--white); border-radius: 26px 26px 0 0; flex: 1; }
.auth-box { width: 100%; max-width: 420px; animation: rise .8s var(--ease) both .1s; }
.auth-box h2 { font-size: 24px; margin-bottom: 4px; }
.auth-box form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

/* --------------------------------------------------- Page d'accueil publique */
.landing { background: var(--white); }
.landing-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter); }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; }
.landing-nav .brand img { width: 44px; height: 44px; object-fit: contain; }
.landing-hero {
  position: relative; overflow: hidden; color: var(--white);
  background:
    radial-gradient(circle at 85% 15%, rgba(194,167,78,.2), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(106,161,204,.5), transparent 45%),
    linear-gradient(160deg, var(--brand-950), var(--brand-800) 55%, var(--brand-600));
  padding: 84px var(--gutter) 0;
  display: flex; flex-direction: column;
}
.landing-hero .eyebrow { color: var(--accent-300); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.landing-hero h1 { color: var(--white); font-size: 34px; line-height: 1.1; margin: 10px 0 12px; letter-spacing: -.02em; }
.landing-hero h1 .gold { background: linear-gradient(90deg, var(--accent-300), var(--accent-500), var(--accent-300)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.landing-hero .lead { color: #c9dcec; font-size: 15.5px; max-width: 520px; }
.landing-hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; }
.landing-hero .hero-copy { position: relative; z-index: 2; }
.landing-hero .hero-visual { position: relative; margin-top: 8px; display: flex; justify-content: center; align-items: flex-end; min-height: 330px; }
.landing-hero .hero-visual .halo { position: absolute; bottom: 30px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(194,167,78,.45), rgba(194,167,78,0) 65%); animation: breathe 6s ease-in-out infinite; }
.landing-hero .hero-visual .logo-orbit { position: absolute; bottom: 40px; width: 330px; height: 330px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.25); animation: spin-slow 50s linear infinite; }
.landing-hero .hero-visual .logo-orbit img { position: absolute; top: -26px; left: 50%; width: 56px; margin-left: -28px; animation: spin-slow 50s linear infinite reverse; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.landing-hero .hero-visual .portrait { position: relative; width: 270px; z-index: 1; filter: drop-shadow(0 20px 40px rgba(0,0,0,.45)); animation: rise 1.2s var(--ease) both .2s; }
.landing-hero .name-tag { position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%); white-space: nowrap; background: rgba(7,26,40,.72); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 10px 16px; text-align: center; animation: rise 1s var(--ease) both .7s; }
.landing-hero .name-tag strong { display: block; font-size: 14px; }
.landing-hero .name-tag span { font-size: 11.5px; color: var(--accent-300); font-weight: 700; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
.section { padding: 56px var(--gutter); max-width: 1180px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 30px; }
.section-title .eyebrow { color: var(--accent-600); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.section-title h2 { font-size: 26px; margin-top: 6px; }
.values { display: grid; gap: 14px; }
.value-card { position: relative; padding: 24px 20px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.value-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.value-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.value-card:hover::before { transform: scaleX(1); }
.value-card .stat-icon { margin-bottom: 14px; }
.visionary-section { display: grid; gap: 24px; align-items: center; }
.visionary-photo { position: relative; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 5; }
.visionary-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform 1.2s var(--ease); }
.visionary-photo:hover img { transform: scale(1.05); }
.visionary-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 6px rgba(194,167,78,.55); pointer-events: none; }
.quote { font-size: 18px; font-style: italic; color: var(--brand-800); border-left: 4px solid var(--accent-500); padding-left: 16px; margin: 18px 0; }
.landing-footer { background: var(--brand-950); color: #9fb8cd; text-align: center; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); font-size: 13px; }
.landing-footer img { width: 54px; margin: 0 auto 10px; }

/* =========================================================================
   Tablette (≥ 640 px)
   ========================================================================= */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  h1 { font-size: 26px; }
  .grid-2, .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 .stat { flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
  .hero .hero-actions .btn { flex: 0 0 auto; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
  .page-header { flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
  .hero { padding: 28px 30px; }
  .hero h1 { font-size: 26px; }
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; }
  .toolbar .search { flex: 1; min-width: 220px; max-width: 380px; }
  .toolbar select { width: auto; min-width: 170px; }
  .details { grid-template-columns: 170px 1fr; gap: 12px 16px; }
  .details dt { margin-top: 0; text-transform: none; font-size: 13px; letter-spacing: 0; font-weight: 600; }
  .modal-backdrop { align-items: center; padding: 16px; }
  .modal { max-width: 460px; border-radius: var(--radius-xl); transform: translateY(24px) scale(.94); opacity: 0; transition: transform .4s var(--ease-spring), opacity .3s; }
  .modal-backdrop.open .modal { transform: none; opacity: 1; }
  .modal-footer { flex-direction: row; justify-content: flex-end; }
  .modal-footer .btn { width: auto; }
  .toasts { left: auto; right: 20px; width: 380px; }
  .scope-pill .label-text { display: inline; }
  .values { grid-template-columns: repeat(3, 1fr); }
  .landing-hero h1 { font-size: 46px; }
  .pagination { flex-direction: row; justify-content: space-between; }
}

/* =========================================================================
   Tableaux complets (≥ 768 px)
   ========================================================================= */
@media (min-width: 768px) {
  .table { display: table; }
  .table thead { display: table-header-group; }
  .table tbody { display: table-row-group; }
  .table tr { display: table-row; padding: 0; }
  .table th, .table td { display: table-cell; }
  .table td[data-label]::before { content: none; }
  .table .hide-sm { display: table-cell; }
  .table th {
    text-align: left; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); background: var(--gray-50);
    padding: 12px 18px; border-bottom: 1px solid var(--border); white-space: nowrap;
  }
  .table td { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; font-size: 14px; }
  .table td:first-child { padding-bottom: 14px; }
  .table td.actions { text-align: right; white-space: nowrap; padding-top: 14px; }
  .table tbody tr { box-shadow: inset 0 0 0 0 var(--brand-500); transition: background .25s, box-shadow .3s var(--ease); }
  .table tbody tr:hover { box-shadow: inset 4px 0 0 0 var(--brand-500); }
  .auth { flex-direction: row; }
  .auth-visual { flex: 1.1; padding: 44px 48px 0; min-height: 100vh; justify-content: space-between; }
  .auth-text { width: 50%; margin: auto 0; padding-bottom: 60px; }
  .auth-visual h1 { font-size: 36px; }
  .auth-portrait { width: 52%; max-width: 440px; right: -20px; }
  .auth-portrait-tag { bottom: 22px; right: 22px; }
  .auth-form { flex: 1; align-items: center; margin-top: 0; border-radius: 0; padding: 48px 32px; }
  .visionary-section { grid-template-columns: 5fr 7fr; gap: 48px; }
}

/* =========================================================================
   Grand écran (≥ 1024 px) : menu latéral fixe, plus de barre d'onglets
   ========================================================================= */
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .sidebar { transform: none; width: var(--sidebar-w); box-shadow: none; }
  .overlay, .tabbar, .topbar .menu-toggle, .topbar-brand { display: none !important; }
  .main { margin-left: var(--sidebar-w); }
  .topbar { height: 68px; }
  .topbar-search { display: block; }
  .content { padding: 28px var(--gutter) 40px; }
  .grid { gap: 20px; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .grid-hero { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); align-items: stretch; }
  .hero { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px 36px; margin-bottom: 0; }
  .hero h1 { font-size: 30px; }
  .toasts { bottom: 24px; }
  .landing-hero { min-height: 100svh; flex-direction: row; align-items: center; padding: 100px max(var(--gutter), calc((100vw - 1180px) / 2)) 0; gap: 40px; }
  .landing-hero .hero-copy { flex: 1.1; padding-bottom: 80px; }
  .landing-hero .hero-visual { flex: 1; align-self: flex-end; min-height: 560px; }
  .landing-hero .hero-visual .portrait { width: 440px; }
  .landing-hero .hero-visual .halo { width: 440px; height: 440px; }
  .landing-hero .hero-visual .logo-orbit { width: 480px; height: 480px; }
  .landing-hero h1 { font-size: 58px; }
  .landing-nav { padding: 20px max(var(--gutter), calc((100vw - 1180px) / 2)); }
}

@media (min-width: 1280px) {
  .grid-4.stats-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Accessibilité : animations réduites */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------ Départements */
.dept-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.dept-card {
  --c: var(--brand-500);
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px;
  color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.dept-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, var(--accent-500))); }
.dept-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%); transition: transform .6s var(--ease); }
.dept-card:hover { color: inherit; transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, white); }
.dept-card:hover::after { transform: scale(1.6); }
.dept-card .dept-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.dept-card .dept-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: var(--white); background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 60%, black)); box-shadow: 0 8px 18px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .5s var(--ease-spring); flex-shrink: 0; }
.dept-card:hover .dept-icon { transform: rotate(-10deg) scale(1.08); }
.dept-card h3 { margin: 0; font-size: 16px; }
.dept-meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.dept-leader { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); position: relative; z-index: 1; font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-size: 12px; font-weight: 700; }
.chip .icon { width: 14px; height: 14px; }
.resp-leader { background: linear-gradient(135deg, var(--accent-300), var(--accent-500)); color: var(--brand-950); }
.resp-assistant { background: var(--brand-100); color: var(--brand-700); }
.resp-secretary, .resp-treasurer { background: var(--info-100); color: #075985; }
.resp-member { background: var(--gray-100); color: var(--gray-700); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select { min-height: 38px; width: auto; font-size: 14px; padding-top: 0; padding-bottom: 0; }
@media (min-width: 640px) { .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.row-actions { display: flex; align-items: center; gap: 8px; width: 100%; padding-left: 50px; }
.row-actions .inline-form { flex: 1; }
.row-actions .inline-form select { width: 100%; }
@media (min-width: 640px) {
  .row-actions { width: auto; padding-left: 0; }
  .row-actions .inline-form select { width: auto; }
}

/* ------------------------------------------------------------ Activités */
.icon.icon-xs { width: 15px; height: 15px; vertical-align: -3px; }
.event-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.event-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: inherit; box-shadow: var(--shadow-sm); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.event-card:hover { color: inherit; transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.event-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); overflow: hidden; display: grid; place-items: center; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.event-card:hover .event-cover img { transform: scale(1.07); }
.event-cover-icon .icon { width: 54px; height: 54px; color: rgba(255,255,255,.75); stroke-width: 1.5; }
.event-card:hover .event-cover-icon .icon { animation: float 3s ease-in-out infinite; }
.date-pill { position: absolute; left: 12px; top: 12px; background: var(--white); border-radius: 14px; padding: 6px 10px; text-align: center; box-shadow: var(--shadow); min-width: 52px; }
.date-pill b { display: block; font-size: 20px; line-height: 1; color: var(--brand-800); }
.date-pill span { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--accent-600); }
.date-pill.static { position: static; box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.status-pill { position: absolute; right: 12px; top: 12px; }
.event-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.event-body h3 { margin: 4px 0 2px; font-size: 16px; }
.event-body .chip { align-self: flex-start; }
.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-item { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--gray-50); }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #000; transition: transform .6s var(--ease); }
.media-item a:hover img { transform: scale(1.05); }
.media-item figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; font-size: 12px; }
.media-item figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 4 / 3; padding: 12px; color: var(--brand-500); }
.audio-box audio { width: 100%; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 16px; border: 2px dashed var(--brand-200); border-radius: var(--radius-lg); background: var(--brand-50); cursor: pointer; transition: border-color .25s, background .25s, transform .3s var(--ease); }
.dropzone:hover, .dropzone.drag { border-color: var(--brand-500); background: var(--brand-100); transform: scale(1.01); }
.dropzone > .icon { width: 34px; height: 34px; color: var(--brand-500); transform: rotate(180deg); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-files { color: var(--brand-700); font-weight: 700; }
.dropzone.has-error { border-color: var(--danger-600); }
@media (min-width: 640px) { .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .event-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------ Archives */
.cat-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 4px; scrollbar-width: thin; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); color: var(--gray-700); font-weight: 700; font-size: 13px; transition: transform .3s var(--ease-spring), background .2s, color .2s, border-color .2s; }
.cat-chip .icon { width: 16px; height: 16px; }
.cat-chip:hover { transform: translateY(-2px); color: var(--brand-700); border-color: var(--brand-400); }
.cat-chip.active { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: var(--white); border-color: transparent; box-shadow: 0 6px 14px rgba(36,103,154,.3); }
.pdf-frame { width: 100%; height: 70vh; min-height: 420px; display: block; border: 0; }

/* ------------------------------------------------------------ Membres : photo, filtres, import */
img.avatar.has-photo { object-fit: cover; padding: 0; background: var(--gray-100); }
.photo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-preview { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-100), var(--accent-100)); color: var(--brand-600); box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--brand-100); transition: transform .4s var(--ease-spring); flex-shrink: 0; }
.photo-preview:hover { transform: scale(1.05) rotate(-3deg); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .icon { width: 38px; height: 38px; }
.more-filters { width: 100%; }
.more-filters > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand-600); font-size: 13.5px; padding: 6px 0; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters[open] > summary .icon { transform: rotate(180deg); }
.more-filters > summary .icon { transition: transform .3s var(--ease); width: 16px; height: 16px; }
.filter-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 640px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filter-grid .age-range { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.filter-grid .age-range input { width: 90px; }
.import-table td, .import-table th { font-size: 13px; }
.import-table tr.bad { background: var(--danger-100); }
@media (min-width: 900px) { .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .filter-grid .age-range { grid-column: auto; } }
.avatar.xl { width: 84px; height: 84px; box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--accent-300), var(--shadow); }
a:hover > .avatar.xl { transform: scale(1.06); }

/* ------------------------------------------------------------ Écran d'ouverture (logo animé) */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 42%, var(--brand-700), var(--brand-900) 55%, var(--brand-950));
  color: var(--white); text-align: center; padding: 24px;
  animation: splash-out .7s var(--ease) 2.1s forwards;
}
.splash-stage { position: relative; width: 200px; height: 200px; display: grid; place-items: center; margin-bottom: 14px; }
.splash-logo { width: 150px; height: auto; position: relative; z-index: 2; filter: drop-shadow(0 12px 30px rgba(0,0,0,.45)); animation: splash-logo 1.3s var(--ease-spring) both, splash-glow 2.2s ease-in-out .9s both; }
.splash-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(224,205,140,.55); opacity: 0; animation: splash-ring 1.8s var(--ease) both; }
.splash-ring.r2 { animation-delay: .25s; border-color: rgba(106,161,204,.5); }
.splash-ring.r3 { animation-delay: .5s; border-style: dashed; }
.splash-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; opacity: 0; animation: rise .8s var(--ease) .6s both; }
.splash-motto { font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-300); opacity: 0; animation: rise .8s var(--ease) .85s both; }
.splash-bar { width: 140px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 18px; }
.splash-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-300), var(--accent-500)); transform-origin: left; animation: splash-load 1.9s var(--ease) .2s both; }
@keyframes splash-logo { 0% { opacity: 0; transform: scale(.3) rotate(-160deg); } 70% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes splash-glow { 0%, 100% { filter: drop-shadow(0 12px 30px rgba(0,0,0,.45)); } 50% { filter: drop-shadow(0 0 34px rgba(224,205,140,.75)); } }
@keyframes splash-ring { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes splash-load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; } }
@media (min-width: 768px) { .splash-name { font-size: 26px; } .splash-stage { width: 240px; height: 240px; } .splash-logo { width: 180px; } }
@media (prefers-reduced-motion: reduce) { .splash { display: none; } }

/* ------------------------------------------------------------ Installation de l'application */
.install-btn { animation: install-pulse 2.6s ease-in-out 3s 3; }
@keyframes install-pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(194,167,78,.4); } 50% { box-shadow: 0 0 0 8px rgba(194,167,78,.18), 0 6px 18px rgba(194,167,78,.4); } }
.install-steps { padding-left: 20px; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.kbd { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 6px; background: var(--gray-100); border: 1px solid var(--gray-300); text-align: center; font-weight: 700; }

/* ------------------------------------------------------------ Finances */
.fin-tabs { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.fin-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.fin-scope { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.fin-scope select { width: auto; min-width: 220px; }
.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 8px; }
.month-switch strong { font-size: 15px; color: var(--brand-800); }
.stat-value.money { font-size: 19px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-in { background: var(--brand-500); } .lg-out { background: var(--accent-500); }
.fin-bars { display: flex; align-items: stretch; gap: 6px; height: 220px; }
.fin-bar { flex: 1; display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); border-radius: 10px; padding: 4px 2px; transition: background .25s; }
.fin-bar:hover, .fin-bar.current { background: var(--brand-50); color: var(--brand-700); }
.fin-bar .pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-bar .pair i { display: block; width: 42%; max-width: 16px; border-radius: 6px 6px 2px 2px; transform-origin: bottom; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
.fin-bar .pair .in { background: linear-gradient(180deg, var(--brand-400), var(--brand-700)); }
.fin-bar .pair .out { background: linear-gradient(180deg, var(--accent-300), var(--accent-600)); }
.fin-bar .lbl { font-size: 10.5px; font-weight: 700; text-align: center; }
.chip.fin-in, .badge.fin-in { background: var(--success-100); color: #15803d; }
.chip.fin-out, .badge.fin-out { background: var(--danger-100); color: #b91c1c; }
.txt-in { color: var(--success-600); } .txt-out { color: var(--danger-600); }
.meter { flex-basis: 100%; height: 6px; border-radius: 6px; background: var(--gray-100); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; animation: grow-x 1s var(--ease) both; transform-origin: left; }
.meter.in i { background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }
.meter.out i { background: linear-gradient(90deg, var(--accent-300), var(--accent-600)); }
@keyframes grow-x { from { transform: scaleX(0); } }
.amount-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-switch label { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--radius); border: 2px solid var(--border); font-weight: 800; cursor: pointer; transition: all .25s var(--ease); }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch input:checked + span.in { color: var(--success-600); }
.type-switch label:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 4px var(--brand-100); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--brand-100); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand-500); }
.timeline li.ok::before { border-color: var(--success-600); } .timeline li.ko::before { border-color: var(--danger-600); }
@media (min-width: 640px) { .stat-value.money { font-size: 21px; } .fin-bars { gap: 10px; } }

/* ------------------------------------------------------------ Impression (rapports) */
@media print {
  .sidebar, .topbar, .tabbar, .overlay, .toasts, .page-header .btn, .fin-tabs, .fin-scope, form.toolbar, .splash, .progress, .install-btn { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none !important; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ------------------------------------------------------------ Annonces */
.nav-badge { margin-left: auto; min-width: 22px; justify-content: center; animation: pop .5s var(--ease-spring); }
@keyframes pop { from { transform: scale(0); } }
.ann-list { display: flex; flex-direction: column; gap: 14px; }
.ann-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--brand-400); border-radius: var(--radius-lg); overflow: hidden; color: inherit; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.ann-card:hover { color: inherit; transform: translateY(-3px); box-shadow: var(--shadow); }
.ann-card.prio-important, .ann-article.prio-important { border-left-color: var(--accent-500); }
.ann-card.prio-urgent, .ann-article.prio-urgent { border-left-color: var(--danger-600); }
.ann-card.unread { background: linear-gradient(90deg, var(--brand-50), var(--white) 40%); }
.ann-card.unread h3::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-500); margin-right: 8px; vertical-align: 2px; box-shadow: 0 0 0 4px var(--brand-100); }
.ann-cover { aspect-ratio: 16 / 7; overflow: hidden; background: var(--gray-100); }
.ann-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.ann-card:hover .ann-cover img { transform: scale(1.05); }
.ann-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ann-body h3 { margin: 4px 0 0; font-size: 17px; }
.ann-body p { margin: 0; }
.ann-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ann-foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.dot-new { font-size: 11px; font-weight: 800; color: var(--brand-600); text-transform: uppercase; letter-spacing: .08em; }
.ann-article { border-left: 5px solid var(--brand-400); }
.ann-text { font-size: 15.5px; line-height: 1.7; }
.ann-text a { word-break: break-word; }
.read-ring { --p: 0; width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--gray-100) 0); }
.read-ring span { width: 92px; height: 92px; border-radius: 50%; background: var(--white); display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--brand-700); }
.target-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.target-chip { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); transition: border-color .2s, background .2s; }
.target-chip:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }
.urgent-banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-bottom: 18px; border-radius: var(--radius-lg); color: var(--white); background: linear-gradient(120deg, #b91c1c, #ef4444); box-shadow: 0 10px 30px rgba(220,38,38,.3); animation: slide-down .6s var(--ease) both; }
.urgent-banner .icon { width: 28px; height: 28px; flex-shrink: 0; animation: pulse-ring 1.8s infinite; border-radius: 50%; }
.urgent-banner a { color: var(--white); font-weight: 800; text-decoration: underline; }

/* ------------------------------------------------------------ Cloche de notifications */
.bell { position: relative; }
.bell-btn { position: relative; }
.bell-btn .icon { transition: transform .4s var(--ease-spring); }
.bell-btn:hover .icon, .bell.ring .bell-btn .icon { animation: bell-ring .9s ease-in-out; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
.bell-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger-600); color: var(--white); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--white); animation: pop .4s var(--ease-spring); }
.bell-panel { position: fixed; left: 10px; right: 10px; top: calc(var(--topbar-h) + 6px); z-index: 70; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: slide-down .3s var(--ease) both; }
.bell-head, .bell-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; }
.bell-head { border-bottom: 1px solid var(--border); }
.bell-foot { border-top: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.bell-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.bell-list a { display: flex; gap: 10px; padding: 11px 14px; color: inherit; border-bottom: 1px solid var(--gray-100); transition: background .2s; }
.bell-list a:hover { background: var(--brand-50); }
.bell-list a.unread { background: linear-gradient(90deg, var(--brand-50), transparent); }
.bell-list a.unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); margin-left: 6px; vertical-align: 2px; }
.bell-list .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex-shrink: 0; }
.bell-list .ic .icon { width: 17px; height: 17px; }
.bell-list strong { display: block; font-size: 13.5px; line-height: 1.3; }
.bell-list small { color: var(--text-muted); font-size: 12px; }
.bell-empty { padding: 26px 14px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.notif-list li.unread { background: linear-gradient(90deg, var(--brand-50), transparent); }
@media (min-width: 640px) { .bell-panel { position: absolute; left: auto; right: 0; top: calc(100% + 10px); width: 380px; } }

/* ------------------------------------------------------------ Présences */
.table td.num, .table th.num { text-align: right; }
.headcount { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .headcount { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.headcount input { font-size: 20px; font-weight: 800; text-align: center; }
.headcount-total { margin: 10px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.headcount-total strong { font-size: 22px; margin-left: 4px; display: inline-block; transition: transform .3s var(--ease-spring); }
.headcount-total strong.bump { transform: scale(1.25); }
.roll-toolbar { flex-wrap: wrap; }
.roll-list li { flex-wrap: wrap; transition: background .25s; }
.roll-list li:has(input[value="present"]:checked) { background: linear-gradient(90deg, var(--success-100), transparent 70%); }
.roll-list li:has(input[value="absent"]:checked) { background: linear-gradient(90deg, var(--danger-100), transparent 70%); }
.roll-list li:has(input[value="excused"]:checked) { background: linear-gradient(90deg, var(--accent-100), transparent 70%); }
.roll-footer { position: sticky; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: 0 -8px 20px rgba(7,26,40,.06); background: var(--white); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; background: var(--gray-50, #f8fafc); margin-left: auto; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); transition: background .2s, color .2s, transform .25s var(--ease-spring); }
.seg label:hover span { color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.seg input:checked + span { color: var(--white); transform: scale(1.04); }
.seg .seg-present input:checked + span { background: var(--success-600); }
.seg .seg-absent input:checked + span { background: var(--danger-600); }
.seg .seg-excused input:checked + span { background: var(--accent-600); }
.attendance-meter { display: flex; align-items: center; gap: 12px; }
.attendance-meter .meter { flex: 1; height: 10px; }
.attendance-meter .meter i { background: linear-gradient(90deg, var(--success-600), #4ade80); }
@media (min-width: 1024px) { .roll-footer { bottom: 0; } }
.details.tight { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
.details.tight dt { margin-top: 0; font-size: 13px; text-transform: none; letter-spacing: 0; }
.details.tight dd { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .roll-list .seg { flex: 1 1 100%; margin-left: 50px; }
  .roll-list .seg label { flex: 1; }
  .roll-list .seg span { text-align: center; padding: 8px 6px; }
}

/* ------------------------------------------------------------ Rapports */
.print-only { display: none; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 13px; }
.hbar span { color: var(--text-muted); font-weight: 600; }
.hbar b { text-align: right; }
.hbar .meter { height: 10px; flex-basis: auto; }
.hbar .meter i { background: linear-gradient(90deg, var(--brand-400), var(--brand-700)); }
.hbar:nth-child(even) .meter i { background: linear-gradient(90deg, var(--accent-300), var(--accent-600)); }
.fin-in-text { color: #15803d; }
.fin-out-text { color: #b91c1c; }
.compact-list li { padding-left: 0; padding-right: 0; }
[data-report-filters] [data-custom-date][disabled] { opacity: .5; }
@media print {
  .print-only { display: block; }
  .no-print, .page-header > div:last-child { display: none !important; }
  .report-print-head { margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #0b2233; font-size: 12px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .table td[data-label]::before { display: none !important; }
}

/* ------------------------------------------------------------ Sauvegardes */
.danger-zone { border-color: var(--danger-100); }
.danger-zone .card-header h2 { color: var(--danger-600); }
.code-block { display: block; padding: 10px 12px; border-radius: 10px; background: #0b2233; color: #e2ecf5; font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Rappel des annonces non lues */
.ann-popup .modal-icon { animation: bell-ring 1.2s ease-in-out 2; }
.ann-popup h3 { margin: 0 0 4px; }
.ann-popup-list { margin: 12px -22px -18px; border-top: 1px solid var(--border); max-height: 46vh; overflow-y: auto; }
.ann-popup-list li { gap: 12px; }
.ann-popup-list a { color: inherit; }
.ann-popup-list a:hover strong { color: var(--brand-600); }

/* ------------------------------------------------------------ Types de présence */
.type-add-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.type-add-grid .field { margin: 0; }
.type-add-grid .type-name { flex: 1 1 240px; }
.type-ic { flex: 0 0 180px; }
.type-order { flex: 0 0 90px; }
.type-worship { min-height: 46px; }
.type-list li.type-row { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; }
.type-row.is-off { background: var(--gray-50); }
.type-row.is-off .type-name input { color: var(--text-muted); text-decoration: line-through; }
.type-form { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.type-form .field { margin: 0; }
.type-form .type-icon { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px; }
.type-form .type-name { flex: 1 1 220px; }
.type-form .type-name .small { display: block; margin-top: 4px; }
@media (max-width: 639px) { .type-ic { flex: 1 1 150px; } }

/* ------------------------------------------------------------ Bouton « Retour » des pages intérieures */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease-spring), box-shadow .3s, border-color .2s, color .2s; }
.back-link .icon { width: 17px; height: 17px; transition: transform .3s var(--ease-spring); }
.back-link:hover { color: var(--brand-600); border-color: var(--brand-200, var(--border)); box-shadow: var(--shadow); }
.back-link:hover .icon { transform: translateX(-3px); }
@media print { .back-link { display: none !important; } }
