:root {
  /* Surfaces : une seule famille de gris, teintée chaud */
  --bg: #15130f;
  --bg-raised: #1d1a15;
  --bg-raised-2: #262119;
  --bg-hover: #2d271e;
  --line: #332d24;
  --line-strong: #4a4033;
  --text: #ece5d8;
  --text-muted: #9c9282;
  --text-faint: #6f6656;  /* placeholders, informations secondaires */

  /* Un seul accent (ambre) ; rouge et vert réservés aux états (erreur, succès) */
  --amber: #e8a33d;
  --amber-dim: #6b4f22;
  --amber-soft: #3c3418;  /* fond des pastilles ambrées (admin, en cours) */
  --on-amber: #1a1408;    /* texte posé sur l'ambre */
  --red: #d9695a;
  --red-soft: #3a211c;
  --green: #7fae6a;
  --green-soft: #223a22;

  /* Arrondis : plus serrés sur les petits éléments, plus doux sur les conteneurs */
  --radius-xs: 3px;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;

  /* Ombres teintées brun chaud plutôt que noir neutre */
  --shadow-s: 0 1px 2px rgba(8, 5, 2, 0.4);
  --shadow-m: 0 8px 24px rgba(8, 5, 2, 0.45);
  --shadow-l: 0 18px 48px rgba(8, 5, 2, 0.6);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber);

  /* Échelle de superposition (un seul endroit pour ordonner les calques) */
  --z-sticky: 10;
  --z-drawer: 30;
  --z-panel: 40;
  --z-modal: 50;
  --z-scanner: 55;  /* lecteur de codes-barres : au-dessus d'une modale, sous les toasts */
  --z-auth: 60;
  --z-toast: 70;

  /* DECISION: 2026-10-01 — Poppins (texte) + Bricolage Grotesque (titres) à la place
     d'Inter + Space Grotesk, jugés trop génériques (audit skill redesign / frontend-design) */
  --font-body: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Poppins', sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration: 160ms;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }
html, body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html { scrollbar-color: var(--line-strong) transparent; }

/* Grain très léger sur le fond : casse l'aspect « aplat numérique » sans gêner la lecture.
   z-index -1 : il passe sous tout le contenu (le fond est porté par html, pas par body). */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}
p { text-wrap: pretty; }

/* Chiffres à largeur fixe partout où l'on compare des valeurs (heures, dates, compteurs) */
.day-num, .hours-badge, .hours-total, .kanban-count, .task-due, .epr-date, .nav-badge,
.pdl-dow, .pdh-dow, .a-date { font-variant-numeric: tabular-nums; }

input[type='checkbox'], input[type='radio'] { accent-color: var(--amber); }
::selection { background: var(--amber-dim); color: var(--text); }

/* Focus clavier visible et cohérent (l'anneau par défaut du navigateur était blanc) */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Lien d'évitement : visible seulement au clavier, mène directement au contenu */
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: var(--z-toast);
  background: var(--amber); color: var(--on-amber); font-weight: 600;
  padding: 0.5rem 0.9rem; border-radius: var(--radius-s); text-decoration: none;
  transition: top var(--duration) var(--ease);
}
.skip-link:focus-visible { top: calc(0.75rem + env(safe-area-inset-top, 0px)); }
/* Cible du lien d'évitement : focusable, mais sans anneau autour de toute la page */
main#main:focus-visible { box-shadow: none; }

/* Détail d'erreur sous une automatisation, et message de la grille planning vide */
.automation-detail { padding-left: 0.2rem; }
.planning-empty { margin: 1rem; }

.hidden { display: none !important; }
/* Actions réservées aux admins : masquées pour les membres (le serveur les refuse aussi) */
body:not(.is-admin) .admin-only { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Layout ---------- */

.app { display: flex; flex-direction: row; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0.9rem;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.75rem;
  border-bottom: 1px solid var(--line);
  /* Légère transparence : le contenu qui défile reste perceptible sous la barre */
  background: rgba(29, 26, 21, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.topbar h1 { font-size: 1.4rem; letter-spacing: -0.025em; }
.topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

/* Burger et fond du tiroir : n'existent visuellement que sur mobile (cf. media query) */
/* Double classe : doit l'emporter sur .icon-btn (display: inline-flex), déclarée plus loin */
.icon-btn.menu-toggle { display: none; flex-shrink: 0; }
.sidebar-backdrop { display: none; }

.brand { display: flex; align-items: center; gap: 0.55rem; padding: 0 0.3rem; }
/* Pastille ambrée avec un halo discret : rappel d'une lumière de bar */
.brand-mark { color: var(--amber); font-size: 0.8rem; text-shadow: 0 0 10px rgba(232, 163, 61, 0.55); }
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }

.side-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
/* Titre d'un groupe d'onglets : une app (« Planning ») ou les paramètres globaux */
.side-group-label {
  margin: 0.9rem 0 0.25rem; padding: 0 0.75rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
}
.side-group-label:first-child { margin-top: 0; }
.side-tab {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.side-tab:hover { color: var(--text); background: var(--bg-hover); }
.side-tab:active { transform: translateY(1px); }
.side-tab.active { color: var(--on-amber); background: var(--amber); font-weight: 600; box-shadow: var(--shadow-s); }
/* Liens vers le portail (retour, Mon compte, Paramètres) : même aspect que les onglets */
a.side-tab { display: block; text-decoration: none; }
.side-tab-back { color: var(--text); margin-bottom: 0.4rem; }

/* ---------- Portail : tuiles des apps ---------- */
.portal-intro { margin: 0 0 1.2rem; }
.app-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.app-tile {
  position: relative; display: flex; flex-direction: column; gap: 0.45rem;
  min-height: 150px; padding: 1.3rem 1.4rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  color: var(--text); text-decoration: none;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
/* Liseré ambré : l'app est prête à ouvrir */
a.app-tile { box-shadow: inset 3px 0 0 var(--amber); }
a.app-tile:hover { border-color: var(--amber-dim); transform: translateY(-2px); box-shadow: inset 3px 0 0 var(--amber), var(--shadow-m); }
a.app-tile:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--amber), var(--focus-ring); }
.app-tile.is-disabled { opacity: 0.55; cursor: default; }
.app-tile-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.app-tile-desc { color: var(--text-muted); font-size: 0.86rem; line-height: 1.45; }
.app-tile-badge {
  margin-top: auto; align-self: flex-start;
  font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs); background: var(--bg-raised-2); color: var(--text-muted);
}

/* Paramètres › Utilisateurs : cases d'accès aux apps */
.app-access-list { display: flex; flex-direction: column; gap: 0.45rem; }
.app-access-item { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; cursor: pointer; }
.app-access-item input:disabled + span { color: var(--text-muted); }

.sidebar-footer { border-top: 1px solid var(--line); padding-top: 1rem; }

.discord-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); padding: 0 0.3rem; }
.discord-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.discord-status.ready .dot { background: var(--green); }

.user-menu { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; }

.main-column { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.auth-screen {
  position: fixed; inset: 0;
  /* Halo ambré diffus en haut : seule « mise en scène » de l'app, à l'entrée */
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(232, 163, 61, 0.14), transparent 70%),
    var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: var(--z-auth);
  overflow-y: auto; padding: 1.5rem 0;
}
.auth-box {
  width: min(380px, 90vw); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 2rem 2rem 1.75rem; box-shadow: var(--shadow-l);
  animation: rise-in 0.35s var(--ease);
}
.auth-brand { margin-bottom: 1.5rem; }
.auth-brand .brand-name { font-size: 1.6rem; letter-spacing: -0.03em; }
.auth-intro { margin: 0 0 1rem; }
.auth-error { color: var(--red); font-size: 0.85rem; margin-top: 0.6rem; min-height: 1.1em; }
.auth-error:empty { margin-top: 0; min-height: 0; }
.auth-submit { width: 100%; margin-top: 0.3rem; }

/* Champ mot de passe avec bouton œil (afficher / masquer) */
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; min-width: 0; padding-right: 2.6rem; }
.password-toggle {
  position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  width: 2.1rem; height: 2.1rem; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-s);
  color: var(--text-muted); cursor: pointer;
}
.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--amber); }
.password-toggle:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

