/* OctoDocs — interface mobile claire et lisible (gestes au pouce, grandes cibles) */
:root {
  --bg: #f2f6f6;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e6e8ec;
  --accent: #0f8a8a;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2f1;
  --ok: #15803d;      --ok-soft: #dcf5e4;
  --warn: #c2410c;    --warn-soft: #ffe8dc;
  --todo: #374151;    --todo-soft: #eceef1;
  --ready: #0b6f70;   --ready-soft: #ddf1ef;
  --err: #b91c1c;     --err-soft: #fde2e2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --card: #181b21; --text: #eef0f3; --muted: #9aa3af; --line: #2a2f37;
    --accent: #2bb7b4; --accent-soft: #12302f;
    --ok: #4ade80; --ok-soft: #12301f; --warn: #fb923c; --warn-soft: #3a2214;
    --todo: #d1d5db; --todo-soft: #262a31; --ready: #5fd0cc; --ready-soft: #133433;
    --err: #f87171; --err-soft: #3b1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --card: #181b21; --text: #eef0f3; --muted: #9aa3af; --line: #2a2f37;
  --accent: #2bb7b4; --accent-soft: #12302f;
  --ok: #4ade80; --ok-soft: #12301f; --warn: #fb923c; --warn-soft: #3a2214;
  --todo: #d1d5db; --todo-soft: #262a31; --ready: #5fd0cc; --ready-soft: #133433;
  --err: #f87171; --err-soft: #3b1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#root { min-height: 100%; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column;
  padding-bottom: calc(76px + var(--safe-b)); }
.page { padding: calc(14px + var(--safe-t)) 16px 16px; }

/* en-tête */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.brand { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h1 { font-size: 24px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.h2 { font-size: 16.5px; font-weight: 650; margin: 0; }

/* pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 0; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.todo { background: var(--todo-soft); color: var(--todo); }
.pill.ready { background: var(--ready-soft); color: var(--ready); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.sync .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 0; }

/* tuiles d'action */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  transition: transform .08s ease, border-color .15s; min-height: 118px; justify-content: center; }
.tile:active { transform: scale(.97); }
.tile .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.tile b { font-size: 15.5px; font-weight: 650; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile.primary .ico { background: rgba(255,255,255,.18); color: #fff; }
.tile.primary small { color: rgba(255,255,255,.82); }

/* listes de documents */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; text-align: left; width: 100%; }
.row + .row { border-top: 1px solid var(--line); }
.row .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--todo-soft); color: var(--muted); flex: none; overflow: hidden; }
.row .ico img { width: 100%; height: 100%; object-fit: cover; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row:active { background: var(--todo-soft); }
/* ligne glissable (supprimer de la liste) */
.swipe { position: relative; overflow: hidden; touch-action: pan-y; }
.swipe + .swipe { border-top: 1px solid var(--line); }
.swipe-front { position: relative; background: var(--card); user-select: none; }
.swipe-del { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; border: 0; background: var(--err); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 650; }
.foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; padding: 12px 16px; border-top: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 26px 16px; }
.empty .ico { margin: 0 auto 10px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--todo-soft); }

/* filtres */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { margin-left: 6px; opacity: .7; }

/* barre de navigation */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b)); }
.tabbar .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center; }
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 6px 0; position: relative; }
.tab.on { color: var(--accent); font-weight: 650; }
.tab .badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; font-weight: 700; }
.fab { width: 60px; height: 60px; border-radius: 20px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; margin: -22px auto 0;
  box-shadow: 0 8px 20px rgba(15, 138, 138, .35); }
.fab:active { transform: scale(.95); }

/* formulaires */
.field { display: block; margin-bottom: 14px; }
.field > .lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .req { color: var(--err); }
.input { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 13px; padding: 12px 13px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { min-height: 84px; resize: vertical; }
.input.low { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 45%, var(--card)); }
.input.changed { border-color: var(--accent); }
.evidence { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; gap: 6px; align-items: flex-start; }
.conf { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.conf.hi { background: var(--ok-soft); color: var(--ok); }
.conf.mid { background: var(--warn-soft); color: var(--warn); }
.conf.lo { background: var(--err-soft); color: var(--err); }
.switch { display: flex; align-items: center; justify-content: space-between; border: 1.5px solid var(--line); background: var(--card); border-radius: 13px; padding: 10px 13px; }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--line); border-radius: 13px; position: relative; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 23px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  padding: 12px 16px; font-weight: 650; font-size: 15px; min-height: 48px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }
.sticky-actions { position: sticky; bottom: calc(72px + var(--safe-b)); margin: 18px -16px 0; padding: 12px 16px 6px;
  background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 16px -12px rgba(16, 24, 40, .25); z-index: 5; }

/* détail d'un document */
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent); font-weight: 600; padding: 6px 0; margin-left: -4px; }
.preview { border-radius: var(--radius); overflow: hidden; background: var(--todo-soft); border: 1px solid var(--line); display: grid; place-items: center; min-height: 180px; max-height: 46vh; }
.preview img { width: 100%; max-height: 46vh; object-fit: contain; display: block; background: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.facts .k { font-size: 12px; color: var(--muted); }
.facts .v { font-weight: 600; word-break: break-word; }
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: 13px; font-size: 13.5px; margin-top: 10px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--ready-soft); color: var(--ready); }
.alert.err { background: var(--err-soft); color: var(--err); }
.cands { display: flex; flex-direction: column; gap: 8px; }
.cand { display: flex; align-items: center; gap: 10px; text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 13px; width: 100%; }
.cand.on { border-color: var(--accent); background: var(--accent-soft); }
.cand .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.cand.on .radio { border-color: var(--accent); }
.cand.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cand .main { flex: 1; min-width: 0; }
.cand .why { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }

/* feuille du bas (confirmation) */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 17, 21, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + var(--safe-b)); max-height: 88vh; overflow: auto; animation: up .2s ease; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.recap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 12px 0; }
.recap .r { display: flex; justify-content: space-between; gap: 12px; padding: 10px 13px; font-size: 14px; }
.recap .r + .r { border-top: 1px solid var(--line); }
.recap .r span:first-child { color: var(--muted); }
.recap .r b { text-align: right; word-break: break-word; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b)); z-index: 60; background: #111827; color: #fff;
  padding: 11px 16px; border-radius: 13px; font-size: 14px; width: max-content; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toastup .2s ease; }
@keyframes toastup { from { transform: translate(-50%, 30px); opacity: .4; } }

/* connexion */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.logo { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(37,99,235,.3); }

