@font-face { font-family: Figtree; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
:root { --nuit: #102b46; --texte: #43576b; --bleu: #176eeb; --bleu-fonce: #0f56c4; --lavis: #e8f1fe; --lime: #dff28a; --brume: #f3f6fb; --trait: #dde5ef; --pale: #e6ecf3; --rouge: #b3261e; --rose: #fdecea; --blanc: #fff; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--brume); color: var(--nuit); font: 16px/1.45 Figtree, system-ui, sans-serif; }
#app { height: 100%; }
h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h2 { margin: 12px 0 0; font-size: 16px; font-weight: 800; }
h3 { margin: 0; font-size: 18px; font-weight: 800; }
h4 { margin: 14px 0 0; font-size: 13.5px; font-weight: 700; color: var(--texte); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
input, textarea { width: 100%; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--trait); border-radius: 12px; background: var(--blanc); font-size: 16px; }
input:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
small { font-size: 13px; }
.sous { color: var(--texte); font-size: 15px; }
.col { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.entete { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.nom { font-size: 18px; font-weight: 800; }
.action-texte { font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--trait); border-radius: 12px; background: var(--blanc); font-weight: 700; cursor: pointer; }
.btn.primaire { border: 0; background: var(--bleu); color: #fff; }
.btn.lime { border: 0; background: var(--lime); }
.btn.nuit { border: 0; background: var(--nuit); color: #fff; }
.btn.danger { border: 0; background: var(--rouge); color: #fff; }
.lien { min-height: 44px; border: 0; background: none; color: var(--texte); font-weight: 600; cursor: pointer; }
.lien-danger { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--rouge); font-size: 14.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tag.bleu { background: var(--lavis); color: var(--bleu-fonce); }
.tag.rouge { background: var(--rose); color: var(--rouge); }
.tag.neutre { background: var(--brume); }
.tag.gris { background: var(--trait); }
.tag.lime { background: var(--lime); }
.tag.nuit { background: var(--nuit); color: #fff; }
.tag.pale { background: var(--pale); color: var(--texte); }

.carte { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--trait); border-radius: 14px; background: var(--blanc); }
.carte.tache { gap: 10px; }
.lien-carte { display: flex; flex-direction: column; gap: 4px; }
.carte.choisi, .ligne-simple.choisi { border-color: var(--bleu); background: var(--lavis); }
.vide { align-items: center; padding: 28px 18px; text-align: center; color: var(--texte); }
.vide strong { color: var(--nuit); font-size: 18px; }
.erreur { color: var(--rouge); font-weight: 600; }

.connexion { display: grid; place-items: center; min-height: 100%; padding: 16px; }
.connexion form { width: 100%; max-width: 380px; gap: 14px; padding: 24px 20px; }
.connexion img { height: auto; }
.connexion label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }

.cadre { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.rail { display: none; }
.panneau { min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); background: var(--blanc); }
.bas a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 52px; color: var(--texte); font-size: 12px; white-space: nowrap; font-weight: 700; }
.bas a.actif { color: var(--bleu-fonce); }
.bas b { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bleu); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }

.prochain { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px; background: var(--nuit); color: #fff; }
.prochain svg { stroke: var(--lime); }
.prochain span { display: flex; flex-direction: column; min-width: 0; }
.prochain small { color: var(--lime); font-weight: 600; }

.compteurs, .jours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.jours { grid-template-columns: repeat(5, minmax(0, 1fr)); flex: 1; min-width: 0; }
.compteurs button, .jours button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: 0; border: 1.5px solid var(--trait); border-radius: 12px; background: var(--blanc); cursor: pointer; }
.compteurs strong { font-size: 20px; font-weight: 800; line-height: 1.1; }
.compteurs span, .jours span { font-size: 12.5px; font-weight: 600; }
.jours strong { font-size: 18px; font-weight: 800; line-height: 1.1; }
.compteurs .actif, .jours .actif, .segments .actif, .statuts .actif { border-color: var(--nuit); background: var(--nuit); color: #fff; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.rdv-ligne { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; }
.bloc-date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 66px; min-height: 50px; border-radius: 10px; background: var(--lime); }
.bloc-date strong { font-size: 15px; font-weight: 800; }
.ligne-simple { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 10px; }
.ligne-simple strong { font-weight: 600; }
.attenue { color: var(--texte); }

.segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.segments button { min-height: 48px; border: 1.5px solid var(--trait); border-radius: 12px; background: var(--blanc); font-size: 14.5px; font-weight: 700; cursor: pointer; }

.segments.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segments.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segments.quatre button, .segments.deux button { min-height: 44px; padding: 4px 6px; font-size: 13.5px; line-height: 1.15; }
.periode { display: flex; flex-direction: column; gap: 8px; }
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dates label { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--texte); font-size: 13.5px; font-weight: 600; }
.dates input { padding: 0 10px; }
.sous.petite { font-size: 13.5px; }
.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chiffre { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 12px 14px; border: 1px solid var(--trait); border-radius: 14px; background: var(--blanc); }
.chiffre strong { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; }
.chiffre span { font-size: 14px; font-weight: 700; }
.chiffre small { min-height: 1.3em; color: var(--texte); font-size: 12.5px; line-height: 1.3; }
.chiffre.alerte small { color: var(--rouge); font-weight: 600; }
.appel { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 12px; border: 1px solid var(--trait); border-radius: 12px; background: var(--blanc); }
.appel.choisi { border-color: var(--bleu); background: var(--lavis); }
.pastille { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--lavis); color: var(--bleu-fonce); }
.pastille.manque { background: var(--rose); color: var(--rouge); }
.pastille svg { width: 18px; height: 18px; }
.appel .col strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appel .col .sous { font-size: 14px; }
.droite { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.droite strong { font-size: 15px; font-weight: 700; }
.droite strong.manque { color: var(--rouge); }
.droite small { color: var(--texte); font-size: 12.5px; }
.exports { display: grid; gap: 8px; }

.semaine { display: flex; align-items: stretch; gap: 6px; }
.btn.fin { min-width: 36px; padding: 0; font-size: 20px; }
.aide { padding: 10px 12px; border-radius: 12px; background: var(--lavis); font-size: 14.5px; }
.creneaux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.creneau { display: flex; flex-direction: column; justify-content: center; min-height: 58px; min-width: 0; padding: 6px 10px; border: 1.5px solid var(--trait); border-radius: 12px; background: var(--blanc); text-align: left; cursor: pointer; }
.creneau strong { font-size: 15px; font-weight: 800; }
.creneau span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creneau.rdv { border-color: var(--bleu); background: var(--lavis); color: var(--bleu-fonce); }
.creneau.attente { border: 1.5px dashed var(--bleu); color: var(--bleu-fonce); }
.creneau.bloque { border-color: var(--pale); background: var(--pale); color: var(--texte); }

.fiche { position: fixed; inset: 0; z-index: 3; display: none; flex-direction: column; background: var(--blanc); }
.avec-fiche .fiche { display: flex; }
.fiche-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.fiche-pied { flex: none; display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); background: var(--blanc); }
.fiche-pied .btn { min-height: 52px; flex: 1; }
.fiche-pied .primaire { flex: 2; }
.retour { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; font-weight: 700; }
.titre { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.bandeau { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; }
.bandeau small { font-size: 13.5px; font-weight: 700; }
.bandeau strong { font-size: 18px; font-weight: 800; }
.bandeau .actions { margin-top: 8px; }
.bandeau.rouge { background: var(--rose); }
.bandeau.rouge small { color: var(--rouge); }
.bandeau.bleu { background: var(--lavis); }
.bandeau.bleu small { color: var(--bleu-fonce); }
.bandeau.neutre { background: var(--brume); }
.bandeau.neutre small { color: var(--texte); }
.bandeau.lime { background: var(--lime); }
.reperes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reperes div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--brume); }
.reperes small { font-weight: 600; color: var(--texte); }
.reperes strong { font-weight: 700; }
.alerte { padding: 10px 12px; border: 1.5px solid var(--trait); border-radius: 12px; font-size: 15px; }
.deux { display: grid; gap: 22px; }
.rang { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--pale); font-size: 15px; }
.rang span { flex: none; color: var(--texte); max-width: 60%; }
.rang strong { min-width: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.suivi { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.statuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--brume); }
.statuts button { min-height: 44px; border: 0; border-radius: 9px; background: none; font-size: 14px; font-weight: 700; cursor: pointer; }
#note { display: flex; flex-direction: column; gap: 8px; }
#note label { font-size: 14px; font-weight: 600; }
#note .btn { align-self: flex-end; }
.histoire { display: flex; flex-direction: column; gap: 10px; }
.histoire div { display: flex; flex-direction: column; }
.histoire strong { font-size: 15px; font-weight: 600; }
.histoire small { color: var(--texte); }
.est-note strong { padding: 6px 10px; border-radius: 10px; background: var(--lime); }