/* Onglets « Se connecter / Créer un compte » */
.auth-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1.25rem;
  background: var(--bg); padding: 0.25rem; border-radius: var(--radius-s);
}
.auth-tab {
  flex: 1; background: transparent; border: none; color: var(--text-muted);
  font-family: inherit; font-size: 0.88rem; padding: 0.5rem 0.6rem;
  border-radius: var(--radius-xs); cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--bg-raised-2); color: var(--text); font-weight: 600; box-shadow: var(--shadow-s); }
.auth-notice {
  background: var(--green-soft); color: var(--green); border-radius: var(--radius-s);
  padding: 0.6rem 0.75rem; font-size: 0.85rem; margin: 0 0 1rem;
}

/* Compteur de demandes d'inscription sur l'onglet Équipe */
.nav-badge {
  display: inline-block; min-width: 1.3em; padding: 0 0.35em; margin-left: 0.35rem;
  border-radius: 999px; background: var(--red); color: var(--text);
  font-size: 0.72rem; font-weight: 700; line-height: 1.4; text-align: center;
}
.side-tab.active .nav-badge { background: var(--on-amber); color: var(--amber); }

/* Demandes d'inscription (onglet Équipe, admins) */
.registrations-list { display: flex; flex-direction: column; gap: 0.5rem; }
.registration-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--bg-raised); border: 1px solid var(--amber-dim);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-m); padding: 0.7rem 0.9rem;
}
.registration-info { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.registration-target {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-s); font-family: inherit; font-size: 0.82rem; padding: 0.35rem 0.5rem;
}
.registration-actions { display: flex; gap: 0.4rem; }

main#main { flex: 1; padding: 1.75rem; max-width: 1080px; width: 100%; margin: 0 auto; }
main#main.wide { max-width: none; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}


.subtabs { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.subtab {
  background: transparent; border: none; color: var(--text-muted);
  font-family: inherit; font-size: 0.88rem; padding: 0.5rem 0.2rem; margin-right: 1rem;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--amber); border-bottom-color: var(--amber); font-weight: 500; }

.dash-subview.hidden, .types-subview.hidden { display: none; }
.dash-subview h2 { font-size: 1.05rem; margin-bottom: 0.9rem; color: var(--text); font-weight: 600; }

/* ---------- Buttons & forms ---------- */

.btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  background: var(--bg-raised-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease),
    color var(--duration) var(--ease), transform 80ms var(--ease), filter var(--duration) var(--ease);
}
.btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
/* Retour « physique » à l'appui */
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn.primary { background: var(--amber); color: var(--on-amber); border-color: var(--amber); font-weight: 600; box-shadow: var(--shadow-s); }
.btn.primary:hover { background: var(--amber); filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: rgba(217, 105, 90, 0.45); }
.btn.small { padding: 0.32rem 0.65rem; font-size: 0.8rem; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; font-size: 0.88rem; }
.field > span { color: var(--text-muted); font-size: 0.82rem; font-weight: 500; }
.field input, .field select, .field textarea {
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-s);
  font-size: 0.92rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
/* Focus des champs : bordure ambrée + halo doux (valable aussi au clic, pas seulement au clavier) */
.field input:focus, .field select:focus, .field textarea:focus,
.notes-textarea:focus, .registration-target:focus, .task-row select:focus,
.panel-status-select:focus, .kc-status-select:focus {
  border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18);
}
.field input::placeholder, .field textarea::placeholder, .notes-textarea::placeholder { color: var(--text-faint); }
.field textarea { resize: vertical; min-height: 70px; }
/* Champ en lecture seule (ex. titre d'une soirée pour un membre) : visiblement non modifiable */
.field input:disabled, .field select:disabled, .field textarea:disabled {
  color: var(--text-muted); cursor: not-allowed; border-color: var(--line);
}
/* Ligne case à cocher + libellé (ex. « Événement classique ») */
.field.field-check { flex-direction: row; align-items: center; gap: 0.55rem; }
.field.field-check input { width: auto; }
.field-row { display: flex; gap: 0.75rem; }
.field-row .field { flex: 1; }

/* ---------- Calendar ---------- */

.month-nav { display: flex; align-items: center; gap: 0.75rem; }
.month-nav h2 { min-width: 200px; text-align: center; text-transform: capitalize; font-size: 1.15rem; }

.year-grid {
  display: flex;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  max-height: calc(100dvh - 220px);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
}

.month-column {
  min-width: 190px;
  flex: 1 0 190px;
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
}

.month-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.year-day-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  min-height: 34px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.year-day-row:first-of-type { border-top: none; }
.year-day-row:hover { background: var(--bg-hover); }
.year-day-row.weekend { background: rgba(255, 240, 215, 0.025); }
.year-day-row.empty { cursor: default; visibility: hidden; }
/* Aujourd'hui : chiffre ambré + liseré à gauche pour le repérer d'un coup d'œil */
.year-day-row.today { box-shadow: inset 2px 0 0 var(--amber); }
.year-day-row.today .day-num { color: var(--amber); font-weight: 700; }

.dow-label { width: 14px; color: var(--text-muted); font-size: 0.68rem; flex-shrink: 0; }
.day-num { width: 18px; color: var(--text-muted); font-size: 0.78rem; flex-shrink: 0; }

.year-event-chip {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  color: var(--on-amber);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: filter var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.year-event-chip:hover { filter: brightness(1.1); transform: translateX(1px); }
.year-event-chip.tag-classique {
  border: 1px dashed rgba(0, 0, 0, 0.35);
  opacity: 0.88;
}

/* Glisser-déposer d'une soirée (calendar-drag.js). Sélection bloquée sur toute la grille et
   pas seulement sur la pastille : sur un appui long, les navigateurs mobiles sélectionnent
   sinon le texte voisin (jour, numéro) puis étendent la sélection */
.year-grid {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* pas de menu « copier / partager » sur l'appui long iOS */
}
.year-event-chip { cursor: grab; }
.year-event-chip.dragging { opacity: 0.35; }
.year-day-row.drop-target {
  background: var(--bg-hover);
  box-shadow: inset 0 0 0 2px var(--amber);
}
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-toast);
  pointer-events: none; /* sinon elementFromPoint trouverait le fantôme au lieu du jour visé */
  box-shadow: var(--shadow-m);
  margin: -0.7rem 0 0 -1rem; /* le pointeur tient la pastille près de son coin gauche */
  opacity: 0.95;
}
body.calendar-dragging,
body.calendar-dragging * { cursor: grabbing !important; }

.tag-chip {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-raised-2);
  color: var(--text-muted);
  border: 1px dashed var(--line);
}

/* ---------- Planning (affectations par semaine) ---------- */

.planning-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--bg-raised); box-shadow: var(--shadow-s); }
.planning-grid { display: flex; flex-direction: column; min-width: 900px; }
.planning-row { display: grid; grid-template-columns: 160px repeat(7, 1fr); border-top: 1px solid var(--line); }
.planning-row:first-child { border-top: none; }
.planning-header { position: sticky; top: 0; z-index: 1; background: var(--bg-raised); }
.planning-corner { border-right: 1px solid var(--line); }
.planning-daycol-header {
  padding: 0.6rem 0.6rem; border-right: 1px solid var(--line); text-align: center;
}
.planning-daycol-header:last-child { border-right: none; }
.planning-daycol-header.today .pdh-dow { color: var(--amber); font-weight: 700; }
.pdh-dow { font-size: 0.8rem; color: var(--text-muted); text-transform: capitalize; }
.pdh-event { font-size: 0.82rem; margin-top: 0.15rem; font-weight: 500; }
.pdh-event.muted { font-weight: 400; }

.planning-staffcol {
  padding: 0.6rem; border-right: 1px solid var(--line);
  font-size: 0.86rem; font-weight: 500; display: flex; align-items: center;
}
.planning-cell {
  padding: 0.4rem; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.3rem; min-height: 52px;
}
.planning-cell:last-child { border-right: none; }
.planning-cell { transition: background var(--duration) var(--ease); }
.planning-cell.clickable { cursor: pointer; }
.planning-cell.clickable:hover { background: var(--bg-hover); }
/* Indique qu'un clic sur une case vide d'un jour avec soirée permet d'affecter quelqu'un */
.planning-cell.clickable:empty:hover::after {
  content: '+'; margin: auto; color: var(--amber); font-size: 1.1rem; opacity: 0.8;
}

