/* ============================================================
   Agenda Shootnbox & Smakk
   Repere visuel : Google Agenda, densite d'un outil metier.
   ============================================================ */

:root {
  --encre:      #1f2229;
  --encre-2:    #5f6368;
  --encre-3:    #80868b;
  --trait:      #dadce0;
  --trait-fin:  #ecedef;
  --fond:       #ffffff;
  --fond-2:     #f6f7f9;
  --fond-3:     #eef0f3;
  --snb:        #e51981;
  --smk:        #1d4ed8;
  --danger:     #d93025;
  --ok:         #188038;
  --rayon:      8px;
  --rayon-s:    5px;
  --barre-h:    58px;
  --cote-l:     236px;
  --ombre-1:    0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --ombre-2:    0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
}

* { box-sizing: border-box; }

/* Une regle d'auteur qui pose un display (.modale{display:grid}, .champ-duo{display:grid})
   bat le display:none que le navigateur applique a l'attribut hidden : sans ce garde-fou,
   la fenetre modale reste posee sur la page et son fond grise tout l'ecran. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font: 400 14px/1.45 "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  color: var(--encre);
  background: var(--fond);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- connexion */

.page-login {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(150deg, #fdf2f8 0%, #f8fafc 45%, #eff6ff 100%);
}

.carte-login {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 34px 30px 30px;
  box-shadow: var(--ombre-2);
}

.login-marque { display: flex; gap: 6px; margin-bottom: 18px; }
.pastille { width: 26px; height: 8px; border-radius: 4px; }
.pastille-snb { background: var(--snb); }
.pastille-smk { background: var(--smk); }

.carte-login h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.login-sous { color: var(--encre-2); font-size: 13.5px; margin: 6px 0 24px; }

.carte-login label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--encre-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 16px 0 6px;
}

.carte-login input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-s);
  background: #fff;
}

.carte-login input:focus {
  outline: none;
  border-color: var(--snb);
  box-shadow: 0 0 0 3px rgba(229, 25, 129, .13);
}

.login-erreur {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: var(--rayon-s);
  background: #fdecea;
  color: var(--danger);
  font-size: 13px;
}

