/* Shax Field — interface. Un look de logiciel de gestion classique : fond clair, menu bleu nuit, cartes blanches, badges de couleur.
   Écrit mobile d'abord : les règles de base sont pour le téléphone, les @media (min-width) ajoutent la mise en page du bureau. */
@font-face { font-family: "Inter"; src: url("/fonts/Inter-400_700.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f4f6fa; --surface: #ffffff; --sunk: #f1f4f9;
  --ink: #1c2434; --ink-2: #566074; --ink-3: #8a93a6;
  --line: #e3e7ef;
  --primary: #2563eb; --primary-dark: #1d4fd8; --primary-soft: #e8f0fe; --on-primary: #fff;
  --side: #101c36; --side-ink: #c5cee0; --side-hover: #1a2a4d;
  --ok: #15803d; --ok-soft: #dcfce7; --info: #1d4ed8; --info-soft: #dbeafe;
  --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --door-ok: #22a35a; --door-def: #f59e0b; --door-na: #ef4444;
  --shadow: 0 1px 2px rgba(16, 28, 54, .05), 0 1px 3px rgba(16, 28, 54, .06);
  --r: 10px; --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1420; --surface: #171d2b; --sunk: #1e2536;
  --ink: #e7eaf1; --ink-2: #a9b2c4; --ink-3: #78829a;
  --line: #283044;
  --primary: #4f8bff; --primary-dark: #6b9dff; --primary-soft: #1b2a4a; --on-primary: #0b1220;
  --side: #0b101b; --side-ink: #aab4c8; --side-hover: #171f31;
  --ok: #4ade80; --ok-soft: #12301f; --info: #8ab4ff; --info-soft: #17274a;
  --warn: #fbbf24; --warn-soft: #3a2a0c; --bad: #f87171; --bad-soft: #3b1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0f1420; --surface: #171d2b; --sunk: #1e2536;
  --ink: #e7eaf1; --ink-2: #a9b2c4; --ink-3: #78829a;
  --line: #283044;
  --primary: #4f8bff; --primary-dark: #6b9dff; --primary-soft: #1b2a4a; --on-primary: #0b1220;
  --side: #0b101b; --side-ink: #aab4c8; --side-hover: #171f31;
  --ok: #4ade80; --ok-soft: #12301f; --info: #8ab4ff; --info-soft: #17274a;
  --warn: #fbbf24; --warn-soft: #3a2a0c; --bad: #f87171; --bad-soft: #3b1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg { flex: none; }

/* ---------- logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; }

/* ---------- en-tête de page ---------- */
.head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.head h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.head p { color: var(--ink-2); margin-top: 3px; }
.head > div:last-child:not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; }
.head > div:empty { display: none; }
.card .head { margin-bottom: 10px; flex-direction: row; justify-content: space-between; align-items: center; }
.card .head h2 { margin: 0; }
.wrap .head > div:last-child { flex-direction: row; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.grid2 { display: grid; gap: 16px; align-items: start; }
.grid2 > * { min-width: 0; }
.muted { color: var(--ink-2); font-size: .93em; }
.note { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; }
.note b { display: block; }
.error { color: var(--bad); font-weight: 500; min-height: 22px; margin: 6px 0; font-size: 14px; }

/* ---------- chiffres clés ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.kpi small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi b { display: block; font-size: 24px; font-weight: 700; line-height: 1.3; margin-top: 2px; }
.kpi em { font-style: normal; font-size: 13px; color: var(--ink-3); }

/* ---------- badges d'état ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 10px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-info { background: var(--info-soft); color: var(--info); }
.p-warn { background: var(--warn-soft); color: var(--warn); } .p-bad { background: var(--bad-soft); color: var(--bad); }
.p-idle { background: var(--sunk); color: var(--ink-2); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px; background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary); border-radius: 8px;
  font-weight: 600; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--sunk); border-color: var(--line); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- listes ---------- */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row > div:first-child { min-width: 0; }
.row small { color: var(--ink-3); display: block; font-size: 13px; margin-top: 2px; }
.progress { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 4px; border: 1px solid var(--line); }

/* ---------- tableaux : fiches empilées sur téléphone, vrai tableau à partir de 720 px ---------- */
table { width: 100%; border-collapse: collapse; }
tr:has(> th) { display: none; }
tr { display: block; border-top: 1px solid var(--line); padding: 12px 0; }
tr:nth-child(2) { border-top: 0; padding-top: 2px; }
td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; text-align: right; min-width: 0; }
td:empty { display: none; }
td::before { content: attr(data-label); font-size: 13px; color: var(--ink-3); text-align: left; flex: none; }
td:first-child { font-size: 16px; font-weight: 600; text-align: left; display: block; padding-bottom: 4px; }
td:first-child::before { display: none; }
td[colspan] { display: block; text-align: left; }
td br { display: none; }
td > .muted { margin-left: 6px; font-weight: 400; }

/* ---------- portes ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.doors.wide { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; }
.door { height: 56px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 15px; color: #fff; position: relative; display: flex; align-items: center; justify-content: center; }
.doors.wide .door { height: 30px; font-size: 11.5px; border-radius: 6px; }
.d-todo { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.d-ok { background: var(--door-ok); } .d-def { background: var(--door-def); } .d-noaccess { background: var(--door-na); }
.door.wait::after { content: ""; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }

/* ---------- formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea, .inline input, .price, textarea.n { width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus, .inline input:focus, .price:focus, textarea.n:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.checks label { display: flex; gap: 10px; align-items: center; min-height: var(--tap); }
.checks input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.inline { display: flex; gap: 8px; margin-top: 10px; }
.inline input { flex: 1; min-width: 0; }
.price { width: 104px; text-align: right; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: var(--surface); border-radius: 16px 16px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.sheet h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.sheet .foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
#toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 140px); background: #1c2434; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
  transition: transform .25s; z-index: 70; width: max-content; max-width: calc(100vw - 24px); font-size: 14px; font-weight: 500; }
#toast.on { transform: translate(-50%, 0); }

/* ---------- connexion ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 28, 54, .08); padding: 28px 24px; }
.login-card .brand { margin-bottom: 22px; }
.login-card h1 { font-size: 22px; font-weight: 700; }
.login-card > p { margin: 2px 0 20px; }
.login-card .btn { width: 100%; }
.login-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 14px; }
.login-foot a { font-weight: 500; color: var(--ink-2); }

/* ---------- cadre du back-office ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; align-items: center; }
.menu { width: var(--tap); height: var(--tap); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; place-content: center; gap: 4px; }
.menu i { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
aside { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 40; background: var(--side); color: var(--side-ink); padding: 18px 12px; overflow-y: auto; transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; }
.shell.open aside { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
.shell.open .scrim { opacity: 1; pointer-events: auto; }
aside .brand { color: #fff; padding: 2px 8px 14px; }
.group { font-size: 12px; font-weight: 600; color: #7385a6; padding: 16px 10px 6px; }
.nav { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: var(--tap); background: none; border: 0; border-radius: 8px; padding: 0 10px; text-align: left; font-weight: 500; color: var(--side-ink); }
.nav .nl { display: flex; align-items: center; gap: 11px; }
.nav svg { width: 18px; height: 18px; opacity: .85; }
.nav:hover { background: var(--side-hover); color: #fff; }
.nav.on { background: #2563eb; color: #fff; font-weight: 600; }
.nav.on svg { opacity: 1; }
.badge { font-size: 12px; font-weight: 600; background: #ef4444; color: #fff; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; }
.nav.on .badge { background: #fff; color: #2563eb; }
.who { margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.me { display: flex; align-items: center; gap: 10px; }
.me b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2563eb; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
.chipbar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.tool { min-height: 34px; padding: 0 10px; background: transparent; border: 0; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tool:hover { background: var(--sunk); color: var(--ink); }
aside .tool { color: var(--side-ink); }
aside .tool:hover { background: var(--side-hover); color: #fff; }
main { padding: 20px 16px 90px; min-width: 0; }
.portal { max-width: 1040px; margin: 0 auto; }

/* ---------- parcours d'une réparation ---------- */
.flow div { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.flow div > span:nth-child(2) { background: var(--sunk); height: 10px; border-radius: 99px; overflow: hidden; }
.flow i { display: block; height: 10px; background: var(--primary); border-radius: 99px; min-width: 4px; transition: width .5s; }
.flow div:nth-child(3) i { background: #0ea5a4; } .flow div:nth-child(4) i { background: #22a35a; } .flow div:nth-child(5) i { background: #15803d; }
.flow b { font-weight: 600; text-align: right; }

/* ---------- application technicien ---------- */
.net { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; color: #fff; }
.net > span:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.net.off { background: #334155; } .net.off > span:first-child::before { background: #fbbf24; }
.net.on { background: #15803d; } .net.busy { background: #1d4ed8; }
.net button { min-height: 32px; background: rgba(255, 255, 255, .18); color: inherit; border: 0; border-radius: 6px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 120px; }
.wrap h2 { font-size: 24px; font-weight: 700; line-height: 1.2; }
.label { font-size: 14px; font-weight: 600; color: var(--ink); margin: 22px 0 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 14px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 600; }
.camp { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.camp b { font-size: 17px; font-weight: 600; display: block; }
.memory { border-radius: 12px; padding: 12px 14px; margin: 14px 0 6px; background: var(--primary-soft); }
.memory b { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
.alert { margin-top: 10px; padding: 10px 12px; background: var(--warn-soft); color: var(--ink); border-radius: 8px; font-weight: 500; }
.check { display: flex; gap: 14px; align-items: center; min-height: 56px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.check input { width: 24px; height: 24px; accent-color: var(--door-ok); flex: none; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shots img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.add { width: 76px; height: 76px; border: 2px dashed var(--ink-3); border-radius: 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--surface); }
.defs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.def { min-height: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; font-weight: 600; line-height: 1.3; }
.def small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 3px; }
.def.on { background: var(--warn-soft); border-color: var(--door-def); box-shadow: 0 0 0 1px var(--door-def); }
.back { min-height: var(--tap); background: none; border: 0; padding: 0; font-size: 15px; font-weight: 500; color: var(--primary); }
/* Les deux actions de fin restent sous le pouce, quel que soit le défilement. */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: 1fr 1.7fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 28, 54, .06); }
.actions .btn { min-height: 52px; font-size: 16px; padding: 0 8px; border-radius: 12px; }

.fix { display: grid; gap: 8px; margin-top: 6px; }
.fix input { width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }

/* ---------- documents : facture ---------- */
.doc-top { display: grid; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.doc-co { font-size: 20px; font-weight: 700; display: block; margin-bottom: 4px; }
.doc-meta div, .doc-sum div { display: flex; justify-content: space-between; gap: 24px; padding: 3px 0; }
.doc-meta span, .doc-sum span, .doc-to span { color: var(--ink-2); font-size: 13px; }
.doc-to { margin-bottom: 16px; }
.doc-to span { display: block; margin-bottom: 2px; }
.doc-sum { margin: 16px 0 0 auto; max-width: 320px; }
.doc-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px !important; font-size: 18px; }
.mail { white-space: pre-wrap; font: 14px/1.55 inherit; background: var(--sunk); border-radius: 8px; padding: 14px; margin: 12px 0; max-height: 50vh; overflow: auto; }

/* ---------- à partir de 720 px : vrais tableaux ---------- */
@media (min-width: 720px) {
  .head { flex-direction: row; justify-content: space-between; align-items: center; }
  .doc-top { grid-template-columns: 1fr auto; }
  .doc-meta { min-width: 240px; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .scroll { overflow-x: auto; margin: 0 -16px -6px; }
  tr:has(> th), tr { display: table-row; padding: 0; border: 0; }
  th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 10px 16px; background: var(--sunk); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
  td, td:first-child, td[colspan] { display: table-cell; padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: inherit; font-weight: inherit; }
  td:empty { display: table-cell; }
  td::before { display: none; }
  td br { display: inline; }
  td > .muted { margin-left: 0; }
  td.r, th.r { text-align: right; white-space: nowrap; }
  tr:last-child td { border-bottom: 0; }
  tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
  .modal { align-items: center; padding: 20px; }
  .sheet { border-radius: 14px; padding: 24px; }
  .sheet .foot { display: flex; justify-content: flex-end; }
}
/* ---------- à partir de 1000 px : menu fixe, densité du bureau ---------- */
@media (min-width: 1000px) {
  body { font-size: 14.5px; }
  :root { --tap: 38px; }
  .btn.sm { min-height: 32px; font-size: 13px; }
  .field input, .field select, .field textarea, .inline input, .price { font-size: 14.5px; }
  .shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
  .shell > .topbar, .scrim { display: none; }
  aside { position: sticky; top: 0; height: 100dvh; transform: none; width: auto; z-index: 1; }
  main { padding: 28px 32px 80px; max-width: 1260px; }
  .head h1 { font-size: 24px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .card { padding: 20px; }
  .scroll { margin: 0 -20px -8px; }
  th, td, td:first-child, td[colspan] { padding-left: 20px; padding-right: 20px; }
  .kpi { padding: 18px 20px; }
  .kpi b { font-size: 28px; }
  .flow div { grid-template-columns: 96px 1fr 90px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  :root { --bg: #fff; --surface: #fff; --sunk: #f3f4f6; --ink: #111; --ink-2: #444; --ink-3: #666; --line: #d1d5db; --shadow: none; color-scheme: light; }
  .noprint, #toast, aside, .topbar, .scrim, .net { display: none !important; }
  .shell { display: block; } main { padding: 0; max-width: none; }
  .card, .kpis { break-inside: avoid; } body { font-size: 11pt; }
  .d-ok, .d-def, .d-noaccess, .pill, th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- fiche de visite résidentielle (app technicien) ---------- */
.job .seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.job .seg button { flex: 1 1 auto; min-height: var(--tap); padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.job .seg button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.job .seg button.on.good { background: var(--door-ok); border-color: var(--door-ok); color: #fff; }
.job .seg button.on.warn { background: var(--door-def); border-color: var(--door-def); color: #fff; }
.job .seg button.on.bad { background: var(--door-na); border-color: var(--door-na); color: #fff; }
.job .seg.big button { min-height: 56px; font-size: 16px; font-weight: 600; }
.jrow { padding: 10px 0; border-top: 1px solid var(--line); }
.jrow > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.jrow .seg { margin-bottom: 0; }
.num { display: flex; align-items: center; gap: 8px; }
.num input, .job .txt { width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.num input { max-width: 140px; text-align: right; }
.num span { color: var(--ink-2); font-weight: 500; min-width: 34px; }
.pair { display: flex; gap: 10px; margin-bottom: 8px; }
.two-in { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-btn { position: relative; min-height: 104px; border: 2px dashed var(--ink-3); border-radius: 12px; background: var(--surface); padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; overflow: hidden; }
.photo-btn i { position: absolute; top: 8px; right: 12px; font-style: normal; font-size: 26px; line-height: 1; color: var(--ink-3); }
.photo-btn b { font-size: 14px; line-height: 1.25; position: relative; }
.photo-btn small { color: var(--ink-3); font-size: 12.5px; position: relative; }
.photo-btn.has { border: 2px solid var(--door-ok); color: #fff; }
.photo-btn.has small { color: #e6f6ec; }
.photo-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }
.jtotal { display: flex; justify-content: space-between; align-items: center; background: var(--primary-soft); border-radius: 10px; padding: 12px 14px; margin-top: 10px; font-weight: 600; }
.jtotal b { font-size: 20px; }
.voice { display: flex; align-items: center; justify-content: center; min-height: var(--tap); margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; color: var(--primary); cursor: pointer; }
.sig { width: 100%; height: 150px; border: 1px solid var(--ink-3); border-radius: 10px; background: #fff; touch-action: none; }
/* ---------- rapport de visite (bureau) ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.facts .row span:first-child { color: var(--ink-2); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photos figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.sigimg { max-width: 320px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr; } }

/* ---------- demandes entrantes, planning, passeport d'appartement, liste de chargement, portefeuille ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { min-height: 38px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tabs button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 600; }
.leads { display: grid; gap: 14px; }
.lead { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lead.hot { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad), var(--shadow); }
.lead h2 { margin: 0; font-size: 17px; }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-top small { color: var(--ink-3); font-size: 13px; }
.lead-facts { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.lead-msg { background: var(--sunk); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.lead-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.lead-done { margin-top: auto; font-size: 14px; } .lead-done small { display: block; color: var(--ink-3); margin-top: 4px; }
.dsp-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.dsp { min-width: 860px; }
.drow { display: grid; grid-template-columns: 150px 1fr; align-items: stretch; border-top: 1px solid var(--line); }
.drow.dhead { border-top: 0; }
.dname { padding: 10px 10px 10px 0; min-width: 0; } .dname b { display: block; } .dname small { display: block; color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
.dcamp { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.dtrack { position: relative; min-height: 64px; background: var(--sunk); border-radius: 8px; margin: 6px 0; }
.dhead .dtrack { min-height: 22px; background: none; margin: 0; }
.dhead .dtrack span { position: absolute; top: 2px; font-size: 12px; color: var(--ink-3); transform: translateX(-50%); }
.dhead .dtrack span:first-child { transform: none; } .dhead .dtrack span:last-child { transform: translateX(-100%); }
.dtrack i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.dtrack u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--bad); z-index: 3; border-radius: 2px; }
.dtrack.over { outline: 2px dashed var(--primary); outline-offset: 2px; }
.dblock { position: absolute; top: 6px; bottom: 6px; z-index: 2; min-width: 34px; padding: 5px 8px; border-radius: 8px; border-left: 4px solid var(--ink-3); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; cursor: grab; text-decoration: none; color: var(--ink); font-size: 12px; line-height: 1.3; }
.dblock b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; } .dblock span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.dblock.b-enroute { border-left-color: var(--info); background: var(--info-soft); } .dblock.b-onsite { border-left-color: var(--warn); background: var(--warn-soft); }
.dblock.b-done { border-left-color: var(--ok); background: var(--ok-soft); cursor: pointer; }
.dlegend { margin-top: 12px; line-height: 2.2; }
.dunp { cursor: grab; }
input.dday { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.suite-search { margin-top: 0; flex-wrap: wrap; } .suite-search input, .suite-search select { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
.suite-search select { flex: 1 1 180px; } .suite-search input { flex: 1 1 160px; }
.tl { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.tl:first-of-type { border-top: 0; padding-top: 0; }
.tl-date b { display: block; } .tl-date small { color: var(--ink-3); font-size: 13px; }
.tl-body { min-width: 0; border-left: 2px solid var(--line); padding-left: 14px; } .tl-body p { margin-bottom: 6px; } .tl-body p:last-child { margin-bottom: 0; }
.tick-box { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ink-3); border-radius: 4px; vertical-align: middle; }
.pf-line { font-size: 15px; line-height: 1.9; } .pf-line b { font-size: 18px; } .pf-line i { color: var(--line); font-style: normal; margin: 0 6px; }
a.door { text-decoration: none; }
/* Application technicien : journée de visites, historique d'une porte, liste de chargement. */
.stop { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.stop.now { border-color: var(--primary); }
.stop-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; } .stop-top b { font-size: 15px; color: var(--primary); }
.stop h3 { font-size: 17px; font-weight: 600; } .stop p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.stop-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; } .stop-act .btn { min-height: 46px; }
.hist { margin-top: 10px; } .hist div { padding: 8px 10px; border-radius: 8px; background: var(--surface); margin-top: 6px; font-size: 14px; } .hist div.flag { background: var(--warn-soft); font-weight: 500; }
.pack { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; } .pack h3 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; } .pack h3:first-child { margin-top: 0; }
.pack label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; } .pack input { width: 20px; height: 20px; flex: none; }
@media (min-width: 720px) { .leads { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .leads { grid-template-columns: repeat(3, 1fr); } }
@media print { .dsp-scroll, .tabs, .suite-search { display: none; } }

/* ---------- gestion des contrats : calendrier, documents, feuilles de temps ---------- */
.imp { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 14px; border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.tool.hot { color: var(--primary); font-weight: 700; }
aside .tool.hot { color: #fff; background: var(--side-hover); }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 8px; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-left: 6px; animation: live 1.6s infinite; }
@keyframes live { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.cal-title { display: inline-flex; align-items: center; min-width: 150px; justify-content: center; text-transform: capitalize; }
.cal-scroll { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-width: 740px; }
.cal-h { background: var(--sunk); padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cal-day { background: var(--surface); min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.off { background: var(--sunk); }
.cal-day > b { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.cal-day.today > b { color: var(--on-primary); background: var(--primary); border-radius: 10px; width: 22px; height: 22px; display: grid; place-items: center; }
.cal-chip { display: inline-block; font-size: 11.5px; line-height: 1.25; padding: 3px 6px; border-radius: 5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-weight: 600; }
.cal-day .cal-chip { display: block; }
.c-active { background: var(--info-soft); color: var(--info); } .c-planned { background: var(--warn-soft); color: var(--warn); } .c-done { background: var(--ok-soft); color: var(--ok); }
.c-renew { background: var(--bad-soft); color: var(--bad); } .c-due { background: transparent; color: var(--ink-2); border: 1px dashed var(--ink-3); }
.prep { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.prep input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.prep span { flex: 1; } .prep small { display: block; color: var(--ink-3); font-size: 12px; }
.prep.done span { color: var(--ink-3); text-decoration: line-through; } .prep.done small { text-decoration: none; }
.sec { margin-bottom: 12px; } .sec .inline { margin: 0 0 6px; } .sec .inline input { font-weight: 600; }
.sec textarea, .line input, .terms input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.line { display: grid; grid-template-columns: 1fr 70px 100px auto; gap: 6px; margin-bottom: 6px; }
.line-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.steps-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.steps-line div { border-top: 3px solid var(--line); padding-top: 8px; color: var(--ink-3); }
.steps-line div.on { border-color: var(--ok); color: var(--ink); }
.steps-line b { display: block; font-size: 14px; } .steps-line small { font-size: 12px; }
.doc h3 { font-size: 15px; font-weight: 700; margin: 18px 0 4px; }
.doc-p { white-space: pre-wrap; color: var(--ink-2); margin: 0; }
@media print { .imp { display: none; } }

/* application technicien : pointage */
.clock { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: var(--r); padding: 14px; margin: 4px 0 16px; box-shadow: var(--shadow); }
.clock.in { border-left-color: var(--ok); }
.clock b { display: block; font-size: 16px; } .clock span { color: var(--ink-2); font-size: 14px; }
.clock-row { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.clock-row select, .clock-row input { min-height: var(--tap); padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); width: 100%; }
.clock-row select { flex: 1; min-width: 0; } .clock-row label { font-size: 12px; color: var(--ink-2); width: 96px; flex: none; }
.clock-row .btn { flex: 1; white-space: nowrap; }
.clock-link { display: inline-block; margin-top: 10px; font-size: 14px; }
.trow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); } .trow small { display: block; color: var(--ink-2); font-size: 13px; } .trow .btn { flex: none; }

/* application technicien : fiche de service (réponses Oui / Non / N/A, état, accès, photos avant et après) */
.sg { display: flex; flex-wrap: wrap; gap: 6px; }
.sg button { flex: 1 1 auto; min-height: var(--tap); padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.sg button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.sg button.on.ok { background: var(--door-ok); border-color: var(--door-ok); color: #fff; } .sg button.on.bad { background: var(--door-na); border-color: var(--door-na); color: #fff; } .sg button.on.warn { background: var(--door-def); border-color: var(--door-def); color: #1c2434; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.task > span { font-size: 15px; font-weight: 500; flex: 1; } .task .yn { flex: none; flex-wrap: nowrap; } .task .yn button { min-width: 52px; padding: 0 8px; flex: none; }
.shotrow { display: grid; gap: 10px; } .shotcol small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.fix select, .fix input { min-height: var(--tap); }
.chips.towers { padding-bottom: 0; }
/* rapport formel envoyé à la gestion */
.formal h2 { font-size: 17px; margin: 22px 0 8px; } .formal h2:first-of-type { margin-top: 14px; }
.formal .lede { font-size: 15.5px; line-height: 1.6; }
.pr-high { color: var(--bad); font-weight: 700; } .pr-medium { color: var(--warn); font-weight: 700; } .pr-low { color: var(--ink-2); font-weight: 700; }
.fix select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.res { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13.5px; }

/* listes quotidiennes, avis d'anomalie, contrat mécanique */
.eq { display: grid; grid-template-columns: 1.2fr 70px 120px 2fr auto; gap: 6px; margin-bottom: 6px; } .eq.pay { grid-template-columns: 1fr 2fr 120px auto; }
.eq input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
@media (max-width: 700px) { .eq, .eq.pay { grid-template-columns: 1fr 1fr; } }
.tickline { margin: 5px 0; font-size: 15.5px; }
.vth { font-size: 11.5px; font-weight: 600; max-width: 92px; white-space: normal; line-height: 1.25; vertical-align: bottom; }
td.c { text-align: center; } td.c a { text-decoration: none; display: inline-block; min-width: 30px; padding: 4px; }
.yn-Y { color: var(--ok); font-weight: 700; } .yn-N { color: var(--ink-3); } .yn-NA { color: var(--ink-3); font-size: 12px; }
.c-mech { background: var(--primary-soft); color: var(--primary); }
.daylist table td, .daylist table th { padding-top: 6px; padding-bottom: 6px; }
@media print { .daylist, .notice { break-after: page; box-shadow: none; border: 0; } .daylist:last-child, .notice:last-child { break-after: auto; } }

/* ---------- barre de menu : en-tête fixe, menu qui défile, pied rangé ---------- */
aside { padding: 0; overflow: hidden; }
aside .brand { padding: 18px 20px 12px; flex: none; }
.navs { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.group { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #6f80a0; padding: 16px 10px 6px; }
.navs .group:first-child { padding-top: 6px; }
.nav { font-size: 14.5px; gap: 8px; margin-bottom: 1px; }
.nav .nl { min-width: 0; } .nav .nl svg { flex: none; }
.nav.on { box-shadow: inset 3px 0 0 rgba(255, 255, 255, .55); }
.nav:focus-visible, .side-btn:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 1px; }
.badge { flex: none; font-size: 11.5px; line-height: 18px; min-width: 20px; padding: 0 6px; }
.who { margin-top: 0; flex: none; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .16); }
.me { gap: 10px; } .me-id { flex: 1; min-width: 0; }
.me-id b, .me-id span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .me-id span { color: #8fa0bf; font-size: 12.5px; }
.sidebar-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.side-btn { position: relative; display: grid; place-items: center; height: 36px; min-width: 36px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: transparent; color: var(--side-ink); }
.me .side-btn { flex: none; width: 36px; }
.side-btn:hover { background: var(--side-hover); color: #fff; border-color: rgba(255, 255, 255, .22); }
.side-btn svg { width: 18px; height: 18px; } .side-btn b { font-size: 12.5px; font-weight: 700; letter-spacing: .03em; }
.side-btn i { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; line-height: 18px; text-align: center; }
@media (min-width: 900px) { .nav { min-height: 38px; } }

/* profil et photos */
img.avatar { object-fit: cover; display: block; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; } .avatar.xl { width: 96px; height: 96px; font-size: 38px; }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; border-radius: 8px; padding: 2px; margin: -2px; }
.me-link:hover { text-decoration: none; background: var(--side-hover); } .me-link:hover b { color: #fff; }
.sidebar-tools .side-btn svg { width: 18px; height: 18px; }
.tool-me { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.pf-photo { display: flex; gap: 18px; align-items: center; }
.card form .btn { margin-top: 4px; }