.planning-shift-chip {
  background: var(--bg); border: 1px solid var(--amber-dim); border-radius: var(--radius-xs);
  padding: 0.25rem 0.45rem; cursor: pointer; font-size: 0.74rem;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.planning-shift-chip:hover { border-color: var(--amber); transform: translateY(-1px); }
.psc-time { display: block; color: var(--amber); font-variant-numeric: tabular-nums; }

/* ---------- Planning : sélection, copier-coller, duplication ---------- */
.planning-shift-chip.is-selected {
  background: var(--amber-soft); border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}
.planning-hint { font-size: 0.8rem; margin: -0.4rem 0 0.7rem; }
kbd {
  font-family: inherit; font-size: 0.72rem; padding: 0.05rem 0.35rem;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--radius-xs);
  background: var(--bg-raised-2); color: var(--text);
}
.planning-toolbar {
  position: sticky; top: 0.5rem; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin-bottom: 0.7rem; padding: 0.55rem 0.8rem;
  background: var(--bg-raised); border: 1px solid var(--amber-dim);
  border-left: 3px solid var(--amber); border-radius: var(--radius-m);
  box-shadow: var(--shadow-s); font-size: 0.86rem;
}
.planning-toolbar > span { flex: 1; min-width: 12rem; }
.planning-toolbar kbd { margin-left: 0.3rem; }
/* Mode collage : toutes les cases deviennent des cibles */
.has-planning-clipboard .planning-cell { cursor: copy; }
.has-planning-clipboard .planning-cell:hover { background: var(--amber-soft); }
.has-planning-clipboard .planning-cell.clickable:empty:hover::after { content: 'Coller'; font-size: 0.75rem; }
.pdh-duplicate {
  margin-top: 0.3rem; padding: 0.1rem 0.45rem; font: inherit; font-size: 0.7rem;
  color: var(--text-muted); background: none; border: 1px dashed var(--line);
  border-radius: var(--radius-xs); cursor: pointer;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.pdh-duplicate:hover, .pdh-duplicate:focus-visible { color: var(--amber); border-color: var(--amber); }
/* « Coller ici » (mobile) n'apparaît qu'avec quelque chose dans le presse-papiers */
.pdl-paste { display: none; }
.has-planning-clipboard .pdl-paste { display: inline-flex; }
.copy-week-summary { margin: 0.8rem 0; padding-left: 1.2rem; line-height: 1.7; }
.psc-label { display: block; color: var(--text-muted); }

/* Liste par jour : remplace la grille sur mobile, masquée sur desktop */
.planning-day-list { display: none; flex-direction: column; gap: 0.6rem; }
.pdl-day {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 0.7rem 0.8rem;
}
.pdl-day.today { border-color: var(--amber-dim); box-shadow: inset 3px 0 0 var(--amber); }
.pdl-day.today .pdl-dow { color: var(--amber); font-weight: 700; }
.pdl-day.no-event { padding-block: 0.45rem; opacity: 0.6; }
.pdl-header { display: flex; align-items: center; gap: 0.6rem; }
.pdl-dow { font-size: 0.8rem; color: var(--text-muted); min-width: 48px; flex-shrink: 0; }
.pdl-event { flex: 1; min-width: 0; font-weight: 500; font-size: 0.9rem; overflow-wrap: anywhere; }
.pdl-day.no-event .pdl-event { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; }
.pdl-shift-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding-top: 0.5rem; margin-top: 0.5rem; border-top: 1px solid var(--line);
}
.pdl-person { font-size: 0.86rem; font-weight: 500; flex: 1; min-width: 0; }
.pdl-shift-row .planning-shift-chip { flex-shrink: 0; }
.pdl-empty { padding: 0.5rem 0 0; font-size: 0.82rem; }

.hours-total { font-size: 1.1rem; font-weight: 600; color: var(--amber); margin-top: 0.7rem; }

/* ---------- Équipe (cards) ---------- */

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.team-card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 1.15rem 1.25rem; display: flex; flex-direction: column;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.team-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-m); }
.team-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
.team-card-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.015em; }
.app-role-chip { font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: var(--radius-xs); background: var(--bg-raised-2); color: var(--text-muted); }
.app-role-chip.admin { background: var(--amber-soft); color: var(--amber); }
.team-card-role { color: var(--text-muted); font-size: 0.86rem; margin: 0 0 0.7rem; }
.team-card-meta { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.team-card-stats { display: flex; justify-content: space-between; font-size: 0.82rem; padding-top: 0.7rem; border-top: 1px solid var(--line); margin-bottom: 0.8rem; }
.team-card-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.team-card-actions .btn { flex: 1; }
/* Carte « Équipe » du planning : toute la carte ouvre la fiche (bouton natif, accessible) */
.team-card-link { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.team-card-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.team-card-link .team-card-stats { margin-bottom: 0; }

/* ---------- Dashboard ---------- */

.dash-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-raised-2); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 0.8rem; padding: 0.3rem 0.7rem 0.3rem 0.5rem;
  border-radius: 999px; cursor: pointer;
  transition: opacity var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.filter-chip:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.filter-chip.off { opacity: 0.4; }
.filter-chip.off .type-dot { opacity: 0.5; }

.kanban-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.6rem; }
.kanban-header h2 { margin: 0; }
.kanban-mode-toggle { display: flex; gap: 0.25rem; background: var(--bg-raised-2); padding: 0.2rem; border-radius: var(--radius-s); }
.kanban-mode-toggle .mode-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-family: inherit; font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: var(--radius-xs); cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.kanban-mode-toggle .mode-btn:hover { color: var(--text); }
.kanban-mode-toggle .mode-btn.active { background: var(--amber); color: var(--on-amber); font-weight: 600; }

.kanban-board { display: flex; gap: 0.9rem; overflow-x: auto; padding-bottom: 0.5rem; }
.kanban-column { min-width: 250px; flex: 0 0 250px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l); display: flex; flex-direction: column; max-height: 560px; }
.kanban-column.overdue-column { border-color: var(--red); }
.kanban-column.overdue-column .kanban-col-header { color: var(--red); }
.kanban-col-header {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 500;
}
.kanban-count { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; font-weight: 400; }
.kanban-col-body { padding: 0.6rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }

.kanban-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 0.65rem 0.75rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.35rem;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.kanban-card:hover { border-color: var(--amber-dim); transform: translateY(-1px); box-shadow: var(--shadow-m); }
.kc-title { font-size: 0.86rem; font-weight: 500; }
.kc-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--text-muted); }
.kc-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.76rem; color: var(--text-muted); }
.kc-due.overdue { color: var(--red); }
.kc-status-select { background: var(--bg-raised-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-xs); font-size: 0.76rem; padding: 0.2rem 0.3rem; }

.dash-block { margin-bottom: 2rem; }
.dash-block h2 { font-size: 1.05rem; margin-bottom: 0.75rem; color: var(--text); font-weight: 600; }

.hours-summary-list { display: flex; flex-direction: column; gap: 0.5rem; max-width: 460px; }
.hours-badge { font-weight: 600; color: var(--amber); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.task-flat-list, .event-progress-list { display: flex; flex-direction: column; gap: 0.5rem; }

.task-flat-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 0.6rem 0.85rem; font-size: 0.88rem;
}
.task-flat-row .overdue-days { color: var(--red); font-size: 0.78rem; margin-left: auto; }

.event-progress-row {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 0.8rem 0.95rem;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.event-progress-row:hover { border-color: var(--amber-dim); background: var(--bg-hover); }
.epr-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.epr-title { font-weight: 500; }
.epr-date { color: var(--text-muted); font-size: 0.82rem; margin-left: auto; }
.progress-track { height: 5px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--amber-dim), var(--amber)); border-radius: inherit; transition: width 0.4s var(--ease); }

/* État vide : encadré en pointillés plutôt qu'une ligne grise isolée, pour qu'on voie qu'il
   s'agit d'un emplacement qui attend du contenu */
.empty-state {
  color: var(--text-muted); font-size: 0.86rem; text-align: center;
  padding: 0.9rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius-m);
}
.kanban-col-body .empty-state { padding: 0.7rem; font-size: 0.8rem; color: var(--text-faint); }

