/* ISHID — système visuel
   Brume froide, vert blouse profond, ambre pour l'attention. Une seule famille : Onest. */
:root {
  --mist: #F1F5F3;
  --paper: #FFFFFF;
  --sunk: #E7EEEB;
  --line: #D9E3DF;
  --line-strong: #BFCEC8;
  --ink: #102420;
  --ink-2: #33473F;
  --muted: #5F726B;
  --pine: #0F5C4D;
  --pine-2: #137561;
  --pine-deep: #0A3B32;
  --pine-tint: #DDEEE8;
  --amber: #D8901F;
  --amber-ink: #8A5A0C;
  --amber-tint: #FBEED6;
  --red: #BE3A31;
  --red-tint: #F8E2DF;
  --violet: #4F4CC9;
  --violet-tint: #E6E6FA;
  --focus: #2F6FED;
  --r-s: 8px; --r-m: 12px; --r-l: 20px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(16, 36, 32, .06);
  --shadow-2: 0 10px 30px -12px rgba(10, 59, 50, .28);
  --font: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--mist); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--pine); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pine); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--pine-2); }
.btn.ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--line-strong); background: #FAFCFB; }
.btn.danger { background: var(--red); color: #fff; }
.btn.warn { background: var(--amber); color: #2A1A00; }
.btn.quiet { background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--sunk); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { min-height: 54px; padding: 0 22px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunk); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-ok { background: var(--pine-tint); color: var(--pine); }
.t-warn { background: var(--amber-tint); color: var(--amber-ink); }
.t-bad { background: var(--red-tint); color: var(--red); }
.t-info { background: var(--violet-tint); color: var(--violet); }
.t-neutral { background: var(--sunk); color: var(--ink-2); }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--av) 14%, white); color: var(--av); font-weight: 700; letter-spacing: .02em; }

/* ---------- champs ---------- */
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); font-weight: 400; font-size: 15px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-tint); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.err { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-1); }
.switch input:checked + .track { background: var(--pine); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; background: var(--sunk); border-radius: 12px; gap: 2px; }
.seg button { white-space: nowrap; border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- toasts & modales ---------- */
#toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-2); font-weight: 500; animation: tin .25s ease-out; }
.toast.t-ok .ic { color: #7FD8BE; } .toast.t-warn .ic { color: #F5C66E; } .toast.t-bad .ic { color: #FF9C93; } .toast.t-info .ic { color: #B7B5FF; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

.modal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(10, 30, 26, .42); display: grid; place-items: center; padding: 16px; animation: fin .18s; }
.modal-wrap.out { opacity: 0; transition: .18s; }
@keyframes fin { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow-2); animation: min .22s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(720px, 100%); }
@keyframes min { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 22px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 22px 18px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .modal-foot .btn { flex: 1; }
}