.voile { position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgb(16 43 70 / .45); }
.feuille { width: 100%; max-height: 88%; overflow-y: auto; padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--blanc); display: flex; flex-direction: column; gap: 10px; }
.feuille h2 { margin: 0; font-size: 20px; }
.feuille p { color: var(--texte); }
.trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.heures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.heures .btn { padding: 0; }
.horaire { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; align-items: center; gap: 6px; }
.horaire label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.horaire input[type='checkbox'] { width: 20px; min-height: 0; height: 20px; accent-color: var(--bleu); }
.horaire input[type='time'] { padding: 0 6px; font-size: 15px; }
#fermeture input { padding: 0 6px; font-size: 14px; }
body.charge::before { content: ''; position: fixed; inset: 0 0 auto; z-index: 7; height: 3px; background: var(--bleu); transform-origin: left; animation: charge 1s ease-in-out infinite alternate; }
@keyframes charge { from { transform: scaleX(.15); } to { transform: scaleX(.85); } }
@media (prefers-reduced-motion: reduce) { body.charge::before { animation: none; } }
.toast { position: fixed; left: 50%; bottom: 84px; z-index: 6; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--nuit); color: #fff; font-size: 15px; font-weight: 600; }

@media (min-width: 900px) {
  .cadre { grid-template-columns: 232px 372px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .bas { display: none; }
  .rail { position: relative; z-index: 4; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 14px; border-right: 1px solid var(--trait); background: var(--blanc); }
  .marque { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 18px; }
  .marque img { height: auto; }
  .marque .sous { font-size: 13px; font-weight: 600; }
  .logo-mini { display: none; }
  .rail-bas { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--texte); font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; }
  .rail-bas:hover, .rail nav a:hover:not(.actif) { background: var(--brume); }
  .rail nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .rail nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; font-weight: 700; }
  .rail nav a span { flex: 1; }
  .rail nav a.actif { background: var(--lavis); color: var(--bleu-fonce); }
  .rail b { min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--bleu); color: #fff; font-size: 12.5px; line-height: 22px; text-align: center; }
  .cadre.replie { grid-template-columns: 68px 372px minmax(0, 1fr); }
  .replie .rail { padding-inline: 12px; align-items: stretch; }
  .replie .marque { align-items: center; padding: 0 0 18px; }
  .replie .logo, .replie .marque .sous, .replie .rail nav span, .replie .rail-bas span { display: none; }
  .replie .logo-mini { display: block; }
  .replie .rail nav a, .replie .rail-bas { position: relative; justify-content: center; padding: 0; }
  .replie .rail b { position: absolute; top: 3px; right: 3px; min-width: 16px; padding: 0 4px; font-size: 11px; line-height: 16px; }
  .replie .info::after { content: attr(data-info); position: absolute; left: calc(100% + 12px); top: 50%; translate: 0 -50%; z-index: 8; padding: 6px 10px; border-radius: 8px; background: var(--nuit); color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
  .replie .info:hover::after, .replie .info:focus-visible::after { opacity: 1; }
  .panneau { padding: 24px 20px; border-right: 1px solid var(--trait); }
  .cadre:not(.avec-fiche) .panneau { grid-column: 2 / -1; border-right: 0; }
  .cadre:not(.avec-fiche) .panneau > * { max-width: 760px; width: 100%; }
  .fiche { position: static; }
  .fiche-corps { padding: 24px 28px; }
  .fiche-pied { padding-inline: 28px; }
  .retour { display: none; }
  .reperes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cadre:not(.avec-fiche) .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .exports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deux { grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; }
  .statuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creneaux { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .avec-fiche .creneaux { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .voile { align-items: center; justify-content: center; }
  .feuille { width: 460px; border-radius: 16px; }
  .toast { bottom: 24px; }
}
