/* ──────────────────────────────────────────────────────────────────────────
   Le thème de l'appli, tel que le site de trad l'applique (gerbytool, static/style.css)

   Chargée en dernier sur toutes les pages (vitrine, espaces créateur et équipe, espace Admin) :
   la boutique a la même barre d'en-tête, les mêmes onglets, boutons, bascules, champs, cartes,
   titres et tuiles que le site de trad. Valeurs recopiées de style.css : à garder alignées.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #111B2A; --bg-bar: #142030; --panel: rgba(30, 45, 66, 0.95); --panel-solid: #1D2B40; --field: #162336;
  --line: #2A3A51; --line-strong: #34465F; --line-soft: #203046;
  --text: #E6EBF2; --text-soft: #B6C0CE; --muted: #8D99AB; --text-muted: #8D99AB; --text-dim: #7C8899;
  --accent: #56A1A6; --accent-hover: #68B5BA; --accent-text: #04252B; --accent-soft: rgba(86, 161, 166, 0.16);
  --accent-line: rgba(86, 161, 166, 0.35); --accent-light: #7FD1D6;
  --ok-text: #7BE0A0; --ok-soft: rgba(39, 160, 72, 0.14); --warn-text: #F4C76A; --warn-soft: rgba(224, 163, 65, 0.14);
  --danger-text: #F2A0A8; --danger-line: #5A2E35; --danger-soft: rgba(224, 82, 82, 0.16);
  --radius: 10px; --radius-card: 16px;
  --font-title: "Montserrat", system-ui, sans-serif; --font-body: "Manrope", system-ui, sans-serif;
}

/* ---------- Page : pleine largeur, barre d'en-tête en haut, contenu avec ses marges ---------- */
html, body { background: var(--bg); }
body { margin: 0; padding: 0; color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: normal; }
body > main, body.public > main { max-width: none; margin: 0; padding: 16px 24px 32px; }
body > footer, #footer-links { max-width: none; margin: 0; padding: 0 24px 24px; font-size: 14.5px; color: var(--text-muted); }

h1, h2, h3 { font-family: var(--font-title); }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; color: #FFFFFF; margin: 0 0 10px; }
h3 { font-size: 12.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-soft); margin: 14px 0 6px; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted, .small { font-size: 14.5px; color: var(--text-muted); }
p.muted, span.muted { font-size: 14.5px; }

/* ---------- Barre d'en-tête (header du site de trad) ---------- */
.app-head, #header.space-header {
  max-width: none; margin: 0; padding: 12px 16px 0; background: var(--bg-bar); border-bottom: 1px solid var(--line-soft);
}
.app-head:not(:has(nav.tabs)) { padding-bottom: 12px; }
header.brand-bar { max-width: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; background: none; border: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; text-decoration: none !important; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.brand-name { font-family: var(--font-title); font-size: 22px; font-weight: 700; letter-spacing: normal; color: var(--text); }
.brand:hover .brand-name { color: var(--text); }
.brand-shop { margin-left: 2px; font-family: var(--font-title); font-size: 12.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-soft); }
header.brand-bar .bar-right { display: flex; align-items: center; gap: 10px; }

/* Tête de Copi : 36 px, sans cadre (copi-guide du site de trad) */
header.brand-bar .guide-open { width: 36px; height: 36px; border: none; border-radius: 50%; background: none; padding: 0; }
header.brand-bar .guide-open img { width: 36px; height: 36px; }
header.brand-bar .guide-open:hover { border: none; background: none; }

/* Espace sans personne connectée (page de connexion) : la pastille du site de trad */
.space-tag, .space-tag.admin {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-light); font-size: 13.5px; font-weight: 600; letter-spacing: normal;
}