/* Blocs de chargement (skeleton) : reprennent la forme du contenu attendu */
.skeleton {
  display: inline-block; height: 0.85em; border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--bg-raised-2) 25%, var(--bg-hover) 50%, var(--bg-raised-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton-line { width: 45%; }
.skeleton-wide { width: 9rem; }

/* ---------- Animations d'entrée (transform + opacity uniquement, accélérées par le GPU) ---------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slide-in-right { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Changement de vue : léger fondu montant, pour que le passage d'un onglet à l'autre se sente */
.view:not(.hidden) { animation: rise-in 0.25s var(--ease); }

/* ---------- Type badge ---------- */

.type-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ---------- Types de soirée ---------- */

.types-list { display: flex; flex-direction: column; gap: 1rem; }
.type-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.15rem 1.3rem; }
.type-card-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.type-card-header h3 { flex: 1; }
.type-sub { font-size: 0.82rem; color: var(--text-muted); margin: 1rem 0 0.4rem; font-weight: 600; letter-spacing: 0.01em; }
.tpl-row, .rule-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0; font-size: 0.88rem; border-top: 1px solid var(--line);
}
.tpl-row:first-of-type, .rule-row:first-of-type { border-top: none; }
.tpl-offset, .rule-offset { color: var(--amber); font-variant-numeric: tabular-nums; min-width: 48px; }
.tpl-title, .rule-label { flex: 1; }
.rule-action-chip { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: var(--radius-xs); background: var(--bg-raised-2); color: var(--text-muted); }

/* ---------- Settings ---------- */

.settings-block { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.35rem; margin-bottom: 1.25rem; max-width: 520px; }
.settings-block h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.settings-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.staff-list, .recurring-list { display: flex; flex-direction: column; gap: 0.5rem; }
.staff-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; padding: 0.5rem 0.6rem; background: var(--bg); border-radius: var(--radius-s); }
.staff-row .staff-name { font-weight: 500; }
.staff-row .staff-meta { color: var(--text-muted); font-size: 0.8rem; }
.staff-row .spacer { flex: 1; }

/* ---------- Status chips ---------- */

.status-chip { font-size: 0.75rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: var(--radius-xs); white-space: nowrap; }
.status-todo { background: var(--bg-raised-2); color: var(--text-muted); }
.status-in_progress { background: var(--amber-soft); color: var(--amber); }
.status-done { background: var(--green-soft); color: var(--green); }

/* ---------- Panel (event detail) ---------- */

.panel-backdrop {
  position: fixed; inset: 0; background: rgba(10, 9, 6, 0.6); backdrop-filter: blur(2px);
  display: flex; justify-content: flex-end; z-index: var(--z-panel);
  animation: fade-in 0.2s var(--ease);
}
/* Panneau en colonne : en-tête fixe, contenu qui défile, pied fixe (action principale) */
.panel {
  background: var(--bg-raised);
  width: min(480px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* seul .panel-body défile */
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-l);
  animation: slide-in-right 0.25s var(--ease);
}
.panel-header {
  display: flex; align-items: flex-start; gap: 0.75rem; flex-shrink: 0;
  padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--line);
}
.panel-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 1.5rem 1.5rem;
  overscroll-behavior: contain; /* le défilement ne se propage pas à la page derrière */
  /* Barre de défilement toujours visible quand le contenu dépasse (Firefox + Chromium/Safari) */
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}
.panel-body::-webkit-scrollbar { width: 10px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px;
  border: 2px solid var(--bg-raised); /* marge visuelle autour du curseur */
}
.panel-body::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
.panel-body > .panel-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
/* Pied du panneau : au premier plan, action principale en bas à droite */
.panel-footer {
  flex-shrink: 0; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.85rem 1.5rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg-raised-2); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -10px 24px rgba(8, 5, 2, 0.45); /* relief au-dessus du contenu qui défile */
}
.panel-footer-hint { font-size: 0.8rem; color: var(--amber); }
.panel-footer-hint::before { content: '● '; font-size: 0.6rem; vertical-align: middle; }
.panel-footer-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.panel-header h2 { flex: 1; font-size: 1.35rem; letter-spacing: -0.02em; }
.panel-close {
  background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer;
  width: 34px; height: 34px; border-radius: var(--radius-s); flex-shrink: 0;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.panel-close:hover { background: var(--bg-hover); color: var(--text); }
.panel-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
/* Statut de la soirée : même style sombre que les selects des tâches, calé à droite */
.panel-status-select { margin-left: auto; cursor: pointer; }
.panel-section { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.panel-section h3 { font-size: 0.95rem; color: var(--text); margin-bottom: 0.65rem; }
/* Espacement des boutons d'action sous une section (remplace les style="margin-top" en ligne) */
.section-action { margin-top: 0.6rem; }
.panel-progress-text { margin-top: 0.4rem; }

.notes-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-s);
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}

.task-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.88rem;
}
.task-row:first-of-type { border-top: none; }
.task-row .task-title { flex: 1; }
.task-row .task-due { font-size: 0.78rem; color: var(--text-muted); min-width: 78px; }
.task-row.overdue .task-due { color: var(--red); }
.task-row select, .panel-status-select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-xs); font-size: 0.78rem; padding: 0.15rem 0.3rem; }

.automation-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.85rem; }
.automation-row:first-of-type { border-top: none; }

.shift-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.86rem; }
.shift-row:first-of-type { border-top: none; }
.shift-time { font-variant-numeric: tabular-nums; color: var(--amber); min-width: 118px; }
.shift-person { font-weight: 500; }
.shift-label { color: var(--text-muted); flex: 1; }
.automation-row .a-date { color: var(--text-muted); min-width: 78px; font-variant-numeric: tabular-nums; }
.automation-row .a-label { flex: 1; }
.automation-row .a-status-pending { color: var(--text-muted); }
.automation-row .a-status-done { color: var(--green); }
.automation-row .a-status-error { color: var(--red); }
.automation-row .a-status-skipped { color: var(--text-faint); font-style: italic; }

/* ---------- Generic modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 9, 6, 0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: var(--z-modal);
  animation: fade-in 0.2s var(--ease);
}
.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.6rem;
  width: min(460px, 92vw);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-l);
  animation: rise-in 0.22s var(--ease);
}
.modal-box h2 { margin-bottom: 1.1rem; font-size: 1.3rem; letter-spacing: -0.02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }

/* Fenêtre « Date déjà prise » (event-moves.js) : une carte par choix */
.conflict-options { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.conflict-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem;
  width: 100%; padding: 0.75rem 0.9rem; text-align: left;
  font: inherit; color: var(--text);
  background: var(--bg-raised-2); border: 1px solid var(--line); border-radius: var(--radius-m);
}
.conflict-option > span { color: var(--text-muted); font-size: 0.85rem; }
button.conflict-option { cursor: pointer; transition: border-color var(--duration) var(--ease); }
button.conflict-option:hover { border-color: var(--amber); }
.conflict-danger strong { color: var(--red); }
button.conflict-danger:hover { border-color: var(--red); background: var(--red-soft); }
.conflict-shift-row { width: 100%; align-items: flex-end; margin-top: 0.4rem; }
.conflict-shift-row .field { margin-bottom: 0; }
.conflict-shift-row .btn { flex-shrink: 0; }
/* Bouton « Supprimer » à gauche dans une modale (remplace un style en ligne) */
.modal-actions .push-left { margin-right: auto; }

/* ---------- Accueil : tableau de bord personnel ---------- */

.home-hero { margin-bottom: 1.5rem; }
.home-date { margin: 0 0 0.2rem; color: var(--text-muted); font-size: 0.88rem; }
/* Majuscule sur la première lettre seulement (« Jeudi 1 octobre », pas « Octobre ») */
.home-date::first-letter { text-transform: uppercase; }
.home-greeting { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.035em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; margin-bottom: 1.5rem; }
.stat-card {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 1rem 1.15rem; color: inherit; text-decoration: none; box-shadow: var(--shadow-s);
}
.stat-label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.stat-value {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.stat-value.small { font-size: 1.6rem; display: block; }
.stat-hint { font-size: 0.78rem; color: var(--text-faint); }
.stat-card-link { transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.stat-card-link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
/* Tâches urgentes : ambre s'il y en a, rouge si l'une est en retard */
.stat-card.is-warning { border-color: var(--amber-dim); box-shadow: inset 3px 0 0 var(--amber), var(--shadow-s); }
.stat-card.is-warning .stat-value { color: var(--amber); }
.stat-card.is-alert { border-color: rgba(217, 105, 90, 0.5); box-shadow: inset 3px 0 0 var(--red), var(--shadow-s); }
.stat-card.is-alert .stat-value { color: var(--red); }

/* Semaine à gauche, tâches empilées à droite */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.home-card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow-s);
}
.home-card-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.home-card-header h3 { font-size: 1.05rem; }
.home-card-header .muted { font-size: 0.8rem; }
/* Ancre « tâches urgentes » : laisse la place de la barre du haut collante */
#homeUrgentCard { scroll-margin-top: 5rem; }

