/* =====================================================================
 * 10% — feuille de style unique.
 * Mobile-first, thème sombre, respecte les encoches (safe-area).
 * ===================================================================== */

:root {
  --bg:          #0f1115;
  --bg-elev:     #171a21;
  --bg-elev-2:   #1f232c;
  --border:      #2a2f3a;
  --text:        #e8eaed;
  --text-muted:  #9aa2b1;
  --accent:      #4f8cff;
  --accent-dark: #2f6fe0;
  --danger:      #ff5b5b;
  --success:     #37c98b;

  --radius:   14px;
  --radius-s: 9px;
  --tabbar-h: 60px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:         #f6f7f9;
    --bg-elev:    #ffffff;
    --bg-elev-2:  #eef0f4;
    --border:     #dfe3ea;
    --text:       #14171c;
    --text-muted: #667085;
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* --- Structure ------------------------------------------------------- */

.page {
  padding: 12px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  max-width: 720px;
  margin: 0 auto;
}

.center {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__title { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 650; }

.header__action,
.header__back {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* --- Barre d'onglets -------------------------------------------------- */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}

.tabbar__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.68rem;
  min-height: 48px;               /* cible tactile confortable */
}

.tabbar__item.is-active { color: var(--accent); }
.tabbar__icon { font-size: 1.25rem; line-height: 1; }

.tabbar__badge {
  position: absolute;
  top: 6px;
  right: 50%;
  transform: translateX(18px);
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
}

/* --- Cartes et listes -------------------------------------------------- */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card__title { margin: 0 0 10px; font-size: 0.95rem; font-weight: 650; }

.list { list-style: none; margin: 0; padding: 0; }

.list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
}

.list__item:last-child { border-bottom: 0; }
.list__item.is-unread { position: relative; }
.list__item.is-unread::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.list__body { flex: 1; display: flex; flex-direction: column; gap: 2px; color: inherit; }
.list__title { font-weight: 550; }
.list__sub, .list__time { color: var(--text-muted); font-size: 0.82rem; }
.list__icon { font-size: 1.3rem; }

/* --- Posts ------------------------------------------------------------- */

.post {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.post__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post__author { font-weight: 600; font-size: 0.92rem; }
.post__meta { color: var(--text-muted); font-size: 0.78rem; }
.post__text { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.post__image { border-radius: var(--radius-s); margin-bottom: 10px; }

.post__actions {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.reaction:hover  { background: var(--bg-elev-2); }
.reaction.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.reaction .count { font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* --- Avatars ----------------------------------------------------------- */

.avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.avatar--sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 0.7rem; }
.avatar--lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.1rem; }

/* --- Sondages ---------------------------------------------------------- */

.poll { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.poll__question { margin: 0 0 4px; font-weight: 600; }

.poll__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-elev-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.poll__option.is-voted { border-color: var(--accent); }
.poll__option[disabled] { cursor: default; opacity: .8; }

.poll__bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  transition: width .4s ease;
}

.poll__label   { position: relative; flex: 1; }
.poll__percent { position: relative; color: var(--text-muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.poll__total   { margin: 2px 0 0; color: var(--text-muted); font-size: 0.78rem; }

/* --- Commentaires ------------------------------------------------------ */

.comments { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.comment { display: flex; gap: 10px; }
.comment__author { font-size: 0.85rem; font-weight: 600; }
.comment__text { margin: 2px 0 0; word-break: break-word; }

.comment-form {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  display: flex;
  gap: 8px;
  padding: 10px 0;
  background: var(--bg);
}

/* --- Formulaires -------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 0.85rem; color: var(--text-muted); }

.field__input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 16px;              /* 16px évite le zoom auto sur iOS */
}

.field__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.field__input--code {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.form__hint  { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.form__error, .error { margin: 0; color: var(--danger); font-size: 0.88rem; }

/* --- Boutons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-elev-2);
  color: var(--text);
  font-weight: 550;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn--ghost   { background: transparent; }
.btn--danger  { background: transparent; border-color: var(--danger); color: var(--danger); width: 100%; }
.btn--small   { padding: 8px 13px; min-height: 38px; font-size: 0.85rem; }

/* --- Bannière push ------------------------------------------------------ */

.banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.banner p { margin: 0; font-size: 0.9rem; }
.banner__actions { display: flex; gap: 8px; }

/* --- Authentification ---------------------------------------------------- */

.auth {
  max-width: 380px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12vh) 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth__logo { margin: 0; font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.auth__intro { margin: 0; color: var(--text-muted); }
.auth__link { font-size: 0.85rem; text-align: center; }

/* --- Divers -------------------------------------------------------------- */

.muted { color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }

.profile { display: flex; align-items: center; gap: 14px; }
.profile__name { font-weight: 650; font-size: 1.05rem; }

.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.splash__logo { font-size: 2.6rem; font-weight: 800; }

.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(90vw, 420px);
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgb(0 0 0 / .35);
  font-size: 0.9rem;
}

.toast--error { border-color: var(--danger); color: var(--danger); }

/* --- Compléments : écrans membre et administration ---------------------- */

.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card__head .card__title { margin: 0; }
.card__title--lg { font-size: 1.2rem; }
.card--accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card--danger { border-color: var(--danger); }
.card--nav { padding: 4px 16px; }

.center-text { text-align: center; }
.text-danger { color: var(--danger); }
.is-muted { opacity: .6; }
.version { text-align: center; color: var(--text-muted); font-size: .78rem; margin-top: 20px; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Puces de filtre */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 13px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: .84rem;
  white-space: nowrap;
}
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Pastilles d'état */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 550;
  white-space: nowrap;
}
.pill--ok   { background: color-mix(in srgb, var(--success) 18%, transparent);
              border-color: color-mix(in srgb, var(--success) 45%, transparent); color: var(--success); }
.pill--warn { background: color-mix(in srgb, var(--danger) 15%, transparent);
              border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }

.badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
}

.list--cards .list__item {
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-elev);
}
.list__aside { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.banner--warn   { border-color: color-mix(in srgb, #ffb020 50%, transparent);
                  background: color-mix(in srgb, #ffb020 12%, transparent); }
.banner--danger { border-color: var(--danger);
                  background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* Statistiques */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat  { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 14px; }
.stat__value { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat__label { display: block; color: var(--text-muted); font-size: .78rem; margin-top: 2px; }

/* Tableau clé/valeur */
.facts { list-style: none; margin: 10px 0; padding: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border-bottom: 0; }
.facts li > span:first-child { color: var(--text-muted); flex-shrink: 0; }
.facts li > span:last-child  { text-align: right; word-break: break-word; }

/* Événements */
.event { margin-bottom: 10px; }
.event__link {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); color: inherit;
}
.event__date {
  flex: 0 0 52px; text-align: center;
  padding: 6px 0; border-radius: var(--radius-s);
  background: var(--bg-elev-2);
}
.event__day   { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1; }
.event__month { display: block; font-size: .7rem; color: var(--text-muted); text-transform: uppercase; }
.event__body  { flex: 1; min-width: 0; }
.event__title { font-weight: 600; }
.event__meta  { color: var(--text-muted); font-size: .8rem; }
.event__cover { border-radius: var(--radius); margin-bottom: 12px; }
.event__desc  { white-space: pre-wrap; }

/* Grille photos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid--photos { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tile { position: relative; display: block; color: inherit; margin: 0; }
.tile__img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-s); background: var(--bg-elev-2);
}
.tile__img--empty { display: grid; place-items: center; font-size: 2rem; }
.tile__title { display: block; font-weight: 550; margin-top: 6px; font-size: .9rem; }
.tile__sub   { display: block; color: var(--text-muted); font-size: .78rem; }
.tile__del {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgb(0 0 0 / .55); color: #fff;
  cursor: pointer; line-height: 1;
}

/* Messagerie */
.page--chat { display: flex; flex-direction: column; min-height: calc(100vh - var(--tabbar-h) - 120px); }
.thread { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }

.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.is-mine { flex-direction: row-reverse; }

.bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 16px 16px 16px 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.is-mine .bubble {
  border-radius: 16px 16px 4px 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.bubble__author { font-size: .76rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.bubble__text   { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble__img    { border-radius: 10px; margin-top: 6px; }
.bubble__time   { display: block; font-size: .68rem; opacity: .7; margin-top: 3px; text-align: right; }

.chat-form {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  display: flex; gap: 8px; padding: 10px 0;
  background: var(--bg);
}

.avatar--group { background: linear-gradient(135deg, #7f77dd, #534ab7); }
img.avatar { object-fit: cover; }

.search { margin-bottom: 14px; }
.profile__bio { white-space: pre-wrap; margin-top: 12px; }

/* Fenêtres modales */
.modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgb(0 0 0 / .6);
  min-height: 100vh;
}
.modal__box {
  width: 100%; max-width: 420px;
  max-height: 85vh; overflow-y: auto;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal__box--wide { max-width: 520px; }
.modal__title { margin: 0 0 14px; font-size: 1.05rem; }
.modal__text  { margin: 0 0 18px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.modal__actions .btn { flex: 1; }

.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }

.field__hint { color: var(--text-muted); font-size: .78rem; }
textarea.field__input { resize: vertical; font-family: inherit; }
select.field__input[multiple] { min-height: 120px; }

.cb { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px; }
.cb input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }

.post__ident { flex: 1; min-width: 0; }
.post__del {
  background: none; border: 0; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 0 6px; line-height: 1;
}


/* --- Accueil : bandeau alpin ------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--safe-top) + 26px) 20px 22px;
  border-bottom: 1px solid var(--border);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: url('/assets/img/alps.jpg') center 55% / cover no-repeat;
  opacity: .85;
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(15 17 21 / .25), var(--bg));
}

@media (prefers-color-scheme: light) {
  .hero__bg { background-image: url('/assets/img/alps-light.jpg'); }
  .hero__bg::after { background: linear-gradient(to bottom, rgb(255 255 255 / .2), var(--bg)); }
}

.hero__inner { position: relative; max-width: 720px; margin: 0 auto; }

.hero__logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero__logo span { color: var(--accent); }

.hero__hello { margin: 6px 0 12px; font-size: 1.05rem; }

.hero__counters { display: flex; flex-wrap: wrap; gap: 8px; }

.hero__counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  font-size: .8rem;
}
.hero__counter strong { font-variant-numeric: tabular-nums; }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- Événement en cours ------------------------------------------------ */

.live {
  display: block;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--success);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: inherit;
}

.live__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--success);
}
.live__pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.6s ease-out infinite;
}
.live__title { display: block; font-weight: 650; margin-top: 5px; }
.live__meta  { display: block; color: var(--text-muted); font-size: .82rem; }

.chip__count {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  font-size: .7rem;
}

/* --- Vidéo dans le fil -------------------------------------------------- */

.post__video {
  width: 100%;
  max-height: 460px;
  border-radius: var(--radius-s);
  margin-bottom: 10px;
  background: #000;
}

/* --- Espace admin : barre latérale -------------------------------------- */

.adminbar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.adminbar__brand {
  display: none;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 4px 10px 14px;
}
.adminbar__brand span { color: var(--accent); }
.adminbar__brand em {
  font-style: normal;
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* Mobile : rangée de puces horizontale défilante */
.adminbar__nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.adminbar__nav::-webkit-scrollbar { display: none; }

.adminbar__link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: .84rem;
  white-space: nowrap;
}
.adminbar__link.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.adminbar__link--out { display: none; }
.adminbar__icon { font-size: .95rem; }

/* Bureau : vraie barre latérale fixe */
@media (min-width: 900px) {
  .page {
    max-width: 1180px;
    padding-left: 250px;
  }

  .adminbar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 226px;
    padding: 22px 14px;
    gap: 3px;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 30;
  }

  .adminbar__brand { display: block; }

  .adminbar__nav { flex-direction: column; overflow: visible; }

  .adminbar__link {
    width: 100%;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    justify-content: flex-start;
  }
  .adminbar__link:hover { background: var(--bg-elev-2); }
  .adminbar__link--out {
    display: inline-flex;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    border-radius: 0;
  }

  /* La barre d'onglets mobile et l'en-tête reculent devant la sidebar */
  .header { padding-left: 250px; }
  .tabbar { display: none; }
  .page   { padding-bottom: 40px; }
  .chat-form, .comment-form { bottom: 0; }
}

/* --- Graphiques en barres ------------------------------------------------ */

.bars { display: flex; flex-direction: column; gap: 7px; }

.bars__row { display: flex; align-items: center; gap: 10px; }

.bars__label {
  flex: 0 0 88px;
  font-size: .8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars__track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.bars__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.bars__value {
  flex: 0 0 42px;
  text-align: right;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

/* --- Aperçu d'import CSV -------------------------------------------------- */

.preview__summary { margin: 0 0 10px; }

.preview__table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}
.preview__table table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.preview__table th {
  position: sticky;
  top: 0;
  background: var(--bg-elev-2);
  text-align: left;
  padding: 7px 9px;
  font-weight: 550;
}
.preview__table td { padding: 6px 9px; border-top: 1px solid var(--border); }
.preview__table tr.is-bad { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.preview__table tr.is-bad td:last-child { color: var(--danger); }

.field__input--file { padding: 9px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