/* Personne connectée : le badge du site de trad (#userBadge) */
.user-badge {
  display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 5px 6px; color: var(--text-soft); min-width: 0;
}
.user-badge .uavatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-light);
  font-family: var(--font-title); font-weight: 700; font-size: 15px;
}
.user-badge .uinfos { display: flex; flex-direction: column; line-height: 1.15; padding-right: 4px; min-width: 0; }
.user-badge .uname { font-weight: 700; color: var(--accent-light); font-family: var(--font-title); font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-badge .urole { font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; }
.user-badge .icon-form { display: inline-flex; margin: 0; }
.user-badge .icon-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; min-height: 0;
  padding: 0; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--text-soft);
  cursor: pointer; text-decoration: none !important;
}
.user-badge .icon-btn:hover, .icon-btn:hover { background: #26364F; color: var(--text); border-color: var(--line-strong); }

/* ---------- Onglets (.tabs / .tabbtn du site de trad) ---------- */
nav.tabs, #header.space-header nav.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-end; max-width: none; margin: 10px 0 0; padding: 0;
  border-bottom: 1px solid var(--line);
}
.app-head nav.tabs, #header.space-header nav.tabs { margin-bottom: -1px; }
nav.tabs a, nav.tabs button, nav.tabs .end {
  position: static; display: inline-flex; align-items: center; gap: 0; padding: 9px 14px 10px; margin: 0;
  background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 10px;
  color: var(--text-muted); font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: normal;
  text-decoration: none; cursor: pointer; white-space: nowrap; height: auto; min-height: 0; box-shadow: none;
}
nav.tabs a:hover, nav.tabs button:hover { background: #26364F; color: var(--text); text-decoration: none; }
nav.tabs a.now { color: var(--accent-light); border-bottom: 2px solid var(--accent); }
nav.tabs a.now::after { content: none; }
nav.tabs .end { margin-left: auto; }
nav.tabs form.end { padding: 0; border: none; }
nav.tabs .ico { margin-right: 6px; flex: none; }
nav.tabs .count { margin-left: 6px; }
.ico { display: inline-block; vertical-align: -0.18em; }

/* ---------- Cartes ---------- */
.card, .module, #content-main .module {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.card { padding: 16px; }
main > .card { margin-top: 14px; }
main > .card:first-child, main > .notice + .card { margin-top: 0; }
.card > h2:first-child { margin-top: 0; }

/* ---------- Boutons ---------- */
button, a.button, input[type=submit], .button {
  background: var(--panel-solid); color: var(--text-soft); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 9px 16px; font-family: var(--font-body); font-size: 14.5px; font-weight: 600; line-height: normal;
  cursor: pointer; text-decoration: none; transition: background .12s, color .12s, border-color .12s;
}
button:hover, a.button:hover, input[type=submit]:hover, .button:hover { background: #26364F; color: var(--text); text-decoration: none; }
button:disabled, button:disabled:hover { color: #556173; border-color: var(--line); background: var(--panel-solid); cursor: default; opacity: 1; }
button.primary, a.button.primary, input[type=submit].default, .button.primary {
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); font-weight: 700;
}
button.primary:hover, a.button.primary:hover, input[type=submit].default:hover, .button.primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text);
}
button.primary:disabled { background: #2F4F52; border-color: #2F4F52; color: #8A97A6; }
button.danger, .button.danger { background: transparent; color: var(--danger-text); border: 1px solid var(--danger-line); }
button.danger:hover, .button.danger:hover { background: var(--danger-soft); color: var(--danger-text); }
input[type=file]::file-selector-button {
  background: var(--panel-solid); color: var(--text-soft); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 5px 10px; margin-right: 10px; font-family: var(--font-body); font-weight: 600; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #26364F; border-color: var(--line-strong); color: var(--text); }
input[type=file] { padding: 6px; color: var(--text-soft); font-size: 14.5px; }

/* ---------- Bascules (.bascule du site de trad) : filtres de la vitrine, filtres des ventes, pagination ---------- */
.seg, .bascule { display: inline-flex; gap: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; background: transparent; }
.seg button, .bascule button {
  background: transparent; border: none; border-radius: 0; color: var(--text-muted); padding: 7px 16px;
  font-size: 15px; font-weight: 700; letter-spacing: .04em;
}
.seg button + button, .bascule button + button { border-left: 1px solid var(--line-strong); }
.seg button:hover, .bascule button:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.seg button.on, .bascule button.actif { background: var(--accent); color: var(--accent-text); font-weight: 700; }
a.tag { display: inline-block; margin: 4px 6px 0 0; padding: 7px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: transparent; color: var(--text-muted); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
a.tag:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; }
a.tag.now { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
span.tag { border-color: var(--line); color: var(--text-soft); font-size: 13.5px; }
.pages button { padding: 7px 12px; min-width: 38px; font-size: 15px; font-weight: 700; }
.pages button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* ---------- Champs ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]),
select, textarea {
  background-color: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font-family: var(--font-body); font-size: 14.5px; line-height: normal; box-shadow: none;
}
select, .card select, form.inline select, .shop-tools select, .per-page select { padding-right: 32px; background-color: var(--field);
  background-position: right 10px center; line-height: normal; }
textarea { font-size: 14.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
label { color: var(--text-soft); font-size: 14.5px; }
.card label { color: var(--text-soft); }
.card label.check { color: var(--text); }
.app-select-btn { padding: 7px 32px 7px 10px; font-size: 14.5px; line-height: normal; background-color: var(--field);
  border-color: var(--line); background-position: right 10px center; }
.app-select-btn:hover { background-color: var(--field); border-color: var(--accent-line); }

/* ---------- Pastilles (.pill / .badge du site de trad) ---------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-light); font-size: 13.5px; font-weight: 600;
}
.pill.ok, .pill.state-publie { background: var(--ok-soft); border-color: rgba(76, 212, 131, .35); color: var(--ok-text); }
.pill.error, .pill.state-refuse, .pill.state-suspendu { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.pill.state-en_validation, .pill.state-brouillon { background: var(--warn-soft); border-color: rgba(224, 163, 65, .35); color: var(--warn-text); }
.pill.state-retire { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--text-soft); }
.count { background: var(--accent); color: var(--accent-text); font-size: 12.5px; }

/* ---------- Tuiles de chiffres (.encours-tuile du site de trad) ---------- */
.stats { gap: 12px; }
.stats div { display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; }
.stats span { font-size: 12px; color: var(--text-muted); letter-spacing: .5px; text-transform: uppercase; }
.stats strong { font-family: var(--font-title); font-size: 25px; font-weight: 700; color: var(--text); }

/* ---------- Tableaux (.admin-table du site de trad) ---------- */
table { font-size: 14.5px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--accent-light); font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

/* ---------- Messages ---------- */
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font-size: 14.5px; }
.notice.success { background: var(--ok-soft); border-color: rgba(76, 212, 131, .35); color: var(--ok-text); }
.notice.error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.notice.warning { background: var(--warn-soft); border-color: rgba(224, 163, 65, .35); color: var(--warn-text); }

/* ---------- Barres de défilement et mise au point clavier ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; border-radius: 6px; }
button:focus-visible, nav.tabs a:focus-visible { outline-offset: -2px; }
button:focus:not(:focus-visible) { outline: none; }

/* ---------- Petit écran (règles du site de trad) ---------- */
@media (max-width: 760px) {
  .brand-name { font-size: 17px; }
  nav.tabs, #header.space-header nav.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a, nav.tabs button { padding: 8px 10px 9px; font-size: 14.5px; flex: none; }
  body > main, body.public > main { padding: 14px 16px 28px; }
  .user-badge .uinfos { display: none; }
}

/* ---------- Vitrine ---------- */
/* Nom d'un pack : titre de carte (comme h2, un cran plus petit), pas un intertitre en capitales */
.pack-body h3 { margin: 0; font-size: 16px; font-weight: 700; color: #FFFFFF; text-transform: none; letter-spacing: normal; }
/* Recherche : la loupe à gauche, le texte après */
.shop-tools .search input.search-input, .shop-tools .search input[type=search], .shop-tools .search input[type=text] {
  padding-left: 34px !important; background-position: 11px center; background-repeat: no-repeat; }   /* plus fort que la règle générale des champs */
.hero-title { color: #FFFFFF; }
/* Essai d'un pack : les boutons d'humeur et de notification sont des boutons de l'appli (arrondi 10 px) */
.chips button { border-radius: var(--radius); padding: 7px 14px; font-size: 14.5px; }
.chips button.on { border-color: var(--accent); color: var(--accent-light); }
.pill.big { font-weight: 700; }

/* Filtres (état d'un pack, type de vente) : une bascule d'un seul bloc, comme LIVE / PTU / Tout du site de trad */
p.filters { display: inline-flex; flex-wrap: wrap; margin: 0 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden; }
p.filters a.tag { margin: 0; border: none; border-radius: 0; }
p.filters a.tag + a.tag { border-left: 1px solid var(--line-strong); }

/* La barre d'en-tête reste en haut quand la page défile (dans le site de trad, seul le contenu défile) */
.app-head, #header.space-header { position: sticky; top: 0; z-index: 50; }

/* ---------- Champs, boutons et en-têtes de tableaux : mêmes tailles que le site de trad ---------- */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=tel],
input[type=search], input[type=date], input[type=time], input[type=datetime-local], textarea, select {
  font-size: 14.5px; padding: 7px 10px; min-height: 0; line-height: normal; border-color: var(--line); background-color: var(--field); }
select { padding-right: 32px; }
.button, button.button, a.button { min-height: 0; padding: 9px 16px; font-size: 14.5px; line-height: normal; }
.button:hover, button.button:hover, a.button:hover { background: #26364F; border-color: var(--line-strong); color: var(--text); }
thead th { color: var(--accent-light); font-size: 13.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
thead th a { color: var(--accent-light); }

/* ---------- Accueil de l'espace équipe : comme l'accueil du site de trad ---------- */
.home { display: flex; flex-direction: column; gap: 14px; }
.home > .card { margin: 0; }
.home-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-light); }
/* La boutique : une ligne, l'état à gauche, la bascule Fermée / Ouverte à droite */
.home-shop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.home-shop:not(.is-open) .home-ico { background: rgba(255, 255, 255, .05); color: var(--text-muted); }
.home-shop-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.home-shop h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.home-shop .pill { font-family: var(--font-body); }
/* À faire : cartes cliquables (les cartes de projet du site de trad) */
.home-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
a.home-job { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; min-height: 120px; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-card);
  transition: border-color .12s, transform .12s, background .12s; text-decoration: none; }
a.home-job:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.home-job-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 16px; font-weight: 700; }
.home-job-head .home-ico { width: 30px; height: 30px; flex-basis: 30px; }
.home-job-go { margin-left: auto; color: var(--text-muted); }
.home-job-n { font-family: var(--font-title); font-size: 25px; font-weight: 700; color: var(--text-muted); margin-top: auto; }
a.home-job.due .home-job-n { color: var(--warn-text); }
a.home-job.due { border-color: rgba(224, 163, 65, .35); }
a.home-job:not(.due) .home-ico { background: rgba(255, 255, 255, .05); color: var(--text-muted); }
/* Chiffres : les tuiles du site de trad (.encours-tuile) */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.home-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; min-height: 112px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); border-radius: var(--radius); }
.home-tile .titre { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; }
.home-tile .chiffre { font-family: var(--font-title); font-size: 25px; font-weight: 700; color: var(--text); }
.home-tile .note { font-size: 13px; color: var(--text-dim); margin-top: auto; }