.home-week, .home-task-list { display: flex; flex-direction: column; gap: 0.35rem; }

/* Ligne de jour : bouton si une soirée existe (ouvre le détail), simple ligne sinon */
.home-day {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: center; gap: 0.6rem;
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-m);
  padding: 0.5rem 0.6rem;
}
button.home-day { cursor: pointer; transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease); }
button.home-day:hover { background: var(--bg-hover); border-color: var(--line); }
.home-day.is-today { background: rgba(232, 163, 61, 0.06); box-shadow: inset 3px 0 0 var(--amber); }
.home-day-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.home-day-dow { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.home-day-num { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.home-day.is-today .home-day-num, .home-day.is-today .home-day-dow { color: var(--amber); }
.home-day-body { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; min-width: 0; }
.home-day-event { font-weight: 500; font-size: 0.9rem; overflow-wrap: anywhere; }
.home-day-event.is-empty { font-weight: 400; color: var(--text-faint); font-size: 0.84rem; }
.home-day-off { font-size: 0.78rem; color: var(--text-faint); }
/* Mes créneaux : la seule information mise en avant dans la semaine */
.home-shift {
  font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--on-amber); background: var(--amber); border-radius: var(--radius-xs); padding: 0.1rem 0.45rem;
}

/* Ligne de tâche cliquable (ouvre la soirée correspondante) */
.home-task {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 0.6rem 0.75rem;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.home-task:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.home-task-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.home-task-title { font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.home-task-meta { font-size: 0.78rem; color: var(--text-muted); }
.home-task-due { flex-shrink: 0; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.home-task-due.is-soon { color: var(--amber); }
.home-task-due.is-overdue { color: var(--red); }

/* ---------- Personnes assignées : pastilles + liste à cocher ---------- */

.assignee-picker { position: relative; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; min-width: 0; }
.assignee-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; min-width: 0; }
.assignee-chip {
  display: inline-flex; align-items: center; gap: 0.3rem; max-width: 11rem;
  background: var(--bg-raised-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.15rem 0.1rem 0.15rem; font-size: 0.78rem;
}
.assignee-avatar {
  flex-shrink: 0; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber-soft); color: var(--amber); font-size: 0.62rem; font-weight: 700;
}
.assignee-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-remove {
  flex-shrink: 0; width: 1.2rem; height: 1.2rem; border: none; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-muted); font-size: 0.85rem; line-height: 1;
}
.assignee-remove:hover { background: var(--red-soft); color: var(--red); }
.assignee-empty { font-size: 0.78rem; color: var(--text-faint); }
.assignee-add {
  flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px dashed var(--line-strong); color: var(--text-muted);
  font-size: 0.95rem; line-height: 1;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.assignee-add:hover, .assignee-add[aria-expanded="true"] { border-color: var(--amber); color: var(--amber); }
/* Liste à cocher, affichée sous le bouton « + » */
.assignee-popover {
  position: absolute; top: calc(100% + 0.35rem); left: 0; z-index: calc(var(--z-panel) + 5);
  min-width: 13rem; max-height: 16rem; overflow-y: auto;
  background: var(--bg-raised-2); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  box-shadow: var(--shadow-m); padding: 0.35rem; font-size: 0.85rem;
  animation: rise-in 0.15s var(--ease);
}
.assignee-option {
  display: flex; align-items: center; gap: 0.55rem; cursor: pointer;
  padding: 0.4rem 0.5rem; border-radius: var(--radius-s);
}
.assignee-option:hover { background: var(--bg-hover); }

/* Ligne de tâche dans le panneau d'une soirée : statut | titre | personnes | échéance | supprimer */
.task-title-wrap { display: flex; align-items: center; gap: 0.25rem; flex: 1; min-width: 0; }
.task-title-wrap .task-title { flex: 0 1 auto; }
.task-title.is-editable { cursor: text; border-radius: var(--radius-xs); }
.task-title.is-editable:hover { background: var(--bg-hover); }
.task-rename {
  flex-shrink: 0; border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  font-size: 0.85rem; padding: 0.15rem 0.3rem; border-radius: var(--radius-xs);
  opacity: 0; transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}
.task-row:hover .task-rename, .task-rename:focus-visible { opacity: 1; }
.task-rename:hover { color: var(--amber); }
.title-input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.88rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--amber); border-radius: var(--radius-xs);
  padding: 0.2rem 0.4rem; box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18);
}
/* Panneau étroit : titre sur sa propre ligne, contrôles en dessous (sinon le titre est écrasé) */
#panelTasks .task-row { flex-wrap: wrap; row-gap: 0.4rem; padding: 0.6rem 0; }
#panelTasks .task-title-wrap { flex-basis: 100%; order: -1; }
.task-assignees { flex: 1; min-width: 0; }
#panelTasks .task-due { min-width: 0; }
.task-row .task-delete { width: 28px; height: 28px; }

/* ---------- Types de soirée : liste, panneau, bibliothèque ---------- */

.view-intro { margin: 0; max-width: 60ch; }

/* Ligne de type : nom + compteurs + bouton, le détail s'ouvre dans le panneau */
.type-row {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 0.8rem 1rem;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.type-row:hover { border-color: var(--line-strong); }
.type-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.type-row-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.type-row-desc { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-row-counts { display: flex; gap: 0.9rem; font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.types-list { gap: 0.5rem; }

.type-dot-lg { width: 14px; height: 14px; margin-top: 0.45rem; }
.section-count {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg-raised-2); border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.3rem;
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.section-header h3 { margin-bottom: 0; }
.section-help { margin: -0.3rem 0 0.7rem; font-size: 0.8rem; }
.field-color input { width: 4rem; height: 2.4rem; padding: 0.2rem; cursor: pointer; }

/* Tâches d'un type : échéance modifiable sur place */
.type-task-list, .library-list { display: flex; flex-direction: column; gap: 0.35rem; }
.type-task-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.type-task-row:first-child { border-top: none; }
.type-task-title { flex: 1; min-width: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.offset-field {
  display: inline-flex; align-items: center; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding-left: 0.45rem; transition: border-color var(--duration) var(--ease);
}
.offset-field:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18); }
.offset-prefix { color: var(--amber); font-weight: 600; font-size: 0.82rem; }
.offset-input {
  width: 3.6rem; background: transparent; border: none; color: var(--amber); font: inherit;
  font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0.3rem 0.35rem;
}
.offset-input:focus-visible { box-shadow: none; }
.type-task-assignees { flex-shrink: 0; }
.icon-btn.icon-btn-danger { width: 30px; height: 30px; flex-shrink: 0; color: var(--red); font-size: 1.05rem; }
.icon-btn.icon-btn-danger:hover { background: var(--red-soft); border-color: rgba(217, 105, 90, 0.45); }

/* Bibliothèque dans le panneau : ajout en un clic */
.library-filter {
  width: 100%; margin-bottom: 0.6rem; font: inherit; font-size: 0.88rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.5rem 0.7rem;
}
.library-filter:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18); }
.library-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.55rem;
  border-radius: var(--radius-s); transition: background var(--duration) var(--ease);
}
.library-row:hover { background: var(--bg-hover); }
.library-offset { flex-shrink: 0; min-width: 3rem; color: var(--amber); font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.library-title { flex: 1; min-width: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.library-add { flex-shrink: 0; }
.library-list { max-height: 18rem; overflow-y: auto; }

/* Sous-onglet « Tâches » : la bibliothèque complète */
.generic-tasks-list { display: flex; flex-direction: column; gap: 0.5rem; }
.generic-task-row {
  display: flex; align-items: flex-start; gap: 0.85rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.8rem 1rem;
}
.generic-task-row .library-offset { padding-top: 0.15rem; }
.generic-task-main { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.generic-task-title { font-weight: 600; font-size: 0.95rem; }
.generic-task-desc { font-size: 0.82rem; color: var(--text-muted); }
.generic-task-usage { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.78rem; margin-top: 0.15rem; }
.type-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--bg-raised-2); border-radius: 999px; padding: 0.1rem 0.55rem 0.1rem 0.45rem;
}
.generic-task-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ---------- Mon compte ---------- */

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1rem; align-items: start; }
.account-grid .settings-block { max-width: none; margin-bottom: 0; }
.field-help { margin: -0.4rem 0 1rem; font-size: 0.8rem; }
.activity-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.1rem; }
.account-subtitle { font-size: 0.95rem; margin-bottom: 0.5rem; }

