/* Bons de location - Lopera TP */
:root {
  --navy: #2a2a2a; --navy-2: #3d3d3d; --accent: #fe5901; --orange: #fe5901; --bg: #f3f5f8; --card: #fff;
  --ink: #1b2430; --muted: #6b7684; --line: #e3e7ee; --ok: #1f8a4c; --err: #c2412d; --warn: #b7791f;
  --radius: 12px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--navy-2); }
h2 { font-size: 1.3rem; margin: .2em 0 .4em; }
h3 { font-size: 1.02rem; margin: 0 0 .6em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); font-weight: 600; }
.ok { color: var(--ok); }
code.hash { font-size: .8rem; }

/* barre du haut */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; background: var(--navy); color: #fff;
  padding: calc(10px + var(--safe-t)) 14px 10px; min-height: 52px; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.topbar-title { flex: 1; font-weight: 650; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-back { color: #fff; text-decoration: none; font-size: 2rem; line-height: 1; padding: 0 6px 4px 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.net { width: 10px; height: 10px; border-radius: 50%; background: #4cd38a; display: inline-block; }
.net.off { background: #ff7a59; box-shadow: 0 0 0 3px rgba(255,122,89,.3); }
.queue { background: var(--accent); color: #1b1b1b; border-radius: 10px; padding: 1px 8px; font-size: .8rem; font-weight: 700; text-decoration: none; }

.main { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(96px + var(--safe-b)); }
body.public .main { padding-bottom: 40px; }

/* navigation du bas */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); }
.bottomnav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: 7px 0 8px; }
.bottomnav a .ico { display: block; font-size: 1.25rem; line-height: 1.3; }
.bottomnav a.on { color: var(--navy); font-weight: 650; }
.bottomnav a.on .ico { color: var(--accent); }

/* cartes */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.06); border: 1px solid #edf0f4; }
.card-accent { border: 2px solid var(--navy-2); background: #f4f8fd; }
.card .big { font-size: 1.35rem; font-weight: 700; margin-top: 2px; }
.empty { text-align: center; padding: 28px 16px; }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; color: var(--muted); }
details.card[open] > summary::before { content: '▾ '; }
.section-title { margin: 22px 2px 8px; color: var(--navy); }

/* formulaires */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select, textarea { width: 100%; font: inherit; color: inherit; padding: 11px 12px; border: 1px solid #cfd6df; border-radius: 10px; background: #fff; min-height: 46px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(44,79,124,.15); }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--navy); flex: none; }
input[type=file] { padding: 9px; font-size: .9rem; }
input[readonly] { background: #f6f7f9; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0 10px; }
.grid2 > *, .grid3 > * { min-width: 0; }
select { text-overflow: ellipsis; }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: 1 / -1; } }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 11px 16px; min-height: 46px;
  border-radius: 10px; border: 1px solid #cfd6df; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-outline { background: #fff; border: 2px solid var(--navy); }