/* ---------- Statistiques : comme celles du site de trad ---------- */
.stats-tete { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stats-tete h2 { margin: 0; flex: 1; }
.stats-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.stats-grille .large { grid-column: 1 / -1; }
@media (max-width: 900px) { .stats-grille { grid-template-columns: minmax(0, 1fr); } }
.stats-bloc { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); border-radius: var(--radius); }
.stats-bloc > .titre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; }
.stats-bloc > .titre .small { text-transform: none; letter-spacing: 0; font-size: 12px; }
.stats-legende { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; text-transform: none; letter-spacing: 0;
  font-size: 13px; color: var(--text-soft); }
.stats-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.stats-legende i.packs, .stats-courbe .packs { background: var(--accent); fill: var(--accent); }
.stats-legende i.nouveaux, .stats-courbe .nouveaux { background: var(--ok-text); fill: var(--ok-text); }
.stats-courbe { width: 100%; height: auto; display: block; }
.stats-courbe text { font-family: var(--font-body); }
.stats-courbe .axe { fill: var(--text-muted); font-size: 12px; }
.stats-courbe .grille { stroke: var(--line-soft); stroke-width: 1; }
.stats-courbe .grille.base, .stats-courbe .trait { stroke: var(--line-strong); stroke-width: 1; }
.stats-courbe .fond { fill: transparent; }
.stats-courbe g:hover .fond { fill: rgba(255, 255, 255, .03); }
.stats-barres { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 9px 14px; align-items: center; }
.stats-barres .nom { font-size: 13.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.stats-barres .nb { font-size: 13.5px; color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stats-barres .mini { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.stats-barres .mini > div { height: 100%; border-radius: 4px; background: var(--accent); }
#stats-tuiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { #stats-tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { #stats-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Joueurs : un PC par ligne, en colonnes (une seule ligne de haut), cliquable ---------- */
.players { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.player { display: grid; align-items: center; gap: 14px; padding: 7px 14px;
  grid-template-columns: minmax(180px, 1.6fr) 60px minmax(120px, 1.2fr) minmax(120px, 1.2fr) 130px 90px 18px; }
a.player { color: var(--text); text-decoration: none; background: var(--field); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color .12s, background .12s; }
a.player:hover { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.player-head { padding-top: 0; padding-bottom: 2px; color: var(--accent-light); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; }
.player > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-who strong { margin-right: 6px; }
.player-n { font-family: var(--font-title); font-weight: 700; }
.player-used { color: var(--accent-light); font-size: 14px; }
.player-revoked { color: var(--danger-text); font-size: 14px; }
.player .home-job-go { display: inline-flex; }
@media (max-width: 900px) {
  .player { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 18px; }
  .player > :nth-child(4), .player > :nth-child(5), .player > :nth-child(6) { display: none; }
}
#joueur code { font-size: 12.5px; color: var(--text-soft); }
#joueur .row-actions { margin-left: auto; }

/* Fiche d'un joueur : ses packs en petites cartes ; « Révoquer… » s'ouvre sur place */
.owned { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.owned-pack { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); }
.owned-pack.revoque, .owned-pack.supprime { opacity: .75; }
.owned-pack.utilise { border-color: var(--accent-line); background: var(--accent-soft); }
.pill.etat-utilise { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.owned-note { margin: -4px 0 12px; }
.owned-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.owned-head a { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owned-head a:hover { color: var(--accent-light); }
.owned-head .pill { white-space: nowrap; flex: 0 0 auto; }
.owned-reason { color: var(--danger-text); }
.owned-pack .revoke { margin-top: auto; }
.revoke-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.revoke-form[hidden] { display: none; }
.revoke-form input { flex: 1 1 100%; min-width: 0; margin: 0; padding: 6px 10px; font-size: 14px; }
#joueur .revoke-form input { flex-basis: 200px; }
button.small-btn { padding: 5px 12px; font-size: 13.5px; min-height: 0; }
.revoke button.small-btn[data-open][hidden] { display: none; }
#joueur .revoke { margin-left: auto; max-width: 420px; }

/* ---------- Packs : filtres par état, grille de cartes, 48 par page ---------- */
.bascule .bascule-n { font-weight: 600; opacity: .75; margin-left: 4px; }
#depot-form { margin: 0; }
#deposer { display: inline-flex; align-items: center; gap: 8px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 14px; }
a.pack-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text); text-decoration: none;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .12s, background .12s, transform .12s; }
a.pack-tile:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
a.pack-tile.due { border-color: rgba(224, 163, 65, .45); }
a.pack-tile img, .pack-tile-empty { width: 48px; height: 48px; flex: 0 0 48px; border-radius: var(--radius); object-fit: cover; }
.pack-tile-empty { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .05); color: var(--text-muted); }
.pack-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pack-tile-text strong, .pack-tile-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-tile-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pack-tile-pills .pill { margin: 0; }
.pack-count { margin: 12px 0 0; }

/* ---------- Connexion : l'écran du site de trad (#loginOverlay, #loginBox) ---------- */
#loginOverlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; }
#loginBox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 36px 44px; width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); margin: 0; }
#loginBox .loginLogo { text-align: center; }
#loginBox .loginLogo img { width: 104px; height: 104px; object-fit: contain; border-radius: 16px; }
#loginBox h2 { margin: 0; text-align: center; color: var(--accent-light); letter-spacing: .04em; }
#loginBox .loginSous { margin-top: -12px; text-align: center; font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .12em; }
#loginBox label { display: flex; flex-direction: column; gap: 6px; align-items: stretch; margin: 0; color: var(--text-soft); }
#loginBox input { width: 100%; margin: 0; }
#loginBox button { padding: 11px; font-size: 16px; width: 100%; }
#loginError { color: var(--danger-text); font-size: 14.5px; text-align: center; min-height: 18px; }
@media (max-width: 420px) { #loginBox { padding: 28px 22px; } }

/* Fiche d'un pack : les actions à droite, sur la ligne du titre */
.pack-main { flex: 1; min-width: 0; }
.fiche-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fiche-tete h2 { margin: 0; flex: 1; min-width: 200px; }
.fiche-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
#supprimer-volet { margin-top: 12px; }
#supprimer-volet .inline { margin-top: 10px; }
.player-who .small { display: inline; margin: 0; }
.pavatar { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center;
  justify-content: center; vertical-align: middle; margin-right: 10px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-light); font-family: var(--font-title); font-weight: 700; font-size: 13px; }
.pavatar.big { width: 40px; height: 40px; font-size: 18px; margin-right: 0; }
.player-head > span:first-child { padding-left: 36px; }
.shared-pill { margin-left: 6px; cursor: pointer; font-size: 12px; padding: 1px 8px; }
#meme-pseudo { margin: 14px 0 0; }

/* Codes cadeaux d'un pack */
#code-form { margin: 0; flex-wrap: nowrap; }
#code-form input { width: 260px; max-width: 50vw; margin: 0; }
.codes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.code-line { display: grid; grid-template-columns: 150px 70px minmax(120px, 1fr) minmax(150px, auto) minmax(200px, auto);
  align-items: center; gap: 12px; padding: 7px 12px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); }
.code-line.used { opacity: .8; }
.code-line code { font-size: 15px; font-weight: 700; color: var(--accent-light); letter-spacing: .04em; }
.code-line.used code { color: var(--text-soft); grid-column: span 2; }
.code-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-state { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.code-state .pill { margin: 0; }
@media (max-width: 900px) { .code-line { grid-template-columns: 1fr auto; } .code-line > .small, .code-note { display: none; } }

/* Pack réservé (codes cadeaux seulement) */
.pill.state-reserve { background: rgba(167, 139, 250, .14); border-color: rgba(167, 139, 250, .4); color: #C9B8FF; }
#decide .dest { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; }
#etat-pack button { padding: 6px 14px; font-size: 14px; }

/* Créer un pack */
#creer { display: inline-flex; align-items: center; gap: 8px; }
#kit .fiche-actions .button { display: inline-flex; align-items: center; gap: 8px; }
.creer-steps { display: flex; flex-direction: column; gap: 10px; }
.creer-step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; background: var(--field);
  border: 1px solid var(--line); border-radius: var(--radius); }
.creer-step h3 { margin: 2px 0 6px; text-transform: none; letter-spacing: 0; font-size: 15.5px; color: var(--text); }
.creer-step p { margin: 4px 0; }
.creer-n { flex: 0 0 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-light);
  font-family: var(--font-title); font-weight: 700; }
.creer-code { margin: 6px 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px; color: var(--text-soft); overflow-x: auto; white-space: pre; }
.creer-charte { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-soft); }
#contenu .home-tile { min-height: 0; }
#contenu .home-tile .note { margin-top: 0; }

/* Comptes : création à gauche (formulaire empilé), liste à droite ; l'un sous l'autre sur un petit écran */
.comptes-grille { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 14px; align-items: start; }
.comptes-grille > .card { margin: 0; }
@media (max-width: 1100px) { .comptes-grille { grid-template-columns: minmax(0, 1fr); } }
#nouveau-compte .compte-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
#nouveau-compte .compte-champ { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--text-soft); font-size: 14.5px; }
#nouveau-compte .compte-titre { white-space: nowrap; }
#nouveau-compte .compte-titre:empty { display: none; }
#nouveau-compte .compte-titre .small { display: inline; margin-left: 6px; }
#nouveau-compte input:not([type=hidden]) { width: 100%; margin: 0; height: 38px; box-sizing: border-box; }
#nouveau-compte .compte-mdp-ligne { display: flex; gap: 6px; align-items: center; }
#nouveau-compte .compte-mdp-ligne input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
#nouveau-compte .compte-mdp-ligne .small-btn { height: 38px; padding: 0 12px; font-size: 14px; flex: none; }
#nouveau-compte #role-choix { display: flex; height: 38px; box-sizing: border-box; }
#nouveau-compte #role-choix button { flex: 1; height: 36px; padding: 0 14px; }
#nouveau-compte .compte-ok { width: 100%; height: 40px; margin: 0; }
#nouveau-compte .compte-aide { margin: 12px 0 0; }
#nouveau-compte .compte-form, #nouveau-compte .compte-champ { align-items: stretch; text-align: left; }
#nouveau-compte .compte-ok { align-self: stretch; }
.driver-req { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.driver-req p { margin: 4px 0; }

/* Créer un module d'intégration */
.module-sortes { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.module-sortes .home-tile { min-height: 0; }
.module-sortes .home-tile .note { margin-top: 0; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; margin-top: 12px; }
.ref-grid h3 { margin: 6px 0 8px; }
.ref-table { width: 100%; border-collapse: collapse; }
.ref-table th { width: 1%; white-space: nowrap; vertical-align: top; text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.ref-table td { color: var(--text-soft); }
.ref-table code { font-size: 12.5px; }
@media (max-width: 600px) { .ref-grid { grid-template-columns: 1fr; } .ref-table th { white-space: normal; } }

/* Créer : pack cosmétique ou module d'intégration, au même niveau */
.creer-choix { margin: 0; flex: none; }
.creer-tete { padding: 10px 14px; }
.creer-choix button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-size: 15px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
