/* ==========================================================================
   MCA — Maison des Cultures et des Animations
   Design system : mobile d'abord, aucune dépendance externe.
   ========================================================================== */

:root {
  --violet: #6c3ce9;
  --violet-dark: #4b22b8;
  --violet-soft: #f1ecfe;
  --amber: #ff9f1c;
  --amber-soft: #fff3e0;
  --coral: #ef476f;
  --coral-soft: #fdeaf0;
  --mint: #06b98a;
  --mint-soft: #e2f8f1;
  --ink: #17132a;
  --ink-soft: #4a4560;
  --muted: #7a7590;
  --line: #e8e5f0;
  --paper: #fbf9f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(23, 19, 42, .06), 0 2px 8px rgba(23, 19, 42, .05);
  --shadow: 0 8px 24px rgba(23, 19, 42, .08);
  --shadow-lg: 0 18px 48px rgba(23, 19, 42, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --nav-h: 68px;
  --maxw: 1180px;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  overflow-x: hidden;
}

body.admin-body { background: #f4f2fb; }

img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.18;
  letter-spacing: -.02em;
  font-weight: 800;
}
h1 { font-size: clamp(1.9rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 4.4vw, 2.1rem); }
h3 { font-size: clamp(1.08rem, 3.2vw, 1.3rem); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mb1 { margin-bottom: .6rem; }
.mb2 { margin-bottom: 1.2rem; }
.mb3 { margin-bottom: 2rem; }
.mt2 { margin-top: 1.2rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.flex { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.flex-between { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------------------------------------------------------------- Barre du haut */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(251, 249, 246, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-height: 62px;
  padding: .55rem 0;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(150deg, var(--violet), var(--violet-dark));
  color: #fff; display: grid; place-items: center;
  font-size: .92rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.brand-logo { padding: 0; overflow: hidden; background: #fff; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.06rem; }
.brand-text span { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.top-links { display: none; gap: .2rem; }
.top-links a {
  color: var(--ink-soft); font-weight: 600; font-size: .93rem;
  padding: .5rem .8rem; border-radius: 999px;
}
.top-links a:hover { background: var(--violet-soft); color: var(--violet); text-decoration: none; }
.top-links a.active { background: var(--violet); color: #fff; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--white); display: grid; place-items: center; color: var(--ink-soft);
  cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { border-color: var(--violet); color: var(--violet); }
.icon-btn svg { width: 20px; height: 20px; }
.user-chip {
  display: none; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .35rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font-size: .85rem; font-weight: 600; color: var(--ink);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, var(--amber), var(--coral));
  color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 800;
}

/* ---------------------------------------------------------------- Barre du bas */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex;
  justify-content: space-around;
  gap: .15rem;
  padding: .4rem max(.3rem, env(safe-area-inset-left, 0px)) calc(.4rem + env(safe-area-inset-bottom, 0px)) max(.3rem, env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  padding: .35rem .1rem;
  border-radius: 12px;
  color: var(--muted); font-size: .68rem; font-weight: 700; text-align: center;
  line-height: 1.1;
}
.bottom-nav a:hover { text-decoration: none; color: var(--violet); background: var(--violet-soft); }
.bottom-nav a.active { color: var(--violet); background: var(--violet-soft); }
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

body.admin-body .bottom-nav {
  background: rgba(23, 19, 42, .97);
  border-top-color: rgba(255, 255, 255, .12);
}
body.admin-body .bottom-nav a { color: rgba(255, 255, 255, .62); }
body.admin-body .bottom-nav a.active { color: #fff; background: rgba(108, 60, 233, .38); }
body.admin-body .bottom-nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit; font-weight: 700; font-size: .95rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 6px 18px rgba(108, 60, 233, .28); }
.btn-primary:hover { background: var(--violet-dark); }
.btn-amber { background: var(--amber); color: #3b2500; box-shadow: 0 6px 18px rgba(255, 159, 28, .32); }
.btn-amber:hover { background: #f08f0a; }
.btn-outline { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--violet-soft); color: var(--violet); }
.btn-danger { background: var(--coral-soft); color: #b02348; }
.btn-danger:hover { background: #fbdbe4; }
.btn-mint { background: var(--mint); color: #fff; }
.btn-sm { padding: .45rem .8rem; font-size: .84rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- Cartes / sections */
.section { padding: 2.4rem 0; }
.section-sm { padding: 1.4rem 0; }
.section-head { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.3rem; }
.section-head p { margin: .2rem 0 0; color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--violet);
  margin-bottom: .4rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card-pad-lg { padding: 1.4rem; }
.card-flat { box-shadow: none; }
.card-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 .3rem; }
.card-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.card-head h3 { margin: 0; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.split { display: grid; gap: 1.2rem; grid-template-columns: 1fr; align-items: start; }
.stats-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------------------------------------------------------- Héros */
.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(160deg, #2b1650 0%, #4b22b8 55%, #6c3ce9 100%);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 88% 12%, rgba(255, 159, 28, .38), transparent 65%),
    radial-gradient(55% 50% at 6% 92%, rgba(6, 214, 160, .32), transparent 68%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; padding: 2.2rem 0 2.9rem; }
.hero-logo {
  width: clamp(140px, 42vw, 230px);
  margin: 0 auto 1.4rem;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  border: 3px solid rgba(255, 255, 255, .55);
  box-shadow: 0 18px 44px rgba(12, 8, 30, .35);
}
.hero-logo img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.hero h1 { color: #fff; }
.hero .lead { font-size: 1.03rem; color: rgba(255, 255, 255, .86); max-width: 44ch; }
.hero-media { margin-top: 1.6rem; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .18); }
.hero-media img { width: 100%; height: clamp(190px, 46vw, 400px); object-fit: cover; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.1rem; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .32rem .75rem; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  font-size: .78rem; font-weight: 700;
}
.hero-stats { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.7rem; }
.hero-stat { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--radius); padding: .8rem .9rem; }
.hero-stat b { display: block; font-size: 1.6rem; line-height: 1; }
.hero-stat span { font-size: .76rem; color: rgba(255, 255, 255, .78); font-weight: 600; }

/* ---------------------------------------------------------------- Stats */
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem; box-shadow: var(--shadow-sm);
}
.stat-top { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; }
.stat-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--violet-soft); color: var(--violet);
}
.stat-ico svg { width: 18px; height: 18px; }
.stat-ico.is-amber { background: var(--amber-soft); color: #b06a00; }
.stat-ico.is-mint { background: var(--mint-soft); color: #067a5b; }
.stat-ico.is-coral { background: var(--coral-soft); color: #b02348; }
.stat-label { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.05; letter-spacing: -.03em; }
.stat small { color: var(--muted); font-size: .76rem; }

/* ---------------------------------------------------------------- Photos / vignettes */
.thumb { width: 100%; height: 190px; object-fit: cover; border-radius: var(--radius-sm); background: var(--violet-soft); }
.thumb-sm { width: 100%; height: 132px; object-fit: cover; border-radius: var(--radius-sm); background: var(--violet-soft); }
.card-media { margin: -1.1rem -1.1rem 1rem; }
.card-media img { width: 100%; height: 190px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.card-activity .card-media img { height: 200px; }

.item {
  display: grid; grid-template-columns: 74px 1fr; gap: .85rem; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem; box-shadow: var(--shadow-sm);
}
.item img { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; background: var(--violet-soft); }
.item h4 { margin: 0 0 .2rem; font-size: .98rem; }
.item .meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem .7rem; }

/* ---------------------------------------------------------------- Badges / chips */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  background: var(--violet-soft); color: var(--violet-dark);
}
.badge-confirmee, .badge-validee, .badge-actif, .badge-ouvert { background: var(--mint-soft); color: #067a5b; }
.badge-en_attente { background: var(--amber-soft); color: #a85f00; }
.badge-annulee, .badge-refusee, .badge-suspendu { background: var(--coral-soft); color: #b02348; }
.badge-terminee, .badge-termine { background: #eceaf5; color: var(--ink-soft); }
.badge-en_cours { background: var(--violet-soft); color: var(--violet-dark); }
.badge-a_venir { background: #e7f0ff; color: #2554b0; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .38rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--white); font-size: .82rem; font-weight: 700; color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--violet); color: var(--violet); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- Formulaires */
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .83rem; font-weight: 700; margin-bottom: .3rem; color: var(--ink-soft); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: .25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%; padding: .72rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink);
  font: inherit; font-size: .95rem;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(108, 60, 233, .14);
}
textarea { min-height: 108px; resize: vertical; }
.search-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.search-row input, .search-row select { flex: 1 1 170px; }
.checkbox { display: flex; gap: .5rem; align-items: center; font-size: .88rem; }
.checkbox input { width: auto; }

/* ---------------------------------------------------------------- Tableaux */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 620px; }
table.data th, table.data td { padding: .7rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #f7f5fd; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fcfbff; }
table.data td.actions { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------------------------------------------------------------- Calendrier / planning */
.calendar { display: grid; gap: .7rem; grid-template-columns: 1fr; }
.cal-day { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.cal-day h4 { margin: 0 0 .5rem; font-size: .95rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cal-day.today { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(108, 60, 233, .1); }
.cal-day .day-count { font-size: .7rem; color: var(--muted); font-weight: 700; }
.slot {
  border: 1px solid var(--line); border-left: 4px solid var(--violet);
  border-radius: var(--radius-sm); padding: .6rem .7rem; margin-bottom: .5rem;
  background: #fdfcff;
}
.slot:last-child { margin-bottom: 0; }
.slot.is-full { border-left-color: var(--coral); background: #fff8fa; }
.slot.is-past { opacity: .62; border-left-color: var(--muted); }
.slot h5 { margin: 0 0 .15rem; font-size: .92rem; }
.slot .meta { font-size: .76rem; color: var(--muted); }
.slot-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: space-between; }

.timetable { display: grid; gap: .7rem; grid-template-columns: 1fr; }
.tt-day { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tt-day > header { padding: .6rem .8rem; background: #f7f5fd; font-weight: 800; font-size: .88rem; }
.tt-day .tt-body { padding: .6rem .8rem; }
.tt-line { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.tt-line:last-child { border-bottom: 0; }
.tt-time { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--violet); font-size: .84rem; min-width: 96px; }

/* ---------------------------------------------------------------- Messagerie */
.thread { display: flex; flex-direction: column; gap: .55rem; max-height: 420px; overflow-y: auto; padding: .3rem; }
.bubble { max-width: 86%; padding: .6rem .8rem; border-radius: 14px; font-size: .9rem; box-shadow: var(--shadow-sm); }
.bubble .when { display: block; font-size: .68rem; opacity: .7; margin-top: .25rem; }
.bubble.membre { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.bubble.admin { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

/* ---------------------------------------------------------------- Avertissements / vide */
.alert { border-radius: var(--radius-sm); padding: .8rem .9rem; font-size: .88rem; border: 1px solid transparent; margin-bottom: 1rem; }
.alert-info { background: #eef3ff; border-color: #cddaff; color: #22407f; }
.alert-warn { background: var(--amber-soft); border-color: #ffdca8; color: #8a5100; }
.alert-ok { background: var(--mint-soft); border-color: #b8ecd9; color: #05624a; }
.alert-err { background: var(--coral-soft); border-color: #f8c2d2; color: #a11d40; }

.empty { text-align: center; padding: 1.8rem 1rem; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--line); margin-bottom: .5rem; }

/* ---------------------------------------------------------------- Bandeau install */
.install-banner {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--ink), #3b2a68);
  color: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.2rem;
}
.install-banner .ib-text { display: flex; align-items: center; gap: .7rem; min-width: 200px; flex: 1 1 240px; }
.install-banner b { display: block; font-size: .98rem; }
.install-banner span { font-size: .8rem; color: rgba(255, 255, 255, .74); }
.store-icons { display: flex; gap: .5rem; align-items: center; }
.store-icons svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- Modale */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 12, 30, .55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-box {
  background: var(--white); width: 100%; max-width: 620px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 92vh; overflow-y: auto;
  padding: 1.2rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.modal-head h3 { margin: 0; }

/* ---------------------------------------------------------------- Pied de page */
.footer { background: #14112a; color: rgba(255, 255, 255, .74); padding: 2.2rem 0 1.4rem; margin-top: 2.4rem; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: .5rem; }
.footer a { color: rgba(255, 255, 255, .8); font-size: .88rem; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 1.6rem; padding-top: 1rem; font-size: .78rem; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; }

/* ---------------------------------------------------------------- Admin */
.admin-top {
  position: sticky; top: 0; z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(120deg, #17132a, #2f2159);
  color: #fff;
}
.admin-top-inner { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 0; min-height: 62px; }
.admin-top .brand { color: #fff; }
.admin-top .brand-text span { color: rgba(255, 255, 255, .6); }
.admin-top .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }
.admin-top .icon-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.admin-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber);
}
.admin-shell { padding: 1.2rem 0 2rem; }
.admin-body .card { box-shadow: var(--shadow-sm); }
.chart-box { position: relative; height: 260px; width: 100%; }

/* Barre de sections de l'administration */
.admin-tabs { background: var(--white); border-bottom: 1px solid var(--line); }
.admin-tabs-inner {
  display: flex; gap: .3rem; overflow-x: auto; padding: .55rem 1.1rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.admin-tabs a {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 999px;
  font-size: .85rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap;
}
.admin-tabs a:hover { text-decoration: none; background: var(--violet-soft); color: var(--violet); }
.admin-tabs a.active { background: var(--ink); color: #fff; }
.admin-tabs svg { width: 16px; height: 16px; }
.admin-tabs .tab-count {
  background: var(--coral); color: #fff; border-radius: 999px;
  font-size: .66rem; padding: 0 .38rem; font-weight: 800;
}
.admin-tabs a.active .tab-count { background: var(--amber); color: #3b2500; }

/* ---------------------------------------------------------------- Auth */
.auth-wrap { display: grid; gap: 1.2rem; grid-template-columns: 1fr; padding: 1.6rem 0 2rem; }
.auth-aside {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: linear-gradient(150deg, #2b1650, #6c3ce9); color: #fff; min-height: 190px;
  padding: 1.4rem;
}
.auth-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.auth-aside .aa-content { position: relative; z-index: 2; }
.auth-aside h2 { color: #fff; font-size: 1.35rem; }
.auth-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.3rem; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- Animations */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- Toast */
.toast-host { position: fixed; left: .8rem; right: .8rem; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 300; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  pointer-events: auto;
  background: var(--ink); color: #fff; border-radius: 12px;
  padding: .75rem .9rem; font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; gap: .5rem; align-items: flex-start;
  animation: toastIn .22s ease;
}
.toast.ok { background: #067a5b; }
.toast.err { background: #b02348; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================================================================ */
/* Tablette / ordinateur                                             */
/* ================================================================ */
@media (min-width: 640px) {
  body { padding-bottom: calc(var(--nav-h) + 18px); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .hero-inner { padding: 3.2rem 0 3.4rem; }
  .modal { align-items: center; padding: 1.5rem; }
  .modal-box { border-radius: var(--radius-lg); padding: 1.5rem; }
  .item { grid-template-columns: 92px 1fr; }
  .item img { width: 92px; height: 92px; }
  .thumb { height: 210px; }
}

@media (min-width: 768px) {
  .top-links { display: flex; }
  .user-chip { display: inline-flex; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: 1.15fr .85fr; gap: 1.8rem; }
  .split-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; }
  .cal-day { padding: .7rem .6rem; }
  .cal-day h4 { flex-direction: column; align-items: flex-start; gap: .1rem; font-size: .82rem; }
  .timetable { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; padding: 3rem 0; }
  .auth-aside { min-height: 460px; padding: 2rem; display: flex; align-items: flex-end; }
  .auth-aside h2 { font-size: 1.9rem; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  .section { padding: 3.4rem 0; }
  .bottom-nav {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(560px, calc(100% - 2rem));
    bottom: 1rem; border-radius: 999px; border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: .35rem .5rem;
  }
  body.admin-body .bottom-nav { border-color: rgba(255, 255, 255, .14); }
  .toast-host { left: auto; right: 1.2rem; width: 340px; }
  .chart-box { height: 300px; }
}

@media (min-width: 1024px) {
  .timetable { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-shell .split { grid-template-columns: 340px 1fr; }
  table.data { min-width: 0; }
}

/* ---------------------------------------------------------------- Galerie de souvenirs */
.card-album { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-album .card-media { margin: 0; display: block; position: relative; }
.card-album .card-media img { height: 200px; border-radius: 0; }
.card-album .album-body { padding: 1rem; }
.card-album .album-body h3 { font-size: 1.04rem; }
.card-media-vide {
  display: grid; place-items: center; text-align: center;
  height: 168px; padding: 1rem;
  background: linear-gradient(140deg, var(--violet-soft), #f7f3ff);
  color: var(--muted); font-weight: 700; font-size: .92rem;
}
.card-album .card-media-vide { border-radius: var(--radius) var(--radius) 0 0; }
.album-count {
  position: absolute; right: .7rem; bottom: .7rem;
  background: rgba(23, 19, 42, .74); color: #fff;
  font-size: .72rem; font-weight: 800;
  padding: .22rem .6rem; border-radius: 999px;
}

.photos-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo {
  margin: 0; overflow: hidden; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.photo-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-open img { width: 100%; height: 148px; object-fit: cover; }
.photo figcaption { padding: .6rem .75rem; font-size: .82rem; color: var(--ink-soft); line-height: 1.45; }

.lightbox .lightbox-img {
  width: 100%; max-height: 60vh; object-fit: contain;
  border-radius: 12px; background: #0f0c1e;
}

.album-mini-liste { display: grid; gap: .5rem; }
.album-mini {
  display: flex; gap: .7rem; align-items: center;
  padding: .5rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--ink);
}
.album-mini:hover { text-decoration: none; border-color: var(--violet); }
.album-mini img { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; }
.album-mini-vide { width: 56px; height: 56px; flex: none; border-radius: 10px; background: var(--violet-soft); }
.album-mini-texte { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }

/* Galerie : administration */
.admin-photos { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.admin-photo { border: 1px solid var(--line); border-radius: 12px; padding: .6rem; background: #fbfaff; }
.admin-photo img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: .5rem; }
.admin-photo input[type="text"] { margin-bottom: .5rem; font-size: .86rem; padding: .55rem .7rem; }
.admin-photo-couv {
  display: inline-block; margin-bottom: .4rem;
  font-size: .7rem; font-weight: 800;
  color: #067a5b; background: var(--mint-soft);
  padding: .2rem .55rem; border-radius: 999px;
}
.admin-upload { border-top: 1px dashed var(--line); margin-top: 1.1rem; padding-top: 1rem; }

@media (min-width: 640px) {
  .photo-open img { height: 180px; }
  .admin-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .photos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .album-mini-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .photos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