/* ---------- scanner (plein écran sombre) ---------- */
.scan { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; display: flex; flex-direction: column; user-select: none; }
.scan .bar { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-t)) 16px 10px; z-index: 2; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.round.on { background: #fff; color: #000; }
.scan .stage { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.scan video, .scan .stage > img, .scan .stage canvas.view { width: 100%; height: 100%; object-fit: cover; }
.scan svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan .hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.72); padding: 7px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.scan .controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px 26px calc(22px + var(--safe-b)); gap: 10px; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; padding: 0; }
.shutter i { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: block; transition: transform .1s; }
.shutter:active i { transform: scale(.88); }
.scan .thumbs { display: flex; gap: 8px; justify-self: start; }
.scan .thumbs img { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; }
.auto-toggle { justify-self: end; font-size: 13px; font-weight: 600; border: 0; background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; padding: 8px 12px; }
.auto-toggle.on { background: #ff7a1a; }

/* édition d'une page */
.edit-stage { flex: 1; display: grid; place-items: center; padding: 8px 16px; min-height: 0; }
.edit-stage canvas, .edit-stage img { max-width: 100%; max-height: 100%; box-shadow: 0 6px 24px rgba(0,0,0,.5); background: #fff; }
.tools { display: flex; justify-content: center; gap: 22px; padding: 10px 0 6px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: #fff; font-size: 11.5px; }
.tool .round { width: 48px; height: 48px; }
.filters { display: flex; gap: 8px; justify-content: center; padding: 4px 12px 8px; flex-wrap: wrap; }
.filters button { border: 0; border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 600; }
.filters button.on { background: #fff; color: #000; }
.scan .actions { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px calc(18px + var(--safe-b)); }
.pillbtn { border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 650; font-size: 15px; background: rgba(255,255,255,.16); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.pillbtn.light { background: #fff; color: #000; }

/* recadrage */
.crop-wrap { position: relative; touch-action: none; }
.crop-wrap img, .crop-wrap canvas { display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 230px); }
.handle { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; touch-action: none; display: grid; place-items: center; }
.handle::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #ff7a1a; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.loupe { position: absolute; width: 96px; height: 96px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.5); top: -110px; left: -48px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; gap: 10px; text-align: center; font-weight: 600; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* fiches : bascule nouvelle/consulter, dictée, lecteur QR */
.seg { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin: 10px 0 6px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 9px 6px; font-weight: 650; font-size: 14px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--accent); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip:disabled { opacity: .45; }
.dictbar { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 12px; border: 1px solid var(--line); color: var(--text); }
.micbtn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: inline-grid; place-items: center; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.micbtn.small { width: 42px; height: 42px; box-shadow: none; flex: none; }
.micbtn.on { background: #dc2626; animation: micpulse 1.3s ease-out infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); } 100% { box-shadow: 0 0 0 22px rgba(220,38,38,0); } }
.qrscan { position: fixed; inset: 0; z-index: 60; background: #000; }
.qrscan video { width: 100%; height: 100%; object-fit: cover; }
.qrframe { position: absolute; left: 50%; top: 45%; width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); border: 3px solid rgba(255,255,255,.9); }
.qrclose { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.qrhint { position: absolute; left: 16px; right: 16px; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; color: #fff; font-weight: 600; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }/* étiquettes QR : seule la planche est imprimée */
#print-labels { display: none; }
@media print {
  body.printing > *:not(#print-labels) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #print-labels { display: block; font-family: system-ui, sans-serif; color: #111; }
  #print-labels .g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm; }
  #print-labels .l { border: 1px dashed #ccc; border-radius: 3mm; padding: 4mm; text-align: center; break-inside: avoid; }
  #print-labels img { width: 40mm; height: 40mm; display: block; margin: 0 auto; }
  #print-labels .t { font-weight: 700; font-size: 12pt; margin-top: 2mm; word-break: break-word; }
  #print-labels .s { font-size: 8.5pt; color: #555; margin-top: 1mm; }
  @page { margin: 8mm; }
}
/* recherche universelle, contacts, indicateurs, équipe */
.searchbar { width: 100%; display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 15px; text-align: left; }
.contactbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.contactbar .btn { flex-direction: column; gap: 2px; min-height: 58px; text-decoration: none; }
.contactbar .btn small { font-weight: 500; font-size: 11.5px; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round.mini { width: 36px; height: 36px; flex: none; background: var(--card); color: var(--text); border: 1px solid var(--line); backdrop-filter: none; text-decoration: none; }
.round.mini.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.card .kpi { background: var(--bg); border: 0; }
.kpi .kv { font-size: 24px; font-weight: 750; letter-spacing: -.02em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .kt { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--text); }
.kpi .ks { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi .kper { display: inline-block; margin-top: 5px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); } /* periode propre a l indicateur */
.task.done { opacity: .7; }
.chatpage { display: flex; flex-direction: column; min-height: calc(100vh - 90px); }
.chatlog { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-bottom: 78px; }
.bubble { max-width: 82%; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; border-color: var(--accent); border-radius: 16px 16px 4px 16px; }
.bubble.pending { opacity: .6; }
.bubble .who { font-size: 12px; font-weight: 650; color: var(--accent); margin-bottom: 2px; }
.bubble .txt { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.bubble .at { font-size: 10.5px; opacity: .65; text-align: right; margin-top: 2px; }
.chatimg { border: 0; padding: 0; background: none; display: block; min-width: 120px; min-height: 80px; }
.chatimg img { max-width: 230px; max-height: 260px; border-radius: 12px; display: block; }
.chatfile { border: 0; background: rgba(0,0,0,.08); color: inherit; padding: 8px 10px; border-radius: 10px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.chatbar { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 20; display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 12px; background: var(--bg); border-top: 1px solid var(--line); max-width: 560px; margin: 0 auto; }
.chatbar textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding-top: 11px; }
.chatbar .btn { min-height: 44px; padding: 0 12px; }
.round.send { background: var(--accent); color: #fff; flex: none; backdrop-filter: none; }
.round.send:disabled { opacity: .45; }.contactbar a.btn:not(.ok) { color: var(--text); }
.contactbar a.btn.ok { color: #fff; }
.kpi .ksrc { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.kpi .ksrc.warn { color: var(--warn); }
.kpi .ksrc.ok { color: var(--ok); }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg button { min-width: 0; }

/* messagerie : avatars, présence, vocaux, vidéos, coches de lecture */
.avatar { position: relative; flex: none; border-radius: 50%; color: #fff; font-weight: 700; display: inline-grid; place-items: center; letter-spacing: .02em; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); }
.onlinestrip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; }
.onlinestrip button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); font-size: 12px; font-weight: 600; min-width: 56px; }
.row .meta.typing, .chathead .cs.on { color: #16a34a; font-weight: 600; }
.chathead { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.chathead .back { padding: 6px 2px; }
.chathead .ct { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chathead .cs { font-size: 12.5px; color: var(--muted); }
.bubble .del { font-size: 14px; opacity: .75; }
.bubble .tick { letter-spacing: -3px; margin-left: 4px; opacity: .8; }
.bubble.mine .tick.read { color: #7dd3fc; opacity: 1; }
.upbar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); margin-top: 6px; overflow: hidden; }
.upbar i { display: block; height: 100%; background: #fff; transition: width .2s; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 2px 0; }
.voice .vplay { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.bubble.mine .voice .vplay { background: #fff; color: var(--accent); }
.voice .vbar { flex: 1; height: 4px; border-radius: 4px; background: rgba(0,0,0,.15); overflow: hidden; }
.bubble.mine .voice .vbar { background: rgba(255,255,255,.35); }
.voice .vbar i { display: block; height: 100%; background: currentColor; }
.voice .vdur { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .85; }
.chatvideo { display: block; max-width: 240px; max-height: 320px; border-radius: 12px; background: #000; }
.chatvideo.poster { width: 220px; height: 140px; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.chatvideo .vbig { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.chatvideo small { font-size: 11.5px; opacity: .85; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recbox { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 650; font-variant-numeric: tabular-nums; }
.recbox small { color: var(--muted); font-weight: 500; margin-left: auto; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: pulse 1s infinite; }
.reclvl { width: 60px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.reclvl i { display: block; height: 100%; background: #dc2626; transition: width .15s; }
.chatbar .round.mini { width: 40px; height: 40px; }
.chatbar .btn { padding: 0 10px; }.kpi .kext { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.kpi .kext.run { border-color: transparent; background: none; padding: 6px 0; color: var(--muted); }

/* aide aux autorisations (caméra, micro) */
.permhelp { text-align: center; padding: 8px 6px 4px; color: var(--text); max-width: 380px; margin: 0 auto; }
.permhelp.dark { color: #fff; padding: 24px 22px; }
.permhelp .ph-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--accent-soft); color: var(--accent); }
.permhelp.dark .ph-ico { background: rgba(255,255,255,.12); color: #fff; }
.permhelp b { display: block; font-size: 17px; margin-bottom: 6px; }
.permhelp p { margin: 0 0 10px; font-size: 14px; opacity: .8; }
.permhelp ol { text-align: left; margin: 0 0 14px; padding-left: 22px; font-size: 14px; line-height: 1.45; }
.permhelp ol li { margin-bottom: 4px; }
.permhelp .ph-btns { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.permhelp:not(.dark) .pillbtn.light { background: var(--accent); color: #fff; }
.permhelp .pillbtn.ghost { background: transparent; border: 1px solid currentColor; color: inherit; }
.qrperm { position: absolute; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; }.attachgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.attachgrid button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 16px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.attachgrid .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
.attachgrid small { color: var(--muted); font-size: 12px; }

/* documents d'un formulaire */
.facts-mini { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.facts-mini b { color: var(--text); }
/* appel vidéo */
.callscreen { position: fixed; inset: 0; z-index: 80; background: #0b1220; color: #fff; overflow: hidden; }
.callscreen .remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b1220; }
.callscreen .local { position: absolute; top: calc(70px + env(safe-area-inset-top)); right: 14px; width: 110px; height: 150px; object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,.6); background: #111; z-index: 3; }
.callscreen .local.mirror { transform: scaleX(-1); }
.callscreen .callwait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 1; background: radial-gradient(circle at 50% 35%, #1e3a8a 0%, #0b1220 70%); }
.callscreen .callwait b { font-size: 24px; margin-top: 8px; }
.callscreen .callwait span { opacity: .8; }
.callscreen.incoming .avatar { animation: callpulse 1.6s ease-out infinite; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 36px rgba(34,197,94,0); } }
.callscreen .calltop { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: calc(16px + env(safe-area-inset-top)) 18px 30px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.callscreen .calltop b { font-size: 19px; }
.callscreen .calltop span { opacity: .85; font-variant-numeric: tabular-nums; }
.callscreen .callbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: center; gap: 18px; padding: 24px 16px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.callscreen .callbar.wide { gap: 90px; }
.callscreen .cbtn { width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); }
.callscreen .cbtn.off { background: #fff; color: #0b1220; }
.callscreen .cbtn.hang { background: #dc2626; }
.callscreen .cbtn.hang svg { transform: rotate(135deg); }
.callscreen .cbtn.accept { background: #16a34a; }
.callscreen .cbtn.big { width: 72px; height: 72px; }
.chathead .callbtn { color: var(--accent); }.row .rowmore { padding: 6px 4px 6px 10px; font-size: 20px; line-height: 1; color: var(--muted); }
.chathead .round.mini { width: 38px; height: 38px; }

/* réactions aux messages (appui long) */
.bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; position: relative; }
.bubble.picked { transform: scale(1.03); box-shadow: 0 6px 22px rgba(0,0,0,.18); transition: transform .12s; z-index: 61; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rchip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 1px 7px; font-size: 14px; line-height: 1.5; display: inline-flex; align-items: center; gap: 3px; }
.rchip small { font-size: 11px; font-weight: 700; color: var(--muted); }
.rchip.mine { border-color: var(--accent); background: var(--accent-soft); }
.bubble.mine .rchip { color: var(--text); }
.reactmenu-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.25); animation: fade .12s ease; }
.reactmenu { position: fixed; background: var(--card); border-radius: 18px; box-shadow: 0 10px 34px rgba(0,0,0,.25); padding: 6px; animation: up .14s ease; }
.reactmenu .emorow { display: flex; gap: 2px; align-items: center; }
.reactmenu .emorow button, .reactmenu .emogrid button { border: 0; background: none; font-size: 26px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.reactmenu .emorow button.on { background: var(--accent-soft); }
.reactmenu .emorow button.more { font-size: 22px; color: var(--muted); background: var(--bg); width: 38px; height: 38px; margin-left: 2px; }
.reactmenu .emogrid { display: grid; grid-template-columns: repeat(8, 1fr); max-height: 190px; overflow: auto; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.reactmenu .emogrid button { width: 38px; height: 38px; font-size: 22px; }
.reactmenu .menuacts { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 4px; }
.reactmenu .menuacts:empty { display: none; }
.reactmenu .menuacts button { border: 0; background: none; color: var(--text); text-align: left; padding: 10px 10px; font-size: 15px; display: flex; align-items: center; gap: 10px; border-radius: 10px; }
.reactmenu .menuacts button.danger { color: var(--err); }
/* visionneuse de documents */
.docviewer { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.docviewer .dvbar { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--card); }
.docviewer .dvbar b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.docviewer .dvbody { flex: 1; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.dvinfo { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.dvinfo button { border: 1px solid var(--line); background: var(--card); color: var(--text); width: 34px; height: 30px; border-radius: 8px; font-size: 17px; margin-left: 6px; }
.pdfbox { overflow-x: auto; }
.pdfbox .pdfpage { display: block; margin: 0 auto 10px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.imgbox { touch-action: pinch-zoom pan-x pan-y; text-align: center; }
.imgbox img { max-width: 100%; height: auto; border-radius: 8px; }
.dvvideo { width: 100%; max-height: 80vh; background: #000; border-radius: 10px; }
.sheetbox { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.sheetbox table { border-collapse: collapse; font-size: 13px; }
.sheetbox td, .sheetbox th { border: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; }
.sheetbox tr:first-child td { background: var(--bg); font-weight: 650; position: sticky; top: 0; }
.docxbox { background: #fff; color: #111; padding: 18px; border-radius: 10px; line-height: 1.5; font-size: 15px; overflow-wrap: anywhere; }
.docxbox img { max-width: 100%; }
.docxbox table { border-collapse: collapse; } .docxbox td { border: 1px solid #ccc; padding: 4px 6px; }
.textbox { white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
/* page d'un formulaire : source affichée, tableau des fiches, sélection des documents */
.fhead { display: flex; flex-direction: column; gap: 4px; }
.fhead .btns { margin-bottom: 4px; }
.srcsel { margin: 4px 0 12px; }
.srcsel button { white-space: nowrap; }
.srcsel .n { font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--todo-soft); color: var(--muted); }
.srcsel .on .n { background: rgba(255,255,255,.22); color: #fff; }
.srcsel .sm { display: none; }
@media (max-width: 479px) { .srcsel .lg { display: none; } .srcsel .sm { display: inline; } }
.fsec { margin-top: 6px; min-width: 0; }
.fsec + .fsec { margin-top: 18px; }
.fsec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 10px; }
.fsec-h .h2 { display: flex; align-items: center; gap: 7px; }
.card.flush { overflow: hidden; }
.tblwrap { overflow: auto; max-height: 70vh; -webkit-overflow-scrolling: touch; }
.rtable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.rtable th, .rtable td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.rtable th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-size: 12px; font-weight: 650; color: var(--muted); cursor: pointer; user-select: none; }
.rtable th:first-child, .rtable td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); border-right: 1px solid var(--line); }
.rtable th:first-child { z-index: 3; background: var(--bg); }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.rtable td.id { color: var(--muted); font-size: 12.5px; }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover td, .rtable tbody tr:focus td { background: var(--accent-soft); }
.rtable tbody tr:focus { outline: none; }
.rtable tbody tr:last-child td { border-bottom: 0; }
/* onglets d'un formulaire : le tableau se lit comme la feuille du classeur */
.sheettabs { padding: 2px 0 10px; }
.sheettabs:has(.tabmenu) { overflow: visible; flex-wrap: wrap; } /* le menu ⋯ ne doit pas être coupé par le défilement */
.rtable.sheetlike th, .rtable.sheetlike td { padding: 7px 10px; border-right: 1px solid var(--line); }
.rtable.sheetlike th:last-child, .rtable.sheetlike td:last-child { border-right: 0; }
.tblfoot { font-size: 12.5px; color: var(--muted); padding: 9px 13px; border-top: 1px solid var(--line); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; margin-bottom: 10px; }
.selbar .selall { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; }
.selbar .selall input { width: 18px; height: 18px; accent-color: var(--accent); }
.selbar .selcount { color: var(--muted); font-size: 13px; flex: 1; }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.btn.danger:not(:disabled) { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.chip.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, var(--line)); }
.docrow.picked { background: var(--accent-soft); }
.dchk { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; margin: 0 7px; background: var(--card); color: #fff; }
.dchk.on { background: var(--accent); border-color: var(--accent); }
.dchk.off { opacity: .35; }
.dellist { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; max-height: 30vh; overflow: auto; }
.dellist div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dellist span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dellist .muted { color: var(--muted); }

/* ---------- multiplateforme : téléphone, tablette, ordinateur ---------- */
.navbrand, .fablbl, .tab.deskonly { display: none; }

/* tablette en portrait : colonne plus large, tuiles sur 4 colonnes */
@media (min-width: 700px) {
  .app { max-width: 820px; }
  .tabbar .inner { max-width: 820px; }
  .chatbar { max-width: 820px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .sheet-bg { align-items: center; }
  .sheet { max-width: 560px; border-radius: 22px; padding-bottom: 18px; }
  .sheet .grab { display: none; }
  .fhead { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; }
  .fhead .btns { flex: none; }
  .fhead .btns > * { flex: none; }
  .srcsel { max-width: 520px; }
}

/* ordinateur et tablette en paysage : menu latéral, contenu large */
@media (min-width: 1000px) {
  :root { --nav-w: 232px; }
  .app { max-width: none; margin: 0; padding: 0 0 24px var(--nav-w); }
  .app > .page { max-width: 1100px; width: 100%; margin: 0 auto; padding: 24px 32px; }
  .app > .page.wide { max-width: 1500px; }
  .tabbar { top: 0; right: auto; width: var(--nav-w); border-top: 0; border-right: 1px solid var(--line); padding: 18px 12px; background: var(--card);
    backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar .inner { max-width: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; height: 100%; }
  .navbrand { order: -2; display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 700; font-size: 17px; }
  .navbrand img { border-radius: 9px; }
  .navbrand span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .navbrand small { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tab, .tab.deskonly { display: flex; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px; padding: 11px 12px; border-radius: 12px; color: var(--text); }
  .tab:hover { background: var(--bg); }
  .tab.on { background: var(--accent-soft); color: var(--accent); }
  .tab .badge { position: static; margin-left: auto; }
  .tab.deskonly { margin-top: auto; }
  .tab.deskonly.deskdash { margin-top: 0; }
  .fab { order: -1; width: 100%; height: 46px; border-radius: 13px; margin: 0 0 14px; display: flex; gap: 10px; justify-content: center; box-shadow: none; font-weight: 650; font-size: 15px; }
  .fab svg { width: 20px; height: 20px; }
  .fablbl { display: inline; }
  .toast { bottom: 28px; left: calc(50% + var(--nav-w) / 2); }
  .chatbar { left: var(--nav-w); bottom: 0; max-width: none; padding: 10px 24px; }
  .sticky-actions { bottom: 0; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .btn { min-height: 44px; }
  .rtable { font-size: 14px; }
  .tblwrap { max-height: calc(100vh - 290px); }
  .homeduo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .homeduo .tiles { grid-template-columns: 1fr 1fr; }
  .fsplit { display: grid; grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr); gap: 22px; align-items: start; }
  .fsplit .fsec + .fsec { margin-top: 6px; }
}
@media (min-width: 1000px) and (hover: hover) {
  .row:hover, .docrow .dmain:hover .title { color: var(--accent); }
}/* première ouverture : activation par numéro de série */
.logo.ok { background: var(--ok); box-shadow: 0 10px 24px rgba(21,128,61,.3); animation: actpop .45s ease-out; }
@keyframes actpop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.input.serial { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.actsteps { display: flex; gap: 8px; margin-top: 16px; }
.actsteps div { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); background: var(--accent-soft); border-radius: 12px; padding: 8px 10px; }
.actsteps div.off { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.actsteps b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }
.actsteps div.off b { background: var(--line); color: var(--muted); }
.actsteps div.done { background: transparent; color: var(--muted); }
.actsteps div.done b { background: var(--ok, #16a34a); }
.actwait { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 14px; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.actchip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; color: var(--text); }
.actchip .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; }
.actchip.ask .ico { background: var(--accent-soft); color: var(--accent); }
.actchip.ask { border-style: dashed; cursor: pointer; }
.actchip .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.actchip .main small { color: var(--muted); font-size: 12px; }
.actchip .link { background: none; border: none; color: var(--accent); font-weight: 600; padding: 6px; cursor: pointer; }

/* champ calcule : resultat, formule, modification */
.calcbox { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1.5px dashed var(--line); background: var(--bg); border-radius: 13px; padding: 9px 12px; color: var(--muted); cursor: pointer; font: inherit; }
.calcbox:hover { border-color: var(--accent); }
.calceq { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--ready-soft); color: var(--ready); }
.calcmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.calcmain b { color: var(--text); font-size: 17px; }
.calcmain small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calclink { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; }
.formula-read { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--bg); font-family: ui-monospace, Consolas, monospace; font-size: 14px; word-break: break-word; }
.formula-input { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 15px; min-height: 84px; }
.formula-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 120px; overflow-y: auto; }
.formula-chips .chip { padding: 5px 10px; font-size: 13px; }
.formula-chips .chip.op { min-width: 36px; color: var(--text); }
.formula-chips .chip.fn { color: var(--accent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

/* carte KPI : fiche de réglage, pièces à cocher */
.kpi.tap { cursor: pointer; }
.kpi.tap:hover { border-color: var(--accent); }
.kpi .ksrc { overflow-wrap: anywhere; }
.kbig { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 2px; }
.kdetail { margin-top: 10px; font-size: 13px; }
.kdetail summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.kdetail pre { white-space: pre-wrap; font: inherit; max-height: 30vh; overflow: auto; margin: 8px 0 0; color: var(--muted); }
.kdocs { max-height: 34vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.kdoc { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.kdoc:last-child { border-bottom: 0; }
.kdoc input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.kdoc .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kdoc .m { flex: none; font-size: 12px; color: var(--muted); }
.kdoc .m.warn { color: var(--warn); }
.kdoc.off .n { color: var(--muted); text-decoration: line-through; }
/* page d'un formulaire : recherche, regroupement par émetteur */
.doctools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.doctools .input { flex: 1 1 220px; min-width: 0; }
.docgroup { padding: 10px 14px; font-size: 13px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.docgroup b { color: var(--text); }
/* pièces jointes d'une tâche */
.tfiles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tfile { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 10px; font-size: 13px; color: var(--text); }
.tfile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.tfile .x { border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; cursor: pointer; }

/* tableau de bord : période et graphiques */
.perdates { display: flex; gap: 8px; margin: 8px 0 10px; }
.perdates label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.perdates .input { padding: 9px 10px; min-width: 0; width: 100%; }
.charts { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .charts { grid-template-columns: 1fr 1fr; } }
.chartcard { min-width: 0; cursor: pointer; }
.chartcard .ct { font-size: 14.5px; font-weight: 700; }
.chartcard .cs { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.clegend { display: flex; gap: 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.clegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 6px; }
.ctable th, .ctable td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.ctable th:first-child, .ctable td:first-child { text-align: left; }
.ctable th { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.chartrow { display: flex; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.chartrow .n { flex: 1; min-width: 0; font-weight: 650; font-size: 14px; }
.chartrow .n small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
div.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.alerts { padding: 4px 14px; }
.alertrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.alertrow:last-child { border-bottom: 0; }
.alertrow .pill { flex: none; font-size: 11px; }
.alertrow.tap { cursor: pointer; }
.advtext { white-space: pre-line; font-size: 13.5px; line-height: 1.45; }
.whylist { margin: 4px 0 8px; padding-left: 18px; font-size: 13.5px; line-height: 1.45; }
/* Octobot */
.botcard { width: 100%; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.botmsgs { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 90px; }
.botq { align-self: flex-end; max-width: 85%; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; white-space: pre-wrap; }
.bota { align-self: stretch; font-size: 14.5px; line-height: 1.5; }
.botsteps { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; } .md .mdh { font-weight: 750; margin: 10px 0 4px; }
.md code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.mdtable { overflow-x: auto; margin: 6px 0 10px; }
.mdtable table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.mdtable th, .mdtable td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
.mdtable th { color: var(--muted); font-weight: 650; }
.botbar { position: sticky; bottom: calc(70px + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
.botbar textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; }
@media (min-width: 900px) { .botbar { bottom: 0; } }
/* Pourquoi ce chiffre ? */
.whybasis { background: var(--accent-soft); color: var(--ready); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; margin: 4px 0 10px; }
.whytrend { color: var(--muted); }
.whycause { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0; overflow-wrap: anywhere; }
.whycause .t { font-weight: 700; font-size: 14px; }
.whycause .i { display: inline-block; margin-top: 3px; font-size: 12px; font-weight: 650; color: var(--warn); }
.whycause .d { font-size: 13.5px; line-height: 1.45; margin-top: 3px; color: var(--text); }
.why { overflow-wrap: anywhere; }
.kdetail pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pickforms { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }

/* ---------- design 2026-11 : sarcelle, accueil = tableau de bord ---------- */
.card { border-radius: 20px; box-shadow: 0 1px 2px rgba(16, 40, 40, .04), 0 6px 18px rgba(16, 60, 60, .06); }
.hello { margin: 4px 0 10px; }
.hello .h1 { font-size: 26px; margin: 0; }
.hello .sub { margin: 2px 0 0; text-transform: capitalize; }
.round.ghost { width: 38px; height: 38px; background: var(--card); color: var(--text); border: 1px solid var(--line); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 6px; }
@media (max-width: 420px) { .quick { grid-template-columns: repeat(2, 1fr); } }
.qtile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 12px; cursor: pointer; text-align: left; color: var(--text); font: inherit;
  box-shadow: 0 1px 2px rgba(16, 40, 40, .04); transition: transform .12s, box-shadow .12s; }
.qtile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 60, 60, .10); }
.qtile b { font-size: 22px; line-height: 1.1; margin-top: 6px; }
.qtile small { color: var(--muted); font-size: 12px; font-weight: 600; }
.qico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.qico.ok { background: var(--accent-soft); color: var(--accent); }
.qico.warn { background: var(--warn-soft); color: var(--warn); }
.qico.err { background: var(--err-soft); color: var(--err); }
.quickforms { padding: 6px 0 4px; }
.dashembed { margin-top: 8px; }
.dashhead { margin: 14px 0 8px; }
.dashhead .h2 { font-size: 19px; }
.dashsettings { padding: 12px 16px; }
.dashsettings summary { cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.dashsettings summary b { color: var(--text); }
.addtiles { margin-bottom: 10px; }
.reviewbanner { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 10px; cursor: pointer; }
.docfoot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; padding: 10px 4px; }
.botfab { position: fixed; right: 16px; bottom: calc(86px + var(--safe-b)); z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 14px 18px 14px 16px; background: var(--accent); color: #fff; font: inherit; font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 138, 138, .38); cursor: pointer; animation: botpop .35s ease-out; }
.botfab:hover { filter: brightness(1.05); transform: translateY(-1px); }
@keyframes botpop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 420px) { .botfab span { display: none; } .botfab { padding: 15px; } }
@media (min-width: 900px) { .botfab { bottom: 24px; right: 24px; } }
/* 23/11 : dans une conversation, la bulle passe au-dessus de la barre du message (elle cachait le bouton d'envoi),
   plus petite, et s'efface pendant la saisie */
.botfab.abovebar { bottom: calc(68px + 74px + var(--safe-b)); padding: 12px; box-shadow: 0 6px 16px rgba(15, 138, 138, .30); }
.botfab.abovebar span { display: none; }
@media (min-width: 900px) { .botfab.abovebar { bottom: 90px; } }
body:has(.chatbar textarea:focus) .botfab, body:has(.chatbar textarea:not(:placeholder-shown)) .botfab { display: none; }
.kpi { border-radius: 18px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.formchip { display: inline-flex; flex: none; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; background: var(--card); overflow: hidden; }
.formchip button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.formchip .fc-open { padding: 7px 10px 7px 13px; }
.formchip .fc-new { padding: 0 11px; border-left: 1px solid var(--line); color: var(--accent); }
.formchip button:hover { background: var(--accent-soft); }

/* ---------- maquette 2026-11 : typographie, menu, période, Octobot ---------- */
.h1, .hello .h1, .dashhead .h2, .kpi .kv, .kbig, .qtile b { font-family: "Space Grotesk", Inter, system-ui, sans-serif; }
.h1 { letter-spacing: -.015em; }
.navforms, .navuser .who { display: none; }
.perline { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.perline .perico { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.perline .pertext { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perline .pertext b { color: var(--text); }
.bothead { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.botico { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.botbar { flex-direction: column; align-items: stretch; }
.botsugg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.botsugg .chip { flex: none; font-size: 12.5px; }
.botrow { display: flex; gap: 8px; align-items: flex-end; }
.bota { border-radius: 18px; }
@media (min-width: 1000px) {
  .navforms { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 2px solid var(--accent-soft); }
  .navform { text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 9px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .navform:hover { background: var(--bg); }
  .navform.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .tab.navuser { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 8px 4px; align-items: center; }
  .navuser .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
    font-weight: 700; font-size: 13px; flex: none; }
  .navuser .who { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.25; }
  .navuser .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .navuser .who small { font-size: 12px; color: var(--muted); }
  .tab.navuser.on { background: transparent; }
  .quick { gap: 14px; }
  .qtile { flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
  .qtile .qico { width: 42px; height: 42px; }
  .qtile b { margin: 0; font-size: 24px; display: block; }
  .qtile small { display: block; }
  .qtile > b, .qtile > small { order: 1; }
  .addtiles .tile { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; text-align: left; min-height: 72px; padding: 16px 18px; }
  .addtiles .tile .ico { margin: 0; }
  .addtiles .tile small { display: block; }
}
.qtxt { display: flex; flex-direction: column; min-width: 0; } .qtxt b { margin-top: 6px; } @media (min-width: 1000px) { .qtxt b { margin-top: 0; } }
/* documents d'un formulaire : cartes en grille (2026-11-08) */
.dwrap { margin-bottom: 4px; }
.doclist { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.dgroup { min-width: 0; max-width: 100%; }
.dgroup .docgroup { background: none; border: 0; padding: 2px 2px 8px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.dcard.picked { background: var(--accent-soft); border-color: var(--accent); }
.dcard .dmain { width: 100%; border: 0; background: none; color: inherit; display: flex; align-items: center; gap: 10px; text-align: left; padding: 0; }
.dcard .dmain .main { flex: 1; min-width: 0; }
.dcard .dmain .title { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard .dmain .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.dcard .ico.pdf { background: var(--err-soft); color: var(--err); }
.dcard .ico.img { background: var(--ready-soft); color: var(--ready); }
.dcard .dbody { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; }
.dcard .dbody .pill { font-size: 11.5px; padding: 2px 9px; }
.dfacts { width: 100%; display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.dfacts div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.dfacts div span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfacts b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dnone { font-size: 12.5px; color: var(--muted); font-style: italic; }
.dcard .dacts { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin: 0; }
.dcard .dfill { flex: 1; justify-content: center; font-size: 12.5px; padding: 7px 10px; background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dicons { display: flex; gap: 4px; }
.dib { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; padding: 0; }
.dib:hover { color: var(--accent); border-color: var(--accent); }
.dib.danger:hover { color: var(--err); border-color: var(--err); }
@media (hover: hover) {
  .dcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 6px 18px rgba(15, 138, 138, .10); }
  .dcard .dmain:hover .title { color: var(--accent); }
}
/* choix du thème : clair / sombre / auto */
.themesw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.themesw button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 6px; min-width: 0; }
.themesw button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.themesw button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.navtheme { display: none; }
@media (min-width: 1000px) {
  .navtheme { display: block; margin-top: auto; padding: 10px 2px 2px; }
  .navtheme .themesw button { flex-direction: column; gap: 2px; height: 46px; font-size: 11.5px; }
  .navtheme + .tab.navuser { margin-top: 6px; }
}
/* Octobot : ajouter au tableau de bord, réponses épinglées */
.botacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.botacts .pinned { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ok); }
.pincard .pinhead { display: flex; align-items: flex-start; gap: 8px; }
.pincard .pinhead .ct { flex: 1; min-width: 0; }
.pinico { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.pinacts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; min-height: 45px; }
.pinacts .botsteps { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.pincard { cursor: default; }
/* fiches : statut en pastille, montants totalisés, cartes sur téléphone */
.rtable th { text-transform: uppercase; letter-spacing: .03em; font-size: 11px; }
.rtable td .pill { font-size: 11.5px; padding: 2px 9px; }
.rtable td.amt { font-weight: 650; }
.rtable tfoot td { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 0; font-weight: 700; }
.rtable tfoot td.tlabel { font-size: 12px; color: var(--muted); text-align: left; z-index: 3; }
.rcards { display: flex; flex-direction: column; gap: 8px; }
.rcard { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
.rcard:active { background: var(--accent-soft); }
.rcard .l1, .rcard .l2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rcard .l1 b { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .l1 .amt { flex: none; font-variant-numeric: tabular-nums; }
.rcard .l2 { font-size: 12px; color: var(--muted); }
.rcard .l2 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .l2 .pill { font-size: 11px; padding: 2px 8px; flex: none; }
.rtotal { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 4px 0; font-size: 12.5px; color: var(--muted); }
.rtotal b { color: var(--text); }
.card.flush:has(> .rcards) { background: none; border: 0; box-shadow: none; }
/* Octobot : graphique de taille raisonnable sur grand écran, bouton d'ajout toujours visible dessous */
.bota .botchart { max-width: 720px; }
.bota .botchart .chart { max-height: 360px; }
.charts .chart { max-height: 300px; }
/* concepteur de rapports (modèles du Centre de rapports d'OCTOPUS) */
.rplist { display: flex; flex-direction: column; gap: 8px; }
.rprow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.rprow .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.rprow .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rprow .main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rprow small { color: var(--muted); font-size: 12px; }
.rpacts { display: flex; gap: 4px; }
.rptpls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rdwrap { position: fixed; inset: 0; z-index: 58; background: var(--bg); display: flex; flex-direction: column; }
.rdbar { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rdtitle { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.rdbtns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rdbtns .dib { font-weight: 700; }
.dib.wide { width: auto; padding: 0 8px; font-size: 12.5px; }
.dib.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.dib:disabled { opacity: .4; }
.rdbody { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.rdcanvas { overflow: auto; padding: 20px; background: color-mix(in srgb, var(--bg) 80%, #8a9aa8 20%); }
.rdpage { margin: 0 auto; background: #fff; color: #000; box-shadow: 0 4px 20px rgba(0,0,0,.18); position: relative; }
.rdband { position: relative; }
.rdbandlbl { font-size: 10.5px; color: #3b4a5a; background: #e8eef5; padding: 2px 6px; border-left: 3px solid #9fb2c6; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.rdband.cur .rdbandlbl { background: #d7ecec; border-left-color: #0f8a8a; color: #0b5f5f; }
.rdbandbody { position: relative; outline: 1px dashed #c7d2de; touch-action: none; }
.rdband.cur .rdbandbody { outline-color: #0f8a8a; }
.rdpage.grid .rdbandbody { background-image: radial-gradient(#cfd8e3 1px, transparent 1px); background-size: calc(var(--mm) * 5) calc(var(--mm) * 5); }
.rdbandgrip { height: 7px; cursor: ns-resize; touch-action: none; }
.rdbandgrip:hover { background: rgba(15,138,138,.25); }
.rditem { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; line-height: 1.15; cursor: move; touch-action: none; user-select: none; }
.rditem.k-line { overflow: visible; }
.rditem.sel { outline: 2px solid #0f8a8a; outline-offset: 1px; z-index: 5; overflow: visible; }
.rditem:hover:not(.sel) { outline: 1px dashed #0f8a8a; }
.rdline { position: absolute; }
.rdph { margin: auto; display: flex; align-items: center; gap: 4px; font: 11px Inter, sans-serif; color: #5b6b6a; text-align: center; padding: 2px; }
.rditem.k-image, .rditem.k-barcode, .rditem.k-qrcode, .rditem.k-chart { background: repeating-linear-gradient(45deg, #f4f6f8, #f4f6f8 6px, #e9eef3 6px, #e9eef3 12px); outline: 1px dashed #9fb2c6; }
.rdgrip { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #0f8a8a; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.rdside { border-left: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.rdtabs { margin: 10px; }
.rdprops { flex: 1; overflow: auto; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.rdprops .input { padding: 7px 10px; font-size: 13.5px; min-height: 0; }
.rdkind { font-weight: 700; font-size: 13px; color: var(--accent); }
.rdgrid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rdgrid4 label, .rdrow { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.rdrow.col textarea { resize: vertical; font-family: inherit; }
.rdtools { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; }
.rdtools label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); width: 90px; }
.rdtb { min-width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; }
.rdtb.wide { flex: 1; }
.rdtb.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rdcolor { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.rdcolor input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
.rdcolor label { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.rdcheck { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.rdbandrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rdbandrow .h { width: 72px; }
.rdpal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rdpalbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font-size: 12px; font-weight: 600; }
.rdpalbtn:hover { border-color: var(--accent); color: var(--accent); }
.rdpalbtn svg { color: var(--accent); }
.rdfields { display: flex; flex-direction: column; gap: 2px; }
.rdfield { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 13.5px; text-align: left; }
.rdfield:hover { background: var(--accent-soft); color: var(--accent); }
.rdfield svg { color: var(--muted); flex: none; }
@media (max-width: 860px) {
  .rdbody { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 46vh; }
  .rdside { border-left: 0; border-top: 1px solid var(--line); }
  .rdcanvas { padding: 10px; }
  .rdbtns .btn.sm { padding: 6px 10px; }
}
.rdwrap { overflow: hidden; }
.rdtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rdtabs button { min-width: 0; padding-left: 4px; padding-right: 4px; font-size: 13px; }
.rdside, .rdcanvas { min-width: 0; }
/* duplicata : zone de dépôt du document modèle */
.rpdrop { border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 16px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; background: var(--bg); }
.rpdrop.over { background: var(--accent-soft); border-color: var(--accent); }
.rpdrop b { color: var(--accent); font-size: 15px; word-break: break-word; }
.rpdropicons { display: flex; gap: 8px; margin-bottom: 4px; }
.rpft { font-size: 11px; font-weight: 800; color: #fff; padding: 3px 7px; border-radius: 6px; }
.rpft.pdf { background: #d64545; } .rpft.x { background: #2e9e5b; } .rpft.csv { background: #2f80c9; } .rpft.img { background: #8e5bc9; }
/* concepteur : image choisie, glisser-déposer depuis la palette et les champs */
.rdimg { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.rditem.k-image:has(.rdimg) { background: none; outline: none; }
.rditem.k-image.sel:has(.rdimg) { outline: 2px solid #0f8a8a; }
.rdghost { position: fixed; z-index: 100; pointer-events: none; background: #0f8a8a; color: #fff; padding: 5px 11px; border-radius: 9px; font: 600 12.5px Inter, sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.rdbandbody.drop { outline: 2px solid #0f8a8a !important; background-color: rgba(15,138,138,.07); }
.rdpalcell { display: contents; }
.rdpalbtn { touch-action: none; cursor: grab; }
.rdfield { cursor: grab; width: 100%; }
body:has(.rdghost) { cursor: grabbing; user-select: none; }
.rdfields > span { display: block; }
/* menu : formulaires récents repliables */
.navchev { display: none; }
@media (min-width: 1000px) {
  .navchev { display: grid; place-items: center; margin-left: auto; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); }
  .navchev:hover { background: var(--bg); color: var(--accent); }
  .navchev svg { transition: transform .15s; }
  .navchev.open svg { transform: rotate(90deg); }
  .navforms.folded { display: none; }
}
/* documents : choix Cartes / Liste */
.viewsel { display: inline-flex; padding: 3px; gap: 2px; flex: none; }
.viewsel button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; }
.dlines { container: docs / inline-size; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px) 110px auto; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dline:last-child { border-bottom: 0; }
.dline.picked { background: var(--accent-soft); }
.dline:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.dline .dmain { display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: none; color: inherit; text-align: left; padding: 0; }
.dline .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.dline .ico.pdf { background: var(--err-soft); color: var(--err); }
.dline .ico.img { background: var(--ready-soft); color: var(--ready); }
.dline .main { display: flex; flex-direction: column; min-width: 0; }
.dline .title { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dline .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dline .dmain:hover .title { color: var(--accent); }
.lfacts { display: flex; gap: 14px; justify-content: flex-end; min-width: 0; overflow: hidden; }
.lfacts > span { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.lfacts small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.lfacts b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dline .pill { justify-self: start; font-size: 11.5px; padding: 2px 9px; }
.dline .dicons { justify-self: end; }
/* liste en colonnes, comme la liste de documents d'OCTOPUS */
.fsec-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dtable-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: color-mix(in srgb, var(--accent-soft) 35%, var(--card)); position: sticky; top: 0; }
.dtable td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.dtable tr.picked { background: var(--accent-soft); }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable th.sortable { padding: 0; }
.dtable .thbtn { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 9px 10px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.dtable th.num .thbtn { justify-content: flex-end; }
.dtable th.c-ico .thbtn { justify-content: center; padding: 9px 4px; }
.dtable .thbtn:hover { color: var(--accent); }
.dtable th.sorted { color: var(--accent); }
.dtable .sarrow { font-size: 9px; min-width: 8px; }
.dtable .muted, .muted { color: var(--muted); }
.dtable .c-name { min-width: 220px; max-width: 420px; }
.dtable .c-ico { width: 34px; text-align: center; padding-left: 4px; padding-right: 4px; }
.dtable .c-act { width: 1%; text-align: right; }
.dtable .dname { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: inherit; padding: 0; text-align: left; max-width: 100%; cursor: pointer; }
.dtable .dname .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dtable .dname:hover .t { color: var(--accent); }
.dtable .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.dtable .ico.pdf { background: var(--err-soft); color: var(--err); }
.dtable .ico.img { background: var(--ready-soft); color: var(--ready); }
.dtable .pill { font-size: 11.5px; padding: 2px 9px; display: inline-flex; align-items: center; gap: 4px; }
.stor { display: inline-flex; align-items: center; gap: 1px; color: var(--accent); }
.stor.muted { color: var(--muted); }
.stor.warn { color: var(--warn, #b45309); }
.colsel, .tabchip { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.colmenu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; }
.tabmenu { left: 0; right: auto; }
.colitem { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; border: 0; background: none; color: var(--text); text-align: left; }
.colitem:hover { background: var(--accent-soft); }
.colitem.danger { color: var(--err); }
.colmenu .link { margin-top: 4px; padding: 6px 10px; text-align: left; }
.chip.tabdots { padding: 0 9px; letter-spacing: 1px; }
.chip.addtab { border-style: dashed; color: var(--accent); }
.selmove { width: auto; min-width: 150px; padding: 6px 10px; height: auto; }
.odlist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.oditem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.oditem.on { border-color: var(--accent); background: var(--accent-soft); }
.oditem .main { display: flex; flex-direction: column; min-width: 0; }
.oditem small { color: var(--muted); word-break: break-all; }
.oditem .warnt { color: var(--warn, #b45309); }
@media (max-width: 640px) { .dtable .c-name { min-width: 170px; } .fsec-h { flex-wrap: wrap; } }
.dib.fill { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
@container docs (max-width: 720px) {
  .dline { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main pill" "facts acts"; row-gap: 6px; }
  .dline .dmain { grid-area: main; }
  .dline .pill { grid-area: pill; justify-self: end; }
  .dline .lfacts { grid-area: facts; justify-content: flex-start; }
  .dline .lfacts > span { align-items: flex-start; }
  .dline .dicons { grid-area: acts; justify-self: end; }

}
@media (max-width: 860px) { .viewsel span { display: none; } }
/* remplir une fiche depuis un document déjà dans OCTOPUS */
.attachgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .attachgrid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .attachgrid.three button:last-child { grid-column: 1 / -1; } }
.octodocs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 55vh; overflow: auto; }
.octodoc { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); text-align: left; }
.octodoc:hover { border-color: var(--accent); }
.octodoc .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.octodoc .ico.pdf { background: var(--err-soft); color: var(--err); }
.octodoc .ico.img { background: var(--ready-soft); color: var(--ready); }
.octodoc .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.octodoc .main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.octodoc small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Octobot à la voix : micro, lecture des réponses */
.botmic { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--accent); display: grid; place-items: center; }
.botmic:hover { border-color: var(--accent); }
.botmic.on { background: var(--err); border-color: var(--err); color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
.botmic:disabled { opacity: .5; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--err) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .botmic.on { animation: none; } }
.botvoice { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.botlisten { display: flex; gap: 6px; margin-top: 8px; }
.botlisten .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.botq svg { vertical-align: -2px; opacity: .85; }

/* ---------- 17/11 : choix du module et module OCTOPUS Drive ---------- */
.modgrid { display: grid; gap: 14px; margin-top: 18px; }
.modcard { display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px 18px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.modcard:hover { border-color: var(--accent); }
.modcard.last { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modico { flex: none; display: grid; place-items: center; width: 56px; height: 56px; }
.modico img { border-radius: 14px; }
.modicodrive { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; }
.modtxt { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.modtxt b { font-size: 18px; font-family: 'Space Grotesk', Inter, sans-serif; }
.modtxt small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 2px; }
.crumb { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 4px 6px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb.on { color: var(--text); font-weight: 650; }
.crumb:hover { background: var(--accent-soft); }
.crumbs .sep { color: var(--muted); }
.driveacts { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.driveacts .btn { flex: 1; min-width: 160px; }
.driverow { padding: 6px 10px 6px 4px; gap: 6px; }
.drivemain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: inherit;
  text-align: left; padding: 6px 8px; border-radius: 12px; cursor: pointer; }
.drivemain:hover { background: var(--bg); }
.drivemain .title, .drivemain .meta { display: block; }
.modpick .hello .sub { text-transform: none; }
/* « Mes fiches de paie » (19/11) */
.payslips .psub { text-transform: none; }
.psrow { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 12px 14px; }
.psrow:hover { background: var(--bg); }
.psrow .title, .psrow .meta { display: block; }
.pspriv { display: flex; align-items: center; gap: 6px; margin: 16px 2px 0; font-size: 12px; }

/* classeur : filtre par colonne comme Excel (17/11) */
.sgnotes { font-size: 12.5px; color: var(--muted); margin: 4px 2px 6px; }
.sgtable thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); font-weight: 650; text-align: left; padding: 6px 6px 6px 8px; }
.sgtable thead th.on { background: var(--accent-soft); }
.sgtable th .sgh { vertical-align: middle; }
.sgtable tbody tr:first-child td { position: static; font-weight: 400; background: none; }
.sgtable tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 45%, transparent); }
.sgbtn { margin-left: 6px; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted);
  display: inline-grid; place-items: center; vertical-align: middle; cursor: pointer; padding: 0; }
.sgbtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sgtable thead th { cursor: pointer; user-select: none; -webkit-user-select: none; }
@media (pointer: coarse) { .sgbtn { width: 30px; height: 30px; border-radius: 8px; } .sgval { padding: 9px 6px; } .sgval input { width: 20px; height: 20px; } }
.sheetbox { max-height: 70vh; }
.sgback { position: fixed; inset: 0; z-index: 80; }
.sgmenu { position: fixed; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: min(560px, 75vh); }
.sgmh { font-weight: 700; font-size: 14px; padding: 2px 4px; }
.sgsort { display: flex; gap: 6px; }
.sgsort button, .sgorder button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 9px; padding: 7px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.sgsort button:hover, .sgorder button:hover { background: var(--bg); }
.sgorder { display: flex; gap: 6px; }
.sgorder button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.sgsearch { position: relative; }
.sgsearch svg { position: absolute; left: 10px; top: 11px; color: var(--muted); }
.sgsearch .input { padding: 8px 10px 8px 32px; font-size: 14px; }
.sgvals { overflow: auto; flex: 1; min-height: 80px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.sgval { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; font-size: 13.5px; cursor: pointer; }
.sgval:hover { background: var(--bg); }
.sgval input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.sgval span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgval small { color: var(--muted); flex: none; }
.sgall { font-weight: 650; }
.sgfoot { display: flex; gap: 8px; align-items: center; }
.sgfoot .btn { padding: 8px 14px; }

/* fiche d'un indicateur = « Mes indicateurs » d'OCTOPUS (17/11) */
.sheet.wide { max-width: 860px; }
.kfhead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.kfmain { flex: 1 1 260px; min-width: 0; }
.kprev { flex: 0 1 290px; min-width: 240px; }
.kpcap { font-size: 12px; font-weight: 700; color: var(--muted); margin: 4px 0 6px; }
.kpcap span { font-weight: 500; }
.kpcard { border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; padding: 12px 14px; background: var(--card); }
.kpt { font-weight: 700; font-size: 14px; }
.kpv { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0; }
.kps { font-size: 12.5px; color: var(--muted); }
.kpstat { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 12.5px; }
.kpst { padding: 2px 9px; border-radius: 999px; font-weight: 700; }
.kpst.ok { background: var(--ok-soft); color: var(--ok); }
.kpst.watch { background: var(--warn-soft); color: var(--warn); }
.kpst.crit { background: var(--err-soft); color: var(--err); }
.kppc { font-weight: 700; color: var(--warn); margin-left: auto; }
.kpchart { width: 100%; height: 64px; display: block; margin-top: 6px; color: var(--muted); }
.kpgauge { width: 150px; height: 80px; display: block; margin: 6px auto 0; color: var(--text); }
.kpbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; }
.kpbar i { display: block; height: 100%; border-radius: 4px; }
.kpgoal { font-size: 12.5px; font-weight: 700; margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.kfs { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 4px; margin-top: 12px; }
.kfs h3 { margin: 0 0 10px; font-size: 15.5px; color: var(--accent); }
.kfs h3 b { font-weight: 800; }
.kfro { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12.5px; }
.kfdesc { position: relative; }
.kfdesc textarea { padding-right: 50px; resize: vertical; }
.kfdesc .kfmic { position: absolute; right: 8px; top: 8px; }
.kfmic.on { background: var(--err); color: #fff; border-color: var(--err); }
.kfnote { margin: 4px 0 10px; font-size: 12.5px; }
.kferr { color: var(--err); font-weight: 600; }
.kflbl { display: block; margin-bottom: 6px; }
.kfgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.kfgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; margin-top: 10px; }
@media (max-width: 620px) { .kfgrid3, .kfgrid2 { grid-template-columns: 1fr; } }
.kdoc .m.val { color: var(--text); font-weight: 650; display: flex; gap: 6px; align-items: baseline; }
.kdoc .m.val small { color: var(--muted); font-weight: 500; }
.kdochint { padding: 8px 12px 10px 40px; font-size: 12.5px; color: var(--warn); border-bottom: 1px solid var(--line); background: var(--warn-soft); }
.kflive { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.kflive small { color: var(--muted); font-size: 12px; }
.kfdir { display: flex; gap: 8px; flex-wrap: wrap; }
.kfdir .btn { flex: 1 1 200px; }
.kfdir .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.kfviz { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 620px) { .kfviz { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kfvt { text-align: left; border: 1.5px solid var(--line); background: var(--card); color: inherit; border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; }
.kfvt small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.kfvt.on { border-color: var(--accent); background: var(--accent-soft); }
.kfsw { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.kfswatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.kfswatch.on { box-shadow: 0 0 0 3px var(--text); }
.kfsw .kfnote { margin: 0 0 0 4px; }
.kfbtns { margin-top: 14px; position: sticky; bottom: calc(-16px - var(--safe-b)); background: var(--card); padding: 10px 0 4px; }

/* avis « navigateur trop ancien » (17/11) */
.oldengine { border: 1.5px solid #f0b429; background: #fff8e6; color: #5c4400; border-radius: 16px; padding: 14px 16px; margin: 14px 0; font-size: 14.5px; line-height: 1.45; }
.oldengine .oehead { display: flex; align-items: center; gap: 8px; color: #8a5a00; margin-bottom: 6px; }
.oldengine p { margin: 0 0 6px; }
.oldengine ol { margin: 0 0 10px; padding-left: 20px; }
.oldengine .oebtns { display: flex; gap: 8px; flex-wrap: wrap; }
.oldengine .oebtns .btn { text-decoration: none; }
:root[data-theme="dark"] .oldengine { background: #2b2410; border-color: #8a6a1a; color: #f3dfa6; }
:root[data-theme="dark"] .oldengine .oehead { color: #f6c453; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .oldengine { background: #2b2410; border-color: #8a6a1a; color: #f3dfa6; }
  :root:not([data-theme="light"]) .oldengine .oehead { color: #f6c453; } }
.driveico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.driveico.file { background: var(--bg); color: var(--muted); }
.driveup { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.driveup span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driveup .bar { width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.driveup .bar i { display: block; height: 100%; background: var(--accent); }
.sheetlist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sheetlist .btn { justify-content: flex-start; gap: 10px; }
@media (min-width: 1000px) {
  .app.modapp { padding-left: 0; }
  .app.modapp > .page { max-width: 880px; }
  .modgrid { grid-template-columns: 1fr 1fr; }
  .modcard { padding: 28px 24px; }
  .app.modapp .toast { left: 50%; }
}

/* ---------- espace salarié (21/11) ---------- */
.sttabs { margin: 6px 0 10px; }
.sttabs .chip { gap: 6px; }
.stnotice { margin-bottom: 10px; }
.sthead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strecapline { margin: 0 0 10px; }
.strecap { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.strecap small { color: var(--muted); font-size: 12.5px; }
.strecap b { font-size: 20px; }
.strow { border-bottom: 1px solid var(--line); }
.strow:last-child { border-bottom: 0; }
.strow .psrow { border-bottom: 0; }
.stsumbtn { display: block; margin: -4px 0 10px 58px; font-size: 13px; }
.stsum { margin: 0 14px 14px; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.stgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stgrid small, .stcg small { display: block; color: var(--muted); font-size: 12px; }
.stgrid b { font-size: 16px; }
.stcg { margin-top: 10px; font-size: 13.5px; display: grid; gap: 2px; }
.stform { padding: 16px; }
.strow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.strq { align-items: flex-start; gap: 10px; }
.strq .main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stanswer { font-size: 13px; color: var(--text); background: var(--accent-soft); border-radius: 8px; padding: 4px 8px; align-self: flex-start; }
.stacts { display: flex; gap: 14px; margin-top: 2px; }
.stdecide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.stans { flex: 1 1 100%; min-height: 40px; padding: 8px 10px; font-size: 14px; }
.stphoto { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.stprev { display: block; max-width: 100%; max-height: 220px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); }
.stpaper { display: flex; gap: 10px; align-items: flex-start; margin: 18px 2px 6px; font-size: 14px; }
.stpaper input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.stpaper span { display: grid; gap: 2px; }
.stpaper small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 380px) { .strow2, .stgrid { grid-template-columns: 1fr; } }
.stdel { display: inline-flex; align-items: center; gap: 5px; color: var(--err) !important; align-self: flex-start; font-size: 13.5px; }
.stphoto + .stprev + .stdel, .field > .stdel { margin-top: 8px; }

/* messages et documents de l'administrateur au salarie (21/11) */
.stmsgform { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 8px; }
.stattach { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--chip, rgba(127,127,127,.12)); font-size: 13.5px; }
.stattach .stattname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stattach .stdel { margin: 0; }
.stmsgbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; margin-top: 2px; }
.stmsg.unread { box-shadow: inset 3px 0 0 var(--accent); }
.stmsgfile { align-self: flex-start; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stsent { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.stsent .okc { color: var(--ok, #22c55e); font-weight: 600; }
.stsent b { font-weight: 600; }
/* reseau de contacts de l'espace salarie (21/11) */
.ctrow { display: flex; align-items: center; gap: 10px; }
.ctrow .main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ctmain { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.ctrow .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ctunread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ctmore { position: relative; }
.ctmore > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.ctmore > summary::-webkit-details-marker { display: none; }
.ctmore[open] > summary { background: var(--chip, rgba(127,127,127,.14)); }
.ctmenu { position: absolute; right: 0; top: 36px; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; min-width: 190px; border-radius: 12px; background: var(--card, #fff); border: 1px solid var(--line, rgba(127,127,127,.25)); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ctpage .section-head { margin-top: 14px; }
.ctpage .section-head:first-child { margin-top: 0; }

/* Gestion des salaries refaite (22/11) : a traiter, salaries, fiche */
.sgbar { display: flex; gap: 10px; align-items: stretch; margin: 6px 0 12px; flex-wrap: wrap; }
.sgbar .stsearch { flex: 1 1 260px; margin: 0; position: relative; }
.sgbar .stsearch .input { padding-left: 42px; min-height: 48px; }
.sgsearchico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.sgnew { flex: 0 0 auto; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; white-space: nowrap; }
.sgseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.sgseg button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 650; font-size: 14.5px; cursor: pointer; }
.sgseg button.on { background: var(--accent); color: #fff; }
.sgseg .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: var(--todo-soft); color: var(--muted); }
.sgseg .n.hot { background: var(--warn); color: #fff; }
.sgseg button.on .n { background: rgba(255,255,255,.26); color: #fff; }
.sgtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.sgtile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.sgtile .ico { position: absolute; right: 12px; top: 12px; display: flex; opacity: .55; }
.sgtile .n { font-size: 30px; font-weight: 750; line-height: 1.05; color: var(--muted); }
.sgtile .l { font-size: 13px; font-weight: 600; line-height: 1.25; }
.sgtile.hot .n { color: var(--text); }
.sgtile.hot { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.sgtile.hot .ico { color: var(--warn); opacity: 1; }
.sgtile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--text); }
.sgblock { margin-bottom: 16px; }
.sgblock .section-head { margin-bottom: 8px; }
.sgblock .section-head .meta { color: var(--muted); font-size: 13px; }
.sgdone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 16px; color: var(--muted); }
.sgdone .ico { width: 54px; height: 54px; border-radius: 27px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 4px; }
.sgdone b { color: var(--text); font-size: 17px; }
.sgperson { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sgperson + .sgperson { border-top: 1px solid var(--line); }
.sgperson:hover { background: var(--accent-soft); }
.sgperson .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sgperson .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgperson .meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgperson > svg { color: var(--muted); flex: none; }
.sgwho { padding: 0; font: inherit; font-weight: 650; color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; cursor: pointer; }
.sgwho:hover { color: var(--accent); }
.sgpage .strq .title { white-space: normal; overflow-wrap: anywhere; }
.sgpage .strq .meta { white-space: normal; }
.sgpage .stacts { flex-wrap: wrap; gap: 4px 16px; }
.sgpage .stacts .link { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; }
.sgpage .stdecide .btn { display: inline-flex; align-items: center; gap: 6px; }
.sgret { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 8px; }
.sghead { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 12px; }
.sghead .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sghead .h2 { font-size: 19px; overflow-wrap: anywhere; }
.sghead .meta { color: var(--muted); font-size: 13px; }
.sgwrite { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; }
.sgto { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--accent-soft); }
.sgto .main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sgpick { display: flex; flex-direction: column; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sgpickrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sgpickrow + .sgpickrow { border-top: 1px solid var(--line); }
.sgpickrow:hover { background: var(--accent-soft); }
.sgpage .stacts .link { text-align: left; }
@media (max-width: 560px) {
  .sgnew { flex: 1 1 100%; }
  .sgpage .strq { flex-wrap: wrap; position: relative; }
  .sgpage .strq > .avatar { display: none; }
  .sgpage .strq > .main { flex: 1 1 100%; order: 2; }
  .sgpage .strq > .pill { order: 1; margin-left: auto; }
  .sgpage .stdecide .btn { flex: 1 1 0; justify-content: center; }
  .sgtile { padding: 11px 10px; }
  .sgtile .n { font-size: 25px; }
  .sgtile .l { font-size: 12px; }
  .sgtile .ico { display: none; }
  .sgseg button { font-size: 13.5px; gap: 5px; }
  .sgseg button svg { display: none; }
  .sgperson .pill + .pill { display: none; }
}