.btn-danger { color: var(--err); border-color: #f0c4bb; }
.btn-small { padding: 7px 12px; min-height: 38px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.link-danger { background: none; border: 0; color: var(--err); font: inherit; font-size: .82rem; cursor: pointer; padding: 4px; }
.chip { border: 1px solid #cfd6df; background: #fff; border-radius: 16px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; margin: 3px 2px 0 0; }
.actions-sticky { position: sticky; bottom: calc(64px + var(--safe-b)); z-index: 10; display: flex; gap: 8px; padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(243,245,248,0)); }
.actions-sticky .btn { flex: 1; }
body.public .actions-sticky { bottom: 0; }
.fab { position: fixed; right: 18px; bottom: calc(78px + var(--safe-b)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #1b1b1b;
  font-size: 2rem; display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 15; }

/* interrupteurs */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 46px; height: 28px; background: #cfd6df; border-radius: 14px; position: relative; flex: none; transition: .2s; }
.switch .slider::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--navy-2); }
.switch input:checked + .slider::after { left: 21px; }
.switch .muted { font-weight: 400; }

/* plages horaires */
.ranges .range { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ranges .range input { flex: 1; }
.range-del { border: 0; background: none; font-size: 1.4rem; color: var(--muted); width: 36px; cursor: pointer; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick { margin-top: 8px; }
.stepper { display: flex; align-items: center; }
.stepper button { width: 44px; height: 44px; border: 1px solid #cfd6df; background: #fff; font-size: 1.3rem; cursor: pointer; }
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper input { width: 60px; text-align: center; border-radius: 0; border-left: 0; border-right: 0; min-height: 44px; height: 44px; }

/* signature */
.sigpad { position: relative; border: 2px dashed #b9c3cf; border-radius: 10px; background: #fff; touch-action: none; height: 174px; }
.sigpad canvas { display: block; width: 100%; height: 170px; touch-action: none; border-radius: 10px; }
.sig-clear { position: absolute; top: 6px; right: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: .8rem; padding: 4px 8px; cursor: pointer; }
.sig-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #a7b0bc; font-size: .85rem; pointer-events: none; }
.sigpad.signed .sig-hint { display: none; }
.sig-view { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.sig-view img { max-width: 100%; max-height: 140px; display: block; margin: 0 auto; }

/* listes */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #edf0f4; border-radius: 10px; padding: 12px 14px; text-decoration: none; color: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: #b0b8c3; font-size: 1.3rem; }
.menu .menu-ico { width: 28px; text-align: center; font-size: 1.2rem; }
.line { padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.line:last-child { border-bottom: 0; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.badge-orange { background: #fff1de; color: #a5560b; }
.badge-amber { background: #fff5d6; color: #8a6200; }
.badge-teal { background: #dff5f1; color: #0d6b5e; }
.badge-blue { background: #e3edfb; color: #224f8f; }
.badge-green { background: #def4e6; color: #1b6e3c; }
.badge-gray { background: #eceff3; color: #5b6573; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.tile { background: #fff; border: 1px solid #edf0f4; border-radius: 10px; padding: 12px 6px; text-align: center; text-decoration: none; color: inherit; }
.tile b { display: block; font-size: 1.5rem; color: var(--navy); }
.tile span { font-size: .78rem; color: var(--muted); }
.alert { display: block; background: #fff8e6; border: 1px solid #f3dca2; color: #7a5300; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; font-size: .9rem; }

.flash { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #e9f1fb; color: #1d4677; border: 1px solid #cddff4; }
.flash-ok { background: #e7f6ec; color: #17633a; border-color: #bfe5cd; }
.flash-err { background: #fdecea; color: #9b2c1a; border-color: #f5c6bd; }
.flash-warn { background: #fff5e0; color: #7a5300; border-color: #f3dca2; }
.banner { background: var(--accent); color: #1b1b1b; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }

.checklist { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row .grow { flex: 1; min-width: 0; }
.check-row > .muted { white-space: nowrap; }
.total-line { margin-top: 10px; font-size: .95rem; }

.tabs { display: flex; background: #e6eaf0; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 10px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.tab.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.copy-input { font-size: .85rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { width: 96px; text-align: center; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pdf-thumb { display: flex; width: 96px; height: 96px; align-items: center; justify-content: center; background: #fdecea; color: var(--err); font-weight: 700; border-radius: 8px; }

.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; }
.big-dl { font-size: 1.1rem; margin: 14px 0; }
.control-card h2 { margin-top: 6px; }

.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl td, .tbl th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; color: var(--muted); }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl tr.tot td { font-weight: 700; border-bottom: 0; }
.input-euro { display: flex; align-items: center; gap: 4px; }
.input-euro input { width: 100px; text-align: right; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid #edf0f4; border-radius: 10px; padding: 12px; }
.kpi b { display: block; font-size: 1.35rem; color: var(--navy); }
.kpi span { font-size: .8rem; color: var(--muted); }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: .88rem; }
.bar-lbl { width: 36px; color: var(--muted); }
.bar { flex: 1; background: #edf0f4; border-radius: 6px; height: 14px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--navy-2); border-radius: 6px; }
.bar-val { width: 64px; text-align: right; }

/* page publique de signature */
.lead { font-size: 1.15rem; margin: 4px 0; }
.summary .sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.summary .sum-row > span:last-child { white-space: nowrap; }
.summary .sum-row.total { font-weight: 700; border-bottom: 0; }
.done .check, .check { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 8px; display: flex; align-items: center; justify-content: center; font-size: 2rem;
  color: var(--ok); background: #e3f5ea; border: 2px solid #9ad3b0; }
.question { background: #f6f8fb; }
.question p.center { font-size: 1.08rem; margin: 6px 0; }
.question label.btn { position: relative; }

/* connexion */
.login-page .main { padding-top: 10vh; }
.login-box { max-width: 380px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 26px 22px; box-shadow: 0 4px 24px rgba(16,24,40,.08); text-align: center; }
.login-box form { text-align: left; margin-top: 16px; }
.login-logo { width: 64px; height: 64px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; border-bottom: 5px solid var(--accent); }
.login-box h1 { font-size: 1.3rem; margin: 0; }
pre.code { white-space: pre-wrap; font-size: .8rem; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px); background: #1b2430; color: #fff; padding: 10px 16px; border-radius: 10px;
  opacity: 0; transition: .3s; z-index: 50; font-size: .92rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 800px) {
  .main { padding-top: 22px; }
  .tiles { gap: 12px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- v1.1 : parcours du bon, navigation simplifiée ---------- */
.bottomnav a.nav-new .ico { display: inline-flex; width: 40px; height: 40px; margin: -14px auto 0; border-radius: 50%; background: var(--accent); color: #1b1b1b;
  align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.bottomnav a.nav-new { color: var(--ink); font-weight: 600; }

.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mini-steps { display: inline-flex; gap: 3px; }
.mini-steps i { width: 14px; height: 5px; border-radius: 3px; background: #dfe4eb; }
.mini-steps i.d { background: var(--ok); }
.mini-steps i.c { background: var(--accent); }

.bon-head { margin: 2px 2px 12px; }
.bon-head-title { font-size: 1.3rem; font-weight: 700; }
.stepper-h { display: flex; justify-content: space-between; position: relative; margin: 6px 0 12px; }
.stepper-h::before { content: ''; position: absolute; left: 10%; right: 10%; top: 19px; height: 3px; background: #dfe4eb; z-index: 0; }
.stepper-h .st { flex: 1; position: relative; z-index: 1; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stepper-h .dot { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid #dfe4eb; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #9aa4b1; }
.stepper-h .lbl { font-size: .7rem; line-height: 1.15; text-align: center; max-width: 70px; }
.stepper-h .st.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper-h .st.cur .dot { border-color: var(--accent); color: var(--ink); background: #fff7e0; box-shadow: 0 0 0 4px rgba(242,169,0,.18); }
.stepper-h .st.cur .lbl { color: var(--ink); font-weight: 700; }
.stepper-h .st.open .dot { transform: scale(1.12); }
.stepper-h .st.open .lbl { text-decoration: underline; text-underline-offset: 3px; }
.step-panel h3 { color: var(--navy); }

.chips-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 14px 10px; margin: 0 -14px 4px; -webkit-overflow-scrolling: touch; }
.chip-f { flex: none; border: 1px solid #cfd6df; background: #fff; border-radius: 18px; padding: 7px 12px; font-size: .85rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip-f.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.row.todo { gap: 12px; }
.todo-step { width: 28px; height: 28px; flex: none; border-radius: 50%; background: #fff7e0; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.todo-btn { color: var(--navy-2); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.legend { text-align: center; }

.signed-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.signed-auto img { max-height: 46px; max-width: 140px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.check-inline { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; }
.suggest { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.suggest .chip { margin: 0; padding: 6px 10px; font-size: .85rem; background: #f1f5fa; border-color: #d6e0ec; }
.more-opts { margin-top: 4px; }
.more-opts summary { cursor: pointer; color: var(--navy-2); font-size: .9rem; }

.progress { height: 8px; background: #e3e7ee; border-radius: 4px; overflow: hidden; margin: 2px 0 4px; }
.progress span { display: block; height: 100%; background: var(--ok); }
.seq-card h2 { margin: 0; }
.seq-date { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin-top: 4px; }
.mini-sig { max-height: 36px; max-width: 90px; }
.center-row { justify-content: center; }
img { max-width: 100%; }


/* ---------- v1.2 : le bon présenté comme une feuille de location ---------- */
.sheet { background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 18px 16px 16px; margin: 0 -6px 14px; border: 1px solid #e6e6e6; font-size: 15px; }
.sh-head { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid #1d1d1d; }
.sh-co { flex: 1.1; min-width: 0; }
.sh-logo { width: 100%; max-width: 230px; display: block; }
.sh-co-lines { font-size: .68rem; color: #555; margin-top: 6px; line-height: 1.45; }
.sh-title { flex: 1; text-align: right; }
.sh-title h1 { font-size: 1.05rem; letter-spacing: .02em; margin: 0 0 4px; font-weight: 900; color: #1d1d1d; line-height: 1.15; }
.sh-title div { font-size: .7rem; color: #555; line-height: 1.35; }
.sh-title .sh-num { font-size: .8rem; color: #444; margin-top: 8px; }
.sh-title .sh-num b { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; color: var(--orange); font-size: 1.05rem; letter-spacing: .02em; }
.sh-status { display: inline-block; margin-top: 6px; font-size: .68rem !important; font-weight: 800; letter-spacing: .12em; color: #1d1d1d !important; }
.sh-status.st-signe, .sh-status.st-cloture { color: var(--ok) !important; }
.sh-status.st-annule { color: var(--err) !important; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.sh-grid > section { min-width: 0; padding-top: 12px; }
.sh-grid > section:nth-child(odd) { border-right: 1px solid #e6e6e6; padding-right: 12px; }
.sh-rule { border-bottom: 2px solid #1d1d1d; padding-bottom: 12px; }
.sh-full { padding-top: 12px; }
.sheet h4 { font-size: .74rem; letter-spacing: .14em; font-weight: 800; margin: 0 0 8px; display: flex; justify-content: space-between; color: #1d1d1d; }
.sheet h4 span { font-weight: 400; letter-spacing: 0; color: #888; font-size: .7rem; }
.sf { display: block; margin-bottom: 8px; }
.sf > span { display: block; font-size: .72rem; font-weight: 600; color: #333; }
.sf > span i { color: var(--orange); font-style: normal; }
.sheet input:not([type=checkbox]):not([type=file]), .sheet select, .sheet textarea { border: 0; border-bottom: 1px dotted #999; border-radius: 0; padding: 6px 2px; min-height: 36px; font-size: 16px; font-weight: 600; background: transparent; }
.sheet textarea { border: 1px dotted #999; border-radius: 4px; font-weight: 400; min-height: 86px; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { box-shadow: none; border-color: var(--orange); }
.sheet input:disabled, .sheet select:disabled, .sheet textarea:disabled { color: #1d1d1d; -webkit-text-fill-color: #1d1d1d; opacity: 1; border-color: transparent; }
.sheet textarea:disabled { border-color: #eee; }
.sf-val { font-weight: 600; padding: 6px 2px; border-bottom: 1px dotted #ccc; min-height: 36px; font-size: .95rem; overflow-wrap: anywhere; }
.sf-line { font-size: .85rem; margin: 2px 0 8px; }
.sf-info { font-size: .7rem; color: #666; line-height: 1.4; margin-top: 2px; }
.sheet .suggest { margin: -4px 0 4px; }
.sh-hours { display: flex; gap: 10px; align-items: flex-start; }
.sh-hours .ranges { flex: 1; min-width: 0; }
.sheet .range { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.sheet .range .rl { font-size: .75rem; font-weight: 600; color: #333; }
.sheet .range input { flex: 1; min-width: 0; }
.sheet .range-del { width: 26px; font-size: 1.1rem; }
.sh-total { flex: none; width: 112px; border: 2px solid #1d1d1d; border-radius: 4px; text-align: center; padding: 6px 4px; }
.sh-total small { display: block; font-size: .56rem; letter-spacing: .08em; color: #555; }
.sh-total b { display: block; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; color: var(--orange); font-size: 1.35rem; line-height: 1.3; }
.sh-link { background: none; border: 0; padding: 4px 0; color: var(--orange); font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; display: inline-block; }
.sheet .quick { display: inline; }
.sh-opts { display: flex; flex-direction: column; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eee; cursor: pointer; }
.opt > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.opt b { font-weight: 500; font-size: .95rem; }
.opt small { color: #666; font-size: .68rem; line-height: 1.3; }
.opt .box { width: 26px; height: 26px; accent-color: var(--orange); }
.sheet .stepper { border: 2px solid #1d1d1d; border-radius: 4px; }
.sheet .stepper button { border: 0; width: 32px; height: 34px; background: #fff; font-size: 1.1rem; }
.sheet .stepper input { width: 34px; height: 34px; min-height: 34px; border: 0 !important; text-align: center; padding: 0; }
.sh-sigs h4 { margin-top: 4px; }
.sig-box { border: 1px dashed #aaa; border-radius: 4px; height: 96px; display: flex; align-items: center; justify-content: center; position: relative; background: #fff; overflow: hidden; }
.sig-box[data-sig-box] { cursor: pointer; border-color: var(--orange); background: #fff9f5; }
.sig-box img { max-width: 92%; max-height: 86px; }
.sig-box img.pending { opacity: .45; }
.sig-box em { position: absolute; bottom: 3px; right: 6px; font-size: .62rem; color: #888; }
.sig-empty { color: var(--orange); font-size: .8rem; font-weight: 600; text-decoration: none; text-align: center; }
.sig-meta { font-size: .66rem; color: #666; margin-top: 3px; min-height: 1em; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.sh-actions .grow { flex: 1; }
.sh-actions .btn { min-height: 44px; padding: 9px 14px; }
.sheet-view .sh-actions, .sheet-sign .sh-actions { justify-content: flex-end; }
.thumb.sm, .thumb.sm img { width: 64px; height: 64px; }
.seq-title { font-size: 1.05rem; margin: 6px 2px 10px; }
.paper { background: #fff; }
.sig-view.big img { max-height: 180px; }
.tips { padding-left: 18px; margin: 4px 0 12px; }
.tips li { margin-bottom: 4px; }

/* fenêtre de signature plein écran */
.sig-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 12px; }
.sig-modal .sm-card { background: #fff; border-radius: 12px; width: 100%; max-width: 820px; padding: 12px; }
.sig-modal .sm-title { font-weight: 700; margin-bottom: 8px; }
.sig-modal canvas { width: 100%; height: 46vh; max-height: 360px; border: 2px dashed #bbb; border-radius: 8px; touch-action: none; display: block; background: #fff; }
.sig-modal .btn-row { margin-top: 10px; justify-content: flex-end; }
@media (orientation: landscape) and (max-height: 500px) { .sig-modal canvas { height: 62vh; } }
@media (max-width: 380px) { .sheet { padding: 14px 10px; } .sh-grid { gap: 4px 10px; } .sh-total { width: 96px; } }
@media (min-width: 700px) { .sheet { padding: 28px 30px; margin: 0 0 16px; } .sh-title h1 { font-size: 1.5rem; } .sh-co-lines, .sh-title div { font-size: .8rem; } }
.login-img { max-width: 260px; width: 100%; display: block; margin: 0 auto 6px; }
.sheet input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.sheet input[type=time] { padding-right: 0; }
.opt b { font-size: .9rem; }
.sheet .stepper button { width: 28px; }
.sheet .stepper input { width: 30px; }

/* ---------- v1.3 : charte graphique Lopera TP ---------- */
:root {
  --noir: #2A2A2A; --orange: #FD5902; --brique: #C24100; --beton: #5C5A57; --gravier: #B9B6B1; --sable: #F3F2F0;
  --navy: #2A2A2A; --navy-2: #2A2A2A; --accent: #FD5902; --bg: #F3F2F0; --ink: #2A2A2A; --muted: #5C5A57; --line: #E2E0DC;
  --display: "Montserrat", "Arial Black", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
body { font-family: var(--body); color: var(--noir); background: var(--sable); }
a { color: var(--brique); }
h1, h2, h3, .section-title, .topbar-title, .big, .bon-head-title, .seq-title { font-family: var(--display); }
h3, .section-title { font-weight: 800; }
.section-title, .step-panel h3 { color: var(--noir); }
.topbar { background: var(--noir); }
.topbar-title { font-weight: 800; letter-spacing: .01em; }
.topbar-emb { height: 28px; width: auto; margin-right: 2px; }
.ruban { height: 6px; background: repeating-linear-gradient(-45deg, var(--orange) 0 12px, var(--noir) 12px 24px); position: sticky; top: calc(52px + var(--safe-t)); z-index: 19; }
.btn { font-family: var(--display); font-weight: 700; font-size: .92rem; border-color: var(--gravier); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--noir); }
.btn-outline { border: 2px solid var(--noir); }
.btn-danger { color: var(--brique); border-color: #E8B9A0; }
.card { border-color: #E6E4E0; }
.card-accent { border: 2px solid var(--noir); background: #fff; border-top: 5px solid var(--orange); }
.badge-orange, .badge-amber { background: #FFE6D8; color: var(--brique); }
.badge-teal { background: #E9E7E3; color: var(--noir); }
.badge-blue { background: #2A2A2A; color: #fff; }
.badge-green { background: #E4F2E8; color: #1d6b3a; }
.tile b, .kpi b { color: var(--noir); font-family: var(--display); font-weight: 900; }
.todo-step { background: #FFF1E8; border-color: var(--orange); font-family: var(--display); }
.todo-btn { color: var(--brique); }
.chip-f.on { background: var(--noir); border-color: var(--noir); }
.mini-steps i.c { background: var(--orange); }
.stepper-h .st.cur .dot { border-color: var(--orange); background: #FFF1E8; box-shadow: 0 0 0 4px rgba(253,89,2,.18); }
.stepper-h .lbl { font-family: var(--display); font-weight: 600; font-size: .64rem; }
.bottomnav a.on { color: var(--noir); }
.bottomnav a.on .ico { color: var(--orange); }
.bottomnav a.nav-new .ico { background: var(--orange); color: var(--noir); }
.switch input:checked + .slider { background: var(--orange); }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(253,89,2,.15); }
.flash { background: #fff; border-color: var(--gravier); color: var(--noir); }
.alert { background: #FFF1E8; border-color: #F6C3A3; color: var(--noir); }
.banner { background: var(--orange); color: var(--noir); }
.login-page .main { padding-top: 6vh; }
.login-box { border-top: 6px solid var(--orange); }

/* feuille de location */
.sheet { font-family: var(--body); }
.sh-head { border-bottom: 3px solid var(--orange); }
.sh-title h1 { font-family: var(--display); font-weight: 900; color: var(--noir); }
.sh-title .sh-num b { color: var(--orange); font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.sheet h4 { font-family: var(--display); font-weight: 700; color: var(--noir); }
.sf > span { font-family: var(--display); font-weight: 600; color: var(--beton); font-size: .68rem; letter-spacing: .02em; }
.sf > span i, .sh-link, .sig-empty { color: var(--brique); }
.sheet input:not([type=checkbox]):not([type=file]), .sheet select, .sheet textarea, .sf-val { font-family: var(--body); font-weight: 600; color: var(--noir); }
.sh-rule { border-bottom-color: var(--noir); }
.sh-total { border-color: var(--noir); }
.sh-total small { font-family: var(--display); font-weight: 700; color: var(--beton); font-size: .6rem; letter-spacing: .14em; }
.sh-total b { font-family: var(--display); font-weight: 900; color: var(--orange); }
.opt .box { accent-color: var(--orange); }
.sig-box[data-sig-box] { border-color: var(--orange); background: #FFF6F0; }
.sh-status { font-family: var(--display); }

/* ---------- v1.4 : mode signature verrouillé, refus, donneurs d'ordre ---------- */
body.kiosk .main { padding-bottom: 30px; }
body.kiosk .topbar { background: var(--noir); }
.kiosk-lock { text-decoration: none; font-size: 1.1rem; opacity: .75; padding: 2px 4px; }
.thanks { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.thanks h1 { font-family: var(--display); font-weight: 900; font-size: 3rem; margin: 10px 0 0; color: var(--noir); }
.thanks .check { width: 96px; height: 96px; font-size: 3rem; color: var(--noir); background: var(--orange); border: 0; }
.pin-card { max-width: 360px; margin: 8vh auto 0; text-align: center; }
.pin-input { font-size: 2rem !important; letter-spacing: .6em; text-align: center; font-family: var(--display); }
.sig-box.refused { flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--brique); background: #FFF1E8; text-align: center; }
.sig-box.refused b { color: var(--brique); font-family: var(--display); font-size: .78rem; letter-spacing: .08em; }
.sig-box.refused span { font-size: .75rem; color: var(--noir); }
.sig-wait { font-size: .7rem; color: var(--beton); text-align: center; padding: 6px; }
.refuse-box { margin-top: 12px; padding: 12px; border: 1px solid var(--brique); border-radius: 6px; background: #FFF6F0; }
.refuse-box textarea { background: #fff !important; }
.btn-danger { background: #fff; color: var(--brique); border: 2px solid var(--brique); }
.badge-red { background: var(--brique); color: #fff; }
.row.todo-alert { border-color: var(--brique); background: #FFF6F0; }
.row.todo-alert .todo-step { background: var(--brique); border-color: var(--brique); color: #fff; }
.card-alert { border: 2px solid var(--brique); }
.card-alert h3 { color: var(--brique); }
.small-link { font-size: .78rem; }
.sf.mt { margin-top: 10px; }
.flash-ok { background: #E4F2E8; color: #1d6b3a; border-color: #b9dfc6; }
.flash-err { background: #FFF1E8; color: var(--brique); border-color: #F2B48F; }
.flash-warn { background: #FFF6E5; color: #7a4d00; border-color: #F0D29A; }
.stepper-h .st.refus .dot { background: var(--brique); border-color: var(--brique); color: #fff; }
.stepper-h .st.refus .lbl { color: var(--brique); font-weight: 700; }
.alert-refus { background: #FFF1E8; border-color: var(--brique); color: var(--brique); font-weight: 600; }
.sh-travel { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: #333; margin: 6px 0 2px; }
.sh-travel input { width: 92px !important; flex: none; }
.contact-pick { background: #FFF6F0; border: 1px solid #F6C3A3; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }

/* bon signé : document figé */
.frozen { border-left: 4px solid var(--orange, #FD5902); }
.frozen-pdf { display: block; width: 100%; aspect-ratio: 595 / 842; border: 1px solid #B9B6B1; border-radius: 6px; background: #fff; margin: .6rem 0; }
.mono { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }

/* heures par demi-heure */
.sheet select.hh { -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center; padding: 6px 2px; background-image: none; }
.sheet .range select.hh { flex: 1; min-width: 0; }
.sh-travel select.hh { width: 92px; flex: none; }

/* tarifs par client */
.rates { display: grid; gap: 8px; margin-bottom: 12px; }
.rate-row { display: grid; grid-template-columns: 1fr 9.5rem 5.5rem; gap: 6px; align-items: center; }
.rate-row .rate-name { display: flex; flex-direction: column; min-width: 0; }
.rate-row select, .rate-row input { min-width: 0; }
@media (max-width: 420px) { .rate-row { grid-template-columns: 1fr 1fr; } .rate-row .rate-name { grid-column: 1 / -1; } }

/* débogage (admin) */
.dbg-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 6px; border-radius: 8px; text-decoration: none; font-size: 16px; background: rgba(255,255,255,.08); }
.dbg-form .field label { display: block; }
.dbg-form textarea { font-size: 14px; }
.dbg-null { display: inline-flex !important; align-items: center; gap: 4px; margin-top: 4px; color: #5C5A57; }

/* 2e engin : retirer / ajouter */
.sf > span.sf-head { display: flex; justify-content: space-between; align-items: center; }
.sf-x { border: 0; background: none; padding: 0 2px; font: inherit; font-size: .68rem; color: var(--brique, #C24100); text-decoration: underline; cursor: pointer; }