/* ---------- bandeau démo ---------- */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 7px 16px; background: var(--pine-deep); color: #CFE6DE; font-size: 13px; }
.demo-bar a, .demo-bar button { color: #fff; background: none; border: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: 13px; }

/* ========== ACCUEIL ========== */
.home { min-height: 100dvh; display: flex; flex-direction: column; }
.home-main { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 48px 28px 64px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--pine); display: grid; place-items: center; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; letter-spacing: 0; }
.home h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.035em; font-weight: 750; margin: 30px 0 18px; max-width: 13ch; }
.home .lede { font-size: 18px; color: var(--ink-2); max-width: 46ch; line-height: 1.55; }
.role-group { font-size: 13px; font-weight: 600; color: var(--muted); margin: 28px 0 10px; letter-spacing: 0; }
.roles { margin-top: 0; display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.role { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 16px; padding: 16px 18px; background: var(--paper); text-decoration: none; color: var(--ink); transition: background .15s; }
.role:hover { background: #F8FBFA; }
.role:hover .go { color: var(--pine); transform: translateX(3px); }
.role .ri { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--pine-tint); color: var(--pine); }
.role strong { display: block; font-size: 15.5px; }
.role span { font-size: 13.5px; color: var(--muted); }
.role .go { color: var(--line-strong); transition: .15s; }
.home-visual { position: relative; display: grid; place-items: center; }
.home-visual .dial-wrap { width: min(440px, 100%); }
.home-foot { width: min(1180px, 100%); margin: 0 auto; padding: 18px 28px 28px; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); }
.home-foot b { color: var(--ink-2); font-weight: 600; }
.legend { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 920px) {
  .home-main { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  .home-visual { order: -1; }
  .home-visual .dial-wrap { width: min(300px, 80vw); }
  .home h1 { margin-top: 8px; }
}

/* ========== CADRAN DE POINTAGE (élément signature) ========== */
.dial-wrap { position: relative; aspect-ratio: 1; width: 100%; }
.dial-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dial-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.dial-center .time { font-size: clamp(34px, 9vw, 54px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.dial-center .sub { margin-top: 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.dial-center .state { margin-top: 12px; }
.dial-track { stroke: var(--sunk); }
.dial-tick { stroke: var(--line-strong); }
.dial-shift { stroke: var(--pine); }
.dial-tol { stroke: var(--amber); }
.dial-now { fill: var(--ink); }
.dial-hold { stroke: var(--pine-deep); transition: stroke-dashoffset .05s linear; }
.dial-intro .dial-shift, .dial-intro .dial-tol { animation: draw 1.4s cubic-bezier(.6,.05,.2,1) both; }
.dial-intro .dial-tol { animation-delay: .9s; }
@keyframes draw { from { stroke-dashoffset: var(--len); } }

.hold-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px;
  border: 0; border-radius: 18px; background: var(--pine); color: #fff; font-weight: 700; font-size: 17px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.hold-btn .fill { position: absolute; inset: 0; background: var(--pine-deep); transform-origin: left; transform: scaleX(0); }
.hold-btn > span, .hold-btn > svg { position: relative; }
.hold-btn.depart { background: var(--ink); }
.hold-btn.depart .fill { background: #000; }
.hold-btn:disabled { background: var(--line-strong); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ========== ESPACE AGENT (PWA mobile) ========== */
.agent-stage { min-height: calc(100dvh - 34px); display: grid; grid-template-columns: 1fr minmax(0, 400px) 1fr; gap: 40px; align-items: center; padding: 32px 24px; }
.stage-note { max-width: 300px; justify-self: end; display: grid; gap: 14px; }
.stage-note h2 { font-size: 22px; }
.stage-note p { color: var(--ink-2); }
.stage-note .tips { display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); padding: 0; margin: 0; list-style: none; }
.stage-note .tips li { display: flex; gap: 10px; }
.stage-note .tips .ic { color: var(--pine); margin-top: 2px; }
.stage-side { justify-self: start; max-width: 320px; display: grid; gap: 12px; }
.phone { position: relative; width: 100%; height: min(820px, calc(100dvh - 100px)); min-height: 640px; background: var(--mist); border-radius: 44px; border: 10px solid #15201D; box-shadow: 0 40px 80px -30px rgba(10,40,34,.45); overflow: hidden; display: flex; flex-direction: column; }
.phone::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; background: #15201D; border-radius: 99px; z-index: 5; }
@media (max-width: 1000px) {
  .agent-stage { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .stage-note, .stage-side { display: none; }
  .phone { height: calc(100dvh - 34px); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .phone::before { display: none; }
}
.app-top { padding: 46px 20px 10px; display: flex; align-items: center; gap: 12px; }
@media (max-width: 1000px) { .app-top { padding-top: 16px; } }
.app-top .who { flex: 1; min-width: 0; }
.app-top .who strong { display: block; font-size: 15.5px; }
.app-top .who span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); font-size: 12.5px; font-weight: 600; color: var(--pine); }
.net.off { color: var(--violet); border-color: #C9C8F3; background: var(--violet-tint); }
.app-body { flex: 1; overflow-y: auto; padding: 6px 20px 24px; }
.app-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--paper); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); }
.app-tabs button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; font-size: 11.5px; font-weight: 600; color: var(--muted); border-radius: 10px; }
.app-tabs button[aria-current="page"] { color: var(--pine); }
.app-tabs button[aria-current="page"] .ic { stroke-width: 2.4; }

.shift-card { background: var(--paper); border-radius: var(--r-xl); padding: 18px 18px 20px; border: 1px solid var(--line); }
.shift-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.shift-meta h3 { font-size: 15px; }
.shift-meta .span { font-size: 13.5px; color: var(--muted); }
.agent-dial { width: min(290px, 88%); margin: 4px auto 10px; }
.agent-dial .time { font-size: 38px; }
.agent-dial .sub { font-size: 12.5px; margin-top: 6px; }
.hold-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; background: var(--sunk); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chip.ok { background: var(--pine-tint); color: var(--pine); }
.chip.bad { background: var(--red-tint); color: var(--red); }
.chip.info { background: var(--violet-tint); color: var(--violet); }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); text-align: left; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tile-btn .ic { color: var(--pine); }
.tile-btn:hover { border-color: var(--line-strong); }
.section-h { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.section-h h3 { font-size: 15px; }
.list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .grow strong { display: block; font-size: 14.5px; font-weight: 600; }
.li .grow span { display: block; font-size: 12.5px; color: var(--muted); }
.li .tm { font-weight: 700; font-size: 15px; }
.pending-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--violet-tint); color: #2E2C8F; border-radius: 14px; font-size: 13.5px; margin-bottom: 12px; }
.pending-banner .btn { margin-left: auto; }

.week { display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.day.today { border-color: var(--pine); box-shadow: inset 4px 0 0 var(--pine); }
.day .d { text-align: center; line-height: 1.1; }
.day .d b { display: block; font-size: 20px; }
.day .d span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.day.rest { background: transparent; border-style: dashed; }
.bar-h { height: 8px; border-radius: 4px; background: var(--sunk); position: relative; margin-top: 6px; }
.bar-h i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--pine); }

/* séquences plein écran dans le téléphone (PIN, géoloc, confirmation) */
.sheet { position: absolute; inset: 0; z-index: 10; background: var(--mist); display: flex; flex-direction: column; animation: sup .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sup { from { transform: translateY(24px); opacity: 0; } }
.sheet-top { padding: 46px 16px 8px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 1000px) { .sheet-top { padding-top: 14px; } }
.sheet-top h2 { font-size: 17px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 22px 24px; display: flex; flex-direction: column; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 8px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); transition: .12s; }
.pin-dots i.on { background: var(--pine); border-color: var(--pine); transform: scale(1.08); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.keypad button { height: 62px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); font-size: 24px; font-weight: 600; display: grid; place-items: center; }
.keypad button:active { background: var(--sunk); }
.keypad button.k-alt { background: transparent; border-color: transparent; color: var(--pine); font-size: 14px; }
.step-list { display: grid; gap: 10px; margin: 18px 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.step .si { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--muted); flex: none; }
.step.done .si { background: var(--pine-tint); color: var(--pine); }
.step.warn .si { background: var(--amber-tint); color: var(--amber-ink); }
.step.bad .si { background: var(--red-tint); color: var(--red); }
.step.run .si { color: var(--pine); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-result { text-align: center; padding: 20px 0 8px; display: grid; justify-items: center; gap: 10px; }
.big-result .ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--pine-tint); color: var(--pine); animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
.big-result .ring.warn { background: var(--amber-tint); color: var(--amber-ink); }
.big-result .ring.info { background: var(--violet-tint); color: var(--violet); }
.big-result .ring.bad { background: var(--red-tint); color: var(--red); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.big-result h3 { font-size: 22px; }
.receipt { width: 100%; margin-top: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px; text-align: left; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.receipt div:first-child { border-top: 0; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; }
.pick { display: grid; gap: 8px; }
.pick button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); text-align: left; }
.pick button:hover, .pick button:focus-visible { border-color: var(--pine); }
.pick button strong { display: block; font-size: 14.5px; }
.pick button span { font-size: 12.5px; color: var(--muted); }

/* ========== KIOSQUE ========== */
.kiosk { min-height: calc(100dvh - 34px); background: var(--pine-deep); color: #fff; display: flex; flex-direction: column; }
.kiosk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; }
.kiosk-top .brand { color: #fff; }
.kiosk-top .brand small { color: #9FC7BA; }
.kiosk-clock { text-align: right; }
.kiosk-clock b { display: block; font-size: 30px; letter-spacing: -.03em; }
.kiosk-clock span { color: #9FC7BA; font-size: 14px; text-transform: capitalize; }
.kiosk-main { flex: 1; display: grid; place-items: center; padding: 8px 24px 32px; }
.kiosk-panel { width: min(880px, 100%); background: var(--paper); color: var(--ink); border-radius: 32px; padding: 32px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); animation: sup .3s cubic-bezier(.2,.8,.2,1); }
.kiosk-panel h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; }
.kiosk-panel > p { color: var(--muted); margin-top: 6px; font-size: 16px; }
.k-search { margin: 22px 0 16px; position: relative; }
.k-search input { width: 100%; height: 60px; border-radius: 18px; border: 2px solid var(--line); padding: 0 18px 0 52px; font-size: 18px; }
.k-search input:focus { outline: none; border-color: var(--pine); }
.k-search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.k-person { color: var(--ink); display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); text-align: left; min-height: 72px; }
.k-person:hover, .k-person:focus-visible { border-color: var(--pine); background: #F7FBF9; }
.k-person strong { display: block; font-size: 15px; line-height: 1.25; }
.k-person span { font-size: 12.5px; color: var(--muted); }
.k-split { display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: center; }
.k-split .keypad button { height: 70px; font-size: 26px; }
.k-who { display: flex; align-items: center; gap: 16px; }
.k-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.k-choice button { display: grid; gap: 10px; justify-items: start; padding: 22px; border-radius: 22px; border: 2px solid var(--line); background: var(--paper); text-align: left; }
.k-choice button:hover, .k-choice button:focus-visible { border-color: var(--pine); }
.k-choice button .ic { color: var(--pine); }
.k-choice strong { font-size: 20px; }
.k-choice span { color: var(--muted); font-size: 14px; }
.cam { aspect-ratio: 4/3; border-radius: 22px; background: #0E1A17; display: grid; place-items: center; position: relative; overflow: hidden; color: #8FB5A9; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam .frame { position: absolute; inset: 14% 24%; border: 3px solid rgba(255,255,255,.5); border-radius: 50%; }
.k-countdown { margin-top: 18px; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.k-countdown i { display: block; height: 100%; background: var(--pine); transform-origin: left; animation: cd 6s linear forwards; }
@keyframes cd { to { transform: scaleX(0); } }
@media (max-width: 760px) {
  .kiosk-top { padding: 16px 18px; }
  .kiosk-panel { padding: 22px; border-radius: 24px; }
  .k-split { grid-template-columns: 1fr; gap: 20px; }
  .k-choice { grid-template-columns: 1fr; }
}

/* ========== CONSOLES (superviseur / direction / superadmin) ========== */
.console { display: grid; grid-template-columns: 252px 1fr; min-height: calc(100dvh - 34px); }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: calc(100dvh - 34px); }
.side .brand { padding: 0 8px; }
.fosa-pill { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--mist); }
.fosa-pill .ic { color: var(--pine); }
.fosa-pill strong { display: block; font-size: 13.5px; line-height: 1.25; }
.fosa-pill span { font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: 14.5px; border: 0; background: none; text-align: left; width: 100%; }
.nav a:hover, .nav button:hover { background: var(--mist); }
.nav a[aria-current="page"] { background: var(--pine-tint); color: var(--pine); font-weight: 650; }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #2A1A00; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; }
.me strong { display: block; font-size: 13.5px; }
.me span { font-size: 12px; color: var(--muted); }
.main { min-width: 0; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; letter-spacing: -.025em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.mobile-top { display: none; }
@media (max-width: 960px) {
  .console { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; height: 100dvh; z-index: 60; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-2); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10,30,26,.35); z-index: 55; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 22px; }
}

/* indicateurs : une ligne de chiffres sobres, pas de cartes décoratives */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi.ok .v { color: var(--pine); } .kpi.warn .v { color: var(--amber-ink); } .kpi.bad .v { color: var(--red); } .kpi.info .v { color: var(--violet); }
@media (max-width: 600px) { .kpi { border-left: 0; border-top: 1px solid var(--line); } .kpi:first-child { border-top: 0; } }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; }
.panel-head p { font-size: 13px; color: var(--muted); }
.panel-body { padding: 16px 18px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1180px) { .cols, .cols.even { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 18px; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFCFB; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #FAFCFB; }
.t .person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.t .person strong { display: block; font-weight: 600; }
.t .person span { display: block; font-size: 12.5px; color: var(--muted); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }

/* tableau de présence par service : la barre montre présents / retards / sans pointage */
.svc { display: grid; grid-template-columns: 150px 1fr 70px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc b { font-weight: 600; font-size: 14px; }
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sunk); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.stackbar .p { background: var(--pine); } .stackbar .l { background: var(--amber); } .stackbar .a { background: var(--red); } .stackbar .e { background: var(--line-strong); }
.svc .n { text-align: right; font-size: 13.5px; color: var(--muted); }
.svc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.svc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.exc { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.exc:first-child { border-top: 0; }
.exc .why { font-size: 13px; color: var(--ink-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.exc .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .exc { grid-template-columns: auto 1fr; } .exc .acts { grid-column: 1 / -1; justify-content: stretch; } .exc .acts .btn { flex: 1; } }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .ic { color: var(--pine); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.filters .input { min-height: 38px; width: auto; padding: 6px 10px; font-size: 14px; }
.filters .search { position: relative; flex: 1; min-width: 180px; }
.filters .search .input { width: 100%; padding-left: 36px; }
.filters .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.tpl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: center; }
.tpl:first-child { border-top: 0; }
.tpl h3 { font-size: 15px; }
.tpl .days { display: flex; gap: 4px; margin-top: 6px; }
.tpl .days i { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--sunk); color: var(--muted); }
.tpl .days i.on { background: var(--pine-tint); color: var(--pine); }
.timeline { grid-column: 1 / -1; position: relative; height: 22px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--sunk) 0 calc(100%/24 - 1px), var(--paper) calc(100%/24 - 1px) calc(100%/24)); }
.timeline i { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--pine); }
.timeline i.tol { background: var(--amber); }
.tl-scale { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -4px; }

