/* ==========================================================================
   cockpit-institut-beaute.css — « le cahier de rendez-vous ».

   Parti pris inverse de celui de l'artisan : ici l'écran est posé sur un
   comptoir d'accueil, consulté entre deux clientes, souvent d'un coup d'œil.
   D'où le fond papier, les angles ronds, la respiration, et surtout une
   colonne horaire : la gérante lit sa journée de haut en bas, elle ne
   consulte pas un tableau de bord.

   La navigation est une barre d'icônes étroite : l'écran doit rester
   entièrement disponible pour la journée.
   ========================================================================== */

:root {
  --ac: #b4568a;
  --ac-2: #7d5aa6;
  --paper: #fffdfb;
  --bg: #f6efea;
  --ink: #33262f;
  --ink-2: #7a6a74;
  --ink-3: #a89aa2;
  --line: #eadfd9;
  --ok: #4f9b6a;
  --warn: #c58a2a;
  --bad: #c25a52;
  --ck-ac: var(--ac);
  --ck-ink: var(--ink);
  --ck-paper: var(--paper);
  --ck-line: var(--line);
  --ck-radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.5 "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: "Bricolage Grotesque", sans-serif; }
.num { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }

#flag {
  height: 38px; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--ink); color: #fff; font-size: 12.5px;
}
#flag b { font: 600 10.5px "JetBrains Mono", monospace; letter-spacing: 0.14em; padding: 3px 9px; border-radius: 999px; background: var(--ac); }
#flag span { opacity: 0.7; }
#flag .sp { flex: 1; }
#flag button, #flag a {
  border: 1px solid rgba(255,255,255,.28); background: none; color: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
#flag a.cta { background: var(--ac); border-color: var(--ac); font-weight: 700; }

#shell { display: flex; height: calc(100% - 38px); }

/* Barre d'icônes : étroite, pour laisser la journée respirer. */
#rail {
  width: 88px; flex: none; background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 16px 6px; gap: 4px;
}
#rail .logo {
  width: 46px; height: 46px; border-radius: 16px; background: var(--ac); color: #fff;
  display: grid; place-items: center; font: 700 15px "Bricolage Grotesque", sans-serif; margin-bottom: 14px;
}
#rail button {
  position: relative;
  width: 100%; border: 0; background: none; cursor: pointer; border-radius: 14px;
  padding: 10px 4px 8px; color: var(--ink-2); display: grid; justify-items: center; gap: 5px;
}
#rail button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#rail button small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }
#rail button:hover { background: var(--bg); color: var(--ink); }
#rail button.on { background: color-mix(in srgb, var(--ac) 12%, #fff); color: var(--ac); }
/* La pastille se pose sur l'icône, jamais sur le libellé : sinon elle
   ampute le mot et la barre devient illisible. */
