/* ==========================================================================
   Centre dentaire Nacre — gestion du cabinet (démo Démesure)
   Barre latérale lagon profond, contenu perle. Sur téléphone : barre d'onglets en bas.
   ========================================================================== */

html { overflow-x: clip; }
body.ad { background: var(--pearl); }

/* ---------- Coque ----------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 34px); background: linear-gradient(90deg, var(--lagoon-d) 236px, transparent 236px); }
/* collée en haut : visible en entier sous la barre de démo, puis sur toute la hauteur une fois la page défilée */
.side { position: sticky; top: 0; align-self: start; height: calc(100vh - var(--bar, 34px)); height: calc(100dvh - var(--bar, 34px)); overflow-y: auto; display: flex; flex-direction: column; gap: 26px; padding: 22px 14px 22px; background: var(--lagoon-d); color: rgba(255, 255, 255, .8); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: #fff; }
.side__brand svg { width: 34px; height: 34px; flex: none; }
.side__brand b { display: block; font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 25px; line-height: 1; letter-spacing: -.045em; }
.side__brand small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: rgba(255, 255, 255, .72); font-weight: 650; font-size: 14.5px; text-decoration: none; transition: background-color .2s, color .2s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current="page"] { background: var(--pearl); color: var(--lagoon-d); }
.nav .i { width: 20px; height: 20px; }
.nav__short { display: none; }
.nav__badge { margin-left: auto; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; }
.nav__badge--warn { background: var(--amber); color: var(--lagoon-dd); }
.side__foot { margin-top: auto; display: grid; gap: 12px; padding: 0 6px; }
.side__live { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.35; color: rgba(255, 255, 255, .6); }
.side__live .live-dot { background: var(--mint); }
.side__live .live-dot::after { border-color: var(--mint); }
.side__reset { justify-self: start; background: transparent; border-color: rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .82); }
.side__reset:hover { border-color: rgba(255, 255, 255, .55); color: #fff; }

.main { min-width: 0; padding: 24px clamp(16px, 2.6vw, 34px) 70px; outline: none; }
.topbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.topbar__date { color: var(--lagoon); margin-bottom: 6px; }
.topbar h1 { font-size: clamp(30px, 3vw, 40px); }
.topbar__r { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Blocs ------------------------------------------------------------------------ */
.grid { display: grid; gap: 16px; min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px; }
.panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.panel__head h2 { font-size: 21px; }
.panel__sub { color: var(--ink-3); font-size: 13px; }
.empty { padding: 18px; border-radius: 12px; background: var(--pearl); color: var(--ink-3); text-align: center; font-size: 14px; }
.muted { color: var(--ink-3); }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; background: var(--mint-soft); color: var(--lagoon-d); font-size: 14px; line-height: 1.45; }
.insight .i { color: var(--lagoon); margin-top: 1px; }
.insight--warn { background: var(--amber-soft); color: #5d3d04; }
.insight--warn .i { color: var(--amber-ink); }
.insight b { font-weight: 800; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 15px 17px; }
.kpi .mono { color: var(--ink-3); }
.kpi b { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.02; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--ink-2); font-size: 12.5px; }
.kpi--lagoon { background: var(--nacre-dark); border-color: transparent; color: #fff; }
.kpi--lagoon .mono, .kpi--lagoon small { color: rgba(255, 255, 255, .7); }
.kpi.is-bump b { animation: bump .7s var(--ease); }
@keyframes bump { 35% { transform: scale(1.08); color: var(--coral); } }
.bar { height: 7px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--lagoon); transition: width .6s var(--ease); }

/* ---------- Accueil : la file -------------------------------------------------------------- */
.home { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "kpi kpi" "queue side" "strip strip"; gap: 16px; align-items: start; }
.home > .kpis { grid-area: kpi; }
.home > .q { grid-area: queue; }
.home > .home__side { grid-area: side; display: grid; gap: 16px; min-width: 0; }
.home > .strip-card { grid-area: strip; }

.q { padding: 18px 18px 8px; }
.q__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q__head h2 { font-size: 21px; }
.q__live { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-size: 12.5px; font-weight: 700; }
.chairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.chair { position: relative; display: grid; gap: 1px; justify-items: start; min-width: 0; padding: 10px 11px 10px; border: 1.5px solid var(--line); border-radius: 15px; background: var(--paper); text-align: left; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.chair:hover { border-color: var(--ink-3); }
.chair[aria-pressed="true"] { border-color: var(--lagoon); background: var(--mint-soft); box-shadow: 0 0 0 3px rgba(15, 110, 122, .12); }
.chair__k { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.chair__k i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chair__n { font-family: var(--display); font-weight: 800; font-stretch: 76%; font-size: 34px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.chair__who { max-width: 100%; overflow: hidden; color: var(--ink-2); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chair__left { font-size: 11.5px; font-weight: 700; color: var(--lagoon); }
.chair__left.is-free { color: var(--ok); }
.chair.is-new { animation: chairnew 2.4s var(--ease); }
@keyframes chairnew { 0%, 35% { background: var(--coral-soft); border-color: var(--coral); } }

.callbtn { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; width: 100%; min-height: 76px; margin-top: 12px; padding: 12px 14px 12px 20px; border: 0; border-radius: 20px; background: var(--lagoon); color: #fff; text-align: left; box-shadow: 0 16px 34px -18px rgba(15, 110, 122, .95), inset 0 1px 0 rgba(255, 255, 255, .18); overflow: hidden; isolation: isolate; transition: background-color .2s, transform .25s var(--ease); }
.callbtn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 46%, transparent 62%); transform: translateX(-100%); animation: sheen 6s var(--ease) 1.5s infinite; }
.callbtn:hover { background: var(--lagoon-d); }
.callbtn:active { transform: scale(.985); }
.callbtn:disabled { opacity: .5; }
.callbtn b { display: block; font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 25px; line-height: 1.05; letter-spacing: -.02em; }
.callbtn small { display: block; margin-top: 3px; overflow: hidden; color: rgba(255, 255, 255, .78); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.callbtn__n { display: grid; place-items: center; min-width: 58px; height: 52px; padding: 0 10px; border-radius: 15px; background: #fff; color: var(--lagoon-d); font-family: var(--display); font-weight: 800; font-stretch: 76%; font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.callbtn__n small { display: none; }
.callbtn.is-press { animation: press .5s var(--ease); }
@keyframes press { 30% { transform: scale(.97); background: var(--coral); } }

.qlist { display: flex; flex-direction: column; margin-top: 10px; }
.qlist__h { display: flex; justify-content: space-between; padding: 8px 2px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.qrow { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px; border-top: 1px solid var(--line); background: var(--paper); text-align: left; width: 100%; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0; }
.qrow:hover { background: #fbfaf7; }
.qrow__n { display: grid; place-items: center; width: 50px; height: 44px; border-radius: 13px; background: var(--pearl); font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.qrow.is-head .qrow__n { background: var(--lagoon); color: #fff; }
.qrow.is-off .qrow__n { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-3); }
.qrow__main { min-width: 0; }
.qrow__main b { display: block; overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.qrow__main small { display: block; overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.qrow__side { display: grid; justify-items: end; gap: 4px; }
.qrow__st { display: none !important; }
.qrow__eta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.qrow__rule { grid-column: 2 / -1; justify-self: start; margin-top: -2px; padding: 3px 9px; border-radius: 8px; background: var(--pearl); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.qrow.is-new { animation: flash 2.4s var(--ease); }
.qlist__more { padding: 10px 4px 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }

/* À traiter, rappels, activité */
.todo { display: flex; flex-direction: column; }
.todo__it { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.todo__it:first-child { border-top: 0; padding-top: 2px; }
.todo__ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--mint-soft); color: var(--lagoon); }
.todo__ico--warn { background: var(--amber-soft); color: var(--amber-ink); }
.todo__ico--coral { background: var(--coral-soft); color: var(--coral-d); }
.todo__main { flex: 1; min-width: 0; }
.todo__main b { display: block; font-size: 14px; line-height: 1.3; }
.todo__main small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.todo__it .btn { flex: none; }
.todo__it.is-new { animation: flash 2.4s var(--ease); }

.rem { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rem div { padding: 10px 12px; border-radius: 13px; background: var(--pearl); min-width: 0; }
.rem b { display: block; font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.rem small { color: var(--ink-2); font-size: 12px; }
.rem .is-ok b { color: var(--ok); }
.rem .is-warn b { color: var(--amber-ink); }
.rem .is-late b { color: var(--coral-d); }

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow: auto; }
.feed__it { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 11px; border-radius: 12px; background: var(--pearl); font-size: 13.5px; line-height: 1.4; }
.feed__it .i { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--paper); color: var(--lagoon); }
.feed__it.is-coral .i { color: var(--coral); }
.feed__it time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed__it.is-new { animation: flash 2.4s var(--ease); }

/* Bande d'agenda du jour : un ruban par fauteuil */
.strip { display: grid; gap: 8px; }
.strip__row { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; }
.strip__who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 700; }
.strip__who .av { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.strip__who small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11px; }
.strip__lane { position: relative; height: 34px; border-radius: 10px; background: repeating-linear-gradient(90deg, var(--pearl) 0 calc(100% / 28.5 - 1px), var(--sand) 0 calc(100% / 28.5)); overflow: hidden; }
.strip__b { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: var(--c); opacity: .85; }
.strip__b.is-done { opacity: .35; }
.strip__b.is-moved { background: transparent; box-shadow: inset 0 0 0 1.5px var(--amber); opacity: 1; }
.strip__b.is-live { box-shadow: 0 0 0 2px var(--coral); opacity: 1; }
.strip__lunch { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(15, 29, 36, .05) 0 4px, transparent 4px 8px); }
.strip__now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--coral); border-radius: 2px; }
.strip__axis { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.strip__axis > span { position: relative; height: 15px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.strip__axis i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.strip__axis i.is-start { transform: none; }
.strip__axis i.is-end { transform: translateX(-100%); }

/* ---------- Agenda ----------------------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar__sp { flex: 1; }
.ibtn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); }
.ibtn:hover { border-color: var(--ink-3); }
.ibtn .i { width: 18px; height: 18px; }
.daylabel { font-family: var(--display); font-weight: 750; font-stretch: 82%; font-size: 22px; letter-spacing: -.02em; }

.ag { --k: 1.5px; display: grid; grid-template-columns: 52px repeat(3, minmax(0, 1fr)); gap: 0 8px; min-width: 0; }
.ag__h { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 4px 10px; background: var(--pearl); font-size: 13px; font-weight: 700; }
.ag__h .av { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.ag__h span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag__h small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
.ag__axis { position: relative; height: calc(570 * var(--k)); }
.ag__axis span { position: absolute; right: 4px; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.ag__col { position: relative; height: calc(570 * var(--k)); border-radius: 12px; background: repeating-linear-gradient(180deg, var(--paper) 0 calc(20 * var(--k) - 1px), var(--line) 0 calc(20 * var(--k))); box-shadow: inset 0 0 0 1px var(--line); }
.ag__lunch { position: absolute; left: 0; right: 0; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--pearl) 0 6px, var(--sand) 6px 12px); color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.ag__free { position: absolute; left: 3px; right: 3px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: transparent; font-size: 12px; font-weight: 700; transition: background-color .15s, color .15s; }
.ag__free:hover, .ag__free:focus-visible { background: var(--mint-soft); color: var(--lagoon); }
.ag__a { position: absolute; left: 3px; right: 3px; display: block; overflow: hidden; padding: 4px 8px; border: 0; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 13%, #fff); text-align: left; font-size: 12px; line-height: 1.25; color: var(--ink); box-shadow: 0 1px 0 rgba(15, 29, 36, .05); transition: transform .2s var(--ease), box-shadow .2s; }
.ag__a:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -10px rgba(15, 29, 36, .4); z-index: 2; }
.ag__a b { display: block; overflow: hidden; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.ag__a small { display: block; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.ag__a.is-done { opacity: .55; }
.ag__a.is-walk { border-left-style: dotted; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, #fff) 0 5px, color-mix(in srgb, var(--c) 16%, #fff) 5px 10px); }
.swatch--walk { --c: var(--lagoon); background: repeating-linear-gradient(135deg, #e3f1ee 0 3px, #bfe0d8 3px 6px) !important; }
.strip__b.is-walk { opacity: .55; background: repeating-linear-gradient(135deg, var(--c) 0 4px, color-mix(in srgb, var(--c) 45%, #fff) 4px 8px); }
.strip__b.is-walk.is-done { opacity: .3; }
.ag__a.is-moved { border-left-color: var(--amber); background: repeating-linear-gradient(135deg, #fffaf0 0 6px, var(--amber-soft) 6px 12px); color: var(--amber-ink); }
.ag__a.is-online { box-shadow: inset 0 0 0 1.5px var(--c); }
.ag__a.is-new { animation: agnew 2.6s var(--ease); }
@keyframes agnew { 0%, 35% { box-shadow: 0 0 0 3px var(--coral); } }
.ag__dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; }
.ag__dot--wait { background: var(--amber); }
.ag__dot--online { background: var(--ok); }
.ag__now { position: absolute; left: -6px; right: 0; z-index: 2; height: 2px; background: var(--coral); pointer-events: none; }
.ag__now::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.week { overflow-x: auto; }
.week table { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 6px; }
.week th { font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 4px; }
.week td { padding: 0; }
.wcell { display: grid; gap: 2px; width: 100%; min-height: 58px; padding: 8px 10px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--lagoon) calc(var(--p) * 1%), var(--paper)); color: var(--ink); text-align: left; box-shadow: inset 0 0 0 1px var(--line); }
.wcell b { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 20px; line-height: 1; }
.wcell small { font-size: 11.5px; color: inherit; opacity: .8; }
.wcell.is-hi { color: #fff; }
.wcell.is-off { background: repeating-linear-gradient(135deg, var(--pearl) 0 6px, var(--sand) 6px 12px); color: var(--ink-3); }
.wcell.is-today { box-shadow: inset 0 0 0 2px var(--coral); }
.wcell .ws { display: none; }
.week th.is-today { color: var(--coral-d); }
.week__who { display: flex; align-items: center; gap: 8px; font-family: var(--text); font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.week__who .av { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.week__who small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.wcell.is-new { animation: agnew 2.6s var(--ease); }

/* ---------- Patients et plans ----------------------------------------------------------------------- */
.search { position: relative; flex: 1 1 220px; min-width: 0; }
.search .i { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); }
.search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 15px; }
.search input:focus { outline: none; border-color: var(--lagoon); box-shadow: 0 0 0 4px rgba(15, 110, 122, .12); }

.prow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px 6px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.prow:first-child { border-top: 0; }
.prow:hover { background: #fbfaf7; }
.prow__main { min-width: 0; }
.prow__main b { display: block; overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.prow__main small { display: block; overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.prow__side { display: grid; justify-items: end; gap: 4px; font-size: 12.5px; }
.prow__side .amt { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.prow.is-new { animation: flash 2.4s var(--ease); }
.prow--hero { padding: 14px; border: 1.5px solid var(--lagoon); border-radius: 16px; background: var(--nacre); }
.more { justify-self: center; margin-top: 8px; }

/* Éditeur de plan (tiroir) */
.pe { display: grid; gap: 14px; }
.pe__arch { position: relative; max-width: 380px; width: 100%; margin: 0 auto; }
.pe__arch .arch { max-height: 380px; }
.pe__hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52%; color: var(--ink-3); font-size: 12.5px; line-height: 1.35; text-align: center; pointer-events: none; }
.pe__tooth { display: grid; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--pearl); }
.pe__tooth > b { font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.acts button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 700; }
.acts button small { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--ink-3); }
.acts button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, #fff); }
.plines { display: flex; flex-direction: column; }
.plines li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.plines li:first-child { border-top: 0; }
.plines b { font-family: var(--mono); font-size: 12.5px; font-weight: 400; white-space: nowrap; }
.plines button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); }
.plines button:hover { background: var(--coral-soft); color: var(--coral-d); }
.plines button .i { width: 16px; height: 16px; }
.plines li.is-new { animation: flash 2.4s var(--ease); }
ul.plines, ul.ptr { margin: 0; padding: 0; list-style: none; }
.ptotal { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 14px 16px; border-radius: 16px; background: var(--nacre-dark); color: #fff; }
.ptotal span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.ptotal b { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 34px; letter-spacing: -.02em; white-space: nowrap; }
.ptotal small { width: 100%; color: rgba(255, 255, 255, .72); font-size: 12.5px; }
.ptr { display: grid; gap: 8px; }
.ptr li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.ptr i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-soft); color: var(--lagoon); font-style: normal; font-weight: 800; font-size: 13px; }
.ptr li.is-paid i { background: var(--ok); color: #fff; }
.ptr__l { min-width: 0; }
.ptr__l b { display: block; overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.ptr__l small { display: block; color: var(--ink-3); font-size: 12px; }
.ptr input[type="date"] { width: 100%; max-width: 170px; height: 36px; margin-top: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 16px; font-family: var(--text); color: var(--ink); }
.ptr__amt { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; text-align: right; }
.ptr__amt small { display: block; color: var(--ok); font-family: var(--text); font-size: 11.5px; font-weight: 700; }
.pstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pstatus.is-new .tag { animation: tagnew 2.4s var(--ease); }
@keyframes tagnew { 0%, 35% { box-shadow: 0 0 0 4px rgba(47, 155, 116, .35); } }
.sendbar { display: grid; gap: 8px; padding-top: 4px; }

/* ---------- Paiements --------------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.modes { display: grid; gap: 10px; }
.mode { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; }
.mode .bar { height: 12px; }
.mode b { font-family: var(--mono); font-size: 12.5px; font-weight: 400; white-space: nowrap; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .col { fill: var(--mint); }
.chart .col.is-hi { fill: var(--lagoon); }
.chart .col.is-part { fill: url(#hatch); }
.chart text { font-family: var(--mono); font-size: 12px; fill: var(--ink-3); }
.chart .val { fill: var(--ink-2); font-size: 11.5px; }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.trow__main { min-width: 0; }
.trow__main b { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.trow__main small { display: block; color: var(--ink-3); font-size: 12.5px; }
.nw { white-space: nowrap; }
.trow__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.trow__amt { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.trow__meta, .trow__btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.trow.is-new { animation: flash 2.4s var(--ease); }
.prog { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.prog:first-child { border-top: 0; }
.prog b { display: block; overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.prog small { display: block; color: var(--ink-3); font-size: 12px; }
.prog__r { display: grid; gap: 4px; text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.pmodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pmodes button { min-height: 50px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-weight: 700; }
.pmodes button[aria-pressed="true"] { border-color: var(--lagoon); background: var(--mint-soft); color: var(--lagoon-d); }

.chart .colg.is-hover .col { fill: var(--lagoon-d); }
.chart .colg.is-hover .val { fill: var(--ink); font-weight: 700; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.tip { position: fixed; left: 0; top: 0; z-index: 90; max-width: 260px; padding: 8px 11px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.35; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); pointer-events: none; }
.tip[hidden] { display: none; }
.tip b { display: block; font-size: 11px; font-family: var(--mono); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--mint); }
.trow.is-late .trow__main small { color: var(--amber-ink); }

/* ---------- Labo et stock ------------------------------------------------------------------------------ */
.lab { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.lab:first-child { border-top: 0; }
.lab__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mint-soft); color: var(--lagoon); }
.lab.is-late .lab__ico { background: var(--amber-soft); color: var(--amber-ink); }
.lab__main { min-width: 0; }
.lab__main b { display: block; font-size: 14px; }
.lab__main small { display: block; color: var(--ink-3); font-size: 12.5px; }
.lab__side { display: grid; justify-items: end; gap: 6px; }
.lab__acts { grid-column: 2 / -1; margin-top: -2px; }
.saved__bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; margin-left: auto; flex: none; }
.saved__bars span { display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 4px; height: 100%; width: 30px; }
.saved__bars i { position: relative; align-self: end; width: 100%; border-radius: 7px 7px 3px 3px; background: var(--mint); }
.saved__bars span:last-child i { background: var(--lagoon); }
.saved__bars em { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 11px; font-style: normal; color: var(--ink-2); }
.saved__bars small { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock { display: grid; grid-template-columns: minmax(0, 1fr) 150px 90px; align-items: center; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.stock:first-child { border-top: 0; }
.stock__l b { display: block; font-weight: 700; }
.stock__l small { display: block; color: var(--ink-3); font-size: 12px; }
.stock .bar { position: relative; height: 10px; overflow: visible; }
.stock .bar i { background: var(--ok); }
.stock .bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-2); border-radius: 2px; }
.stock.is-low .bar i { background: var(--coral); }
.stock__q { font-family: var(--mono); font-size: 12px; text-align: right; white-space: nowrap; }
.stock__order { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 14px; border-radius: 14px; background: var(--amber-soft); color: #5d3d04; }
.stock__order b { display: block; }
.stock__order small { display: block; font-size: 12.5px; }
.stock__order.is-done { background: var(--ok-soft); color: #1d5a43; }
.saved { display: flex; align-items: center; gap: 18px; padding: 18px 20px; }
.saved b { font-family: var(--display); font-weight: 800; font-stretch: 76%; font-size: 64px; line-height: .9; letter-spacing: -.03em; color: var(--lagoon); }
.saved p { color: var(--ink-2); font-size: 14px; }
.saved p strong { display: block; color: var(--ink); font-size: 16px; }

/* ---------- Tiroir ---------------------------------------------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; overflow: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(8, 38, 45, .4); opacity: 0; transition: opacity .3s; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(540px, 100%); background: var(--paper); box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .45); transform: translateX(102%); transition: transform .45s var(--ease); outline: none; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__close { position: relative; z-index: 5; flex: none; align-self: flex-end; display: grid; place-items: center; width: 44px; height: 44px; margin: 12px 14px 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 2px 22px 36px; border-top: 1px solid transparent; }
.drawer__body h2 { font-size: 28px; }
.drawer__body h3 { font-size: 17px; }
.dhead { display: flex; align-items: center; gap: 12px; }
.dhead .av { width: 48px; height: 48px; border-radius: 16px; font-size: 17px; }
.dhead h2 { padding-right: 0; font-size: 25px; }
.dhead small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.facts div { min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--pearl); font-size: 13.5px; }
.facts span { display: block; color: var(--ink-3); font-size: 11.5px; }
.facts b { display: block; overflow-wrap: anywhere; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lbl { display: grid; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
select.input { appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b898e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; padding-right: 40px; }

/* Toasts au-dessus de tout */
.toast-stack { z-index: 95; }

/* Bascule « Site patient | Gestion cabinet » : jamais posée sur les listes.
   Ordinateur : dans le pied de la barre latérale. Téléphone : dans le flux, en pied de page. */
.pmode--side, .pmode--flow { position: static; transform: none; z-index: auto; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.pmode--side { align-self: stretch; background: rgba(4, 28, 33, .55); }
.pmode--side a { flex: 1 1 0; height: 38px; padding: 0 8px; font-size: 12.5px; }
.mfoot { display: none; }
@media (max-width: 860px) {
  .mfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line); }
  .pmode--flow { background: var(--ink); }
  .mfoot__reset { background: transparent; }
}
@media (max-width: 400px) { .mfoot { justify-content: center; } }
.is-embed .mfoot { display: none !important; }

/* ---------- Écrans moyens -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "queue" "kpi" "side" "strip"; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Téléphone : barre d'onglets en bas ----------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); min-height: 0; background: none; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; height: auto; flex-direction: row; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); overflow: hidden; background: rgba(12, 59, 68, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .side__brand, .side__foot { display: none; }
  .nav { flex: 1; flex-direction: row; gap: 2px; min-width: 0; }
  .nav a { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; height: 56px; min-height: 0; padding: 0 2px; border-radius: 14px; font-size: 11px; font-weight: 700; text-align: center; }
  .nav a > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
  .nav a[aria-current="page"] .i { color: var(--mint); }
  .nav__long { display: none; }
  .nav__short { display: inline; }
  .nav__badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; margin: 0; padding: 0 5px; font-size: 11px; }
  .main { padding: 16px 14px calc(100px + env(safe-area-inset-bottom, 0px)); }
  .toast-stack { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); align-items: stretch; }
  .toast { max-width: none; }
  .topbar { margin-bottom: 14px; }
  .topbar__r { display: none; }
  .search input, .input, select.input, textarea { font-size: 16px; }
  .drawer__panel { width: 100%; }
}
@media (max-width: 480px) {
  .q { padding: 14px 12px 6px; }
  .chairs { gap: 6px; }
  .chair { padding: 8px 9px; border-radius: 13px; }
  .chair__k { font-size: 9.5px; letter-spacing: .02em; white-space: nowrap; }
  .chair__n { font-size: 30px; }
  .chair__pr, .chair__lw { display: none; }
  .chair__left { white-space: nowrap; }
  .callbtn { min-height: 70px; padding-left: 16px; border-radius: 18px; }
  .callbtn b { font-size: 22px; }
  .qrow { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; min-height: 56px; }
  .qrow__n { width: 44px; height: 42px; font-size: 22px; }
  .qrow__side .tag { display: none; }
  .qrow__st { display: inline-flex !important; margin-top: 3px; height: 20px; font-size: 11px; padding: 0 7px; }
  .qrow__rule { font-size: 11.5px; }
  .prow { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
  .prow__side { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 4px 10px; min-width: 0; }
  .prow--hero { min-width: 0; }
}
@media (max-width: 640px) {
  .trow { grid-template-columns: minmax(0, 1fr); }
  .trow__side { justify-content: space-between; }
  .trow__meta { justify-content: flex-start; }
  .trow__btns { flex-wrap: nowrap; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi b { font-size: 22px; white-space: nowrap; }
  .kpi small { font-size: 11.5px; }
  .week table { min-width: 0; table-layout: fixed; border-spacing: 3px; }
  .week th:first-child { width: 44px; }
  .week__who > span:last-child { display: none; }
  .week__who .av { width: 32px; height: 32px; }
  .wcell { min-height: 54px; padding: 6px 5px; border-radius: 10px; }
  .wcell b { font-size: 15px; }
  .wcell .wl { display: none; }
  .wcell .ws { display: inline; }
  .week th { padding: 0 2px; font-size: 9.5px; letter-spacing: 0; }
  .ag { --k: 2.3px; grid-template-columns: 38px repeat(3, minmax(0, 1fr)); gap: 0 4px; }
  .seg button { height: 44px; }
  .ag__h { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 2px 8px; font-size: 11.5px; }
  .ag__h small { font-size: 10.5px; }
  .ag__a { padding: 3px 5px; border-left-width: 3px; font-size: 11px; }
  .ag__free { color: rgba(15, 110, 122, .22); }
  .strip__row, .strip__axis { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
  .strip__who .av { display: none; }
  .strip__axis i:nth-child(2), .strip__axis i:nth-child(4), .strip__axis i:nth-child(5) { display: none; }
  .stock { grid-template-columns: minmax(0, 1fr) 70px; }
  .stock .bar { grid-column: 1 / -1; grid-row: 2; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .rem b { font-size: 24px; }
  .prog { grid-template-columns: minmax(0, 1fr) 96px; }
  .lab { grid-template-columns: 40px minmax(0, 1fr); }
  .lab__side { grid-column: 2; justify-items: start; }
  .saved b { font-size: 48px; }
  .saved { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px 16px; }
  .saved p { grid-column: 1 / -1; grid-row: 2; }
  .saved__bars { justify-self: end; height: 64px; margin-top: 16px; }
  .saved__bars span { width: 26px; }
  .kpis.kpis--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.kpis--3 > :last-child { grid-column: 1 / -1; }
  .drawer__body { padding: 20px 16px 32px; }
}

/* ---------- Intégré (page « en direct ») : seulement l'écran de l'accueil -------------------------------- */
.is-embed .shell { min-height: 100vh; }
@media (min-width: 861px) { .is-embed .side { height: 100vh; height: 100dvh; } }
.is-embed .side { padding-bottom: 18px; }
.is-embed .topbar__r { display: none; }
@media (max-width: 860px) {
  .is-embed .main { padding-top: 12px; }
  .is-embed .topbar { margin-bottom: 10px; }
  .is-embed .topbar h1 { font-size: 26px; }
  .is-embed .topbar__date { margin-bottom: 3px; font-size: 10px; }
  .is-embed .main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Téléphone : la notification se pose sur la barre d'onglets ------------------------------------
   Pleine largeur, collée à la barre, opaque : aucune ligne de la liste ne passe sur les côtés ni dessous,
   elle se dévoile par le bas (sans fondu) et repart de même. Tiroir ouvert : la carte flottante d'origine. */
@media (max-width: 860px) {
  html:not(:has(.drawer.is-open)) .toast-stack { left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); gap: 0; }
  html.is-embed:not(:has(.drawer.is-open)) .toast-stack { bottom: 80px; }
  html:not(:has(.drawer.is-open)) .toast { gap: 12px; padding: 14px 20px 15px; border-radius: 20px 20px 0 0; background: #0f1d24; box-shadow: 0 -16px 32px -20px rgba(15, 29, 36, .55); clip-path: inset(-60px -60px 0 -60px round 20px 20px 0 0); animation: toast-dock .42s var(--ease); }
  html:not(:has(.drawer.is-open)) .toast.is-out { clip-path: inset(100% -60px 0 -60px round 20px 20px 0 0); transform: none; }
  html:not(:has(.drawer.is-open)) .toast + .toast { display: none; }
}
@keyframes toast-dock { from { clip-path: inset(100% -60px 0 -60px round 20px 20px 0 0); } }
