/* Solartech Concept SA · appli des heures. Aucune police ni ressource extérieure. */
:root {
  --marque: #0b4f8a;
  --soleil: #f5b301;
  --fond: #f4f6f9;
  --carte: #ffffff;
  --texte: #1b2430;
  --doux: #5f6b7a;
  --ligne: #e2e7ee;
  --vert: #1e8a4c; --vert-f: #e5f5ec;
  --bleu: #1f6fd1; --bleu-f: #e6f0fc;
  --orange: #c96a00; --orange-f: #fff1df;
  --rouge: #c62828; --rouge-f: #fdeaea;
  --gris: #6b7685; --gris-f: #eef1f5;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
a { color: var(--marque); }
.cache { display: none !important; }
.doux { color: var(--doux); }
.petit { font-size: .85rem; }
.centre { text-align: center; }
.droite { text-align: right; }
.mt { margin-top: .8rem; }
.rouge-texte { color: var(--rouge); } .vert-texte { color: var(--vert); } .orange-texte { color: var(--orange); }
.entre { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }

/* ---------- formulaires ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid #cdd5df; border-radius: 10px; background: #fff; color: var(--texte); min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--marque) 25%, transparent); border-color: var(--marque); }
input[type=color] { width: 70px; height: 44px; border: 1px solid #cdd5df; border-radius: 10px; padding: 3px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input[type=search] { margin-bottom: .8rem; }
label.case { display: flex; gap: .6rem; align-items: center; font-weight: 500; cursor: pointer; }
label.case input { width: 22px; height: 22px; accent-color: var(--marque); }
.duree { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.grille-montant { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .7rem; }
details.options { margin-top: .9rem; border: 1px dashed var(--ligne); border-radius: 10px; padding: .4rem .8rem .8rem; }
details.options summary { cursor: pointer; font-weight: 600; color: var(--marque); padding: .3rem 0; }
.code { font-size: 1.8rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- boutons ---------- */
button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  min-height: 44px; padding: .55rem 1.05rem; border-radius: 10px; border: 1px solid var(--marque);
  background: var(--marque); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .bouton:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: wait; }
