@font-face { font-family: "Sora"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/sora-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/sora-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/sora-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/sora-latin-700-normal.woff2) format("woff2"); }
:root {
  --navy: #14213d;
  --navy-2: #1f3158;
  --amber: #fca311;
  --amber-soft: #fff3d6;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1b1f27;
  --muted: #6b7280;
  --line: #e3e6ec;
  --ok: #1f8a4c;
  --ok-soft: #e3f4ea;
  --bad: #c62828;
  --bad-soft: #fde8e8;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app { max-width: 720px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 12px 14px 96px; }

/* ---------- En-tête ---------- */
.top { background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.top .brand { font-weight: 700; letter-spacing: .2px; }
.top .who { font-size: 13px; opacity: .8; }
.icon-btn { background: transparent; border: 0; color: #fff; font-size: 24px; width: 44px; height: 44px; border-radius: 10px; }
.icon-btn:active { background: var(--navy-2); }

/* ---------- Boutons ---------- */
.btn { border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; background: var(--navy); color: #fff; min-height: 48px; }
.btn:active { opacity: .85; }
.btn.amber { background: var(--amber); color: #1b1f27; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px; font-weight: 600; min-height: 42px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.chips.scroll .chip { white-space: nowrap; }

/* ---------- Formulaires ---------- */
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=email], input[type=date], select, input:not([type]) {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fff; min-height: 48px; font-size: 17px; }
input:focus { outline: 2px solid var(--amber); border-color: var(--amber); }

/* ---------- Connexion ---------- */
.login { padding: 48px 22px; max-width: 420px; margin: 0 auto; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 14px; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login p { margin: 0 0 18px; color: var(--muted); }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin: 12px 0 0; font-weight: 600; }

/* ---------- Semaine ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.week-nav .label { flex: 1; text-align: center; }
.week-nav .label b { display: block; font-size: 17px; }
.week-nav .label small { color: var(--muted); }
.nav-btn { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 22px; font-weight: 700; }
.day { width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; display: block; }
.day:active { background: #fafbfc; }
.day .dhead { display: flex; align-items: center; gap: 8px; }
.day .dname { font-weight: 700; font-size: 17px; flex: 1; }
.day .dtot { font-weight: 700; }
.day .dlines { margin-top: 6px; color: var(--text); font-size: 15px; }
.day .dlines div { padding: 2px 0; display: flex; justify-content: space-between; gap: 8px; }
.day .dlines span:last-child { color: var(--muted); white-space: nowrap; }
.day.todo { border-color: #f3b8b8; background: var(--bad-soft); }
.day.today { border-color: var(--amber); background: var(--amber-soft); }
.day.done { border-color: #bfe3cd; }
.day.off { background: #fafafa; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.tag.todo { background: var(--bad); color: #fff; }
.tag.today { background: var(--amber); color: #1b1f27; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.grey { background: #ececf0; color: var(--muted); }
.summary { display: flex; justify-content: space-between; align-items: center; background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.summary b { font-size: 20px; }

/* ---------- Feuilles (bottom sheets) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 35, .55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
#picker { z-index: 30; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet .sh-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet .sh-head h2 { margin: 0; font-size: 19px; }
.sheet .sh-body { overflow-y: auto; padding: 6px 16px 12px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet .sh-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff;
  display: flex; gap: 10px; align-items: center; }
.sheet .sh-foot .btn { flex: 1; }

.line { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.line .lname { font-weight: 700; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.line .lname small { display: block; font-weight: 400; color: var(--muted); }
.line .del { background: transparent; border: 0; color: var(--bad); font-size: 20px; width: 40px; height: 40px; flex: none; }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.stepper button { width: 52px; height: 48px; font-size: 24px; font-weight: 700; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.stepper input { text-align: center; font-weight: 700; font-size: 20px; width: 90px; }
.stepper .unit { color: var(--muted); font-weight: 600; }
.quick { display: flex; gap: 8px; flex-basis: 100%; }
.quick button { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 42px; font-weight: 700; }
.addrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.addrow .btn { padding: 12px 8px; }
.total-line { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 8px 2px; }
.hint { color: var(--muted); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

/* ---------- Sélecteur de chantier ---------- */
.pick-item { width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: block; }
.pick-item:active { background: var(--amber-soft); }
.pick-item b { display: block; }
.pick-item small { color: var(--muted); }
.pick-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 12px 2px 6px; }

/* ---------- Admin ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs .in { display: flex; width: 100%; max-width: 720px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px 4px 12px; font-weight: 700; color: var(--muted); font-size: 13px; }
.tabs button .ic { display: block; font-size: 22px; line-height: 1.1; }
.tabs button.on { color: var(--navy); box-shadow: inset 0 3px 0 var(--amber); }
.card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.miss { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.miss:first-of-type { border-top: 0; }
.miss .who { font-weight: 700; }
.miss small { color: var(--muted); display: block; }
.tablewrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: normal; text-align: right; vertical-align: bottom; min-width: 64px; }
table.t th:first-child, table.t td:first-child { text-align: left; position: sticky; left: 0; background: #fff; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
table.t tr.tot td { font-weight: 700; border-top: 2px solid var(--navy); }
table.t td.z { color: #c2c6cf; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.crow:first-child { border-top: 0; }
.crow small { color: var(--muted); display: block; }
.crow.off { opacity: .5; }
.switch { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.switch.on { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cd; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: #1b1f27; color: #fff;
  padding: 11px 18px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Terrain (problèmes / RAS / photos) ---------- */
textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 17px; resize: vertical; min-height: 96px; font-family: inherit; }
textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.typebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.typebtn { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 8px; font-weight: 800; font-size: 17px; min-height: 76px; }
.typebtn span { display: block; font-size: 26px; line-height: 1.1; }
.typebtn.prob.on { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.typebtn.ras.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.post { padding: 12px 14px; }
.post.open { border-color: #f3b8b8; }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.phead small { color: var(--muted); }
.pname small { display: block; color: var(--muted); }
.ptxt { margin: 8px 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.th { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #e9ebf0; }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .rm { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; }
.pact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pact .btn { flex: 1 1 40%; padding: 10px 8px; min-height: 42px; font-size: 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.18); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; }
.lb-x { top: calc(10px + env(safe-area-inset-top)); right: 10px; }
.lb-prev { left: 8px; top: 50%; margin-top: -24px; }
.lb-next { right: 8px; top: 50%; margin-top: -24px; }
.lb-n { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; }

/* ---------- Fiches chantier ---------- */
.frow { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 0; }
.frow:first-child { border-top: 0; }
.frow:active { background: var(--amber-soft); }
.frow .fmain { min-width: 0; }
.frow .fmain b { display: block; }
.frow small { color: var(--muted); }
.fbadges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.finfo { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.finfo:first-of-type { margin-top: 8px; }
.finfo span { color: var(--muted); flex: none; }
.finfo b, .finfo a { text-align: right; overflow-wrap: anywhere; }
.maps { color: #1a56c4; font-weight: 700; text-decoration: none; }
.prog { height: 14px; background: #e9ebf0; border-radius: 999px; overflow: hidden; }
.prog div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task .tt { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 6px; }
.task .tt small { display: block; color: var(--muted); }
.task.done .tt > div:first-child { text-decoration: line-through; color: var(--muted); }
.chk { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 2px solid #b8bec9; background: #fff; font-size: 20px; font-weight: 800; color: #fff; }
.task.done .chk { background: var(--ok); border-color: var(--ok); }
.tbtn { flex: none; width: 38px; height: 38px; border: 0; background: transparent; font-size: 18px; border-radius: 10px; }
.tbtn.sure { background: var(--bad-soft); }
.addtask { display: flex; gap: 8px; margin-top: 10px; }
.addtask input { flex: 1; min-width: 0; }
.addtask .btn { flex: none; padding: 0 16px; }

/* ---------- Lots ---------- */
.lot { width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; display: block; }
.lot:active { background: var(--amber-soft); }
.lot .lhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.lot .lpct { font-weight: 800; font-size: 18px; }
.lot .lpct.full { color: var(--ok); }
.lot small { display: block; color: var(--muted); margin-top: 6px; }
.prog.big { height: 18px; }
.prog.sm { height: 7px; flex: 1; }
.bigpct { font-size: 38px; font-weight: 800; text-align: center; margin-bottom: 8px; color: var(--navy); }
.mini { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mini b { display: inline; font-size: 13px; min-width: 40px; text-align: right; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
.opt input { width: 24px; height: 24px; accent-color: var(--navy); flex: none; }
#bar { height: 100%; background: var(--ok); border-radius: 999px; transition: width .15s; }

.poids { display: inline-block; font-size: 12px; font-weight: 700; background: var(--amber-soft); color: var(--navy); padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px; white-space: nowrap; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prow span { flex: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.prow input { width: 84px; text-align: center; font-weight: 700; padding: 8px; min-height: 44px; }
.prow b { color: var(--muted); }

/* Sélecteur de chantier : ancré en haut pour rester visible au-dessus du clavier */
#picker { align-items: flex-start; }
#picker .sheet { border-radius: 0 0 20px 20px; max-height: 100%; padding-top: env(safe-area-inset-top); animation: down .18s ease-out; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#picker .sh-head { padding-bottom: 2px; }
@keyframes down { from { transform: translateY(-30px); opacity: .6; } }
#picker .pick-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#picker .pick-item { padding: 10px 14px; margin-bottom: 6px; }

/* sous-traitants : deux boutons côte à côte */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two .btn { font-size: 14px; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.who-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--text); margin-bottom: 4px; }
.who-tag.st { background: #e3ecff; color: #1d3f8f; }
#rq { width: 100%; min-height: 48px; font-size: 16px; }

/* commandes de matériel */
.cmd { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.cmd:first-child { border-top: 0; }
.cmd .cmain { flex: 1; min-width: 0; }
.cmd .cmain small { display: block; color: var(--muted); }
.tagbtn { background: none; border: 0; padding: 4px; }
.cres { margin-top: 8px; }
.catg { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 4px; }
.ci { display: flex; align-items: center; gap: 6px; }
.cat-item { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 6px; min-height: 46px; }
.cat-item small { color: var(--muted); flex: none; }
.cat-item:active { background: var(--amber-soft); }
.cat-item.other { border-style: dashed; }
.bl { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bl:first-child { border-top: 0; }
.bl > b { flex: 1 1 100%; }
.bl .qty { display: flex; align-items: center; gap: 6px; flex: 1; }
.bl .qty button { width: 44px; height: 44px; font-size: 22px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; }
.bl .qty input { width: 80px; text-align: center; min-height: 44px; font-size: 18px; }
.tot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tot:first-of-type { border-top: 0; }
.urg { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.urg input { width: 22px; height: 22px; }
.cnote { font-size: 14px; margin-top: 2px; }
.thumbs.sm { grid-template-columns: repeat(3, 60px); margin-top: 6px; }
.thumbs.sm .th { width: 60px; height: 60px; }
.bl .lnote { flex: 1 1 100%; min-height: 42px; font-size: 15px; }
.bl .thumbs { flex: 1 1 auto; margin: 0; }

/* =====================================================================
   THÈMES DE COULEURS + finitions
   ===================================================================== */
:root, html[data-theme="electrique"] {
  --navy: #1e3a8a; --navy-2: #2563eb; --amber: #ff6b6b; --amber-soft: #ffe3e3;
  --bg: #eef2fb; --ok: #16a34a; --ok-soft: #dcf5e5; --line: #dfe5f1; --hdr-glow: rgba(37, 99, 235, .35);
}
html[data-theme="chantier"] {
  --navy: #2d2a32; --navy-2: #4a4452; --amber: #ff6b2c; --amber-soft: #ffe8db;
  --bg: #f7f4ef; --ok: #2f9e44; --ok-soft: #e0f3e4; --line: #e8e2d9; --hdr-glow: rgba(255, 107, 44, .30);
}
html[data-theme="foret"] {
  --navy: #0b5d46; --navy-2: #14906b; --amber: #f5b82e; --amber-soft: #fff1cc;
  --bg: #edf7f1; --ok: #15803d; --ok-soft: #d9f2e2; --line: #d9e8df; --hdr-glow: rgba(20, 144, 107, .35);
}
html[data-theme="ocean"] {
  --navy: #0b4f6c; --navy-2: #0e8aa6; --amber: #ff7a59; --amber-soft: #ffe5dd;
  --bg: #ecf7fa; --ok: #0f9d6e; --ok-soft: #d6f4ea; --line: #d6e6ec; --hdr-glow: rgba(14, 138, 166, .35);
}
html[data-theme="violet"] {
  --navy: #4c1d95; --navy-2: #7c3aed; --amber: #fbbf24; --amber-soft: #fff0c4;
  --bg: #f4f1fd; --ok: #16a34a; --ok-soft: #dcf5e5; --line: #e4def5; --hdr-glow: rgba(124, 58, 237, .35);
}
body { background: var(--bg); }
.top { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: 0 4px 18px var(--hdr-glow); }
.top .brand { font-size: 17px; }
.card, .day, .line, .lot, .pick-item { box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 20px rgba(16, 24, 40, .05); border-color: var(--line); }
.card { border-radius: 18px; padding: 14px 16px; }
.card h3 { font-size: 17px; }
.btn:not(.ghost):not(.amber):not(.danger) { background: linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: 0 6px 16px var(--hdr-glow); }
.btn.amber { background: linear-gradient(135deg, var(--amber), color-mix(in srgb, var(--amber) 80%, #fff)); box-shadow: 0 6px 16px color-mix(in srgb, var(--amber) 45%, transparent); color: #1b1f27; }
.btn { border-radius: 14px; }
.btn.ghost { border-color: var(--line); color: var(--navy); }
.chip.on { background: linear-gradient(135deg, var(--navy), var(--navy-2)); border-color: transparent; }
.summary { background: linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: 0 6px 16px var(--hdr-glow); }
.tabs { box-shadow: 0 -6px 20px rgba(16, 24, 40, .07); border-top: 0; }
.tabs button { border-radius: 14px; margin: 4px 2px; padding: 6px 2px 8px; }
.tabs button.on { box-shadow: none; background: color-mix(in srgb, var(--navy-2) 12%, transparent); color: var(--navy); }
.tabs button .ic { font-size: 24px; transition: transform .15s; }
.tabs button.on .ic { transform: translateY(-2px) scale(1.12); }
.prog { background: color-mix(in srgb, var(--navy) 10%, #fff); }
.prog div { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 60%, #6ee7b7)); }
.bigpct { color: var(--navy); }
.sheet { border-radius: 24px 24px 0 0; }
.day.today { box-shadow: 0 0 0 2px var(--amber), 0 8px 20px rgba(16, 24, 40, .06); }
input:focus, textarea:focus { outline: 2px solid var(--navy-2); border-color: var(--navy-2); }
.login { padding-top: 56px; }
.login .logo { box-shadow: 0 10px 28px var(--hdr-glow); }
.login h1 { color: var(--navy); }
.frow .fmain b, .lot .lhead b { font-weight: 800; }
.emo { display: inline-block; width: 1.5em; text-align: center; }
.th-swatch { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.th-swatch.on { border-color: var(--navy-2); background: color-mix(in srgb, var(--navy-2) 8%, #fff); }
.th-swatch .dots { display: flex; flex: none; }
.th-swatch .dots i { width: 26px; height: 26px; border-radius: 50%; margin-right: -8px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.th-swatch b { flex: 1; }

/* =====================================================================
   EFFET VERRE (transparence façon Apple)
   ===================================================================== */
body {
  background:
    radial-gradient(60vmax 50vmax at 0% 0%, color-mix(in srgb, var(--navy-2) 38%, transparent), transparent 60%),
    radial-gradient(55vmax 45vmax at 100% 25%, color-mix(in srgb, var(--amber) 34%, transparent), transparent 60%),
    radial-gradient(60vmax 50vmax at 20% 100%, color-mix(in srgb, var(--navy) 30%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.card, .day, .line, .lot, .pick-item, .frow, .post, .th-swatch {
  background: rgba(255, 255, 255, .58);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 8px 28px rgba(31, 38, 135, .10), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.day.today { background: color-mix(in srgb, var(--amber) 22%, rgba(255, 255, 255, .6)); border-color: var(--amber); }
.th-swatch.on { background: color-mix(in srgb, var(--navy-2) 14%, rgba(255, 255, 255, .6)); }
.top {
  background: linear-gradient(135deg, color-mix(in srgb, var(--navy) 82%, transparent), color-mix(in srgb, var(--navy-2) 78%, transparent));
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .25);
}
.tabs {
  background: rgba(255, 255, 255, .80);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, .8);
}
.overlay { background: rgba(10, 18, 35, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet {
  background: rgba(244, 247, 255, .74);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .8); border-bottom: 0;
}
.sheet .sh-foot { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.sheet .card, .sheet .line, .sheet .pick-item { background: rgba(255, 255, 255, .6); }
input, textarea, select { background: rgba(255, 255, 255, .7); }
.btn.ghost { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chip { background: rgba(255, 255, 255, .6); }

/* =====================================================================
   STYLE « iOS 27 » : verre plus clair, moins flou, bords nets, barre flottante
   ===================================================================== */
:root { --g: .40; }
.card, .day, .line, .lot, .pick-item, .frow, .post, .th-swatch, .chip, .btn.ghost {
  background: rgba(255, 255, 255, var(--g));
  -webkit-backdrop-filter: blur(9px) saturate(200%) brightness(1.04); backdrop-filter: blur(9px) saturate(200%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .95), inset 0 0 0 .5px rgba(20, 30, 60, .14), 0 10px 26px rgba(31, 38, 100, .12);
}
.day.today { background: color-mix(in srgb, var(--amber) 26%, rgba(255, 255, 255, var(--g))); }
.th-swatch.on { background: color-mix(in srgb, var(--navy-2) 18%, rgba(255, 255, 255, var(--g))); }
.chip.on { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
input, textarea, select { background: rgba(255, 255, 255, calc(var(--g) + .25)); border: 1px solid rgba(255, 255, 255, .9); box-shadow: inset 0 0 0 .5px rgba(20, 30, 60, .18); }
.top {
  background: linear-gradient(135deg, color-mix(in srgb, var(--navy) 70%, transparent), color-mix(in srgb, var(--navy-2) 62%, transparent));
  -webkit-backdrop-filter: blur(12px) saturate(200%); backdrop-filter: blur(12px) saturate(200%);
  box-shadow: inset 0 -.5px 0 rgba(10, 20, 50, .35), 0 6px 20px var(--hdr-glow);
}
/* barre d'onglets flottante en capsule */
.tabs {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding-bottom: 0;
  border-radius: 30px; background: rgba(255, 255, 255, calc(var(--g) + .18));
  -webkit-backdrop-filter: blur(14px) saturate(200%); backdrop-filter: blur(14px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .95), inset 0 0 0 .5px rgba(20, 30, 60, .16), 0 12px 32px rgba(20, 30, 90, .22);
  max-width: 720px; margin: 0 auto;
}
.tabs button { border-radius: 24px; margin: 5px 3px; }
.tabs button.on { background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 .5px rgba(20, 30, 60, .2), 0 2px 8px rgba(20, 30, 90, .12); }
.tabs button .ic { filter: none; }
/* boutons en capsule */
.btn { border-radius: 999px; }
.btn:not(.ghost):not(.danger) { box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .45), inset 0 0 0 .5px rgba(0, 0, 0, .18), 0 6px 14px var(--hdr-glow); }
/* fenêtres : très claires, bord net */
.overlay { background: rgba(10, 18, 35, .22); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
  background: rgba(244, 247, 255, calc(var(--g) + .22));
  -webkit-backdrop-filter: blur(16px) saturate(200%); backdrop-filter: blur(16px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, .9); border-bottom: 0; border-radius: 32px 32px 0 0;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .95), inset 0 0 0 .5px rgba(20, 30, 60, .14), 0 -10px 40px rgba(20, 30, 90, .2);
}
.sheet .sh-foot { background: rgba(255, 255, 255, .35); border-top: 0; }
.sheet .card, .sheet .line, .sheet .pick-item { background: rgba(255, 255, 255, calc(var(--g) + .1)); }
body { padding-bottom: 96px; }

/* =====================================================================
   THÈME « APPLE » (inspiré d'apple.com) : blanc/gris clair, noir, bleu Apple, très sobre
   ===================================================================== */
html[data-theme="apple"] {
  --navy: #1d1d1f; --navy-2: #1d1d1f; --amber: #0071e3; --amber-soft: #e8f2fd;
  --bg: #f5f5f7; --text: #1d1d1f; --muted: #6e6e73; --line: #e8e8ed; --ok: #30a46c; --ok-soft: #e3f6ec;
  --hdr-glow: rgba(0, 0, 0, 0); --g: 1;
  --blue: #0071e3;
}
html[data-theme="apple"] body {
  background: #f5f5f7;
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  letter-spacing: -.01em;
}
/* barre du haut : blanche translucide, texte noir, comme le menu d'apple.com */
html[data-theme="apple"] .top {
  background: rgba(251, 251, 253, .8); color: #1d1d1f;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid rgba(0, 0, 0, .16); box-shadow: none;
}
html[data-theme="apple"] .top .brand { font-weight: 600; font-size: 17px; }
html[data-theme="apple"] .top .who { color: #6e6e73; opacity: 1; }
html[data-theme="apple"] .top .iconbtn, html[data-theme="apple"] .top button { color: #1d1d1f; }
/* cartes : blanc pur, grands arrondis, quasi sans ombre */
html[data-theme="apple"] .card, html[data-theme="apple"] .day, html[data-theme="apple"] .line, html[data-theme="apple"] .lot,
html[data-theme="apple"] .pick-item, html[data-theme="apple"] .frow, html[data-theme="apple"] .post, html[data-theme="apple"] .th-swatch {
  background: #fff; border: 0; border-radius: 22px;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
}
html[data-theme="apple"] .day { border-radius: 18px; }
html[data-theme="apple"] .day.today { background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--blue); }
html[data-theme="apple"] .th-swatch.on { background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--blue); }
html[data-theme="apple"] .card h3 { font-weight: 700; letter-spacing: -.02em; }
html[data-theme="apple"] .bigpct { color: #1d1d1f; font-weight: 700; letter-spacing: -.03em; }
/* boutons : pastille bleue Apple */
html[data-theme="apple"] .btn:not(.ghost):not(.danger):not(.amber) { background: var(--blue); box-shadow: none; }
html[data-theme="apple"] .btn.amber { background: var(--blue); color: #fff; box-shadow: none; }
html[data-theme="apple"] .btn.ghost { background: transparent; color: var(--blue); border: 1px solid transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
html[data-theme="apple"] .btn { border-radius: 999px; font-weight: 500; }
html[data-theme="apple"] .btn.danger { box-shadow: none; }
html[data-theme="apple"] .chip { background: #fff; border: 0; box-shadow: none; color: #1d1d1f; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-theme="apple"] .chip.on { background: #1d1d1f; color: #fff; }
/* bandeau « total » : noir comme les bandeaux d'apple.com */
html[data-theme="apple"] .summary { background: #1d1d1f; box-shadow: none; border-radius: 22px; }
html[data-theme="apple"] .prog { background: #e8e8ed; }
html[data-theme="apple"] .prog div { background: var(--ok); }
html[data-theme="apple"] input, html[data-theme="apple"] textarea, html[data-theme="apple"] select {
  background: #fff; border: 0; box-shadow: inset 0 0 0 1px #d2d2d7; border-radius: 14px;
}
html[data-theme="apple"] input:focus, html[data-theme="apple"] textarea:focus { outline: 0; box-shadow: 0 0 0 4px rgba(0, 113, 227, .3), inset 0 0 0 1px var(--blue); }
html[data-theme="apple"] .login h1 { color: #1d1d1f; font-weight: 700; letter-spacing: -.03em; font-size: 32px; }
html[data-theme="apple"] .login .logo { box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
/* barre d'onglets : verre blanc sobre */
html[data-theme="apple"] .tabs {
  background: rgba(251, 251, 253, .8); border: 0; border-radius: 28px;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 8px 30px rgba(0, 0, 0, .12);
}
html[data-theme="apple"] .tabs button { color: #6e6e73; font-weight: 500; }
html[data-theme="apple"] .tabs button.on { background: rgba(0, 0, 0, .06); color: var(--blue); box-shadow: none; }
/* fenêtres */
html[data-theme="apple"] .overlay { background: rgba(0, 0, 0, .3); }
html[data-theme="apple"] .sheet { background: #f5f5f7; border: 0; border-radius: 28px 28px 0 0; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); }
html[data-theme="apple"] .sheet .sh-foot { background: rgba(251, 251, 253, .85); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid rgba(0, 0, 0, .12); }
html[data-theme="apple"] .sheet .card, html[data-theme="apple"] .sheet .line, html[data-theme="apple"] .sheet .pick-item { background: #fff; }
html[data-theme="apple"] .glass-ctl { display: none; }

/* icônes fines (remplacent les émojis) */
.ico { display: inline-block; width: 1.12em; height: 1.12em; vertical-align: -.2em; line-height: 0; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.tabs button .ic { display: block; margin: 0 auto 2px; }
.tabs button .ic .ico { width: 1em; height: 1em; }
.tabs button .ic .ico svg { stroke-width: 1.6; }
.btn .ico, .chip .ico { margin-right: 2px; }
.emo .ico { width: 1.15em; height: 1.15em; }
html[data-theme="apple"] .tabs button.on .ico, html[data-theme="apple"] .card h3 .ico { color: var(--blue); }

/* logo Helbul */
.logo-box { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 4px 0 26px; color: #1B2BFF; }
.logo-sym { width: 170px; height: auto; }
.logo-name { font-family: 'Sora', system-ui, sans-serif; font-weight: 600; font-size: 54px; line-height: 1; letter-spacing: -.03em; color: #0B1020; margin-top: 14px; }
.logo-tag { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: #4F5A72; margin-top: 12px; max-width: 300px; line-height: 1.6; }
.top .brand { display: flex; align-items: center; gap: 9px; }
.top-sym { width: 30px; height: auto; flex: none; color: #fff; }
html[data-theme="apple"] .top-sym { color: #1B2BFF; }
.login .logo, .login h1 { display: none; }
.login { padding-top: 44px; }
.login p { text-align: center; }

/* ---------- Plan du chantier ---------- */
.sheet.tall { max-height: 94vh; min-height: 70vh; }
.bat-line { margin: 10px 0 4px; }
.bat-line .bl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-size: 14px; }
.bat-line .bl-top span { color: var(--muted); font-size: 13px; }
.seg { display: flex; background: rgba(120, 120, 128, .14); border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 8px 4px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.bat-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.bat-tabs button { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bat-tabs button small { color: var(--muted); font-size: 12px; }
.bat-tabs button.on { border-color: var(--blue, var(--navy-2)); background: var(--amber-soft); }
.bat-tabs button.on b { color: var(--blue, var(--navy-2)); }
.plan-sum { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.plan-sum small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bld { margin-top: 14px; }
.bld .roof { height: 18px; margin: 0 14px -1px; background: var(--navy); clip-path: polygon(0 100%, 8% 0, 92% 0, 100% 100%); opacity: .88; border-radius: 6px 6px 0 0; }
html[data-theme="apple"] .bld .roof { background: #1d1d1f; }
.flr { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 10px; text-align: left; box-shadow: inset 3px 0 0 var(--line); }
.flr:first-of-type { border-radius: 4px 4px 0 0; }
.flr.part { box-shadow: inset 3px 0 0 var(--blue, var(--navy-2)); }
.flr.full { box-shadow: inset 3px 0 0 var(--ok); background: var(--ok-soft); }
.flr .fl { width: 42px; font-weight: 700; font-size: 13px; flex: none; }
.flr .fb { position: relative; flex: 1; height: 26px; border-radius: 9px; background: rgba(120, 120, 128, .16); overflow: hidden; }
.flr .fb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--blue, var(--navy-2)), color-mix(in srgb, var(--blue, var(--navy-2)) 70%, #7dd3fc)); border-radius: 9px; }
.flr.full .fb i { background: var(--ok); }
.flr .fb em { position: relative; z-index: 1; font-style: normal; font-weight: 700; font-size: 12px; line-height: 26px; padding-left: 10px; color: var(--text); mix-blend-mode: normal; }
.flr.part .fb em, .flr.full .fb em { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.flr .fp { display: flex; flex-direction: column; gap: 2px; flex: none; min-width: 52px; align-items: flex-end; }
.flr .fp u { text-decoration: none; font-size: 10.5px; font-weight: 700; color: #c026d3; background: #fae8ff; border-radius: 6px; padding: 1px 6px; }
.bld .ground { height: 8px; background: repeating-linear-gradient(45deg, #8e8e93 0 6px, #aeaeb2 6px 12px); border-radius: 0 0 6px 6px; }
.mat { background: #fff; border-radius: 16px; padding: 6px; }
.mrow { display: grid; grid-template-columns: 62px repeat(var(--n, 4), minmax(0, 1fr)); align-items: center; gap: 5px; width: 100%; border: 0; background: transparent; padding: 3px 0; text-align: center; }
.mrow .fl { text-align: left; font-weight: 700; font-size: 13px; padding-left: 6px; }
.mrow .fl small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.mhead span { font-size: 18px; } .mhead small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.mc { display: flex; align-items: center; justify-content: center; height: 34px; border-radius: 10px; background: rgba(120, 120, 128, .12); font-weight: 700; font-size: 12px; color: var(--text); }
.mc.part { background: color-mix(in srgb, var(--blue, var(--navy-2)) calc(18% + var(--p) * .5), #fff); color: #0b2a66; }
.mc.full { background: var(--ok); color: #fff; }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.legend .mc { display: inline-block; width: 14px; height: 14px; vertical-align: -3px; margin-right: 5px; border-radius: 5px; }
.nrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.nrow .nn { font-weight: 600; font-size: 14px; }
.step { display: inline-flex; align-items: center; gap: 8px; }
.step button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(120, 120, 128, .16); font-size: 20px; line-height: 1; font-weight: 600; }
.step b { min-width: 52px; text-align: center; font-size: 14px; }
#pbody .chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 0 6px; margin: 0 -2px; scrollbar-width: none; }
#pbody .chips::-webkit-scrollbar { display: none; }
#pbody .chip { flex: none; font-size: 12.5px; padding: 7px 12px; min-height: 0; white-space: nowrap; }
.nsub { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }

.ico svg.s64 { stroke-width: 3.2; }

.lcom { margin-top: 6px; font-size: 12.5px; color: var(--muted, #6e6e73); line-height: 1.35; text-align: left; }
.com { padding: 10px 12px; margin-top: 8px; border-radius: 12px; background: rgba(120,120,128,.1); }
.com-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.com-h span { color: var(--muted, #6e6e73); flex: 1; }
.com-t { margin-top: 4px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }

/* ---- réserves / quitus ---- */
.sigpad { width: 100%; height: 260px; display: block; border: 2px dashed var(--line); border-radius: 14px; background: #fff; touch-action: none; }
.qlig { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; display: grid; gap: 8px; }
.qcard { font: inherit; color: inherit; cursor: pointer; border: 0; display: block; }
.sheet .sh-body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=search]) { width: 100%; }

/* poids des secteurs : le champ garde sa largeur (la règle générale des champs de feuille l'étirait) */
.sheet .sh-body .prow input { width: 84px !important; flex: none; }

/* ---- sélecteur de langue ---- */
.langsel { appearance: none; -webkit-appearance: none; border: 1px solid rgba(255,255,255,.55) !important; background: rgba(255,255,255,.92) !important; color: #1B2BFF !important; -webkit-text-fill-color: #1B2BFF; border-radius: 10px; padding: 6px 8px; font-size: 13px; font-weight: 600; width: auto; max-width: 118px; min-height: 0; margin: 0; }
.langsel option { color: #111; }
.topl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.langbar { display: flex; justify-content: flex-start; margin: -30px 0 18px; }
.login .langsel { background: var(--card, #fff); color: var(--navy, #1B2BFF); border-color: var(--line, #ccd); }
[dir="rtl"] .langbar { justify-content: flex-start; }
[data-lang="ar"] body, [data-lang="hi"] body, [data-lang="pa"] body { font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Gurmukhi", Tahoma, sans-serif; }

/* suivi logement par logement (domotique…) */
.lg-sum{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0;font-size:.9rem;font-weight:600}
.lg-ok{color:var(--ok)}.lg-nok{color:var(--bad)}
.lg-row{margin:10px 0 14px}
.lg-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.lg-head small{color:var(--muted,#6b7280);flex:1}
.lg-head .chip{padding:6px 10px;font-size:.8rem}
.lg-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:6px}
.lt{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:54px;padding:6px 4px;border-radius:12px;border:2px solid rgba(120,120,130,.35);background:rgba(120,120,130,.08);color:inherit;font:inherit;cursor:pointer}
.lt b{font-size:.95rem}.lt small{font-size:.68rem;opacity:.75}
.lt.ok{background:#1f9d55;border-color:#1f9d55;color:#fff}
.lt.nok{background:#d93025;border-color:#d93025;color:#fff}
.lt .lt-c{position:absolute;top:-6px;right:-4px;font-style:normal;font-size:.8rem}
.lt-d{display:inline-block;width:14px;height:14px;border-radius:4px;border:2px solid rgba(120,120,130,.45);vertical-align:-2px;margin-right:4px}
.lt-d.ok{background:#1f9d55;border-color:#1f9d55}.lt-d.nok{background:#d93025;border-color:#d93025}
.lg-bad{display:block;width:100%;text-align:left;padding:10px 12px;margin-bottom:6px;border-radius:12px;border:1px solid rgba(217,48,37,.4);background:rgba(217,48,37,.08);color:inherit;font:inherit;cursor:pointer}
.lg-bad span{display:block;font-size:.85rem;opacity:.85;margin-top:2px}
.lot .marque{display:inline-block;align-self:flex-start;font-size:.95rem;font-weight:700;letter-spacing:.04em;margin-top:8px;padding:4px 12px;border-radius:999px;background:rgba(0,113,227,.12);color:var(--accent,#0071e3)}
.chips .chip.on, .bat-tabs .on, .seg .on { font-weight: 800; }
.mhead > span > small { display: block; font-size: 10px; }
.mat .mc { font-size: 11px; padding: 0; }
/* numéros de logements : tuiles plus compactes (5 par ligne sur téléphone) */
.lg-tiles { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 5px; }
.lt { min-height: 44px; padding: 4px 2px; border-radius: 10px; gap: 0; }
.lt b { font-size: .82rem; line-height: 1.15; }
.lt small { font-size: .6rem; line-height: 1.15; }
.lt .lt-c { top: -5px; right: -3px; font-size: .7rem; }
/* ligne « Total général » du tableau des heures : doit rester une vraie ligne de tableau (le style .tot de la liste la cassait) */
table.t tr.tot { display: table-row; padding: 0; border: 0; }
table.t.heures td:nth-child(2) { font-weight: 700; }
table.t.heures th:nth-child(2) { min-width: 82px; }
.lot .marque.lien{font-size:.85rem;margin-right:6px}
.lot .lienbtn{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:10px 16px;border-radius:12px;background:var(--amber,#f59e0b);color:#fff;font-weight:800;font-size:.95rem;box-shadow:0 1px 3px rgba(0,0,0,.18);cursor:pointer}
.lot .lienbtn:active{filter:brightness(.92)}

.lienbox{margin:14px 0 0;padding:10px 12px;border:1px dashed var(--amber,#f5a623);border-radius:12px}
.lienbox input{width:100%}

a.btn.lienfull{display:flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;margin:16px 0 4px;text-align:center;text-decoration:none}
.lienbox{margin-top:14px}

.lot .colbadge{display:inline-block;margin-left:6px;padding:3px 10px;border-radius:999px;background:var(--amber,#f59e0b);color:#fff;font-size:.85rem;font-weight:800;letter-spacing:.02em;white-space:nowrap;vertical-align:middle}
.mqrow{display:flex;align-items:center;gap:10px;margin:6px 0}.mqrow span{min-width:64px;font-weight:700}.mqrow input{flex:1}

/* achats : liste claire avec logos */
.seg3 { display: flex; gap: 4px; padding: 4px; background: var(--line, #e6e6ec); border-radius: 16px; margin: 0 0 12px; }
.seg3 button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted, #6b6b76); font: inherit; font-size: 13px; font-weight: 600; }
.seg3 button.on { background: var(--card, #fff); color: var(--text, #1d1d22); font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.mois { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted, #6b6b76); padding: 12px 4px 4px; }
.achrow { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--card, #fff); border-radius: 18px; }
.achmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.achmid b { font-size: 15px; font-weight: 700; }
.achmid small, .achr small { font-size: 12.5px; color: var(--muted, #6b6b76); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.achr { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.achr b { font-size: 15px; font-weight: 800; }
.lg { position: relative; flex: none; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.lg b { font-weight: 800; }
.lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5px; box-sizing: border-box; background: #fff; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 12px; text-align: left; border: 0; font: inherit; color: var(--text); background: var(--card); border-radius: 20px; padding: 14px; min-height: 108px; }
.tile .ti { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.tile b { display: block; font-size: 15px; font-weight: 800; }
.tile small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.tile { flex-direction: row; align-items: center; gap: 10px; min-height: 0; padding: 12px; }
.tile .ti { flex: none; width: 38px; height: 38px; }
.tile b { font-size: 14px; line-height: 1.2; }
.tile small { font-size: 12px; }

/* ================= Style « verre » (façon iPhone) ================= */
:root{ --glass: rgba(255, 255, 255, .6); --glass-b: rgba(255, 255, 255, .85); --glass-sh: 0 8px 24px rgba(40, 60, 120, .12); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .95); }
html{ background: var(--bg); }
html[data-theme] body {background: transparent; }
html[data-theme] body::before {content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at -10% 15%, rgba(120, 160, 255, .38), transparent 60%),
    radial-gradient(55vmax 55vmax at 110% 55%, rgba(255, 190, 150, .38), transparent 60%),
    radial-gradient(50vmax 50vmax at 30% 105%, rgba(200, 170, 255, .34), transparent 60%),
    linear-gradient(160deg, #eef2ff, #f6f1ff 55%, #fff4ec); }
html[data-theme] .card, html[data-theme] .pick-item, html[data-theme] .achrow, html[data-theme] .tile, html[data-theme] .summary, html[data-theme] .day, html[data-theme] .lot, html[data-theme] .line {background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-b); box-shadow: var(--glass-hi), var(--glass-sh); }
html[data-theme] .achrow, html[data-theme] .tile {border-radius: 20px; }
html[data-theme] .chip {background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); border: 1px solid var(--glass-b); box-shadow: var(--glass-hi); }
html[data-theme] .chip.on {background: #1d1d22; color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
html[data-theme] .btn.ghost {background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-b); box-shadow: var(--glass-hi); }
html[data-theme] .btn.cta {background: #3f6fe0; color: #fff; border-radius: 999px; min-height: 52px; font-size: 15px; box-shadow: 0 8px 20px rgba(63, 111, 224, .35); }
html[data-theme] .btn.cta svg {stroke: #fff; }
html[data-theme] .dot {display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
html[data-theme] .seg3 {background: rgba(255, 255, 255, .4); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-b); }
html[data-theme] .seg3 button.on {background: rgba(255, 255, 255, .95); }
html[data-theme] input[type=text], html[data-theme] input[type=password], html[data-theme] input[type=number], html[data-theme] input[type=search], html[data-theme] input[type=tel], html[data-theme] input[type=email], html[data-theme] input[type=date], html[data-theme] select, html[data-theme] textarea, html[data-theme] input:not([type]) {background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: var(--glass-b); }
/* barre du bas flottante */
html[data-theme] .tabs {left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding-bottom: 0; border: 1px solid var(--glass-b); border-radius: 30px;
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); box-shadow: var(--glass-hi), 0 10px 30px rgba(40, 60, 120, .18); max-width: 696px; margin: 0 auto; }
html[data-theme] .tabs button {padding: 8px 4px 9px; border-radius: 24px; }
html[data-theme] .tabs button.on {box-shadow: none; background: rgba(255, 255, 255, .95); color: #3f6fe0; }
/* feuilles */
html[data-theme] .overlay {-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(20, 30, 60, .35); }
html[data-theme] .sheet {background: rgba(244, 245, 250, .78); -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7); border: 1px solid var(--glass-b); border-bottom: 0; box-shadow: 0 -10px 40px rgba(20, 30, 60, .2); }
html[data-theme] .sheet .sh-foot {background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }


html[data-theme] .tabs button { min-height: 52px; font-size: 13px; }
html[data-theme] .tile { padding: 16px; min-height: 64px; }
html[data-theme] .tile b { font-size: 15px; }
html[data-theme] .tile:last-child:nth-child(odd) { justify-content: center; text-align: center; }
html[data-theme] .tile b { white-space: nowrap; }

/* ===== accueil administrateur ===== */
.ahello h1 { margin: 6px 2px 0; font-size: 27px; letter-spacing: -.5px; }
.ahello p { margin: 2px 2px 12px; color: var(--muted); font-size: 13.5px; }
.kgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kcard { text-align: left; font: inherit; color: var(--text); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 2px;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); border: 1px solid var(--glass-b); box-shadow: var(--glass-hi), var(--glass-sh); }
.kcard .kn { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -1px; margin-bottom: 6px; }
.kcard b { font-size: 13.5px; }
.kcard small { font-size: 12px; color: var(--muted); }
.kcard.kc-r .kn { color: #d63a3a; } .kcard.kc-o .kn { color: #c2570c; } .kcard.kc-b .kn { color: #2f5bd0; } .kcard.kc-g .kn { color: #1c7c47; }
.kcard.kc-r { box-shadow: var(--glass-hi), 0 8px 24px rgba(214, 58, 58, .18); }
.ahead { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 4px 8px; }
.ahead h2 { margin: 0; font-size: 15px; }
.alink { border: 0; background: none; color: #3f6fe0; font-weight: 700; font-size: 12.5px; padding: 6px 0; }
.agroup { border-radius: 22px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); border: 1px solid var(--glass-b); box-shadow: var(--glass-hi), var(--glass-sh); }
.arow { width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-top: 1px solid rgba(0, 0, 0, .06); padding: 11px 13px; display: flex; align-items: center; gap: 11px; }
.arow:first-child { border-top: 0; }
.udot { width: 9px; height: 9px; border-radius: 50%; background: #3f6fe0; flex: none; } .udot.off { background: transparent; }
.ath { width: 46px; height: 46px; border-radius: 13px; flex: none; background: linear-gradient(135deg, #9fb4d8, #c9d3e6); overflow: hidden; }
.ath img { width: 100%; height: 100%; object-fit: cover; display: block; }
.amid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.amid b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amid small, .art small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pl { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.pl.red { background: #fde4e4; color: #a12525; } .pl.or { background: #ffe9d6; color: #9a4508; } .pl.ok { background: #dcf5e6; color: #17663a; }
.abar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .08); overflow: hidden; margin-top: 8px; } .abar div { height: 100%; background: #1c9a55; }
/* pastilles chiffrées sur la barre du bas */
.tabs button { position: relative; }
.tabs .badge { position: absolute; top: 2px; right: calc(50% - 38px); min-width: 17px; height: 17px; border-radius: 9px; background: #d63a3a; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.tabs .badge[hidden] { display: none; }
html[data-theme] .tabs button { font-size: 11.5px; padding-left: 0; padding-right: 0; letter-spacing: -.2px; }
.tabs .badge { top: -3px; right: 0; }
html[data-theme] .tabs button, html[data-theme] .tabs button.on { border-radius: 18px; }

/* barre du bas : vrai verre, le contenu défile derrière (comme sur iPhone) */
html[data-theme] .tabs { background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px) saturate(2); backdrop-filter: blur(14px) saturate(2);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 6px 22px rgba(30, 40, 90, .10); }
html[data-theme] .tabs button.on { background: rgba(255, 255, 255, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
html[data-theme] .tabs button { color: #2b2f3a; }
html[data-theme] .tabs button.on { color: #1d5fe0; }
html[data-theme] .top { background: rgba(246, 247, 252, .55); -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8); border-bottom: 1px solid rgba(255, 255, 255, .6); box-shadow: none; }
/* Avancement : barre de progression (curseur) dans chaque chantier */
.pline { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pline .prog { flex: 1; height: 10px; display: block; }
.pline .prog > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.pline em { font-style: normal; font-weight: 800; font-size: 13px; min-width: 42px; text-align: right; }
/* Accueil technicien */
.valcard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 22px; font: inherit; color: inherit; text-align: left; cursor: pointer; border: 1px solid #bfe9cf; background: rgba(255,255,255,.62); }
.valcard.todo { border-color: #ffd9a8; }
.valcard .ck { width: 26px; height: 26px; border-radius: 50%; background: #1c9a55; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.valcard .amid { flex: 1; min-width: 0; } .valcard b { display: block; font-size: 14.5px; } .valcard small { display: block; color: #6b6b76; font-size: 12.5px; }
.mini2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.mini2 button { font: inherit; color: inherit; padding: 12px; text-align: center; border-radius: 22px; border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.62); cursor: pointer; }
.mini2 b { display: block; font-size: 15px; } .mini2 small { color: #6b6b76; font-size: 12px; }
.g2 { padding: 12px 16px; border-radius: 22px; margin-bottom: 10px; background: rgba(255,255,255,.62); border: 1px solid #ffd9a8; }
.g2.red { border-color: #f5c2c2; } .g2.ok { border-color: #bfe9cf; }
.g2h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; } .g2h b { font-size: 16px; }
.sgrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid rgba(0,0,0,.06); background: none; font: inherit; color: inherit; text-align: left; }
.sgrow b { display: block; font-size: 14.5px; } .sgrow small { display: block; color: #6b6b76; font-size: 12.5px; } .sgrow .amid { flex: 1; min-width: 0; }
.sr { padding: 9px 0; border-top: 1px solid rgba(0,0,0,.06); }
.sr .h { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; } .sr .h em { font-style: normal; font-weight: 800; }
.sr .h small { color: #6b6b76; font-weight: 600; font-size: 11.5px; margin-left: 6px; }
.sr .prog.sm { height: 6px; }
.pl.bl { background: #e4ecff; color: #2f5bd0; }
.ahello + .valcard { margin-top: 12px; }
/* Couleurs des statuts de commande */
.tag.stc-a_commander { background: #fde4e4; color: #a12525; }
.tag.stc-commande { background: #e4ecff; color: #2f5bd0; }
.tag.stc-livre { background: #dcf5e6; color: #17663a; }
.tag.stc-dispo_bureau { background: #efe6fb; color: #6b3fb8; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.sdot.stc-a_commander { background: #d63a3a; } .sdot.stc-commande { background: #3f6fe0; } .sdot.stc-livre { background: #1c9a55; } .sdot.stc-dispo_bureau { background: #8a55d6; }
/* Notifications */
.pushenc { border-color: #cfdcff; margin-top: 12px; }
.pushenc p { margin: 4px 0 10px; font-size: 13px; color: #6b6b76; line-height: 1.35; }
.pushrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sw { width: 44px; height: 26px; border-radius: 13px; background: #1c9a55; position: relative; border: 0; padding: 0; cursor: pointer; flex: none; }
.sw u { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.sw.off { background: #c8cbd6; } .sw.off u { right: auto; left: 3px; }
.g2.mat { border-color: #cfdcff; }
/* choix direct du statut d'une commande */
.stpick { position: fixed; z-index: 400; min-width: 210px; max-width: 280px; background: var(--card, #fff); color: var(--text, #1d1d22); border-radius: 18px; box-shadow: 0 12px 34px rgba(0,0,0,.35); padding: 8px; }
.stpick p { margin: 4px 8px 6px; font-size: 12px; font-weight: 800; color: var(--muted, #6b6b76); }
.stpick button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; padding: 12px 10px; border-radius: 12px; text-align: left; }
.stpick button.cur { background: rgba(120,120,140,.16); }
.stpick button b { margin-left: auto; }
.bulkbar { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(120,120,140,.25); }
.bulkbar p { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--muted, #6b6b76); }
.bulkbar div { display: flex; gap: 6px; flex-wrap: wrap; }
.bulkbar button { flex: 1; min-width: 90px; border: 0; border-radius: 14px; padding: 11px 6px; font: inherit; font-weight: 800; font-size: 13px; }
.bulkbar button.stc-a_commander { background: #fde4e4; color: #a12525; } .bulkbar button.stc-commande { background: #e4ecff; color: #2f5bd0; } .bulkbar button.stc-livre { background: #dcf5e6; color: #17663a; } .bulkbar button.stc-dispo_bureau { background: #eadcff; color: #6a35b8; }

/* bouton Activité sur l'accueil (administrateur) */
.ahello { position: relative; }
.actbtn { position: absolute; right: 2px; top: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px var(--hdr-glow, rgba(30,58,138,.35)); }
.actbtn b { background: #e5252a; color: #fff; border-radius: 11px; min-width: 22px; height: 22px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.actbtn b[hidden] { display: none; }

/* dernier ajout : zébré orange / vert, jusqu'à la prochaine saisie (jamais à 100 %) */
:root { --zebre: repeating-linear-gradient(135deg, #f59e0b 0 7px, #1f9d55 7px 14px); }
.prog { position: relative; }
.prog .dlt { position: absolute; top: 0; height: 100%; background: var(--zebre) !important; border-radius: 0 !important; }
.flr .fb i.dlt { background: var(--zebre) !important; border-radius: 0; inset: 0 auto 0 auto; }
.mc.chg { background: var(--zebre) !important; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.lt.ok.new { background: var(--zebre); border-color: #f59e0b; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.lt-d.new { background: var(--zebre); border-color: #f59e0b; }
.jrow:active { filter: brightness(.96); }
.dltxt { margin: 6px 0 8px; }
.dlt-t { background: #f59e0b; color: #fff; border-radius: 8px; padding: 1px 8px; font-weight: 700; }

/* ---- rappels / pense-bête ---- */
.rp-add { padding: 8px 14px; min-height: 36px; font-size: 14px; }
.rp-list { padding: 8px; }
.rp-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 10px 6px 4px; }
.rp-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; }
.rp-ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #9aa3b2; background: #fff; color: #fff; flex: none; font-weight: 800; padding: 0; min-height: 0; }
.rp-ck.on { background: #1f9d55; border-color: #1f9d55; }
.rp-mid { flex: 1; min-width: 0; cursor: pointer; }
.rp-t { font-weight: 700; display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.rp-t i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rp-s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rp-s.late { color: var(--bad); font-weight: 700; }
.rp-item.fait .rp-t { text-decoration: line-through; opacity: .5; }
.rp-go { padding: 6px 12px; min-height: 34px; font-size: 13px; flex: none; }
.rp-big { width: 100%; font: inherit; font-size: 20px; font-weight: 700; border-radius: 16px; padding: 16px; min-height: 84px; resize: none; }
.rp-h2 { margin: 18px 2px 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp-tile { display: block; width: 100%; text-align: left; border: 1.5px solid rgba(20,30,60,.12); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.65); min-height: 64px; font: inherit; color: var(--text, #1b1f27); }
.rp-tile.full { grid-column: 1 / -1; min-height: 0; }
.rp-tile .a { display: block; font-weight: 700; font-size: 16px; }
.rp-tile .b { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.rp-tile.sel, .rp-cat.sel { background: rgba(0,113,227,.16); border: 2px solid #0071e3; color: #0b2a55; }
.rp-cat { display: block; width: 100%; text-align: center; border: 1.5px solid rgba(20,30,60,.12); border-radius: 16px; padding: 14px 6px; background: rgba(255,255,255,.65); font: inherit; font-weight: 700; font-size: 14px; color: var(--text, #1b1f27); white-space: nowrap; }
.rp-cat i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.rp-sum { background: rgba(0,113,227,.10); border-radius: 14px; padding: 12px 14px; margin-top: 10px; font-weight: 700; }
.rp-sum small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }
.rp-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 14px; padding: 14px; background: rgba(255,255,255,.65); }
.rp-row select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.rp-mut { color: var(--muted); }

.rp-urg { background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; flex: none; }
.rp-filtres { margin: 0 0 10px; }
.rp-filtres .chip { display: inline-flex; align-items: center; gap: 6px; }
.rp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rp-chf { margin-bottom: 12px; }
.rp-urgrow { width: 100%; text-align: left; border: 0; font: inherit; margin-top: 14px; }
.ahead .rp-add { margin-left: 8px; }

.rp-pick { background: rgba(255,255,255,.55); border-radius: 14px; padding: 10px; }
.rp-picked { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; min-height: 24px; }
.rp-x { border: 0; background: rgba(0,0,0,.08); border-radius: 50%; width: 26px; height: 26px; }
.rp-search { width: 100%; }
.rp-res button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 6px; border-top: 1px solid rgba(0,0,0,.07); }

.rp-note { display: block; margin-top: 6px; font-size: 13px; color: #8a5a00; background: #fff3d6; border-radius: 8px; padding: 5px 8px; text-align: left; }

.ev-item { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; background: rgba(255,255,255,.7); border-radius: 16px; padding: 12px 14px; margin: 6px 0; font: inherit; }
.ev-d { min-width: 44px; text-align: center; font-weight: 800; font-size: 20px; line-height: 1.1; }
.ev-d small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.ev-m b { display: block; } .ev-m span { font-size: 13px; color: var(--muted); }

.tabs button { font-size: 12px; letter-spacing: -.1px; }

/* planning */
.pg-g { background: rgba(255,255,255,.7); border-radius: 14px; overflow: hidden; margin: 6px 0 4px; }
.pg-row { display: flex; border-bottom: 1px solid rgba(120,120,128,.15); }
.pg-name { width: 84px; flex: none; padding: 8px 6px; font-weight: 700; font-size: 11px; overflow-wrap: anywhere; background: rgba(120,120,128,.06); display: flex; align-items: center; }
.pg-track { flex: 1; position: relative; min-width: 0; background-image: linear-gradient(to right, rgba(120,120,128,.18) 1px, transparent 1px); background-size: 10% 100%; }
.pg-h .pg-track { display: grid; grid-template-columns: repeat(10, 1fr); height: 34px; background-image: none; }
.pg-cols span { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.1; }
.pg-cols span.wk { border-left: 2px solid rgba(120,120,128,.35); }
.pg-cols small { font-weight: 500; font-size: 10px; }
.pg-bar { position: absolute; height: 28px; border: 0; border-radius: 8px; color: #fff; font: inherit; font-size: 11px; font-weight: 700; padding: 0 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; font-weight: 700; }
.pg-nav .icon-btn { font-size: 26px; }
.pg-card { display: block; width: 100%; text-align: left; border: 0; border-left: 5px solid var(--navy); background: rgba(255,255,255,.75); border-radius: 14px; padding: 11px 14px; margin: 6px 0; font: inherit; }
.pg-card b { display: block; font-size: 15px; }
.pg-per { display: block; font-size: 12px; font-weight: 700; color: #b36b00; margin-top: 2px; }
.pg-txt { display: block; margin-top: 5px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.pg-who { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pg-who i { font-style: normal; font-size: 12px; background: rgba(27,79,216,.1); border-radius: 10px; padding: 2px 8px; }
.pg-jour { margin-bottom: 8px; }
.pg-jh { font-size: 12px; font-weight: 700; text-transform: capitalize; color: var(--muted); margin: 12px 2px 2px; }
/* barre d'onglets : défile à l'horizontale quand il y a trop d'onglets (administrateur : 8) */
.tabs { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .in { min-width: max-content; margin: 0 auto; }
.tabs button { flex: 1 0 auto; padding-left: 9px; padding-right: 9px; white-space: nowrap; }

/* navigation regroupée */
.segg { padding: 12px 14px 0; }
.segg:empty { display: none; }
.segg .seg button { white-space: nowrap; }
.mgo-row { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 12px 14px; border-bottom: 1px solid rgba(120,120,128,.15); text-align: left; }
.mgo-row:last-child { border-bottom: 0; }
.mgo-row small { color: var(--muted); font-size: 12px; }
/* la barre du bas n'a plus à défiler */
.tabs { overflow-x: visible; justify-content: center; }
.tabs .in { min-width: 0; }
.tabs button { flex: 1 1 0; padding-left: 2px; padding-right: 2px; }

/* frise du planning : défilement horizontal sans limite, nom des lignes fixe à gauche */
.pg-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; background: rgba(255,255,255,.7); border-radius: 14px; margin: 6px 0 4px; }
.pg-inner { position: relative; }
.pg-r { display: flex; border-bottom: 1px solid rgba(120,120,128,.15); }
.pg-nm { position: sticky; left: 0; z-index: 3; width: 92px; flex: none; padding: 8px 6px; font-weight: 700; font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; background: #f3f4f9; display: flex; align-items: center; border-right: 1px solid rgba(120,120,128,.2); }
.pg-head .pg-nm { background: #eceef6; color: var(--muted); }
.pg-tr { position: relative; flex: none; background-image: linear-gradient(to right, rgba(120,120,128,.16) 1px, transparent 1px); background-size: 44px 100%; }
.pg-head .pg-tr { background-image: none; }
.pg-wrow { position: relative; height: 16px; }
.pg-wk { position: absolute; top: 0; height: 16px; line-height: 16px; font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; padding-left: 4px; border-left: 2px solid rgba(120,120,128,.35); }
.pg-dr { display: flex; height: 34px; }
.pg-hd { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); line-height: 1.1; }
.pg-hd b { font-size: 12px; color: var(--text); }

/* planning : curseur de date, trait du jour, bulle des noms, bouton Auj. */
.pg-wrap { position: relative; margin: 6px 0 4px; }
.pg-wrap .pg-scroll { margin: 0; }
.pg-cur { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #e5484d; pointer-events: none; z-index: 5; }
.pg-cur span { position: absolute; top: 0; left: 0; transform: translateX(-50%); background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; white-space: nowrap; }
.pg-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #1b4fd8; opacity: .8; pointer-events: none; z-index: 1; }
.pg-hd.today b { color: #1b4fd8; }
.pg-hd.today i { color: #1b4fd8; }
.pg-auj { border: 1px solid rgba(120,120,128,.35); background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 3px 8px; margin-left: 6px; }
.pg-bulle { position: fixed; z-index: 60; max-width: 76vw; background: #fff; color: var(--text); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 10px 12px; font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; }
.pg-bulle b { font-size: 14px; }
.pg-bulle em { font-style: normal; white-space: pre-wrap; overflow-wrap: anywhere; }
.pg-bulle small { color: var(--muted); font-size: 11px; margin-top: 3px; }
/* barre du planning sur deux lignes : initiales (ou chantier) puis travaux */
.pg-bar { height: 38px; padding: 3px 6px; line-height: 1.2; }
.pg-bh, .pg-bt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-bh { font-weight: 700; font-size: 11px; }
.pg-bt { font-weight: 500; font-size: 10.5px; opacity: .92; }
/* total de la semaine : le fond suit le thème, donc le texte aussi */
html[data-theme] .summary { color: var(--text); }

/* personne qui a déclaré (rappel, activité) : un peu plus mise en avant */
.pers-b { font-weight: 800; font-size: 1.06em; }

/* accueil admin, option A : bandeau compact + aperçu planning */
.kstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kpill { font: inherit; color: var(--text); border: 1px solid var(--glass-b); border-radius: 16px; padding: 8px 4px 7px; text-align: center; cursor: pointer;
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); box-shadow: var(--glass-hi), var(--glass-sh); }
.kpill .kn { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.kpill .kl { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpill.kc-r .kn { color: #d63a3a; } .kpill.kc-o .kn { color: #c2570c; } .kpill.kc-b .kn { color: #2f5bd0; } .kpill.kc-g .kn { color: #1c7c47; }
.pvprev { display: block; width: 100%; font: inherit; color: var(--text); text-align: left; margin: 18px 0 8px; padding: 12px 12px 6px; border-radius: 22px; border: 1px solid var(--glass-b); cursor: pointer;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); box-shadow: var(--glass-hi), var(--glass-sh); }
.pvdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.pvdays small { font-weight: 500; }
.pvbars { position: relative; margin-top: 6px; width: 100%; }
.pvbar { position: absolute; height: 18px; line-height: 18px; padding: 0 6px; border-radius: 9px; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvvide { font-size: 12px; color: var(--muted); }
.pvplus { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pvwm { margin-top: 6px; text-align: right; font-size: 12px; color: var(--muted); opacity: .45; }

/* ================= Grand écran (ordinateur, grande tablette) : même appli, verre plus visible =================
   À partir de 1024 px de large seulement. Les téléphones (et les tablettes étroites) gardent l'affichage actuel. */
@media (min-width: 1024px) {
  body {
    background:
      radial-gradient(45vw 40vh at 8% 6%, color-mix(in srgb, var(--navy-2) 55%, transparent), transparent 65%),
      radial-gradient(40vw 40vh at 96% 30%, color-mix(in srgb, var(--amber) 50%, transparent), transparent 65%),
      radial-gradient(45vw 45vh at 25% 100%, color-mix(in srgb, var(--navy) 45%, transparent), transparent 65%),
      var(--bg);
    background-attachment: fixed;
  }
  html[data-theme] .card, html[data-theme] .pick-item, html[data-theme] .achrow, html[data-theme] .tile, html[data-theme] .summary,
  html[data-theme] .day, html[data-theme] .lot, html[data-theme] .line, html[data-theme] .kpill, html[data-theme] .pvprev, html[data-theme] .agroup, html[data-theme] .kcard {
    background: rgba(255, 255, 255, .42);
    box-shadow: var(--glass-hi), 0 12px 36px rgba(40, 60, 120, .16);
  }
  #app { max-width: 960px; }
  .tabs .in { max-width: 960px; }
  html[data-theme] .tabs { max-width: 936px; }
}

/* bulle d'information au survol d'un logement « pas OK » (souris uniquement) */
.lt-tip { position: fixed; z-index: 300; transform: translate(-50%, -100%); padding: 7px 10px; border-radius: 10px; background: #1f2937; color: #fff; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; }
.lt-tip[hidden] { display: none; }

/* plaquette corps d'état, avancement sur une ligne, pastilles par bâtiment */
.gline{display:flex;align-items:center;gap:10px;margin:0 0 8px}.gline b{font-size:15px}.gbar{flex:1;height:6px;border-radius:999px;background:color-mix(in srgb,var(--navy) 10%,#fff);overflow:hidden}.gbar i{display:block;height:100%;background:var(--ok);border-radius:999px}
.prog.thin6{height:6px;margin:4px 0 6px}.bat-line .bl-top em{font-style:normal;font-weight:800}
.pchips,.ce-chips{display:flex;gap:4px}.pch{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:3px;padding:4px 0;border-radius:8px;font-size:12px;font-weight:700;line-height:1}
.pch.full{background:#e3f4e8;color:#1b7a3a}.pch.part{background:#fff1d6;color:#8a5a00}.pch.none{background:#eef0f4;color:#8a909c}
.pch .emo{width:1.3em}.ce{padding:0}.ce-head{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;padding:10px 12px;font:inherit;text-align:left}.ce-head b{white-space:nowrap}.ce-chips{flex:1}.ce-v{font-size:18px;color:var(--muted)}
.ce-i{font-size:15px;line-height:1}.ce-body{border-top:1.5px solid var(--line);padding:8px 10px 12px}.ce-row{display:grid;grid-template-columns:26px repeat(5,minmax(0,1fr));gap:5px;align-items:center;margin-bottom:5px}
.ce-lab{font-size:10.5px;text-align:center;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;line-height:1.15}.ce-c{height:38px;border-radius:9px;border:1.5px solid var(--line);background:#fff;color:transparent;padding:0;font-weight:800}.ce-c.on{background:#e3f4e8;border-color:#7cc593;color:#1b7a3a}
.ce-hint{margin-top:8px;font-size:12px;color:var(--muted)}.ce-who{margin-top:4px;font-size:11px;color:var(--muted)}
.lot{padding:8px 12px}.lot .lhead{margin-bottom:5px}.lot .prog{height:6px}.lot small{margin-top:3px}
.lpct{white-space:nowrap}.lot .lhead b{min-width:0}
.pchips .pch{font-size:11.5px;gap:2px}
.gen{display:flex;align-items:center;gap:10px;padding:2px 6px 10px}.gen b{font-size:13px;font-weight:700;white-space:nowrap}.gen .gbar{height:4px}
.lot-c{padding:7px 11px;margin-bottom:6px}.lot-c .lc1{display:flex;align-items:center;gap:8px}.lot-c .lc1 b{white-space:nowrap;font-size:14px}.lot-c .lc1 .gbar{flex:1;height:5px}.lot-c .lpct{font-size:15px;white-space:nowrap;min-width:42px;text-align:right}.lot-c small{margin-top:1px;font-size:11.5px}
.who-tag.mini{font-size:10.5px;padding:1px 6px;margin:0 4px 0 0}.lot-c .poids{font-style:normal;font-size:11px;color:var(--muted);font-weight:600}.pch{border:0;font-family:inherit;cursor:pointer}.pdocs{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.pdocs .lienbtn{margin:0}
.pdocs .lienbtn{display:inline-flex;align-items:center;padding:7px 12px;border-radius:10px;background:var(--amber,#f59e0b);color:#fff;font-weight:800;font-size:.85rem;box-shadow:0 1px 3px rgba(0,0,0,.18);cursor:pointer}
.lot-c .lienbtn{margin-top:6px;padding:7px 12px;font-size:.85rem}
.ce-lab{font-size:10px;line-height:1.15;word-break:break-word;hyphens:auto}.ce-row{align-items:start}.ce-row>b{align-self:center}
.ce-i{display:inline-flex;font-size:19px;line-height:1}.ce-lab .ce-i{font-size:22px}.ce-chips .ce-i{font-size:16px}
button.ce-lab{border:0;background:transparent;font-family:inherit;padding:2px 0;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.ce-c{touch-action:manipulation}

/* facturation des sous-traitants — Mohamed Satouri */
.fx-card{padding:14px 16px}
.fx-head{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;background:none;padding:0;text-align:left;font:inherit;color:inherit}
.fx-head h3{margin:0 0 2px}.fx-head small{display:block;color:var(--muted);font-size:13px}.fx-head i{font-style:normal;font-size:18px;color:var(--muted)}
.fx-att{color:#b45309}
.fx-body{margin-top:10px}
.fx-st{font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:12px 0 4px}
.fx-bc{border:1px solid var(--line);border-radius:14px;padding:11px 12px;margin:6px 0;background:#fff}
.fx-bh{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}.fx-bh span{color:var(--muted);font-size:13px;flex:1;min-width:0}
.fx-j{height:10px;border-radius:6px;background:#e8ebf0;display:flex;overflow:hidden}
.fx-j i{display:block;height:100%}.fx-j .av{background:#bfe6c9}.fx-j .va{background:#2fa35a}
.fx-j.warn .va{background:#f59e0b}.fx-j.bad .va,.fx-j.bad .av{background:#dc2626}
.fx-s{display:flex;justify-content:space-between;font-size:13px;margin:5px 0 2px}.fx-s .warn{color:#b45309}.fx-s .bad{color:var(--bad)}
.fx-dem{background:#fff7e6;border:1px solid #ffd9a8;border-radius:10px;padding:8px 10px;font-size:13.5px;margin:8px 0}
.fx-f{display:flex;align-items:center;gap:8px;width:100%;border:0;border-top:1px solid rgba(0,0,0,.06);background:none;font:inherit;color:inherit;text-align:left;padding:9px 0}
.fx-f>span{flex:1;min-width:0}.fx-f small{display:block;color:var(--muted);font-size:12px}
.fx-t{font-style:normal;font-size:11.5px;font-weight:800;padding:3px 8px;border-radius:999px;white-space:nowrap}
.fx-t.wait{background:#fff1d6;color:#b45309}.fx-t.ok{background:#dcf5e4;color:#1f7a42}.fx-t.bad{background:var(--bad-soft);color:var(--bad)}
.fx-act{display:flex;gap:6px;margin-top:8px}.fx-act .btn{flex:1;min-height:42px;padding:8px 6px;font-size:14px}
.fx-file{display:block;border:1.5px dashed var(--line);border-radius:14px;padding:16px;text-align:center;font-weight:700;background:#fff}.fx-file input{display:none}
.fx-row3{display:grid;grid-template-columns:1.3fr 1.3fr 1fr;gap:8px}.fx-row3 input{min-width:0}
.fx-pv{position:relative;width:max-content;max-width:100%;margin:8px auto;border:1px solid var(--line);box-shadow:0 2px 10px rgba(0,0,0,.08);touch-action:none}
.fx-pv canvas{display:block;max-width:100%}.fx-tp{position:absolute;opacity:.92;cursor:grab;touch-action:none;outline:1.5px dashed #1d4ed8;outline-offset:2px}

/* détail des heures — Mohamed Satouri */
.hd-kp{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 10px}.hd-k{background:#f4f6fb;border-radius:14px;padding:10px 12px}.hd-k small{display:block;color:var(--muted);font-size:12px}.hd-k b{display:block;font-size:21px}
.hd-k.warn b{color:#b45309}.hd-k.bad b{color:var(--bad)}
.hd-seg{display:flex;gap:6px;overflow-x:auto;padding:2px 0 4px}.hd-seg .chip{flex:none}
.hd-rk{display:flex;align-items:center;gap:10px;margin:8px 0}.hd-n{width:26px;height:26px;border-radius:50%;background:#fde68a;display:grid;place-items:center;font-weight:800;font-size:13px;flex:none}.hd-n.a{background:#fbbf24}
.hd-nm{width:104px;font-weight:700;font-size:13.5px;flex:none;line-height:1.2}.hd-bar{flex:1;height:14px;border-radius:7px;background:#eef0f5;overflow:hidden}.hd-bar i{display:block;height:100%;border-radius:7px}
.hd-v{width:58px;text-align:right;font-size:13px;flex:none}.hd-v small{display:block;color:var(--muted);font-size:11px}
.hd-lg{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:11.5px;color:#4b5563;margin-top:6px}.hd-lg span:before{content:"";display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:5px;background:var(--c)}
.hd-t{width:100%;border-collapse:collapse;font-size:12.5px}.hd-t th,.hd-t td{padding:6px 4px;text-align:right;border-top:1px solid #eef0f5}.hd-t th:first-child,.hd-t td:first-child{text-align:left}.hd-t th{color:var(--muted);font-weight:700;border:0}.hd-t td.t{font-weight:800}.hd-t .hd-tot td{font-weight:800;background:#f8f9fc}

/* synthèse : heures par chantier (version fine) — Mohamed Satouri */
.sy-h{display:flex;justify-content:space-between;align-items:baseline;margin:0 2px 10px}.sy-h h3{margin:0;font-size:16px}.sy-h span{color:var(--muted);font-size:13px}
.sy-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}.sy-chip{display:flex;align-items:center;gap:6px;background:#f4f6fb;border-radius:999px;padding:3px 9px;font-size:12px}.sy-chip i{width:8px;height:8px;border-radius:50%}.sy-chip b{margin-left:2px}
.sy-row{border-top:1px solid #eef0f5;padding:8px 0}.sy-top{display:flex;align-items:baseline;gap:8px;width:100%;border:0;background:none;padding:0;font:inherit;color:inherit;text-align:left}
.sy-nm{flex:1;display:flex;align-items:baseline;gap:6px;min-width:0}.sy-nm small{font-size:12px;font-weight:600;color:#9ca3af;flex:none}.sy-nm b{font-size:14px;font-weight:600;line-height:1.25}
.sy-tot{display:flex;align-items:baseline;gap:6px;flex:none}.sy-tot b{font-size:15px;font-weight:800}.sy-tot small{font-size:11.5px;color:var(--muted);min-width:30px;text-align:right;white-space:nowrap}.sy-ch{color:#9ca3af;font-size:12px}
.sy-bar{display:flex;height:5px;border-radius:3px;overflow:hidden;margin-top:6px;background:#eef0f5;gap:1.5px}.sy-bar i{display:block;height:100%}
.sy-det{margin-top:6px;background:#f8f9fc;border-radius:12px;padding:3px 10px}.sy-d{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:13px}.sy-d i{width:8px;height:8px;border-radius:50%;flex:none}.sy-d span{flex:1}.sy-d b{width:52px;text-align:right}.sy-d em{font-style:normal;color:var(--muted);width:38px;text-align:right;font-size:12px}
.sy-ecole{display:flex;justify-content:space-between;background:#f4f6fb;border-radius:14px;padding:8px 12px;margin-top:6px;font-size:13.5px}.sy-tt{display:flex;justify-content:space-between;border-top:1px solid #1f2937;margin-top:10px;padding-top:8px;font-weight:800;font-size:15px}

/* quitus sur place : même feuille que le quitus à distance — Mohamed Satouri */
.qs-invite{background:#fff6d6;color:#6b4e00;border-radius:14px;padding:10px 12px;font-size:14px;margin:4px 0 10px}
.qs-adm{background:#f4f6fb;border-radius:14px;padding:4px 12px 12px;margin:4px 0 10px}
.qs-f{background:#fff;border-radius:6px;padding:14px 12px;box-shadow:0 2px 12px rgba(20,33,61,.1);color:#111}
.qs-ent{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;border-bottom:2px solid #c9ccec;padding-bottom:8px}
.qs-m{font-weight:900;font-size:22px;color:#2b3a8c;letter-spacing:.5px}.qs-m small{display:block;font-weight:600;font-size:10.5px;color:#2b3a8c;letter-spacing:0}.qs-a{text-align:right;font-size:11px;color:#2b3a8c}.qs-a b{font-size:12px}
.qs-ref{display:flex;justify-content:space-between;font-size:12.5px;margin:10px 0 0}
.qs-f h1{font-size:15.5px;text-align:center;color:#2b3a8c;margin:12px 0 10px;letter-spacing:.3px}
.qs-g{display:grid;grid-template-columns:34% 66%;border-top:1.5px solid #a9aedb;border-left:1.5px solid #a9aedb}
.qs-g>div{border-right:1.5px solid #a9aedb;border-bottom:1.5px solid #a9aedb;padding:6px 8px;font-size:14px;min-height:36px;display:flex;align-items:center}
.qs-g .l{background:#dadcf0;color:#2b3a8c;font-weight:700;font-size:12.5px}.qs-g .ed{background:#fffbe6;box-shadow:inset 0 0 0 2px #f2c94c}
.qs-g input,.qs-t input,.qs-t textarea{width:100%!important;border:0!important;background:transparent!important;font:inherit;font-size:14.5px;outline:0!important;padding:0!important;margin:0!important;box-shadow:none!important;min-height:0!important;border-radius:0!important;height:auto}
.qs-tt{margin-top:16px;text-align:center;background:#dadcf0;color:#2b3a8c;font-weight:800;font-size:12.5px;padding:8px;border:1.5px solid #a9aedb;border-bottom:0}
.qs-t{display:grid;grid-template-columns:34% 66%;border-top:1.5px solid #a9aedb;border-left:1.5px solid #a9aedb}
.qs-t>div{border-right:1.5px solid #a9aedb;border-bottom:1.5px solid #a9aedb;padding:6px 8px;position:relative}
.qs-t .e{background:#dadcf0;color:#2b3a8c;font-weight:700;font-size:12px;text-align:center;padding:6px}.qs-t .ed{background:#fffbe6}.qs-t textarea{resize:none;overflow:hidden;display:block}
.qs-t .sup{position:absolute;top:0;right:0;background:transparent;border:0;color:#b3261e;font-size:16px;padding:4px 8px;line-height:1}
.qs-at{font-size:13px;margin:14px 0 0}
.qs-v{display:grid;grid-template-columns:1fr 1fr;margin-top:14px;border-top:1.5px solid #a9aedb;border-left:1.5px solid #a9aedb}
.qs-v>div{border-right:1.5px solid #a9aedb;border-bottom:1.5px solid #a9aedb}.qs-v .t{background:#dadcf0;color:#2b3a8c;font-weight:700;font-size:11.5px;text-align:center;padding:8px 4px}
.qs-ent2{height:170px;display:grid;place-items:center}.qs-ent2 img{max-width:96%;max-height:94%;object-fit:contain}
.qs-sg{height:170px;position:relative;background:#fffbe6;box-shadow:inset 0 0 0 3px #f2c94c}.qs-sg canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;border:0;background:transparent}
.qs-hint{position:absolute;inset:0;display:grid;place-items:center;text-align:center;font-weight:800;color:#a07a00;font-size:14px;pointer-events:none;padding:8px}
.qs-op{display:flex;justify-content:space-between;align-items:center;gap:6px;width:100%;border:0;background:transparent;font:inherit;font-size:14.5px;text-align:left;padding:0;color:inherit}.qs-op i{font-style:normal;color:#6b7280}
.qs-lst{border:0;background:#e5e7f5;border-radius:8px;width:30px;height:28px;flex:none;margin-left:6px;font-size:15px;color:#2b3a8c}
.qs-g .v{gap:4px}

/* synthèse : congés et absences (version compacte) — Mohamed Satouri */
.cg-card{padding:12px 14px}.cg-h{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px}.cg-h h3{margin:0;font-size:15px}.cg-h span{color:var(--muted);font-size:12px}
.cg-r{display:flex;align-items:center;gap:6px;padding:7px 0;border-top:1px solid #eef0f5;font-size:14px}.cg-r:first-of-type{border-top:0}.cg-n{flex:1;min-width:0}
.cg-t{font-style:normal;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;white-space:nowrap}.cg-t.cp{background:#e0ecff;color:#1d4ed8}.cg-t.ab{background:#ffe9d1;color:#b45309}

/* rappels (post-it / liste par section) et agenda (verre) — Mohamed Satouri */
.rpq{display:flex;gap:8px;align-items:center;background:var(--glass);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border:1px solid var(--glass-b);box-shadow:var(--glass-hi),var(--glass-sh);border-radius:18px;padding:6px 6px 6px 14px;margin:0 0 10px}
.rpq input{flex:1;min-width:0;border:0!important;background:transparent!important;box-shadow:none!important;font-size:16px;min-height:40px;padding:0!important;outline:none}
.rpq-b{width:40px;height:40px;border-radius:13px;border:0;background:linear-gradient(135deg,#2563eb,#6d4aff);color:#fff;font-size:24px;font-weight:600;flex:none;padding:0;min-height:0}
.rpc,.agbar{display:flex;align-items:center;gap:8px;margin:0 0 10px;flex-wrap:wrap}
.rpseg{display:flex;background:rgba(120,130,170,.16);border-radius:999px;padding:3px}.rpseg button{border:0;background:transparent;border-radius:999px;padding:7px 14px;font-weight:700;font-size:13px;color:var(--muted);min-height:0}.rpseg .on{background:#fff;color:#1b1f27;box-shadow:0 1px 4px rgba(15,23,42,.15)}
.rpall{border:0;background:rgba(99,102,241,.12);color:#4f46e5;border-radius:999px;padding:8px 13px;font-weight:700;font-size:13px;min-height:0}
.ag-n{margin-left:auto;color:var(--muted);font-size:12.5px;font-weight:600}
.rp-n{font-style:normal;background:rgba(0,0,0,.08);border-radius:999px;padding:0 7px;font-size:12px}.chip.on .rp-n{background:rgba(255,255,255,.25)}
.rps,.ags{margin:6px 0}
.rps-h,.ags-h{display:flex;align-items:center;gap:8px;padding:10px 4px;font-size:13.5px;letter-spacing:.03em;text-transform:uppercase;color:#4b5563;cursor:pointer}
.rps-h .n,.ags-h .n{background:rgba(255,255,255,.8);border-radius:999px;padding:1px 9px;font-size:12px;font-weight:800}
.rps-h .cv,.ags-h .cv{margin-left:auto;color:#6b7280;font-size:12px}
.rps-m{margin-left:auto;border:0;background:rgba(99,102,241,.12);color:#4f46e5;border-radius:999px;padding:4px 10px;font-size:11.5px;font-weight:800;min-height:0;text-transform:none;letter-spacing:0}.rps-m+.cv{margin-left:4px}
.rpi-wall{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 10px;padding:8px 2px 12px}
.rpi{position:relative;min-height:92px;padding:13px 9px 8px;border-radius:3px 3px 14px 3px;display:flex;flex-direction:column;justify-content:space-between;font-family:"Segoe Print","Bradley Hand","Marker Felt","Comic Sans MS",cursive;font-size:13px;line-height:1.2;box-shadow:0 5px 8px -2px rgba(0,0,0,.22),inset 0 -8px 12px -10px rgba(0,0,0,.12);color:#1f2937}
.rpi:nth-child(3n+1){transform:rotate(-1.6deg)}.rpi:nth-child(3n+2){transform:rotate(1deg)}.rpi:nth-child(3n){transform:rotate(-.6deg)}
.rpi:before{content:"";position:absolute;top:-7px;left:50%;margin-left:-16px;width:32px;height:12px;background:rgba(255,255,255,.55);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.rpi.y{background:#fff3a3}.rpi.o{background:#ffd9a0}.rpi.v{background:#e4d9ff}.rpi.g{background:#cdf1c8}.rpi.r{background:#ffc9cf}.rpi.b{background:#cfe3ff}
.rpi-body{cursor:pointer;flex:1;overflow-wrap:anywhere}.rpi-t{font-weight:600}.rpi small{display:block;font:700 10.5px system-ui,sans-serif;color:#4b5563;margin-top:6px;line-height:1.25}
.rpi-b{position:absolute;top:-8px;right:-6px;background:#dc2626;color:#fff;font:800 8.5px system-ui;padding:3px 6px;border-radius:5px;transform:rotate(6deg);letter-spacing:.02em}.rpi-b.late{background:#b45309}
.rpi-ck{align-self:flex-end;margin-top:6px;width:24px;height:24px;border-radius:50%;border:2px solid rgba(0,0,0,.35);background:rgba(255,255,255,.55);color:#fff;font-weight:800;padding:0;min-height:0;font-size:13px}.rpi-ck.on{background:#1f9d55;border-color:#1f9d55}
.rpi.fait{opacity:.55}.rpi.fait .rpi-t{text-decoration:line-through}
/* agenda */
.agh{display:flex;align-items:flex-end;gap:12px;margin:6px 2px 10px}
.agh-d{font-size:84px;line-height:.85;font-weight:800;letter-spacing:-4px;background:linear-gradient(160deg,#1d4ed8,#7c3aed);-webkit-background-clip:text;background-clip:text;color:transparent}
.agh-m{padding-bottom:4px;font-size:15px;color:var(--muted);font-weight:600;line-height:1.25}.agh-m strong{display:block;color:var(--text);font-size:20px;font-weight:800}
.agh-c{display:block;margin-top:6px;font-size:22px;font-weight:800;color:#334155;font-variant-numeric:tabular-nums;letter-spacing:-.3px}.agh-c small{font-size:13px;opacity:.5;margin-left:1px}
.agh-add{margin-left:auto;align-self:flex-start;width:48px;height:48px;border-radius:16px;border:1px solid var(--glass-b);background:var(--glass);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);color:#4f46e5;font-size:28px;font-weight:600;padding:0;min-height:0;box-shadow:0 8px 22px -10px rgba(79,70,229,.45)}
.agcard{background:var(--glass);-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);border:1px solid var(--glass-b);box-shadow:var(--glass-hi),var(--glass-sh);border-radius:22px;padding:6px;margin-bottom:8px}
.agr{display:flex;gap:12px;align-items:center;padding:12px;border-radius:17px;cursor:pointer}.agr+.agr{border-top:1px solid rgba(100,116,139,.14);border-radius:0}
.agr.next{background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(139,92,246,.12));border-radius:17px;border-top:0}.agr.next+.agr{border-top:0}
.agr-h{width:54px;flex:none;text-align:center}.agr-h b{display:block;font-size:17px;font-weight:800;letter-spacing:-.3px;font-variant-numeric:tabular-nums}.agr-h small{display:block;font-size:10.5px;color:#94a3b8;font-weight:700;text-transform:uppercase}.agr.next .agr-h small{color:#6366f1}
.agr-bar{width:4px;align-self:stretch;border-radius:4px;background:var(--c);flex:none}.agr-m{flex:1;min-width:0}.agr-t{font-weight:700;font-size:15px;line-height:1.2;overflow-wrap:anywhere}.agr-u{font-size:12.5px;color:var(--muted);margin-top:3px}.agr.passe{opacity:.6}
.agr-c{margin-top:8px}.agc{display:inline-block;background:rgba(255,255,255,.85);border-radius:999px;padding:5px 11px;font-size:12px;font-weight:700;color:#334155;text-decoration:none;box-shadow:0 1px 3px rgba(15,23,42,.12)}
.ags-d{width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.85);display:grid;place-items:center;font-weight:800;font-size:15px;line-height:1;text-transform:none;letter-spacing:0;color:#0f172a;box-shadow:0 2px 8px rgba(15,23,42,.08);padding-top:2px}.ags-d small{display:block;font-size:8.5px;color:#94a3b8;margin-top:-5px;font-weight:700;text-transform:uppercase}
.ags-h b{font-size:14.5px;letter-spacing:0;text-transform:none;color:#0f172a}.ags.gris{opacity:.75}
.ag-vide,.ag-libre{text-align:center;color:#94a3b8;padding:16px 8px;font-size:14px}.ag-libre{padding:6px 8px 12px}
.ag-jl{font-size:11.5px;font-weight:800;color:#64748b;text-transform:uppercase;padding:8px 12px 0}
.agwk{display:flex;align-items:center;justify-content:space-between;margin:0 0 6px}.agwk button{width:40px;height:40px;border-radius:12px;border:1px solid var(--glass-b);background:var(--glass);font-size:22px;font-weight:700;padding:0;min-height:0}.agwk b{font-size:15px}
/* agenda : vue Mois — Mohamed Satouri */
.mo{background:var(--glass);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border:1px solid var(--glass-b);box-shadow:var(--glass-hi),var(--glass-sh);border-radius:22px;padding:12px;margin:4px 0 10px}
.mh{display:flex;align-items:center;justify-content:space-between;padding:0 2px 8px}.mh b{display:block;text-align:center;font-size:17px;font-weight:800}.mh small{display:block;font-size:11.5px;color:#64748b;font-weight:700;text-align:center;margin-top:1px}
.mh .nv{width:36px;height:36px;border-radius:12px;border:0;background:rgba(255,255,255,.85);font-size:20px;font-weight:700;box-shadow:0 1px 4px rgba(15,23,42,.1);padding:0;min-height:0}
.g7{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}.g7 .gl{font-size:11px;font-weight:800;color:#94a3b8;padding:4px 0}
.mc{position:relative;height:44px;border-radius:13px;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:700;font-size:14.5px;color:var(--text);padding:0;min-height:0}.mc.x{color:#cbd5e1}
.mc .mp{display:flex;gap:2px;margin-top:3px;height:5px}.mc .mp i{width:5px;height:5px;border-radius:50%;background:#6366f1}.mc .mp i.o{background:#f59e0b}
.mc.t{background:rgba(99,102,241,.16);color:#4f46e5}.mc.s{background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;box-shadow:0 6px 14px -6px rgba(79,70,229,.6)}.mc.s .mp i{background:#fff}
.cm{display:flex;gap:8px;margin:0 0 4px}.cm div{flex:1;background:var(--glass);border:1px solid var(--glass-b);border-radius:16px;padding:9px 10px;font-size:11.5px;color:#64748b;font-weight:700}.cm b{display:block;font-size:20px;color:#0f172a;font-weight:800}
.msel{display:flex;align-items:center;justify-content:space-between;margin:14px 4px 6px}.msel b{font-size:17px;font-weight:800}.msel span{font-size:12px;color:#64748b;font-weight:700}
.addj{display:flex;align-items:center;justify-content:center;width:100%;background:rgba(99,102,241,.12);color:#4f46e5;border-radius:16px;padding:13px;font-weight:800;font-size:14.5px;margin:6px 0;border:1.5px dashed rgba(99,102,241,.4);min-height:0}
/* demande de facture : désignation avec suggestions — Mohamed Satouri */
.dsw{position:relative}
.dsug{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;background:#fff;border-radius:16px;box-shadow:0 16px 36px -10px rgba(20,30,70,.45);border:1px solid rgba(15,23,42,.06);overflow:hidden;max-height:300px;overflow-y:auto}
.dsug-t{padding:9px 14px 4px;font-size:11px;font-weight:800;color:#94a3b8;text-transform:uppercase;letter-spacing:.04em}
.dsug-i{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:0;border-top:1px solid #f1f3f8;background:#fff;padding:11px 14px;font:inherit;font-size:14.5px;min-height:0;color:var(--text)}
.dsug-i:first-child{border-top:0}.dsug-i.h{background:#eef2ff}.dsug-i span{flex:1;min-width:0}.dsug-i b{background:#dbeafe;color:#1d4ed8;border-radius:4px;font-weight:700}.dsug-i em{font-style:normal;font-size:10.5px;color:#94a3b8;font-weight:700;flex:none}
.dsug-sv{background:#f8fafc;color:#4f46e5;font-weight:800;font-size:13px}
/* comptes groupés par entreprise (sql/64) */
.cgrp { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #6366f1; margin: 16px 2px 2px; }
.tag.ge { background: #ede9fe; color: #6d28d9; }
.tag.te { background: #e0f2fe; color: #0369a1; }
/* intérimaires : photo de la feuille d'heures (sql/65) */
.fi-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; margin: 0 0 10px; border-radius: 18px; border: 1px solid var(--glass-b, #fff); background: var(--glass, rgba(255,255,255,.75)); box-shadow: var(--glass-sh, 0 2px 10px #0001); cursor: pointer; font: inherit; color: var(--text); }
.fi-card.red { background: rgba(254, 226, 226, .88); border-color: #fca5a5; }
.fi-card.ok { background: rgba(209, 250, 229, .85); border-color: #86efac; }
.fi-card .fi-i { font-size: 22px; }
.fi-card .fi-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fi-card .fi-t b { font-size: 15px; }
.fi-card.red .fi-t b { color: #b91c1c; }
.fi-card .fi-t small { font-size: 12px; color: var(--muted); }
.fi-card .fi-g { font-weight: 700; color: #0071e3; font-size: 13px; }
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fi-ph img { width: 100%; border-radius: 10px; display: block; background: #e2e8f0; min-height: 120px; object-fit: cover; }
.fi-ph small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tag.bad { background: #fee2e2; color: #b91c1c; }

/* planning : réalisé (lu dans les heures) sur le prévu pâle, passé légèrement grisé */
.pg-past { position: absolute; top: 0; bottom: 0; background: rgba(120,120,128,.08); pointer-events: none; z-index: 1; }
.pg-bar.pg-prev { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); }
.pg-real { position: absolute; height: 26px; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 2; }
.pg-real.pg-conge { background: rgba(120,120,128,.18); color: var(--muted); border: 1px dashed rgba(120,120,128,.55); line-height: 24px; }

.pg-sub { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 4px 0; }
.pg-reel { cursor: default; }