#rail em {
  position: absolute; top: 6px; right: 10px; font-style: normal;
  background: var(--ac); color: #fff; font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 999px; line-height: 1.5;
}
#rail .bottom { margin-top: auto; text-align: center; color: var(--ink-3); font-size: 10px; line-height: 1.35; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#head {
  padding: 20px 26px 16px; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
}
#head h1 { font-size: 27px; letter-spacing: -0.02em; }
#head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
#head .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#q {
  width: 240px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); outline: none;
}
#q:focus { border-color: var(--ac); }
.who { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.who b { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--ac) 12%, #fff); color: var(--ac); display: grid; place-items: center; font-size: 12.5px; }

#ck-scroll { flex: 1; overflow-y: auto; padding: 0 26px 40px; }

/* Cartes : douces, blanches, sans ombre lourde. */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.card > h3 {
  font: 600 11px "JetBrains Mono", monospace; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.card > h3 em { margin-left: auto; font-style: normal; font-family: "DM Sans", sans-serif; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ac); }

.jour { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; }

/* La colonne horaire : le cœur de l'écran. */
.tl { position: relative; }
.tl .slot { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; padding: 3px 0; }
.tl .h { font: 500 12px "JetBrains Mono", monospace; color: var(--ink-3); padding-top: 14px; text-align: right; }
.tl .rdv {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-left: 4px solid var(--ac);
  background: #fff; border-radius: 0 16px 16px 0; padding: 12px 15px;
  display: flex; align-items: center; gap: 12px;
}
.tl .rdv:hover { border-color: var(--ac); }
.tl .rdv.done { background: var(--bg); border-left-color: var(--ink-3); opacity: 0.72; }
.tl .rdv.pending { border-left-color: var(--warn); border-style: dashed; }
.tl .rdv .av {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ac) 12%, #fff); color: var(--ac); font-weight: 700; font-size: 13px;
}
.tl .rdv .txt { flex: 1; min-width: 0; }
.tl .rdv b { display: block; font-size: 15px; font-weight: 600; }
.tl .rdv span { display: block; color: var(--ink-2); font-size: 12.8px; }
.tl .libre {
  width: 100%; text-align: left; cursor: pointer; border: 1px dashed var(--line);
  background: none; border-radius: 16px; padding: 10px 15px; color: var(--ink-3); font-size: 13px;
}
.tl .libre:hover { border-color: var(--ac); color: var(--ac); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, #fff); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, #fff); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, #fff); }
.chip.ac { color: var(--ac); border-color: color-mix(in srgb, var(--ac) 30%, #fff); background: color-mix(in srgb, var(--ac) 7%, #fff); }

.btn {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--ac); color: var(--ac); }
.btn.solid { background: var(--ac); border-color: var(--ac); color: #fff; }
.btn.solid:hover { color: #fff; filter: brightness(1.06); }
.btn.mini { padding: 6px 12px; font-size: 12.5px; }
.bar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 16px; }

/* Chiffres du jour : discrets, jamais un tableau de bord d'aéroport. */
.mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
/* Quatre indicateurs de front sur grand écran, deux sur téléphone. La règle
   vit ici et non dans le JS : posée en style en dur, elle rendait les
   ajustements mobiles inopérants. */
.mini.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
@media (max-width: 900px) { .mini.four { grid-template-columns: repeat(2, 1fr); } }
/* Les tableaux larges défilent dans leur carte plutôt que de pousser la page. */
.card > table.t, .tablewrap { display: block; overflow-x: auto; }
.tablewrap table { min-width: 560px; }
@media (max-width: 620px) {
  /* Sur téléphone : la cliente, le montant, le statut, le geste. Le numéro,
     la prestation et la date attendront un écran plus large. */
  .tablewrap table { min-width: 0; }
  .tablewrap th:nth-child(1), .tablewrap td:nth-child(1),
  .tablewrap th:nth-child(3), .tablewrap td:nth-child(3),
  .tablewrap th:nth-child(4), .tablewrap td:nth-child(4) { display: none; }
  table.t { font-size: 13px; }
  /* Un statut ne chevauche pas le bouton d'à côté. */
  table.t .chip { white-space: nowrap; font-size: 10.5px; padding: 3px 8px; }
  table.t td.r { white-space: nowrap; }
  .btn.mini { padding: 7px 11px; font-size: 12px; }
}
@media (max-width: 430px) {
  /* Le bouton dit déjà l'état : « Encaisser » n'apparaît que sur ce qui ne
     l'est pas. On rend la colonne statut à la largeur du montant. */
  .tablewrap th:nth-child(6), .tablewrap td:nth-child(6) { display: none; }
}
.mini > div { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 15px 17px; }
.mini h4 { margin: 0 0 8px; font: 600 10.5px "JetBrains Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.mini b { display: block; font: 700 24px/1 "Bricolage Grotesque", sans-serif; }
.mini small { display: block; margin-top: 5px; color: var(--ink-2); font-size: 12.5px; }
.mini .up { color: var(--ok); font-weight: 600; }
.mini .down { color: var(--bad); font-weight: 600; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows .av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 10%, #fff); color: var(--ac); font-size: 12px; font-weight: 700; }
.rows .b { flex: 1; min-width: 0; }
.rows .b b { display: block; font-weight: 600; }
.rows .b span { color: var(--ink-2); font-size: 12.8px; }
.rows input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ac); }

/* Semaine : six colonnes, lecture en peigne. */
.week { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; }
.dayhead { padding-bottom: 10px; border-bottom: 2px solid var(--line); margin-bottom: 11px; }
.dayhead small { display: block; font: 600 10.5px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.dayhead b { font: 700 19px "Bricolage Grotesque", sans-serif; }
.dayhead.today { border-bottom-color: var(--ac); }
.dayhead.today b, .dayhead.today small { color: var(--ac); }
.wslot { width: 100%; text-align: left; border: 0; background: color-mix(in srgb, var(--ac) 8%, #fff); border-radius: 12px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer; }
.wslot:hover { background: color-mix(in srgb, var(--ac) 15%, #fff); }
.wslot b { display: block; font: 500 11px "JetBrains Mono", monospace; color: var(--ac); }
.wslot strong { display: block; font-size: 13px; font-weight: 600; }
.wslot span { display: block; font-size: 11.5px; color: var(--ink-2); }
.wslot.done { background: var(--bg); opacity: 0.6; }
.wadd { width: 100%; border: 1px dashed var(--line); background: none; border-radius: 12px; padding: 8px; color: var(--ink-3); font-size: 12px; cursor: pointer; }
.wadd:hover { border-color: var(--ac); color: var(--ac); }
.ferme { text-align: center; color: var(--ink-3); font-size: 12.5px; padding: 10px 0; }

/* Fiches clientes : deux colonnes, la fiche ouverte à droite. */
.split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.list { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; max-height: calc(100vh - 240px); overflow-y: auto; }
.list button { display: flex; gap: 11px; align-items: center; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 15px; cursor: pointer; }
.list button:first-child { border-top: 0; }
.list button:hover { background: var(--bg); }
.list button.on { background: color-mix(in srgb, var(--ac) 10%, #fff); }
.list .av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 12%, #fff); color: var(--ac); font-size: 12px; font-weight: 700; }
.list b { display: block; font-size: 14px; font-weight: 600; }
.list span { font-size: 11.8px; color: var(--ink-2); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; text-align: right; font-weight: 600; }
.note { margin: 14px 0 0; padding: 12px 15px; border-radius: 14px; background: #fdf3e7; color: #7a5a1e; font-size: 13.2px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.t th { text-align: left; font: 600 10px "JetBrains Mono", monospace; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 10px; }
table.t td { padding: 11px 10px 11px 0; border-top: 1px solid var(--line); }
table.t td.r, table.t th.r { text-align: right; padding-right: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.jauge { height: 8px; border-radius: 999px; background: var(--bg); margin: 12px 0 10px; }
.jauge i { display: block; height: 100%; border-radius: 999px; background: var(--ac); }
.jauge i.bas { background: var(--bad); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 165px; }
.chart > div { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; position: relative; }
.chart i { flex: 1; background: var(--ac); border-radius: 6px 6px 0 0; min-height: 3px; }
.chart i.b { background: color-mix(in srgb, var(--ac) 22%, #fff); }
.chart > div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 4px 9px; border-radius: 7px; font-size: 11.5px; white-space: nowrap; margin-bottom: 6px; z-index: 5; }
.chart-x { display: flex; gap: 6px; margin-top: 8px; }
.chart-x span { flex: 1; text-align: center; font: 500 9.5px "JetBrains Mono", monospace; color: var(--ink-3); }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--ac); margin-right: 6px; }
.legend i.b { background: color-mix(in srgb, var(--ac) 22%, #fff); }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { padding: 8px 0; font-size: 13.8px; }
.bars .l { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bars u { display: block; height: 7px; background: var(--bg); border-radius: 999px; }
.bars u i { display: block; height: 100%; background: var(--ac); border-radius: 999px; }
.empty { color: var(--ink-3); font-size: 13.5px; }

@media (max-width: 1100px) {
  .jour { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  #rail { width: 100%; height: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 8px; }
  #rail .logo, #rail .bottom { display: none; }
  #rail button { width: auto; padding: 8px 12px; }
  #shell { flex-direction: column; height: auto; }
  #main { min-height: 0; }
  #ck-scroll { overflow: visible; }
  .split, .grid2 { grid-template-columns: minmax(0, 1fr); }
  #q { width: 100%; }
  #head { padding: 16px 16px 12px; }
  #ck-scroll { padding: 0 16px 40px; }
  .week { grid-template-columns: repeat(6, 160px); overflow-x: auto; }
}
@media (max-width: 820px) {
  .btn { min-height: 38px; }
  .btn.mini { min-height: 34px; }
  /* 26 px : au-dessus du minimum de 24 px du critère WCAG 2.5.8 « taille de
     cible », qui s'applique à une case à cocher isolée dans une ligne. */
  .rows input[type="checkbox"] { width: 26px; height: 26px; }
}
@media (max-width: 620px) {
  .mini { grid-template-columns: 1fr; }
  /* La colonne horaire doit rester lisible sur un téléphone : heure plus
     étroite, vignette plus petite, statut renvoyé sous le texte. */
  .tl .slot { grid-template-columns: 42px 1fr; gap: 8px; }
  .tl .h { font-size: 11px; padding-top: 12px; }
  .tl .rdv { flex-wrap: wrap; gap: 9px; padding: 10px 12px; }
  .tl .rdv .av { width: 32px; height: 32px; font-size: 11.5px; }
  .tl .rdv b { font-size: 14px; }
  .tl .rdv span { font-size: 12px; }
  .tl .rdv .chip { margin-left: 41px; }
  #head .right { width: 100%; margin-left: 0; }
  #q { flex: 1; width: auto; }
  #rail button { padding: 7px 9px; }
  #rail button small { font-size: 10px; }
}


/* Sur mobile, le bandeau démo garde sa ligne : le texte s'efface, les deux
   boutons restent. Un bandeau qui passe sur trois lignes mange l'écran. */
@media (max-width: 700px) {
  #flag { flex-wrap: nowrap; overflow: hidden; padding: 0 12px; gap: 8px; }
  #flag span:not(.sp) { display: none; }
  #flag b, #flag button, #flag a { white-space: nowrap; flex: none; }
}
