/* PRICEWOW — interface interne, style Apple (clair / sombre selon l'appareil). */
:root {
  --bg: #f2f2f7; --card: #ffffff; --text: #1d1d1f; --text-2: #6e6e73; --line: rgba(0,0,0,.08); --soft: #f5f5f7;
  --blue: #0071e3; --blue-soft: rgba(0,113,227,.1); --green: #248a3d; --green-soft: rgba(36,138,61,.1);
  --orange: #c93400; --orange-soft: rgba(255,149,0,.14); --red: #d70015; --red-soft: rgba(255,59,48,.1);
  --bar: rgba(249,249,251,.86); --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --text-2: #98989d; --line: rgba(255,255,255,.1); --soft: #2c2c2e;
    --blue: #0a84ff; --blue-soft: rgba(10,132,255,.18); --green: #30d158; --green-soft: rgba(48,209,88,.16);
    --orange: #ff9f0a; --orange-soft: rgba(255,159,10,.16); --red: #ff453a; --red-soft: rgba(255,69,58,.16); --bar: rgba(22,22,24,.86); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 6px 0 4px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 26px 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 6px 0; }
small, .muted { color: var(--text-2); }
.wrap { max-width: 860px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 24px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .02em; font-size: 14px; color: var(--text-2); }
.brand i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); display: inline-block; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; border: 1px solid var(--line); }
.list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.list > a, .list > div, .list > form { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); border-top: 1px solid var(--line); }
.list > :first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .sub { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.chev::after { content: "›"; color: var(--text-2); font-size: 22px; line-height: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); display: block; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; }
.kpi span { font-size: 13px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 980px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--soft); color: var(--text-2); }
.pill.critical, .pill.urgent_raise, .pill.block { background: var(--red-soft); color: var(--red); }
.pill.alert, .pill.warning, .pill.propose_change, .pill.warn, .pill.pending { background: var(--orange-soft); color: var(--orange); }
.pill.initial_price, .pill.draft, .pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.hold, .pill.published, .pill.ok, .pill.confirmed { background: var(--green-soft); color: var(--green); }
.pill.A { background: var(--green-soft); color: var(--green); } .pill.B { background: var(--blue-soft); color: var(--blue); }
.pill.C, .pill.D { background: var(--orange-soft); color: var(--orange); }
.btn, button { font: 600 15px/1 var(--font); border: 0; border-radius: 12px; padding: 12px 16px; background: var(--blue); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; text-decoration: none; }
.btn.secondary, button.secondary { background: var(--soft); color: var(--text); }
.btn.danger, button.danger { background: var(--red-soft); color: var(--red); }
.btn.small, button.small { min-height: 34px; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
button:disabled { opacity: .4; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
input, select, textarea { font: 16px var(--font); color: var(--text); background: var(--soft); border: 1px solid transparent; border-radius: 12px;
  padding: 11px 12px; width: 100%; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; margin: 10px 0; }
.check input { width: 20px; min-height: 0; height: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: 12px; border-top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.flash { border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 15px; }
.flash.ok { background: var(--green-soft); color: var(--green); } .flash.error { background: var(--red-soft); color: var(--red); }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.breakdown div { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.breakdown div:first-child { border-top: 0; }
.breakdown .total { font-weight: 700; }
.reason { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.reason:first-child { border-top: 0; }
details summary { cursor: pointer; color: var(--blue); font-weight: 600; padding: 6px 0; }
code, .mono { font: 13px ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--text-2); padding: 22px 12px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.seg a { padding: 7px 12px; border-radius: 980px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.seg a.on { background: var(--text); color: var(--bg); }

/* barre d'onglets du bas (iOS) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--text-2); position: relative; padding: 2px 0; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a[aria-current="page"] { color: var(--blue); }
.tabs .dot { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11px; line-height: 17px; text-align: center; }

/* assistant */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 17px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.composer { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0; background: var(--bg); }
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; padding: 0 20px; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 14px; display: block; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font: 15px ui-monospace, Menlo, monospace; }
.codes span { white-space: nowrap; }
.codes span { background: var(--soft); border-radius: 10px; padding: 10px; text-align: center; }

/* utilitaires (la CSP interdit les styles en ligne) */
.u-wrap { flex-wrap: wrap; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt22 { margin-top: 22px; }
.w100 { width: 100%; } .w90 { width: 90px; } .w110 { width: 110px; } .w120 { width: 120px; } .grow140 { flex: 1; min-width: 140px; }
.mw320 { max-width: 320px; } .tr { text-align: right; } .blue { color: var(--blue); }
.check input.cb22, input.cb22 { width: 22px; height: 22px; min-height: 0; flex: none; }
.pick { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); margin: 0; color: var(--text); font-size: 15px; cursor: pointer; }
.list > .pick:first-child { border-top: 0; }
.list > .u-wrap > .grow { flex: 1 1 200px; }

/* voile : rien de lisible dans l'aperçu du sélecteur d'apps ni pendant le verrouillage */
html.veil body > * { visibility: hidden; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto; font-size: 12px; margin: 10px 0; }
a.card.row { color: var(--text); }
.kpi.attn { background: var(--orange-soft); } .kpi.attn b { color: var(--orange); }
.kpi.bad { background: var(--red-soft); } .kpi.bad b { color: var(--red); }
.kpi.good b { color: var(--green); }
.ok-text { color: var(--green); } .bad-text { color: var(--red); }
.ok-box { border-color: var(--green); }
textarea { font: 13px/1.45 ui-monospace, "SF Mono", Menlo, monospace; resize: vertical; }
.list > details.pad { display: block; padding: 12px 16px; border-top: 1px solid var(--line); }
.list > details.pad:first-child { border-top: 0; }
.list > details.pad summary { color: var(--text); font-weight: 500; }
.warn-text { color: var(--orange); }
a.card.chev.row { flex-wrap: nowrap; }
.steps { padding-left: 34px; } .steps li { margin: 6px 0; } .steps ul { padding-left: 18px; }
/* V6.4 : provenance des chiffres */
.pill.st-mesure, .pill.conf-elevee { background: var(--green-soft); color: var(--green); }
.pill.st-calcule, .pill.st-choix, .pill.st-estimation { background: var(--blue-soft); color: var(--blue); }
.pill.st-estimation { opacity: .85; }
.pill.st-defaut, .pill.conf-moyenne { background: var(--orange-soft); color: var(--orange); }
.pill.conf-faible { background: var(--red-soft); color: var(--red); }
.prov > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prov > div:last-child { border-bottom: 0; }
.prov .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.prov .why { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.prov .total { font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
/* V6.4.9 : barre de progression des lectures */
progress { width: 100%; height: 10px; margin: 8px 0 2px; border: 0; border-radius: 5px; background: var(--soft); -webkit-appearance: none; appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--soft); border-radius: 5px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 5px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 5px; }

/* V6.8 BOOKINGWOW : agenda */
.tabs.four { grid-template-columns: repeat(4, 1fr); }
.daystrip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; margin: 6px -16px 0; padding-left: 16px; padding-right: 16px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.daystrip::-webkit-scrollbar { display: none; }
.daystrip a { flex: 0 0 auto; width: 54px; text-align: center; padding: 8px 0 7px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); scroll-snap-align: start; position: relative; }
.daystrip a small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-2); }
.daystrip a b { display: block; font-size: 20px; letter-spacing: -.02em; }
.daystrip a.closed { opacity: .45; }
.daystrip a[aria-current="date"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.daystrip a[aria-current="date"] small { color: rgba(255,255,255,.85); }
.daystrip a i { display: block; height: 6px; margin-top: 3px; }
.daystrip a i.has::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); vertical-align: top; }
.daystrip a[aria-current="date"] i.has::after { background: #fff; }
.agenda .t { width: 66px; flex: 0 0 auto; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.agenda .free { color: var(--text-2); }
.agenda .free .t { color: var(--text-2); font-weight: 600; }
.agenda .blocked { background: var(--soft); color: var(--text-2); }
.agenda .past { opacity: .55; }
.agenda .new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: 0 0 auto; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.actions a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.actions a svg { width: 24px; height: 24px; }
.actions a.off { opacity: .35; pointer-events: none; }
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 88px; gap: 8px; align-items: center; margin: 6px 0; }
.hours-row .check { margin: 0; min-width: 0; }
.hours-row select { width: 100%; padding: 10px 8px; }
.dayhead { flex-wrap: nowrap; }
.dayhead h1 { font-size: 22px; text-align: center; flex: 1; margin: 4px 0; }
.agenda .free > span:last-child { color: var(--blue); font-size: 22px; font-weight: 600; }
.bigname { font-size: 26px; margin: 2px 0; }
body.in-app { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.in-app .brand { visibility: hidden; }

/* V6.9.1 — look « verre » (Liquid Glass) pour les apps web : barre d'onglets flottante, puces de jours en verre */
body { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.tabs { left: 12px; right: 12px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px; border-radius: 32px; border: 1px solid rgba(255,255,255,.55);
  background: rgba(250,250,252,.58); -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
  box-shadow: 0 10px 34px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(0,0,0,.04); }
.tabs a { padding: 7px 0 5px; border-radius: 26px; transition: background .2s ease, transform .12s ease; }
.tabs a:active { transform: scale(.94); }
.tabs a[aria-current="page"] { background: rgba(0,113,227,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.tabs .dot { top: 2px; }
.daystrip a { background: rgba(255,255,255,.6); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 2px 10px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.8); }
.daystrip a[aria-current="date"] { background: linear-gradient(180deg, rgba(40,140,255,.95), rgba(0,105,220,.95)); border-color: rgba(255,255,255,.35);
  box-shadow: 0 6px 18px rgba(0,113,227,.35), inset 0 1px 0 rgba(255,255,255,.45); }
@media (prefers-color-scheme: dark) {
  .tabs { background: rgba(30,30,32,.55); border-color: rgba(255,255,255,.14); box-shadow: 0 10px 34px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); }
  .tabs a[aria-current="page"] { background: rgba(10,132,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
  .daystrip a { background: rgba(44,44,46,.55); border-color: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
}
body.in-app { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
a.card { display: flex; align-items: center; gap: 12px; color: var(--text); }
a.card .grow { flex: 1; min-width: 0; }

/* V7.0 DOSSIERS */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; scrollbar-width: none; }
.chips a { flex: 0 0 auto; padding: 7px 14px; border-radius: 980px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; }
.chips a[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.st-recu, .pill.st-diagnostic { background: var(--blue-soft); color: var(--blue); }
.pill.st-attente_piece, .pill.st-reparation { background: var(--orange-soft); color: var(--orange); }
.pill.st-pret { background: var(--green-soft); color: var(--green); }
.pill.st-remis, .pill.st-annule { background: var(--soft); color: var(--text-2); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .checks { grid-template-columns: 1fr; } }
.checks .check { margin: 6px 0; font-size: 15px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 10px 0; }
.photos figure { margin: 0; display: grid; gap: 4px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); display: block; }
.photos.small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.card.next { border-color: var(--blue); }
.mt12 { margin-top: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.sign-page { max-width: 720px; margin: 0 auto; }
.sign-page .terms { font-size: 17px; line-height: 1.5; }
.check.big { font-size: 17px; font-weight: 600; margin: 14px 0; }
.check.big input { width: 24px; height: 24px; }
.sig-wrap { position: relative; margin: 10px 0; border-radius: 16px; border: 2px dashed var(--line); background: #fff; touch-action: none; }
.sig-wrap canvas { display: block; width: 100%; height: 220px; border-radius: 14px; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 16px; bottom: 12px; color: #8e8e93; font-size: 13px; pointer-events: none; }
.sig-wrap.drawn .sig-hint { display: none; }
.done-page { text-align: center; padding-top: 40px; }

/* V7.0.1 — client qui revient */
.returning { border: 1px solid var(--blue-soft); }
.returning p { margin: 4px 0; }
.warr { color: var(--green); }
.warr a { font-weight: 700; }
#client-suggest { margin: 6px 0 10px; }

/* V7.1 — dossiers : sauvegarde, avis légal, menus */
.seg-radio { display: grid; gap: 6px; margin: 6px 0 4px; }
.notice { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.notice-text { white-space: pre-wrap; font-size: 14px; line-height: 1.45; margin-top: 8px; }
.note-ok { background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 10px 12px; }
.small-select { width: auto; min-width: 130px; padding: 6px 10px; }
details.prod summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.prod summary::-webkit-details-marker { display: none; }
details.prod.off { opacity: .6; }
.warr .btn { margin-left: 6px; }
.prods { display: grid; gap: 10px; margin-bottom: 12px; }
details.prod summary .title { color: var(--text); }

/* V7.2 — stock */
.stock-row { display: flex; align-items: center; gap: 10px; }
.stock-row > a { color: inherit; text-decoration: none; min-width: 0; }
.stock-row.low .title { color: var(--orange); }
.qty-ctl { display: flex; align-items: center; gap: 6px; }
.qty-ctl .qty { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.qty-ctl button { min-width: 36px; }
.tabs4 { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
ul.tight { margin: 6px 0 8px 18px; padding: 0; }
ul.tight li { margin: 4px 0; }
/* V7.4 — Visites du site : graphiques dessinés côté serveur (SVG), couleurs du thème clair / sombre */
.chart svg { width: 100%; height: auto; display: block; margin: 6px 0 2px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--blue); }
.chart .hit { fill: transparent; }
.chart .col:hover .bar, .chart .col:focus .bar { fill: var(--text); }
.chart .sub, .sub { font-size: 13px; color: var(--text-2); }
.hbars > div { display: block; }
.hbars .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbars .num small { color: var(--text-2); font-weight: 500; margin-left: 4px; }
.hbar { width: 100%; height: 4px; display: block; margin-top: 6px; }
.hbar .track { fill: var(--soft); }
.hbar .fill { fill: var(--blue); }
.kpi .up { color: var(--green); font-weight: 600; } .kpi .down { color: var(--orange); font-weight: 600; }
.chart svg.small { display: none; }
@media (max-width: 600px) { .chart svg.small { display: block; } .chart svg.wide { display: none; } }