/* Nom de l'utilisateur dans la barre du haut : raccourci vers « Mon compte » */
.user-chip {
  font: inherit; font-size: 0.85rem; color: var(--text-muted); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 0.3rem 0.75rem;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.user-chip:hover { color: var(--text); background: var(--bg-hover); border-color: var(--line); }
.side-tab-account { width: 100%; margin-bottom: 0.75rem; }

/* Masqué à l'écran mais présent pour les gestionnaires de mots de passe */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Retours visuels : toasts, erreurs de champ, boutons occupés ---------- */

.toast-stack {
  position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-toast); /* au-dessus des modales et de l'écran de connexion */
  display: flex; flex-direction: column; gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none; /* seuls les toasts eux-mêmes captent les clics */
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-raised-2); color: var(--text);
  border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: var(--radius-m); padding: 0.65rem 0.8rem;
  font-size: 0.88rem; box-shadow: var(--shadow-m);
  cursor: pointer;
  animation: toast-in 0.18s ease-out;
}
.toast-error { border-left-color: var(--red); }
.toast-info { border-left-color: var(--amber); }
.toast-icon {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: var(--bg); background: var(--green);
}
.toast-error .toast-icon { background: var(--red); }
.toast-info .toast-icon { background: var(--amber); }
.toast-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-action {
  flex-shrink: 0; background: transparent; border: 1px solid var(--amber-dim);
  color: var(--amber); font-family: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.3rem 0.6rem; border-radius: var(--radius-s); cursor: pointer;
}
.toast-action:hover { border-color: var(--amber); }
.toast-leaving { animation: toast-out 0.15s ease-in forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 0.8rem; }

/* Bouton en attente de réponse serveur (runAction) */
.btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* ---------- Mobile (≤ 720px) ---------- */

@media (max-width: 720px) {
  /* --- Layout & navigation en tiroir --- */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: var(--z-drawer);
    width: min(260px, 80vw); height: 100%;
    padding-top: calc(1.2rem + env(safe-area-inset-top, 0px));
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-l); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
    background: rgba(10, 9, 6, 0.55);
  }
  .side-tab { padding: 0.75rem 0.8rem; font-size: 1rem; } /* zones tactiles plus grandes */
  body.menu-open { overflow: hidden; }

  .icon-btn.menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 0.6rem 1rem; padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); }
  .topbar h1 { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #currentUserName { display: none; } /* le bouton Déconnexion suffit, on gagne de la place */
  main#main { padding: 1rem; }

  /* --- Contrôles : taille tactile (~40px) et pas de zoom iOS au focus (police ≥ 16px) --- */
  .icon-btn { width: 40px; height: 40px; }
  .btn { padding: 0.6rem 0.9rem; }
  .btn.small { padding: 0.45rem 0.7rem; }
  /* !important volontaire : c'est un plancher qui doit battre .field input, .kc-status-select, etc. */
  input, select, textarea { font-size: 16px !important; }

  .field-row { flex-direction: column; gap: 0; }
  .conflict-shift-row { align-items: stretch; gap: 0.5rem; } /* bouton « Décaler » sous la date */
  .view-header { margin-bottom: 1rem; }
  .view-header .btn.primary { flex: 1 1 auto; }

  /* Sous-onglets : défilement horizontal plutôt que retour à la ligne */
  .subtabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .subtab { flex-shrink: 0; }

  /* --- Calendrier annuel --- */
  .month-nav { flex: 1; justify-content: space-between; }
  .month-nav h2 { min-width: 0; flex: 1; }
  .year-grid { max-height: calc(100dvh - 240px); scroll-snap-type: x mandatory; }
  .month-column { min-width: 150px; flex-basis: 150px; scroll-snap-align: start; }
  .year-day-row { min-height: 38px; }

  /* --- Planning : grille remplacée par la liste par jour --- */
  .planning-wrap { display: none; }
  .planning-day-list { display: flex; margin-bottom: 1.5rem; }
  .planning-hint { display: none; } /* raccourcis clavier : sans objet sur mobile */
  .hours-summary-list { max-width: none; }

  /* --- Kanban : une colonne presque pleine largeur, alignée au swipe --- */
  .kanban-board { scroll-snap-type: x mandatory; }
  .kanban-column { flex-basis: 85vw; min-width: 0; max-height: 70dvh; scroll-snap-align: start; }
  .kanban-mode-toggle { width: 100%; }
  .kanban-mode-toggle .mode-btn { flex: 1; }

  /* --- Listes : on autorise le retour à la ligne des éléments --- */
  .epr-top, .tpl-row, .rule-row, .automation-row, .staff-row { flex-wrap: wrap; }
  .epr-date { margin-left: 0; width: 100%; }

  /* Tâche du panneau : titre sur sa propre ligne, contrôles en dessous */
  .task-row { flex-wrap: wrap; row-gap: 0.4rem; }
  .task-row .task-title-wrap { flex-basis: 100%; order: -1; }
  .task-rename { opacity: 1; } /* pas de survol au doigt : crayon toujours visible */
  .task-assignees { max-width: none; flex: 1; }
  .task-row .task-due { min-width: 0; margin-left: auto; }

  .shift-row { flex-wrap: wrap; }
  .shift-time { min-width: 0; }

  /* --- Panneaux latéraux et modales --- */
  .panel { width: 100%; border-left: none; }
  .panel-header { padding: calc(0.9rem + env(safe-area-inset-top, 0px)) 1rem 0.8rem; }
  .panel-body { padding: 1rem; }
  .panel-footer { padding-left: 1rem; padding-right: 1rem; }
  .panel-footer-actions { flex: 1; justify-content: flex-end; }
  .panel-close { min-width: 40px; min-height: 40px; }
  .modal-backdrop { align-items: flex-end; } /* modale en « bottom sheet », plus accessible au pouce */
  .modal-box {
    width: 100%; max-height: 90dvh;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    animation-name: sheet-up;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }

  .settings-block { max-width: none; padding: 1rem; }

  /* --- Accueil : une seule colonne, stats en grille 2 + 1 --- */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .stat-grid .stat-card-link { grid-column: 1 / -1; }
  .stat-value { font-size: 1.8rem; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }

  /* --- Types de soirée : compteurs et actions sous le nom --- */
  .type-row { flex-wrap: wrap; }
  .type-row-counts { order: 3; width: 100%; padding-left: calc(9px + 0.85rem); }
  .generic-task-row { flex-wrap: wrap; }
  .generic-task-actions { width: 100%; justify-content: flex-end; }
  .type-task-row { flex-wrap: wrap; }
  .type-task-title { flex-basis: calc(100% - 9rem); }
  .type-task-assignees { flex: 1; }
}

/* Toasts centrés en bas sur mobile, plus faciles à atteindre au pouce */
@media (max-width: 720px) {
  .toast-stack { right: 1rem; left: 1rem; width: auto; }
}

/* Respecte le réglage système « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  /* 0.01ms plutôt que none : les toasts attendent l'événement animationend pour disparaître */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Lecteur de codes-barres (caméra) ---------- */
.scanner-overlay {
  position: fixed; inset: 0; z-index: var(--z-scanner);
  background: rgba(8, 6, 3, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 0) 1rem env(safe-area-inset-bottom, 0);
}
.scanner-box { width: min(100%, 480px); display: flex; flex-direction: column; gap: 0.8rem; }
.scanner-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.scanner-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.scanner-video-wrap {
  position: relative; aspect-ratio: 3 / 4; max-height: 70dvh; overflow: hidden;
  border-radius: var(--radius-l); background: #000;
}
.scanner-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
/* Cadre de visée : bande horizontale, la forme d'un code-barres */
.scanner-frame {
  position: absolute; left: 10%; right: 10%; top: 38%; height: 24%;
  border: 2px solid var(--amber); border-radius: var(--radius-s);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}
.scanner-status { text-align: center; font-weight: 500; min-height: 1.4em; margin: 0; }