.mod-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line); }
.mod-row:first-child { border-top: 0; }
.mod-row .mi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sunk); color: var(--muted); }
.mod-row.on .mi { background: var(--pine-tint); color: var(--pine); }
.mod-row h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mod-row p { font-size: 13px; color: var(--muted); }

.split-bar { display: flex; height: 38px; border-radius: 12px; overflow: hidden; font-weight: 700; font-size: 13.5px; }
.split-bar .f { background: var(--pine); color: #fff; display: flex; align-items: center; padding: 0 12px; transition: width .2s; }
.split-bar .i { background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; transition: width .2s; }
.split-bar.bad { outline: 2px solid var(--red); outline-offset: 2px; }
.model-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-pick label { position: relative; display: grid; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.model-pick input { position: absolute; opacity: 0; }
.model-pick label:has(input:checked) { border-color: var(--pine); background: #F6FBF9; }
.model-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.model-pick strong { font-size: 14.5px; }
.model-pick span { font-size: 12.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { .model-pick { grid-template-columns: 1fr; } }
.calc { background: var(--mist); border-radius: 14px; padding: 14px 16px; font-size: 14px; display: grid; gap: 8px; }
.calc .row { display: flex; justify-content: space-between; gap: 12px; }
.calc .row.total { border-top: 1px solid var(--line-strong); padding-top: 8px; font-weight: 700; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--mist); font-size: 13.5px; color: var(--ink-2); }
.note .ic { color: var(--pine); margin-top: 1px; }
.note.warn { background: var(--amber-tint); color: #5C3C06; }
.note.warn .ic { color: var(--amber-ink); }
.locked { position: relative; }
.locked-cover { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 32px 20px; }
.locked-cover .ic { color: var(--muted); }
.audit-old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }

@media (max-width: 600px) { .demo-bar { gap: 12px; font-size: 12px; } .demo-bar > span { display: none; } }

/* ========== MODULE CLINIQUE ========== */
.care-li { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.care-li:first-child { border-top: 0; }
button.care-li:hover { background: #F8FBFA; }
.bed-tag { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--sunk); color: var(--muted); flex: none; }
.bed-tag.on { background: var(--pine-tint); color: var(--pine); }
.mini-card { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--pine-deep); background: var(--paper); flex: none; }
.viewfinder { position: relative; aspect-ratio: 1; width: min(230px, 70%); margin: 6px auto 0; border-radius: 26px; background: #0E1A17; display: grid; place-items: center; color: rgba(255,255,255,.18); overflow: hidden; }
.vf-corner { position: absolute; width: 34px; height: 34px; border: 4px solid #7FD8BE; }
.vf-corner.tl { top: 22px; left: 22px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.vf-corner.tr { top: 22px; right: 22px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.vf-corner.bl { bottom: 22px; left: 22px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.vf-corner.br { bottom: 22px; right: 22px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.vf-line { position: absolute; left: 30px; right: 30px; height: 2px; background: #7FD8BE; box-shadow: 0 0 12px #7FD8BE; top: 30px; animation: scanline 2.2s ease-in-out infinite alternate; }
@keyframes scanline { to { top: calc(100% - 32px); } }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 16px 18px 18px; }
.bedcell { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; align-content: start; background: var(--paper); }
.bedcell.free { border-style: dashed; background: transparent; }
.bc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.bc-who strong { display: block; font-size: 15px; }
.bc-who span { font-size: 12.5px; color: var(--muted); }
.bc-card { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.bc-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-acts .btn { flex: 1; }
.tok { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--sunk); padding: 2px 6px; border-radius: 6px; }
.pcard { width: min(340px, 100%); margin: 0 auto; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--paper); box-shadow: var(--shadow-2); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--pine); color: #CFE6DE; font-size: 12px; }
.pcard-brand { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 800; font-size: 14px; }
.pcard-body { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px; }
.pcard-qr { width: 132px; height: 132px; display: grid; place-items: center; }
.pcard-qr img, .pcard-qr canvas { display: block; }
.pcard-bed { font-size: 20px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; }
.pcard-code { margin-top: 10px; font-weight: 700; font-size: 15px; letter-spacing: .06em; color: var(--pine); }
.pcard-svc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pcard-foot { padding: 10px 14px; border-top: 1px dashed var(--line-strong); font-size: 11.5px; color: var(--muted); }

.t .num { white-space: nowrap; }
.beds { align-items: start; }
.app-body .kpis { grid-template-columns: repeat(3, 1fr); }
.app-body .kpi { padding: 12px 12px; border-left: 1px solid var(--line); border-top: 0; }
.app-body .kpi:first-child { border-left: 0; }
.app-body .kpi .v { font-size: 24px; }

/* ========== v3 : exigences, définitions, alertes, connexion ========== */
.req { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; background: var(--paper); white-space: nowrap; }
.tip { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--muted); font-size: 11px; font-weight: 700; font-style: italic; display: inline-grid; place-items: center; padding: 0; margin-left: 4px; vertical-align: 1px; cursor: help; }
.tip-pop { position: absolute; z-index: 95; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-2); }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.alert-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: 0; }
.alert-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-tint); color: var(--amber-ink); }
.alert-ic.bad { background: var(--red-tint); color: var(--red); }
.alert-ic.info { background: var(--violet-tint); color: var(--violet); }
.alert-row .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--amber-tint); color: #5C3C06; font-size: 13.5px; margin-bottom: 12px; }
.banner .ic { color: var(--amber-ink); margin-top: 1px; }
.banner.bad { background: var(--red-tint); color: #6E1F19; }
.banner.bad .ic { color: var(--red); }
.status-line { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.trail { display: grid; gap: 8px; margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--line); font-size: 13px; }
.trail div b { font-weight: 600; }
.login-box { display: grid; gap: 14px; margin-top: 8px; }
.method { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); text-align: left; width: 100%; }
.method:hover, .method:focus-visible { border-color: var(--pine); }
.method .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--pine-tint); color: var(--pine); flex: none; }
.method strong { display: block; font-size: 15px; }
.method span { font-size: 12.5px; color: var(--muted); }
.slotgrid { display: grid; gap: 4px; }
.slotrow { display: grid; grid-template-columns: 170px repeat(var(--n), minmax(64px, 1fr)); gap: 4px; align-items: stretch; }
.slotrow > .h { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 2px; }
.slotrow > .bedh { font-size: 13.5px; font-weight: 600; padding: 8px 4px; display: flex; flex-direction: column; justify-content: center; }
.slotrow > .bedh span { font-size: 12px; color: var(--muted); font-weight: 400; }
.slot { min-height: 44px; border-radius: 8px; background: var(--mist); display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; align-content: flex-start; }
.pill { border: 0; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.2; font-family: inherit; }
.pill.ok { background: var(--pine-tint); color: var(--pine); } .pill.warn { background: var(--amber-tint); color: var(--amber-ink); }
.pill.bad { background: var(--red-tint); color: var(--red); } .pill.info { background: var(--violet-tint); color: var(--violet); }
.pill.neutral { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.mx { overflow-x: auto; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--pine); font-weight: 700; } .no { color: var(--line-strong); } .part { color: var(--amber-ink); font-weight: 700; }
.bars { display: grid; gap: 10px; }
.barrow { display: grid; grid-template-columns: 150px 1fr 54px; gap: 12px; align-items: center; font-size: 13.5px; }
.barrow .track { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.barrow .track i { display: block; height: 100%; border-radius: 5px; background: var(--pine); }
.barrow .v { text-align: right; font-weight: 600; }
.ro-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.pick label.tile-btn { cursor: pointer; }

/* ========== v4 : revenus et assistance ========== */
:root { --viz-ishid: #2a78d6; --viz-fosa: #1baf7a; }
.chart { display: grid; gap: 10px; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-ishid { background: var(--viz-ishid); } .sw-fosa { background: var(--viz-fosa); }
.chart-plot { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.chart-y { height: var(--h); display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; transform: translateY(-6px); }
.chart-area { position: relative; height: calc(var(--h) + 22px); }
.chart-area .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.chart-area .gl:first-child { background: var(--line-strong); }
.chart-bars { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.bcol { position: relative; border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; cursor: default; font: inherit; color: inherit; }
.bstack { width: min(34px, 70%); display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; min-height: 0; }
.bstack i { display: block; min-height: 2px; }
.bstack i:first-child { border-radius: 4px 4px 0 0; }
.seg-ishid { background: var(--viz-ishid); } .seg-fosa { background: var(--viz-fosa); }
.bstack i.partial { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 3px, transparent 3px 7px); }
.bx { position: absolute; bottom: 0; font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.bcol:hover .bstack, .bcol:focus-visible .bstack { filter: brightness(1.08); }
.btip { position: absolute; bottom: calc(100% - 10px); left: 50%; transform: translateX(-50%); z-index: 5; display: none; flex-direction: column; gap: 4px; min-width: 210px; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-size: 12.5px; text-align: left; white-space: nowrap; }
.bcol:hover .btip, .bcol:focus-visible .btip { display: flex; }
.bcol:first-child .btip, .bcol:nth-child(2) .btip { left: 0; transform: none; }
.bcol:last-child .btip, .bcol:nth-last-child(2) .btip { left: auto; right: 0; transform: none; }
.delta { font-size: 12.5px; font-weight: 600; margin-left: 6px; }
.delta.up { color: var(--pine); } .delta.down { color: var(--red); }
.spark { display: block; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #F6FAF8 !important; }

.assist-bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 9px 16px; font-size: 13.5px; font-weight: 500; position: sticky; top: 0; z-index: 70; }
.assist-bar.observe { background: var(--violet); color: #fff; }
.assist-bar.intervene { background: var(--red); color: #fff; }
.assist-bar b { font-weight: 700; }
.assist-bar button { border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 4px 10px; font-weight: 600; font-size: 13px; }
.assist-bar button:hover { background: rgba(255,255,255,.22); }
body.assist-observe .phone, body.assist-observe .main, body.assist-observe .kiosk-panel { outline: 3px solid var(--violet); outline-offset: -3px; }
body.assist-intervene .phone, body.assist-intervene .main, body.assist-intervene .kiosk-panel { outline: 3px solid var(--red); outline-offset: -3px; }
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 16px 18px; }
.space-card { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.space-card strong { font-size: 14.5px; }
.space-card .acts { display: flex; gap: 6px; }
.space-card .acts .btn { flex: 1; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick label { position: relative; display: grid; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.mode-pick input { position: absolute; opacity: 0; }
.mode-pick label:has(input:checked) { border-color: var(--pine); background: #F6FBF9; }
.mode-pick label:has(input[value=intervene]:checked) { border-color: var(--red); background: #FDF5F4; }
.mode-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mode-pick strong { font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.mode-pick span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .mode-pick { grid-template-columns: 1fr; } }

.bars.share .barrow { grid-template-columns: minmax(110px, 160px) 1fr auto; }
.bars.share .barrow .v { white-space: nowrap; }
.kpi .v.money { font-size: 26px; }

/* ========== v5 : studio de cartes et impression ========== */
.pc { position: relative; overflow: hidden; border-radius: 3mm; box-shadow: 0 0 0 1px rgba(16,36,32,.18); flex: none; }
.pf { position: absolute; box-sizing: border-box; }
.pf-empty { display: grid; place-items: center; width: 100%; height: 100%; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 7pt; }
.studio { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1280px) { .studio { grid-template-columns: minmax(0, 1fr) 300px; } .studio .st-models { grid-column: 1 / -1; } }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }
.st-stage { background: repeating-conic-gradient(var(--sunk) 0 25%, var(--paper) 0 50%) 0 0 / 18px 18px; border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px; display: grid; place-items: center; min-height: 360px; overflow: auto; }
.st-scale { transform-origin: center; }
.pc[data-edit] .pf { cursor: move; }
.pc[data-edit] .pf:hover { outline: 1px dashed rgba(47,111,237,.6); }
.pc[data-edit] .pf.sel { outline: 2px solid #2F6FED; z-index: 3; }
.pc[data-edit] .pf:focus-visible { outline: 2px solid #2F6FED; }
.rh { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #2F6FED; border: 2px solid #fff; border-radius: 2px; cursor: nwse-resize; }
.field-list { display: grid; gap: 4px; }
.field-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: none; text-align: left; font-size: 13.5px; }
.field-list button:hover { background: var(--mist); }
.field-list button[aria-current="true"] { background: var(--pine-tint); border-color: #B9DCCF; font-weight: 600; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px #2F6FED; }
.model-item { display: grid; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); text-align: left; width: 100%; }
.model-item[aria-current="true"] { border-color: var(--pine); box-shadow: 0 0 0 1px var(--pine); }
.model-item .thumb { height: 74px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--mist); }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); }
.card-preview-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 18px; background: var(--mist); border-radius: 14px; }

/* document d'impression : planches A4, cartes à taille réelle, traits de coupe */
.print-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.print-bar .grow { flex: 1; min-width: 200px; }
.sheets { display: grid; gap: 24px; justify-items: center; padding: 24px 12px 60px; background: #DDE3E1; }
.sheet-a4 { width: 210mm; height: 297mm; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.18); position: relative; display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 6mm 10mm 0; font-size: 8pt; color: #555; font-family: var(--font); }
.sheet-grid { flex: 1; display: grid; justify-content: center; align-content: center; gap: 0; }
.cut { position: relative; padding: 2mm; }
.cut::before, .cut::after { content: ''; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(#000, #000) left 0 top 2mm / 1.6mm .2mm no-repeat, linear-gradient(#000, #000) right 0 top 2mm / 1.6mm .2mm no-repeat,
  linear-gradient(#000, #000) left 0 bottom 2mm / 1.6mm .2mm no-repeat, linear-gradient(#000, #000) right 0 bottom 2mm / 1.6mm .2mm no-repeat; }
.cut::after { background:
  linear-gradient(#000, #000) left 2mm top 0 / .2mm 1.6mm no-repeat, linear-gradient(#000, #000) right 2mm top 0 / .2mm 1.6mm no-repeat,
  linear-gradient(#000, #000) left 2mm bottom 0 / .2mm 1.6mm no-repeat, linear-gradient(#000, #000) right 2mm bottom 0 / .2mm 1.6mm no-repeat; }
.cut .pc { box-shadow: none; border-radius: 0; }
.sheet-foot { padding: 0 10mm 5mm; font-size: 7pt; color: #777; font-family: var(--font); display: flex; justify-content: space-between; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  body > #app > *:not(.print-root), .demo-bar, .assist-bar, .print-bar, #toasts { display: none !important; }
  .print-root .sheets { padding: 0; gap: 0; background: #fff; }
  .sheet-a4 { box-shadow: none; break-after: page; }
  .pc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print { .print-root > .note { display: none !important; } }
/* zones dynamiques : étiquette visible en édition uniquement */
.pc[data-edit] .pf[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 0; transform: translateY(-100%); padding: 1px 5px; font: 600 9px/1.4 var(--font); color: #fff; background: rgba(47,111,237,.85); border-radius: 3px 3px 3px 0; white-space: nowrap; pointer-events: none; opacity: 0; }
.pc[data-edit] .pf[data-label]:hover::before, .pc[data-edit] .pf.sel::before { opacity: 1; }
.pc[data-edit] .pf[data-label] { outline: 1px dashed rgba(47,111,237,.45); outline-offset: 0; }
.st-stage.drawing .pc { cursor: crosshair; }
.st-stage.drawing .pf { pointer-events: none; }
.draw-ghost { position: absolute; z-index: 5; border: 2px dashed #2F6FED; background: rgba(47,111,237,.12); pointer-events: none; }
