/* ————————————————————————————— HUB Koehler Campus
   Identité koehlercampus.fr : chocolat profond, caramel doré, crème,
   photographie plein cadre, capitales espacées. Mobile d'abord. */

:root {
  --chocolat: #2b1c0e;
  --chocolat-2: #201409;
  --caramel: #c89b4b;
  --caramel-fonce: #a97f33;
  --creme: #f0e7da;
  --fond: #faf7f1;
  --carte: #ffffff;
  --trait: #e6ddcf;
  --encre: #2f2a24;
  --encre-2: #6f6659;
  --vert: #2f9469;
  --vert-doux: #e2f2ea;
  --rouge: #d4523f;
  --rouge-doux: #f9e3df;
  --rayon: 14px;
  --ombre: 0 1px 2px rgb(43 28 14 / 5%), 0 10px 30px -18px rgb(43 28 14 / 30%);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  background: var(--fond);
  color: var(--encre);
  font-family: "Mulish", "Avenir Next", "Avenir", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.01em; }

.majuscules {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
}

button { font: inherit; cursor: pointer; }

input, select, textarea {
  font: inherit;
  color: var(--encre);
  background: var(--carte);
  border: 1.5px solid var(--trait);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  width: 100%;
  min-height: 44px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--caramel);
  outline-offset: 2px;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--encre-2);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.champ { margin-bottom: 1rem; }

/* ——————————————— connexion */

.porte {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(50rem 26rem at 110% -10%, rgb(200 155 75 / 18%), transparent 65%),
    radial-gradient(40rem 22rem at -10% 110%, rgb(200 155 75 / 10%), transparent 60%),
    var(--chocolat);
}

.porte-carte {
  width: min(23rem, 100%);
  background: var(--carte);
  border-radius: 22px;
  padding: 2.4rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 55%);
}

.porte-carte img { width: 74px; height: 74px; object-fit: contain; }

.porte-marque {
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 800;
  margin-top: 0.6rem;
}

.porte h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--encre-2);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0.2rem 0 1.6rem;
}

.porte input {
  text-align: center;
  font-family: "Oswald", ui-monospace, sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 0.8rem;
}

.porte .erreur { color: var(--rouge); font-size: 0.85rem; min-height: 1.2rem; margin: 0.5rem 0; }

/* ——————————————— boutons */

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  min-height: 44px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--chocolat);
  color: #fff;
}