button.secondaire, .bouton.secondaire { background: #fff; color: var(--marque); border-color: #c9d3e0; }
button.danger { background: #fff; color: var(--rouge); border-color: #efc4c4; }
button.danger-plein { background: var(--rouge); border-color: var(--rouge); }
button.petit, .bouton.petit { min-height: 36px; padding: .3rem .7rem; font-size: .88rem; }
button.plein, .bouton.plein { width: 100%; margin-top: 1rem; }
button.grand { min-height: 54px; font-size: 1.05rem; }
button.lien { background: none; border: 0; color: var(--doux); text-decoration: underline; margin: .8rem auto 0; display: block; }
.bouton.desactive { pointer-events: none; opacity: .35; }
.icone-bouton { background: none; color: inherit; border: 0; min-height: 40px; padding: .3rem .6rem; font-size: 1.1rem; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.actions-gauche { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }

/* ---------- pastilles et puces ---------- */
.pastille { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pastille.vert { background: var(--vert-f); color: var(--vert); }
.pastille.bleu { background: var(--bleu-f); color: var(--bleu); }
.pastille.orange { background: var(--orange-f); color: var(--orange); }
.pastille.rouge { background: var(--rouge-f); color: var(--rouge); }
.pastille.gris { background: var(--gris-f); color: var(--gris); }
.puces { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.puce { display: inline-flex; align-items: center; min-height: 36px; padding: .25rem .8rem; border-radius: 999px; border: 1px solid #cdd5df;
  background: #fff; color: var(--texte); font-weight: 600; font-size: .88rem; text-decoration: none; }
.puce.active { background: var(--marque); color: #fff; border-color: var(--marque); }
.puce.orange { background: var(--orange-f); border-color: #f3cf9f; color: var(--orange); }

/* ---------- messages ---------- */
.message { padding: .7rem .9rem; border-radius: 10px; margin: .8rem 0; font-size: .93rem; }
.message.erreur { background: var(--rouge-f); color: var(--rouge); }
.message.info { background: var(--bleu-f); color: #164f94; }
.message.ok { background: var(--vert-f); color: var(--vert); }
.message.alerte { background: var(--orange-f); color: var(--orange); }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--bas)); transform: translate(-50%, 20px); opacity: 0; transition: .25s;
  background: #1b2430; color: #fff; padding: .75rem 1.1rem; border-radius: 12px; z-index: 60; max-width: min(92vw, 480px); box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: .93rem; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.erreur { background: var(--rouge); } .toast.alerte { background: #8a4a00; }
.chargement { display: flex; align-items: center; gap: .7rem; justify-content: center; padding: 3rem 1rem; color: var(--doux); }
.rond { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #d5dce6; border-top-color: var(--marque); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- logo ---------- */
.logo { max-height: 38px; max-width: 180px; display: block; }
.logo.grand { max-height: 80px; max-width: 260px; margin: 0 auto 1rem; }
.logo-texte { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.01em; color: var(--marque); font-size: 1.05rem; }
.logo-texte.grand { justify-content: center; font-size: 1.4rem; margin-bottom: 1.2rem; }
.soleil { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, var(--soleil) 0 45%, transparent 47%),
  conic-gradient(from 0deg, var(--soleil) 0 6%, transparent 6% 12.5%, var(--soleil) 12.5% 18.5%, transparent 18.5% 25%, var(--soleil) 25% 31%, transparent 31% 37.5%,
  var(--soleil) 37.5% 43.5%, transparent 43.5% 50%, var(--soleil) 50% 56%, transparent 56% 62.5%, var(--soleil) 62.5% 68.5%, transparent 68.5% 75%,
  var(--soleil) 75% 81%, transparent 81% 87.5%, var(--soleil) 87.5% 93.5%, transparent 93.5%); flex: none; }
.logo-texte.grand .soleil { width: 38px; height: 38px; }

/* ---------- connexion ---------- */
.page-connexion { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.2rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--marque) 92%, #000) 0%, var(--marque) 45%, color-mix(in srgb, var(--marque) 70%, var(--soleil)) 130%); }
.carte.connexion { width: 100%; max-width: 420px; padding: 2rem 1.6rem; }
.carte.connexion h1 { text-align: center; }
.page-connexion .pied { color: rgba(255,255,255,.8); margin-top: 1rem; }
.page-centre { padding: 3rem 1rem; text-align: center; }
ol.etapes { padding-left: 1.2rem; } ol.etapes li { margin: .5rem 0; }
.qr { display: flex; justify-content: center; margin: .6rem 0; } .qr svg { width: 200px; height: 200px; }
code.secret { font-size: 1rem; background: var(--gris-f); padding: .15rem .4rem; border-radius: 6px; word-break: break-all; }

/* ---------- coquille ---------- */
.entete { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(.55rem + env(safe-area-inset-top, 0px)) 1rem .55rem; background: #fff; border-bottom: 3px solid var(--marque); }
.entete-logo { text-decoration: none; }
.entete-droite { display: flex; align-items: center; gap: .6rem; }
.qui { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.qui small { color: var(--doux); font-weight: 500; font-size: .78rem; }
.zone { padding: 1rem 1rem calc(96px + var(--bas)); max-width: 980px; margin: 0 auto; }
.lateral { display: none; }
.barre-bas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--ligne);
  padding-bottom: var(--bas); box-shadow: 0 -2px 10px rgba(16,24,40,.06); }
.barre-bas .nav-lien { flex: 1; flex-direction: column; gap: 0; font-size: .72rem; padding: .45rem .1rem .5rem; min-height: 60px; border-radius: 0; }
.nav-lien { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--doux); font-weight: 600; background: none; border: 0;
  padding: .65rem .9rem; border-radius: 10px; font-size: .95rem; width: 100%; justify-content: flex-start; min-height: 0; }
.barre-bas .nav-lien { justify-content: center; }
.nav-lien:hover { filter: none; background: var(--gris-f); }
.nav-lien.actif { color: var(--marque); }
.lateral .nav-lien.actif { background: color-mix(in srgb, var(--marque) 10%, #fff); }
.nav-icone { font-size: 1.3rem; line-height: 1.1; width: 1.6rem; text-align: center; }
.tiroir { position: fixed; right: .6rem; bottom: calc(70px + var(--bas)); z-index: 31; background: #fff; border-radius: var(--rayon); box-shadow: 0 10px 30px rgba(16,24,40,.2);
  padding: .4rem; min-width: 230px; border: 1px solid var(--ligne); }
.seulement-ordi { display: none; }
@media (min-width: 900px) {
  .seulement-ordi { display: inline-flex; }
  .barre-bas, .tiroir { display: none !important; }
  .lateral { display: block; position: fixed; top: 62px; bottom: 0; left: 0; width: 240px; padding: 1rem .7rem; background: #fff; border-right: 1px solid var(--ligne); overflow-y: auto; }
  .zone { margin-left: 240px; padding: 1.6rem 2rem 3rem; max-width: 1100px; }
}

/* ---------- cartes ---------- */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.05rem 1.1rem; margin-bottom: 1rem; border: 1px solid #edf0f4; }
.carte.sans-marge { padding: 0; overflow: hidden; }
.bord-orange { border-left: 5px solid var(--orange); } .bord-rouge { border-left: 5px solid var(--rouge); }
.bord-bleu { border-left: 5px solid var(--bleu); } .bord-marque { border-left: 5px solid var(--marque); }
.bonjour { font-size: 1.5rem; }
.grille-2 { display: grid; gap: 1rem; } .grille-2 > .carte { margin-bottom: 0; } .grille-2 { margin-bottom: 1rem; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } }
.compteur .grand-chiffre { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.grand-chiffre small { font-size: .95rem; font-weight: 600; color: var(--doux); }
.jauge { height: 10px; border-radius: 99px; background: var(--gris-f); margin: .7rem 0 .4rem; overflow: hidden; }
.jauge-rempli { display: block; height: 100%; width: var(--pc, 0%); background: linear-gradient(90deg, var(--soleil), #f08c00); border-radius: 99px; }
.aujourdhui .chantier, .chantier { padding: .55rem .7rem; background: var(--fond); border-radius: 10px; margin-top: .4rem; border-left: 4px solid var(--soleil); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tuile { display: flex; flex-direction: column; background: #fff; border-radius: var(--rayon); padding: .9rem 1rem; text-decoration: none; color: var(--texte); box-shadow: var(--ombre); border: 1px solid #edf0f4; border-top: 4px solid var(--gris-f); }
.tuile-n { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tuile-t { font-weight: 600; color: var(--doux); font-size: .88rem; }
.tuile.bleu { border-top-color: var(--bleu); } .tuile.orange { border-top-color: var(--orange); } .tuile.rouge { border-top-color: var(--rouge); }
.ligne-info { display: flex; flex-direction: column; padding: .5rem 0; border-top: 1px solid var(--ligne); text-decoration: none; color: inherit; }
.ligne-info:first-of-type { border-top: 0; }
.vide-etat { text-align: center; color: var(--vert); font-weight: 600; padding: 2rem 1rem; }

/* ---------- lignes ---------- */
.element { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .7rem 0; border-top: 1px solid var(--ligne); }
.carte > .element:first-of-type, h2 + .element { border-top: 0; }
.element .info { flex: 1 1 55%; min-width: 150px; overflow-wrap: break-word; }
.element > .pastille, .element > button, .element > .bouton { flex: none; }
@media (max-width: 520px) { .element > .pastille { margin-left: auto; } }
.element.refuse { background: var(--rouge-f); margin: 0 -1.1rem; padding: .7rem 1.1rem; }
.element.inactif, .element.lue { opacity: .55; }
.element.coche { cursor: pointer; font-weight: 400; margin: 0; }
.element.coche input { width: 22px; height: 22px; accent-color: var(--marque); flex: none; }
.vignette { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ligne); flex: none; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--fond); }
.apercu { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin: .8rem auto 0; border: 1px solid var(--ligne); }
.navdate { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.navdate .centre { flex: 1; }
.ligne-jour { display: grid; grid-template-columns: 1fr auto 70px; gap: .6rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--ligne); color: inherit; text-decoration: none; }
.ligne-jour:first-child { border-top: 0; } .ligne-jour b { text-align: right; font-variant-numeric: tabular-nums; }
.ligne-plan { display: grid; grid-template-columns: 110px 1fr; gap: .6rem; padding: .7rem 0; border-top: 1px solid var(--ligne); }
.ligne-plan:first-child { border-top: 0; } .ligne-plan.aujourdhui > b { color: var(--marque); }
.ligne-plan .chantier:first-child { margin-top: 0; }

/* ---------- tableaux ---------- */
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--ligne); vertical-align: top; }
thead th { font-size: .8rem; color: var(--doux); text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; white-space: nowrap; }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.nom { position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; font-weight: 600; }
.aujourdhui { background: color-mix(in srgb, var(--soleil) 10%, #fff); }
.grille-plan td.case-plan { min-width: 110px; height: 64px; }
.grille-plan td.ferie { background: var(--gris-f); }
.etiquette { display: block; width: 100%; min-height: 30px; padding: .2rem .45rem; margin-bottom: .25rem; font-size: .8rem; border-radius: 7px; text-align: left;
  background: color-mix(in srgb, var(--marque) 12%, #fff); color: var(--marque); border: 1px solid color-mix(in srgb, var(--marque) 25%, #fff); overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }
.etiquette.absence { background: var(--gris-f); color: var(--gris); border-color: var(--ligne); font-weight: 600; }
.ajout { min-height: 28px; width: 100%; padding: 0; background: none; color: var(--doux); border: 1px dashed #cdd5df; font-size: 1rem; }
.choix-jours { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; } .choix-jours label { margin: .3rem 0; }
.grille-equipe td { text-align: center; padding: .4rem .3rem; } .grille-equipe a { text-decoration: none; }
.case-equipe { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 30px; border-radius: 7px; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--doux); }
.case-equipe.gris { background: var(--gris-f); } .case-equipe.bleu { background: var(--bleu-f); color: var(--bleu); }
.case-equipe.orange { background: var(--orange-f); color: var(--orange); } .case-equipe.rouge { background: var(--rouge-f); color: var(--rouge); }
.case-equipe.vert { background: var(--vert-f); color: var(--vert); }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--doux); }
.legende .case-equipe { min-width: 18px; min-height: 14px; vertical-align: middle; }

/* ---------- fenêtres ---------- */
.voile { position: fixed; inset: 0; background: rgba(15, 23, 35, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.fenetre { background: #fff; width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 1rem 1.15rem calc(1.2rem + var(--bas)); animation: monte .2s ease-out; }
@keyframes monte { from { transform: translateY(30px); opacity: .4; } }
.fenetre-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .3rem; position: sticky; top: -1rem; background: #fff; padding-top: .2rem; z-index: 2; }
.fenetre-tete h2 { margin: 0; }
@media (min-width: 700px) {
  .voile { align-items: center; }
  .fenetre { max-width: 520px; border-radius: 18px; }
  .fenetre.large { max-width: 680px; }
}
.provisoire { background: var(--fond); border-radius: 10px; padding: 1rem; line-height: 2; }
.grand-code { font-size: 1.3rem; font-weight: 800; letter-spacing: .05em; background: #fff; padding: .1rem .5rem; border-radius: 6px; border: 1px solid var(--ligne); }
.logo-reglage { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.logo-reglage .logo.grand, .logo-reglage .logo-texte.grand { margin: 0; }