/* ---------- App Stocks ---------- */
.stock-toolbar { gap: 0.6rem; }
.search-input {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 0.55rem 0.75rem;
}
.search-input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.stock-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; font-size: 0.86rem; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; cursor: pointer; }
.stock-list { display: flex; flex-direction: column; gap: 0.45rem; }
.stock-row {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 0.65rem 0.9rem;
}
/* Sous le seuil : liseré rouge, la quantité saute aux yeux */
.stock-row.is-low { border-color: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.stock-row.is-archived { opacity: 0.55; }
.stock-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.stock-row-name { font-weight: 500; overflow-wrap: anywhere; }
.stock-row-meta { font-size: 0.8rem; color: var(--text-muted); }
.stock-row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.stock-qty {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right;
}
.stock-qty.is-low { color: var(--red); }
.barcode { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

.declare-block { max-width: 640px; }
.scan-cta { width: 100%; padding-block: 0.85rem; font-size: 1rem; margin-bottom: 1rem; }
.stock-lines { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.stock-line {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.4rem 0.6rem;
}
.stock-line-name { flex: 1; min-width: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.qty-stepper { display: flex; align-items: center; gap: 0.3rem; }
.qty-input {
  width: 4ch; text-align: center; font: inherit; font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 0.3rem 0.2rem;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.danger-text { color: var(--red); }
.input-with-action { display: flex; gap: 0.5rem; }
.input-with-action input { flex: 1; min-width: 0; }

.declarations-list, .movements-list { display: flex; flex-direction: column; gap: 0.5rem; }
.declaration-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.8rem 1rem; }
.declaration-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.86rem; }
.declaration-date { font-weight: 600; }
.declaration-lines { margin: 0.45rem 0 0; font-size: 0.88rem; }
.declaration-note { margin: 0.3rem 0 0; font-size: 0.82rem; }
.declaration-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.movements-filters { display: flex; flex-wrap: wrap; gap: 0 0.8rem; }
.movement-row {
  display: grid; grid-template-columns: 7.5rem 7.5rem 1fr auto; gap: 0.3rem 0.8rem; align-items: baseline;
  padding: 0.5rem 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.86rem;
}
.movement-who { grid-column: 3 / -1; font-size: 0.78rem; }
.movement-type { font-size: 0.78rem; color: var(--text-muted); }
.movement-qty { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.movement-qty.is-in { color: var(--green); }
.movement-qty.is-out { color: var(--red); }
.load-more { margin: 1rem auto 0; display: block; }

@media (max-width: 720px) {
  .stock-row { flex-wrap: wrap; }
  .stock-row-actions { width: 100%; justify-content: flex-start; }
  .movement-row { grid-template-columns: 1fr auto; }
  .movement-type, .movement-who { grid-column: 1 / -1; }
  .qty-input { font-size: 16px; } /* évite le zoom automatique d'iOS sur les champs */
}

/* ---------- App Blindtest : animateur ---------- */
.bt-playlist-list { display: flex; flex-direction: column; gap: 0.6rem; }
.bt-playlist-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.8rem 1rem;
}
.bt-playlist-main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.bt-playlist-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.bt-playlist-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bt-podium-mini { margin: 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--text-muted); text-align: right; }

.bt-editor { max-width: 860px; }
.bt-round { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.8rem; margin-bottom: 0.8rem; background: var(--bg); }
.bt-round-head { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.bt-round-head input { flex: 1 1 10rem; }
.bt-round input, .bt-round select {
  font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 0.4rem 0.55rem; min-width: 0;
}
.bt-tracks { display: flex; flex-direction: column; gap: 0.35rem; }
.bt-track-row { display: grid; grid-template-columns: 1.4fr 1fr 4.5rem auto; gap: 0.35rem; align-items: center; }
.bt-round-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }

.bt-console { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 1rem; align-items: start; }
.bt-join { text-align: center; }
.bt-code { font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: 0.12em; color: var(--amber); margin: 0.2rem 0; }
.bt-join-url { font-size: 0.82rem; overflow-wrap: anywhere; color: var(--text-muted); }
.bt-join-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.bt-round-label { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.bt-track-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin: 0.3rem 0 0; }
.bt-phase { font-weight: 500; margin: 0.6rem 0; }
.bt-big { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.bt-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.bt-answers, .bt-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.bt-answers li, .bt-players li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.bt-answers li > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bt-players li > span:first-child { flex: 1; }
.bt-players li.is-away, .bt-leaderboard li.is-away { opacity: 0.45; }
.bt-score { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--amber); }

.bt-leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.bt-leaderboard li { display: flex; align-items: center; gap: 0.7rem; }
.bt-rank { min-width: 1.6rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bt-nick { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Blindtest : page joueur (téléphone) ---------- */
.player-page { min-height: 100dvh; }
.player-shell { max-width: 480px; margin: 0 auto; padding: 1rem 1rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.player-header { display: flex; align-items: center; gap: 0.5rem; }
.player-title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; flex: 1; }
.player-me { font-weight: 600; color: var(--amber); }
.player-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.2rem; }
.player-card h1 { font-size: 1.4rem; margin: 0 0 1rem; }
/* 16 px minimum : sinon iOS zoome automatiquement sur le champ */
.player-card input { font-size: 16px; }
.player-big-btn { width: 100%; padding-block: 0.9rem; font-size: 1.05rem; }
.player-status { text-align: center; }
.player-round { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.player-countdown { font-family: var(--font-display); font-size: 3.2rem; font-weight: 800; color: var(--amber); margin: 0.2rem 0; font-variant-numeric: tabular-nums; }
.player-big { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; text-align: center; margin: 0.5rem 0; }
.player-big.is-turn { color: var(--amber); }
.player-wait { text-align: center; }
/* Gros bouton rond : on doit pouvoir buzzer sans viser */
.player-buzzer {
  display: block; width: min(72vw, 280px); aspect-ratio: 1; margin: 1rem auto; border-radius: 50%;
  border: none; cursor: pointer; background: var(--red); color: var(--text);
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: 0.08em;
  box-shadow: 0 10px 0 var(--red-soft), var(--shadow-l);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.player-buzzer:active { transform: translateY(8px); box-shadow: 0 2px 0 var(--red-soft), var(--shadow-m); }
.player-choices { display: grid; gap: 0.6rem; }
.player-choice {
  font: inherit; font-size: 1.02rem; font-weight: 500; text-align: left; color: var(--text); cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  padding: 1rem; min-height: 3.4rem; touch-action: manipulation;
}
.player-choice:active { background: var(--amber-soft); border-color: var(--amber); }
.player-reveal { text-align: center; }
.player-answer { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0; }
.player-answer-artist { color: var(--text-muted); margin: 0; }
.player-points { font-weight: 600; margin-top: 1rem; }
.player-points.is-win { color: var(--green); }
.player-score { text-align: center; color: var(--text-muted); }
.player-podium { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.player-podium li { display: flex; justify-content: space-between; background: var(--bg-raised); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; }
.player-podium li.is-me { border: 1px solid var(--amber); }

/* ---------- Blindtest : écran de salle (TV), tailles relatives à la largeur de l'écran ---------- */
.screen-page { min-height: 100dvh; overflow: hidden; }
.screen-shell { min-height: 100dvh; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto 1fr; gap: 2vw; padding: 3vw; }
.screen-header { grid-column: 1 / -1; font-family: var(--font-display); font-size: 2vw; font-weight: 700; }
.screen-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.screen-kicker { font-size: 1.8vw; color: var(--text-muted); margin: 0.4em 0; }
.screen-url { font-size: 2.2vw; margin: 0.2em 0; }
.screen-code { font-family: var(--font-display); font-size: 12vw; font-weight: 800; letter-spacing: 0.1em; color: var(--amber); margin: 0; line-height: 1; }
.screen-big { font-family: var(--font-display); font-size: 5vw; font-weight: 700; margin: 0.3em 0; }
.screen-sub { font-size: 3vw; color: var(--text-muted); margin: 0; }
.screen-countdown { font-family: var(--font-display); font-size: 14vw; font-weight: 800; color: var(--amber); margin: 0; line-height: 1; font-variant-numeric: tabular-nums; }
.screen-options { font-size: 2.4vw; text-align: left; margin-top: 1em; }
.screen-board { font-size: 1.8vw; background: var(--bg-raised); border-radius: var(--radius-l); padding: 1.5vw; align-self: stretch; }

@media (max-width: 720px) {
  .bt-console { grid-template-columns: 1fr; }
  .bt-track-row { grid-template-columns: 1fr 1fr; }
  .bt-round input, .bt-round select { font-size: 16px; }
}

/* ---------- Blindtest : page QR code (affichée en salle) ---------- */
.qr-page { min-height: 100dvh; }
.qr-shell {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; padding: 2rem 1rem; text-align: center;
}
.qr-kicker { font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 3rem); font-weight: 700; margin: 0; }
/* Fond blanc et marge : le contraste dont les appareils photo ont besoin pour lire le code */
.qr-image {
  width: min(70vmin, 520px); height: auto; aspect-ratio: 1;
  background: #fff; border-radius: var(--radius-l); padding: 1rem; box-shadow: var(--shadow-l);
}
.qr-or { font-size: clamp(1rem, 2vw, 1.6rem); color: var(--text-muted); margin: 0; }
.qr-code { font-family: var(--font-display); font-size: clamp(3rem, 10vw, 7rem); font-weight: 800; letter-spacing: 0.12em; color: var(--amber); margin: 0; line-height: 1; }

/* Blindtest : import Spotify */
.bt-editor-add { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bt-import-summary { margin: 0.8rem 0; }
.bt-import-preview { font-size: 0.82rem; }
.sp-random { align-self: center; margin-top: 0.8rem; }


/* CRM : barre de publication, dossiers photo */
.publish-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 0.85rem 1.1rem; margin-bottom: 1.25rem;
}
/* Brouillon non publié : liseré ambré, comme les éléments « en cours » */
.publish-bar.has-changes { border-color: var(--amber-dim); box-shadow: inset 3px 0 0 var(--amber); }
.publish-status { margin: 0; font-size: 0.9rem; color: var(--text-muted); flex: 1; min-width: 14rem; }
.gallery-folders { display: flex; flex-direction: column; gap: 1rem; }
.gallery-folder { max-width: none; margin-bottom: 0; }
.photo-grid {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem;
}
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; background: var(--bg-raised-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-delete {
  position: absolute; top: 0.3rem; right: 0.3rem; width: 1.9rem; height: 1.9rem;
  border: none; border-radius: 50%; background: rgba(21, 19, 15, 0.8); color: var(--text); cursor: pointer;
}
.photo-thumb-delete:hover { background: var(--red); }
.photo-thumb-delete:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.gallery-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
/* Le champ fichier est masqué dans son label : le focus clavier se voit sur le bouton */
.gallery-upload label:focus-within { box-shadow: var(--focus-ring); }

/* ---------- CRM › Planning du site : saisie semaine par semaine ---------- */
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.week-label { font-weight: 500; min-width: 14rem; text-align: center; }
.week-help { margin: 0 0 1rem; }
.week-grid { display: grid; gap: 1rem; }
/* Un bloc par semaine (2 affichées) ; les jours sont des lignes à l'intérieur */
.week-block {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 0.25rem 1rem 0.5rem;
}
.week-block-title { font-size: 1rem; margin: 0.75rem 0 0.25rem; }
.week-day {
  display: grid; grid-template-columns: 11rem 1fr; gap: 0.75rem; align-items: start;
  padding: 0.65rem 0; border-top: 1px solid var(--line);
}
/* Jours passés : encore modifiables, mais en retrait */
.week-day.is-past { opacity: 0.6; }
.week-day-label { font-weight: 500; padding-top: 0.45rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
/* Majuscule au jour seulement (« Lundi 16 nov. ») : capitalize mettrait aussi « Nov. » */
.week-day-label > span:first-child::first-letter { text-transform: uppercase; }
.week-day-body { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.week-day-body .stock-row { width: 100%; }
.week-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.week-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; }
.week-row .field { margin: 0; }
.week-row-text { flex: 1; min-width: 12rem; display: flex; flex-direction: column; gap: 0.35rem; }
.week-row .week-time { width: 7.5rem; }
.week-row .week-time-sep { color: var(--text-muted); }
/* Case marquée à la corbeille : supprimée à l'enregistrement */
.week-row.is-deleted .week-row-text, .week-row.is-deleted .week-time, .week-row.is-deleted .week-time-sep,
.week-row.is-deleted .week-signup, .week-row.is-deleted .week-signup-url { opacity: 0.4; text-decoration: line-through; }
.week-row.is-deleted [data-delete-row] { background: var(--red-soft); border-color: var(--red); }

/* Pastilles « Publié » / « En attente de publication » */
.pub-chip-slot { display: inline-flex; vertical-align: middle; }
.pub-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 500;
  padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; line-height: 1.4;
}
.pub-chip::before { content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.pub-chip.is-published { background: var(--green-soft); color: var(--green); }
.pub-chip.is-pending { background: var(--amber-soft); color: var(--amber); }
.week-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
@media (max-width: 720px) {
  .week-day { grid-template-columns: 1fr; gap: 0.4rem; }
  .week-day-label { padding-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  .week-block { padding: 0.25rem 0.75rem 0.5rem; }
  .week-label { min-width: 0; text-align: left; }
}

/* ---------- CRM › Galeries : boutons icônes, mode « Modifier », dépôt et ordre des photos ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg-raised-2); color: var(--text);
  cursor: pointer; transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.icon-btn.primary:hover { filter: brightness(1.08); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.icon { display: block; flex-shrink: 0; }

.gallery-actions { display: flex; gap: 0.4rem; align-self: flex-start; }
.gallery-folder { position: relative; }
.gallery-folder.is-editing { border-color: var(--amber-dim); box-shadow: inset 3px 0 0 var(--amber); }
.gallery-edit-header { align-items: flex-start; gap: 1rem; }
.gallery-edit-fields { flex: 1; display: grid; grid-template-columns: 1fr 11rem; gap: 0 0.75rem; }
.gallery-edit-fields .field { margin-bottom: 0.5rem; }
.gallery-edit-fields .muted { grid-column: 1 / -1; margin: 0; }

/* Miniatures en mode Modifier : on les saisit pour les déplacer */
.gallery-folder.is-editing .photo-thumb { cursor: grab; }
.photo-thumb.is-dragged { opacity: 0.35; }
.photo-thumb.drop-before { box-shadow: -4px 0 0 var(--amber); }
.photo-thumb.drop-after { box-shadow: 4px 0 0 var(--amber); }
.photo-thumb-grip {
  position: absolute; top: 0.3rem; left: 0.3rem; padding: 0.15rem; border-radius: var(--radius-xs);
  background: rgba(21, 19, 15, 0.75); color: var(--text); pointer-events: none;
}
.photo-thumb .icon-btn { width: 1.9rem; height: 1.9rem; background: rgba(21, 19, 15, 0.8); border-color: transparent; }
.photo-thumb-move { position: absolute; bottom: 0.3rem; left: 0.3rem; right: 0.3rem; display: flex; justify-content: space-between; }

/* Zone de dépôt, d'après le composant fourni par Adri' (pointillés, icône, surbrillance) */
.drop-zone {
  display: flex; align-items: center; gap: 0.9rem; margin-top: 0.5rem; padding: 1.1rem 1.25rem;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-m); background: var(--bg-raised-2);
  cursor: pointer; transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.drop-zone:hover { background: var(--bg-hover); }
.drop-zone:focus-within { box-shadow: var(--focus-ring); }
.drop-zone-icon {
  display: inline-flex; padding: 0.6rem; border-radius: 50%; background: var(--bg); color: var(--text-muted);
  box-shadow: var(--shadow-s);
}
.drop-zone-text { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.88rem; }
.drop-zone-text span { color: var(--text-muted); font-size: 0.8rem; }
.gallery-folder.is-uploading .drop-zone { opacity: 0.5; pointer-events: none; }

/* Fichiers glissés depuis l'ordinateur au-dessus de la carte : toute la carte les accepte */
.drop-overlay {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; border: 2px dashed var(--amber); border-radius: inherit; background: rgba(60, 52, 24, 0.88);
  color: var(--text); font-weight: 500; text-align: center; padding: 1rem; pointer-events: none; z-index: 2;
}
.gallery-folder.is-dropping .drop-overlay { display: flex; }

@media (max-width: 720px) {
  .gallery-edit-header { flex-direction: column; }
  .gallery-edit-fields { grid-template-columns: 1fr; width: 100%; }
  .gallery-actions { align-self: flex-end; }
}
.photo-thumb .photo-thumb-delete:hover { background: var(--red); border-color: var(--red); }
/* Planning du site : lecture (jour vide) et case « Inscription » des lignes à saisir */
.week-empty { color: var(--text-faint); font-size: 0.85rem; padding-top: 0.45rem; }
.week-signup { white-space: nowrap; font-size: 0.85rem; }
.week-row .week-signup-url { width: 12rem; }
@media (max-width: 720px) { .week-row .week-signup-url { width: 100%; } }