.btn:hover { background: #000; }
.btn.caramel { background: var(--caramel); color: var(--chocolat-2); }
.btn.caramel:hover { background: var(--caramel-fonce); color: #fff; }
.btn.discret {
  background: none;
  border: 1.5px solid var(--trait);
  color: var(--encre-2);
  font-weight: 700;
}
.btn.discret:hover { border-color: var(--encre-2); color: var(--encre); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ——————————————— structure : bandeau chocolat + onglets */

.bandeau {
  background: var(--chocolat);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.bandeau-interieur {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bandeau img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
}

.bandeau-titre { line-height: 1.1; }

.bandeau-titre strong {
  display: block;
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.bandeau-titre small {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--caramel);
  font-weight: 700;
}

.bandeau-fin {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
}

.bandeau-fin .qui { text-align: right; line-height: 1.2; }
.bandeau-fin .qui strong { display: block; font-size: 0.85rem; }
.bandeau-fin .qui span { color: rgb(255 255 255 / 60%); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }

.bandeau-fin button {
  background: rgb(255 255 255 / 12%);
  border: none;
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.bandeau-fin button:hover { background: rgb(255 255 255 / 24%); }

/* onglets desktop */
.onglets {
  background: var(--chocolat);
  border-bottom: 4px solid var(--caramel);
}

.onglets-interieur {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.onglets a {
  color: rgb(255 255 255 / 72%);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem 1rem 0.65rem;
  border-radius: 10px 10px 0 0;
  white-space: nowrap;
}

.onglets a:hover { color: #fff; }
.onglets a.actif { background: var(--caramel); color: var(--chocolat-2); }

.contenu {
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 5.5rem;
}

.entete-vue { margin-bottom: 1.4rem; }
.entete-vue h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); text-transform: uppercase; letter-spacing: 0.06em; }
.entete-vue p { color: var(--encre-2); margin: 0.3rem 0 0; }

/* barre de navigation basse (mobile / tablette portrait) */
.barre-basse { display: none; }

/* ——————————————— catalogue : fiches visuelles */

.grille-sessions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1.25rem;
}

.fiche {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fiche-visuel {
  position: relative;
  aspect-ratio: 3 / 2;
  background: linear-gradient(150deg, var(--chocolat), #4a301d);
}

.fiche-visuel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fiche-visuel .sans-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.fiche-visuel .sans-photo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
}

.pilule {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--vert);
  color: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
}

.pilule.complet { background: var(--rouge); }
.pilule.bientot { background: var(--caramel); color: var(--chocolat-2); }

.fiche-corps {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.fiche-corps h3 {
  font-size: 1.02rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.etiquettes { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.etiquette {
  background: var(--creme);
  color: var(--encre);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* icônes au trait — héritent de la couleur du texte */
.ico svg, .ico-mini svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico svg { width: 20px; height: 20px; }
.ico-mini svg { width: 13px; height: 13px; stroke-width: 2; opacity: 0.7; }

.fiche-pied {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.prix {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
}

.prix small { font-size: 0.7rem; color: var(--encre-2); font-weight: 400; }

.fiche .code { font-size: 0.66rem; color: var(--encre-2); opacity: 0.6; font-family: ui-monospace, monospace; }

/* ——————————————— tableau de bord */

.filtres-periode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
  align-items: center;
}

.segment {
  border: 1.5px solid var(--trait);
  background: var(--carte);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--encre-2);
  min-height: 42px;
}

.segment.actif {
  background: var(--chocolat);
  border-color: var(--chocolat);
  color: #fff;
}

.dates-libres { display: flex; gap: 0.4rem; align-items: center; }
.dates-libres input { width: auto; min-height: 42px; padding: 0.4rem 0.6rem; }

.grille-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.kpi {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1rem 1.1rem;
}

.kpi .valeur {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.kpi .intitule {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--encre-2);
  margin-top: 0.15rem;
}

.kpi .delta { font-size: 0.75rem; font-weight: 700; margin-top: 0.4rem; display: inline-block; border-radius: 999px; padding: 0.1rem 0.55rem; }
.kpi .delta.hausse { background: var(--vert-doux); color: var(--vert); }
.kpi .delta.baisse { background: var(--rouge-doux); color: var(--rouge); }
.kpi .delta.stable { background: var(--creme); color: var(--encre-2); }

.kpi.ca { grid-column: span 2; background: var(--chocolat); color: #fff; }
.kpi.ca .intitule { color: var(--caramel); }

.ventes { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.2rem; }
.ventes h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 0.9rem; }

.vente-ligne { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: center; padding: 0.4rem 0; }
.vente-ligne .nom { font-size: 0.86rem; font-weight: 700; }
.vente-ligne .jauge { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--creme); overflow: hidden; }
.vente-ligne .jauge i { display: block; height: 100%; background: var(--caramel); border-radius: 999px; }
.vente-ligne .nombre { font-family: "Oswald", sans-serif; font-weight: 600; }

.note-bas { color: var(--encre-2); font-size: 0.75rem; margin-top: 1rem; }

/* ——————————————— panneau d'inscription */

.voile {
  position: fixed;
  inset: 0;
  background: rgb(32 20 9 / 55%);
  display: grid;
  justify-items: end;
  z-index: 10;
}

.panneau {
  background: var(--fond);
  width: min(30rem, 100vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 1.6rem 1.4rem 6rem;
  box-shadow: -12px 0 40px rgb(0 0 0 / 30%);
  animation: glisser 0.22s ease;
}

@keyframes glisser {
  from { transform: translateX(2rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.panneau h2 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.05em; }
.panneau .sous-titre { color: var(--encre-2); font-size: 0.85rem; margin: 0.2rem 0 1rem; }

.panneau-visuel {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 1.2;
  margin-bottom: 1.1rem;
}
.panneau-visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pas {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--caramel-fonce);
  margin: 1.3rem 0 0.55rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  border: 1.5px solid var(--trait);
  background: var(--carte);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 44px;
}

.chip:hover { border-color: var(--caramel); }
.chip.choisi { background: var(--chocolat); color: #fff; border-color: var(--chocolat); }
.chip .badge-deja { color: var(--caramel-fonce); font-weight: 800; }
.chip.choisi .badge-deja { color: var(--caramel); }

.lien-inscrits {
  align-self: flex-start;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--caramel-fonce);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 32px;
}

.lien-inscrits:hover { color: var(--chocolat); }

.liste-inscrits { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.4rem; }

.liste-inscrits .inscrit {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.55rem 0.75rem;
  background: var(--creme);
  border-radius: 10px;
  font-size: 0.88rem;
}

.liste-inscrits .inscrit small { color: var(--encre-2); text-align: right; }

.liste-inscrits .inscrit.moi {
  background: var(--carte);
  border: 1.5px solid var(--caramel);
}

.tag-apporteur {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--caramel);
  color: var(--chocolat-2);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

.tag-apporteur.autre {
  background: var(--creme);
  color: var(--encre-2);
  border: 1px solid var(--trait);
}

.note-deja {
  background: var(--creme);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--encre-2);
}

.ligne-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.panneau-actions {
  position: sticky;
  bottom: 0;
  margin: 1.6rem -1.4rem -6rem;
  padding: 0.9rem 1.4rem calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--fond);
  border-top: 1px solid var(--trait);
  display: flex;
  gap: 0.6rem;
}

.panneau-actions .btn { flex: 1; }

/* ——————————————— tableaux & listes */

.tableau-cadre { overflow-x: auto; border-radius: var(--rayon); box-shadow: var(--ombre); }

.tableau {
  width: 100%;
  border-collapse: collapse;
  background: var(--carte);
  font-size: 0.9rem;
}

.tableau th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--encre-2);
  padding: 0.75rem 0.9rem;
  border-bottom: 2px solid var(--creme);
  white-space: nowrap;
}

.tableau td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--creme); vertical-align: top; }
.tableau tr:last-child td { border-bottom: none; }

.etat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.etat.envoyee, .etat.confirme { background: var(--vert-doux); color: var(--vert); }
.etat.brouillon, .etat.propose { background: var(--creme); color: var(--caramel-fonce); }
.etat.erreur { background: var(--rouge-doux); color: var(--rouge); }
.etat.annulee { background: #eee; color: var(--encre-2); }

.liste-salons { display: grid; gap: 0.7rem; }

.salon-ligne {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  min-height: 56px;
}

.salon-ligne:hover { border-color: var(--caramel); }
.salon-ligne .ville { color: var(--encre-2); font-size: 0.82rem; }
.salon-ligne .compte { font-size: 0.78rem; color: var(--caramel-fonce); font-weight: 800; white-space: nowrap; }

.toast {
  position: fixed;
  bottom: calc(4.6rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--chocolat);
  color: #fff;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--ombre);
  z-index: 20;
  max-width: min(92vw, 34rem);
}

.toast.erreur { background: var(--rouge); }

.vide {
  border: 2px dashed var(--trait);
  border-radius: var(--rayon);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--encre-2);
}

/* ——————————————— responsive */

@media (max-width: 900px) {
  .onglets { display: none; }
  .contenu { padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }

  .barre-basse {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    background: var(--chocolat);
    border-top: 2px solid var(--caramel);
    padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom));
  }

  .barre-basse a {
    flex: 1 1 0;
    min-width: 0;                    /* chaque onglet reste dans sa colonne */
    text-align: center;
    color: rgb(255 255 255 / 62%);
    text-decoration: none;
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.1rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    min-height: 48px;
    justify-content: center;
  }

  .barre-basse a .lib {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;             /* jamais de libellé sur deux lignes ni qui déborde */
  }

  .barre-basse a .ico svg { width: 21px; height: 21px; }
  .barre-basse a.actif { color: var(--caramel); }

  .voile { justify-items: stretch; }
  .panneau { width: 100vw; }
  .ligne-2 { grid-template-columns: 1fr; }
  .kpi.ca { grid-column: 1 / -1; }
  .bandeau-fin .qui span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panneau { animation: none; }
  * { scroll-behavior: auto !important; }
}