.btn { border: 1px solid var(--trait); background: #fff; border-radius: 100px; padding: 8px 16px; cursor: pointer; }
.btn:hover { background: var(--fond-2); }
.btn-primaire { width: 100%; margin-top: 22px; padding: 12px; border: 0; background: var(--snb); color: #fff; font-weight: 600; border-radius: var(--rayon-s); }
.btn-primaire:hover { background: #c9166f; }
.btn-primaire:disabled { opacity: .6; cursor: default; }

/* ---------------------------------------------------------------- barre du haut */

.barre {
  height: var(--barre-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 10px;
  border-bottom: 1px solid var(--trait);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.barre-marque { display: flex; align-items: center; gap: 9px; padding-right: 4px; }

.logo-agenda {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--snb);
  position: relative;
  flex: none;
}
.logo-agenda::after {
  content: "";
  position: absolute; inset: 6px 5px 5px;
  background: #fff; border-radius: 2px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.22);
}

.barre-titre-app { font-size: 19px; color: var(--encre-2); letter-spacing: -.01em; }

.ico-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--encre-2);
  border-radius: 50%; cursor: pointer; flex: none;
}
.ico-btn:hover { background: var(--fond-3); }

.btn-fin { padding: 7px 15px; font-size: 13.5px; flex: none; }

.nav-mois { display: flex; }

.periode {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.01em;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.barre-fin { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.recherche { position: relative; }
.recherche-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--encre-3); width: 17px; height: 17px; }
.recherche input {
  width: 210px;
  padding: 8px 12px 8px 33px;
  border: 1px solid transparent;
  background: var(--fond-3);
  border-radius: 100px;
}
.recherche input:focus { outline: none; background: #fff; border-color: var(--trait); box-shadow: var(--ombre-1); }

.select-vue {
  border: 1px solid var(--trait);
  border-radius: 100px;
  padding: 7px 10px;
  background: #fff;
  cursor: pointer;
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--snb); color: #fff;
  font-weight: 600; font-size: 13px; cursor: pointer; flex: none;
}

/* ---------------------------------------------------------------- corps */

.corps {
  display: flex;
  height: calc(100% - var(--barre-h));
}

.cote {
  width: var(--cote-l);
  flex: none;
  border-right: 1px solid var(--trait);
  padding: 14px 8px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.btn-creer {
  display: flex; align-items: center; gap: 10px;
  margin: 0 8px 16px;
  padding: 11px 20px 11px 14px;
  border: 0; border-radius: 100px;
  background: #fff;
  box-shadow: var(--ombre-1);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
}
.btn-creer:hover { box-shadow: var(--ombre-2); background: var(--fond-2); }
.btn-creer svg { color: var(--snb); }

.bloc-cote { margin-top: 18px; padding: 0 8px; }
.bloc-titre { font-size: 13.5px; font-weight: 600; color: var(--encre); margin-bottom: 6px; }
.bloc-titre-ligne { display: flex; align-items: baseline; justify-content: space-between; }
.lien-mini { border: 0; background: none; color: var(--encre-3); font-size: 11.5px; cursor: pointer; padding: 0; text-decoration: underline; }
.lien-mini:hover { color: var(--snb); }

.liste-cases li { display: flex; align-items: center; }

.case-agenda {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--rayon-s);
  cursor: pointer;
  font-size: 13.2px;
}
.case-agenda:hover { background: var(--fond-2); }
.case-agenda input { display: none; }

.puce {
  width: 15px; height: 15px; border-radius: 3px;
  border: 2px solid currentColor;
  flex: none;
  position: relative;
}
.case-agenda input:checked + .puce { background: currentColor; }
.case-agenda input:checked + .puce::after {
  content: "";
  position: absolute; left: 3.5px; top: .5px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

.case-nom { color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-agenda input:not(:checked) ~ .case-nom { color: var(--encre-3); }
.case-marque { margin-left: auto; font-size: 10px; color: var(--encre-3); text-transform: uppercase; letter-spacing: .03em; flex: none; }
.case-avertir { margin-left: auto; font-size: 10px; color: #b45309; background: #fef3c7; border-radius: 8px; padding: 1px 6px; flex: none; }

.ligne-radio { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: var(--rayon-s); cursor: pointer; font-size: 13.2px; }
.ligne-radio:hover { background: var(--fond-2); }
.ligne-radio input { accent-color: var(--snb); }
.ligne-separee { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--trait-fin); }

.cote-etat { margin: 20px 10px 0; font-size: 11.5px; color: var(--encre-3); line-height: 1.5; }
.compte-doux { color: var(--encre-3); font-size: 11.5px; }

/* ---------------------------------------------------------------- mini calendrier */

.mini-cal { padding: 0 6px; }
.mini-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; padding-left: 6px; }
.mini-titre { font-size: 13.5px; font-weight: 600; }
.mini-nav { display: flex; }
.mini-nav .ico-btn { width: 28px; height: 28px; }
.mini-nav svg { width: 16px; height: 16px; }

.mini-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-jsem { font-size: 10.5px; color: var(--encre-3); text-align: center; padding: 3px 0; }
.mini-jour {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 11.5px;
  border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  color: var(--encre);
}
.mini-jour:hover { background: var(--fond-3); }
.mini-jour.hors { color: #c3c7cd; }
.mini-jour.aujourdhui { background: var(--snb); color: #fff; font-weight: 600; }
.mini-jour.choisi:not(.aujourdhui) { background: #fce7f3; color: #9d174d; font-weight: 600; }

/* ---------------------------------------------------------------- scene */

.scene { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.bandeau-alerte {
  padding: 8px 16px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12.5px;
  border-bottom: 1px solid #fde68a;
}

#vue { flex: 1; overflow: auto; overscroll-behavior: contain; }

/* ---------------------------------------------------------------- vue mois */

.mois { display: flex; flex-direction: column; min-height: 100%; }

.mois-tete {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--trait);
  position: sticky; top: 0; background: #fff; z-index: 5;
}
.mois-tete div {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--encre-2);
  padding: 7px 0;
}
.mois-tete div.wknd { color: var(--encre-3); }

.mois-corps { flex: 1; display: flex; flex-direction: column; }

.semaine {
  flex: 1;
  min-height: 96px;
  position: relative;
  border-bottom: 1px solid var(--trait-fin);
}
.semaine:last-child { border-bottom: 0; }

.semaine-fond { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cellule { border-right: 1px solid var(--trait-fin); }
.cellule:last-child { border-right: 0; }
.cellule.wknd { background: #fafbfc; }
.cellule.hors { background: var(--fond-2); }
.cellule:hover { background: #f2f4f7; }

.num-jour {
  display: block;
  width: 24px; height: 24px;
  margin: 4px auto 0;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-size: 12px;
  color: var(--encre-2);
}
.cellule.hors .num-jour { color: #b9bec5; }
.num-jour.aujourdhui { background: var(--snb); color: #fff; font-weight: 600; }

.semaine-bandes { position: relative; padding-top: 30px; pointer-events: none; }

.bande {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11.5px;
  line-height: 20px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: auto;
  border: 0;
  text-align: left;
  display: block;
}
.bande:hover { filter: brightness(.92); }
.bande.continue-avant { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bande.continue-apres { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Une demande n'est pas encore une reservation : trame rayee, comme un devis en attente. */
.bande.demande {
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.28) 0 5px, transparent 5px 10px);
}

.bande-jalon { font-weight: 600; }
.bande-marque { opacity: .8; }

.plus-autres {
  position: absolute;
  height: 18px;
  font-size: 11.5px;
  line-height: 18px;
  color: var(--encre-2);
  background: none;
  border: 0;
  padding: 0 6px;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  border-radius: 4px;
}
.plus-autres:hover { background: var(--fond-3); }

/* ---------------------------------------------------------------- vue semaine / jour */

.tableau-jours { padding: 10px 14px 40px; }

.jour-bloc { margin-bottom: 22px; }
.jour-entete {
  display: flex; align-items: baseline; gap: 9px;
  padding: 6px 2px;
  border-bottom: 2px solid var(--trait);
  margin-bottom: 8px;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.jour-entete.est-aujourdhui { border-bottom-color: var(--snb); }
.jour-nom { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-2); font-weight: 600; }
.jour-num { font-size: 21px; font-weight: 500; }
.jour-entete.est-aujourdhui .jour-num { color: var(--snb); }
.jour-compte { margin-left: auto; font-size: 11.5px; color: var(--encre-3); }

.ligne-evt {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: none;
  border-radius: var(--rayon-s);
  cursor: pointer;
  text-align: left;
  border-left: 4px solid transparent;
}
.ligne-evt:hover { background: var(--fond-2); }

.evt-couleur { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.evt-titre { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--encre-2); flex: none; }

.etiquette {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 100px;
  background: var(--fond-3);
  color: var(--encre-2);
  white-space: nowrap;
}
.etiquette.paye   { background: #e6f4ea; color: var(--ok); }
.etiquette.acompte{ background: #fef7e0; color: #b06000; }
.etiquette.impaye { background: #fce8e6; color: var(--danger); }
.etiquette.demande{ background: #ede9fe; color: #5b21b6; }

.vide {
  padding: 60px 20px;
  text-align: center;
  color: var(--encre-3);
  font-size: 13.5px;
}

/* ---------------------------------------------------------------- popup jour */

.popup-jour {
  position: fixed;
  z-index: 60;
  width: 288px;
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--ombre-2);
  padding: 12px 10px 14px;
}
.popup-tete { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 6px 6px; }
.popup-jsem { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-2); text-align: center; }
.popup-num { font-size: 25px; font-weight: 400; text-align: center; line-height: 1.1; }
.popup-liste .bande { position: static; width: 100%; height: auto; min-height: 22px; line-height: 22px; margin-bottom: 3px; border-radius: 4px; }

/* ---------------------------------------------------------------- modale */

.modale { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modale-fond { position: absolute; inset: 0; background: rgba(32,33,36,.5); }
.modale-boite {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--ombre-2);
}

.modale-tete {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--trait-fin);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modale-titre { font-size: 16px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.modale-corps { padding: 16px 18px 20px; }
.modale-pied {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--trait-fin);
  position: sticky; bottom: 0; background: #fff;
}
.modale-pied .btn-danger { margin-right: auto; border-color: #f3c3bf; color: var(--danger); }
.modale-pied .btn-danger:hover { background: #fdecea; }

.btn-ok { border: 0; background: var(--snb); color: #fff; font-weight: 600; padding: 9px 22px; }
.btn-ok:hover { background: #c9166f; }

.num-jour.num-premier { width: auto; padding: 0 8px; border-radius: 100px; }

.bandeau-couleur { height: 5px; border-radius: 12px 12px 0 0; }

.champ { margin-bottom: 14px; }
.champ label { display: block; font-size: 12px; font-weight: 600; color: var(--encre-2); margin-bottom: 5px; }
.champ input[type=text], .champ input[type=date], .champ input[type=time], .champ select, .champ textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-s);
  background: #fff;
}
.champ textarea { min-height: 72px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none; border-color: var(--snb); box-shadow: 0 0 0 3px rgba(229,25,129,.12);
}
.champ-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.champ-case { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 14px; }
.champ-case input { accent-color: var(--snb); }

.paire { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--trait-fin); font-size: 13.5px; }
.paire:last-child { border-bottom: 0; }
.paire dt { width: 128px; flex: none; color: var(--encre-2); }
.paire dd { margin: 0; flex: 1; word-break: break-word; }
.paire a { color: var(--smk); }

.liens-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lien-action {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--trait);
  border-radius: 100px;
  text-decoration: none;
  color: var(--encre);
  font-size: 13px;
}
.lien-action:hover { background: var(--fond-2); }
.lien-action svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- parametres */

.param-section { margin-bottom: 26px; }
.param-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-2); margin-bottom: 10px; }
.param-note { font-size: 12.5px; color: var(--encre-3); margin-bottom: 12px; line-height: 1.5; }

.ligne-couleur {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--trait-fin);
}
.ligne-couleur input[type=color] {
  width: 34px; height: 26px; padding: 0;
  border: 1px solid var(--trait); border-radius: 5px;
  background: none; cursor: pointer; flex: none;
}
.ligne-couleur-nom { flex: 1; font-size: 13.5px; }
.ligne-couleur-marque { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-3); }
.badge-adefinir { font-size: 10px; background: #fef3c7; color: #92400e; border-radius: 8px; padding: 1px 7px; }

.ajout-agenda { display: flex; gap: 8px; margin-top: 12px; }
.ajout-agenda input[type=text] { flex: 1; padding: 8px 11px; border: 1px solid var(--trait); border-radius: var(--rayon-s); }
.ajout-agenda input[type=color] { width: 40px; padding: 0; border: 1px solid var(--trait); border-radius: var(--rayon-s); }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  background: #202124;
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--rayon-s);
  font-size: 13.5px;
  box-shadow: var(--ombre-2);
  max-width: calc(100vw - 32px);
}
.toast.erreur { background: var(--danger); }

/* ---------------------------------------------------------------- responsive */

.only-mobile { display: none; }

@media (max-width: 1080px) {
  .recherche input { width: 150px; }
}

@media (max-width: 900px) {
  :root { --barre-h: 54px; }

  .only-mobile { display: grid; }
  .barre-titre-app { display: none; }
  .barre { padding: 0 6px; gap: 4px; }
  .periode { font-size: 17px; }
  .btn-fin { padding: 6px 11px; font-size: 12.5px; }
  .nav-mois .ico-btn { width: 32px; }

  /* La recherche est repliee derriere la loupe, et couvre la barre quand on l'ouvre. */
  .recherche { display: none; }
  .recherche.ouverte {
    display: block;
    position: absolute; left: 6px; right: 6px; top: 8px; z-index: 6;
  }
  .recherche.ouverte input {
    width: 100%; padding: 9px 12px 9px 34px;
    background: #fff; border-color: var(--trait); box-shadow: var(--ombre-1);
  }
  .recherche.ouverte .recherche-ico { left: 11px; }
  #btn-parametres { display: none; }

  .cote {
    position: fixed;
    top: var(--barre-h); bottom: 0; left: 0;
    z-index: 55;
    background: #fff;
    width: 272px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--ombre-2);
  }
  .cote.ouvert { transform: none; }

  .voile-tiroir { position: fixed; inset: var(--barre-h) 0 0; background: rgba(32,33,36,.45); z-index: 50; }

  .semaine { min-height: 86px; }
  .bande { font-size: 11px; height: 18px; line-height: 18px; padding: 0 5px; }
  .semaine-bandes { padding-top: 26px; }
  .num-jour { width: 21px; height: 21px; line-height: 21px; font-size: 11.5px; }

  .modale { padding: 0; place-items: end stretch; }
  .modale-boite { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modale-pied { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

  .popup-jour { left: 8px !important; right: 8px; width: auto; max-height: 60vh; }
}

@media (max-width: 560px) {
  .mois-tete div { font-size: 9.5px; }
  .champ-duo { grid-template-columns: 1fr; }
  .paire { flex-direction: column; gap: 2px; }
  .paire dt { width: auto; font-size: 11.5px; }
  .select-vue { max-width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .cote { transition: none; }
}
