:root {
  --bg: #eef0f3; --panel: #fff; --ink: #14161a; --muted: #5b6270; --line: #d9dde3; --soft: #f4f6f9;
  --urgent: #d7263d; --semaine: #e07f00; --standard: #1f9d55;
  --accent: #1b4dd8; --ok: #146c3b; --ok-bg: #e8f6ee; --bad-bg: #fde7ea; --bad: #8a1020;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }

/* ---------- Barre du haut ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: #fff; }
.top .brand { font-weight: 800; text-decoration: none; color: #fff; white-space: nowrap; }
.top .search { flex: 1; min-width: 0; }
.top .search input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: #2a2e36; color: #fff; font-size: 16px; }
.top .search input::placeholder { color: #9aa3b2; }
.top .who { font-size: 14px; color: #cfd4dc; white-space: nowrap; background: none; border: 0; padding: 6px; }
.top .nav { display: flex; gap: 6px; }
.top .nav a { color: #cfd4dc; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.top .nav a.on { background: #fff; color: var(--ink); }
.top .plus, .top .nav a.plus.on { background: var(--accent); color: #fff; }
@media (max-width: 640px) { .top { flex-wrap: wrap; } .top .search { order: 5; flex-basis: 100%; } .top .nav a.txt, .top .nav .txt { display: none; } }

main { padding: 16px; max-width: 1700px; margin: 0 auto; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---------- Boutons ---------- */
.big { display: block; width: 100%; font-size: 21px; font-weight: 800; padding: 18px 14px; border-radius: var(--radius); border: 0; background: var(--accent); color: #fff; text-align: center; }
.big small { display: block; font-size: 14px; font-weight: 600; opacity: .85; margin-top: 3px; }
.big.green { background: var(--standard); }
.big.dark { background: var(--ink); }
.big.red { background: var(--urgent); }
.btn { display: inline-block; font-weight: 700; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); text-align: center; text-decoration: none; }
.btn.small { font-size: 14px; padding: 8px 10px; border-radius: 9px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warn { border-color: #f3b3bc; color: var(--urgent); }
.btn.ghost { border-color: transparent; background: transparent; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stack > * + * { margin-top: 8px; }

/* ---------- Cartes / panneaux ---------- */
.panel { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.panel + .panel { margin-top: 12px; }
.h { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.muted { color: var(--muted); }
.msg { border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 15px; margin: 10px 0; }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: #eef2ff; color: #22308a; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--urgent); }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 12px; }
.field > label, .lbl-t { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.field input, .field select, .field textarea, input.in, select.in { width: 100%; font-size: 16px; padding: 11px 12px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, input.in:focus { outline: none; border-color: var(--accent); }
.field input.filled { border-color: var(--standard); background: #f3fbf6; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.choice button { font-weight: 800; padding: 12px 6px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.choice button.on { border-color: var(--accent); background: #eef2ff; color: #22308a; }
.choice button.on.urgent { border-color: var(--urgent); background: var(--bad-bg); color: var(--bad); }
.choice button.on.semaine { border-color: var(--semaine); background: #fff4e5; color: #8a4f00; }
.choice button.on.standard { border-color: var(--standard); background: var(--ok-bg); color: var(--ok); }
details.more { margin: 8px 0 14px; }
details.more summary { font-weight: 700; color: var(--accent); cursor: pointer; padding: 6px 0; }
.auto { background: #f3fbf6; border: 1px solid #bfe6cd; border-radius: 12px; padding: 12px; font-size: 15px; line-height: 1.6; }
.auto b { color: var(--ok); }

/* ---------- Tableau ---------- */
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.board-head h1 { margin: 0; font-size: 22px; }
.kanban { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; }
.card { display: block; background: #fff; border-radius: 12px; padding: 10px 10px 10px 16px; margin-bottom: 8px; position: relative; color: inherit; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 12px 0 0 12px; background: var(--p); }
.card .c { font-weight: 800; font-size: 16px; }
.card .d { font-size: 14px; color: var(--muted); margin-top: 2px; }
.card .due { font-weight: 800; font-size: 15px; margin-top: 6px; }
.card .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.no { background: var(--bad-bg); color: var(--bad); }
.chip.run { background: var(--accent); color: #fff; }
.card.late { outline: 3px solid var(--urgent); }
.card.late .due { color: var(--urgent); }
.card.soon .due { color: #b35f00; }
@media (max-width: 640px) { .kanban { grid-template-columns: 1fr; overflow: visible; } .col.vide { display: none; } }
.empty { color: var(--muted); font-size: 14px; padding: 10px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; }
.p-urgent { --p: var(--urgent); } .p-semaine { --p: var(--semaine); } .p-standard { --p: var(--standard); }

/* Écran atelier (lecture seule, grand format) */
body.tv { background: #0f1115; color: #f2f4f7; }
body.tv .top { display: none; }
body.tv main { max-width: none; }
body.tv .board-head h1 { font-size: 30px; }
body.tv .board-head .clock { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.tv .col h3 { color: #9aa3b2; font-size: 15px; }
body.tv .card { background: #1d222b; color: #f2f4f7; box-shadow: none; }
body.tv .card .d { color: #b7bfcc; }
body.tv .chip { background: #2c323d; color: #cfd6e2; }
body.tv .chip.ok { background: #14432a; color: #9be3b8; }
body.tv .chip.no { background: #4a1520; color: #ffb3bf; }
body.tv .empty { border-color: #2c323d; }
body.tv .card.late .due { color: #ff6b7d; }

/* ---------- Page commande ---------- */
.order { max-width: 760px; margin: 0 auto; }
.o-top { color: #fff; background: var(--p); border-radius: var(--radius); padding: 16px; }
.o-top .row1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 14px; }
.o-top h1 { margin: 8px 0 2px; font-size: 26px; line-height: 1.15; }
.o-top .proj { font-size: 16px; opacity: .95; }
.o-top .date { margin-top: 10px; font-size: 30px; font-weight: 900; }
.o-top.annulee { background: #6b7280; }
.steps { display: flex; gap: 4px; margin: 14px 0 6px; }
.steps i { flex: 1; height: 9px; border-radius: 5px; background: var(--line); }
.steps i.ok { background: var(--standard); } .steps i.na { background: #b9c0cc; } .steps i.cur { background: var(--accent); }
.where { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.where b { color: var(--ink); }
.todo-list > * + * { margin-top: 8px; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.task .t { font-weight: 800; }
.task .s { font-size: 13px; color: var(--muted); }
.task .acts { display: flex; gap: 6px; }
@media (max-width: 520px) { .task { grid-template-columns: 1fr; } .task .acts > * { flex: 1; } }
.task.done { border-color: #bfe6cd; background: #f3fbf6; }
.task.running { border-color: var(--accent); background: #eef2ff; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.art { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.art .t { font-weight: 800; font-size: 17px; }
.art .s { color: var(--muted); font-size: 14px; }
.art-head { display: flex; gap: 12px; align-items: flex-start; }
.art-head img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--soft); }
.zones { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.zone { font-size: 13px; font-weight: 700; padding: 5px 8px; border-radius: 6px; background: #eef2ff; color: #22308a; }
table.sizes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sizes td, .sizes th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: center; font-size: 16px; }
.sizes th { font-size: 12px; color: var(--muted); font-weight: 700; }
.sizes td:first-child { font-weight: 800; text-align: left; }
.sizes tfoot td { font-weight: 800; border-bottom: 0; }
.sizes .ok { color: var(--ok); font-weight: 800; }
.sizes .bad { color: var(--urgent); font-weight: 800; }
.sizes input { width: 64px; padding: 6px; font-size: 16px; text-align: center; border: 2px solid var(--line); border-radius: 8px; }
.cell-btn { font-size: 14px; font-weight: 700; padding: 7px 9px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; }
.cell-btn.soft { background: var(--ok-bg); color: var(--ok); }
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi div { background: #fff; border-radius: 10px; padding: 10px; text-align: center; }
.kpi b { display: block; font-size: 22px; }
.kpi span { font-size: 12px; color: var(--muted); }
.hist { font-size: 14px; color: var(--muted); line-height: 1.5; list-style: none; padding: 0; margin: 0; }
.hist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist b { color: var(--ink); }
.linkbox { display: block; padding: 12px; border-radius: 10px; background: #fff; font-weight: 700; text-decoration: none; }

/* ---------- Dialogue ---------- */
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,12,16,.55); }
dialog h2 { margin: 0 0 12px; font-size: 20px; }

/* ---------- Éditeur d'articles ---------- */
.item-edit { border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.zone-edit { display: grid; grid-template-columns: 1.4fr .7fr .7fr .9fr .9fr auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 560px) { .zone-edit { grid-template-columns: 1fr 1fr 1fr; } }
.zone-edit input, .zone-edit select { padding: 8px; font-size: 15px; border: 2px solid var(--line); border-radius: 8px; width: 100%; }

/* ---------- Réglages ---------- */
.users { width: 100%; border-collapse: collapse; }
.users td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .users td { display: block; text-align: left !important; white-space: normal !important; } .users td:first-child { border-bottom: 0; padding-bottom: 4px; } .users td:last-child { padding-top: 0; } }

/* ---------- Vue Poste (tablette) ---------- */
.postes-choix { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; line-height: 22px; }
.choice button.on .badge { background: #22308a; }
.now-card { background: #fff; border-radius: var(--radius); padding: 16px 16px 16px 24px; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,.07); margin-bottom: 10px; }
.now-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; border-radius: var(--radius) 0 0 var(--radius); background: var(--p); }
.now-top { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--p); }
.now-client { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; margin-top: 6px; color: var(--ink); text-decoration: none; }
.now-d { font-size: 17px; color: var(--muted); margin-top: 4px; }
.now-d b { color: var(--ink); }
.now-run { margin-top: 8px; font-weight: 800; color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.next-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 10px 10px 18px; margin-bottom: 6px; position: relative; }
.next-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 12px 0 0 12px; background: var(--p); }
.next-row a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.next-row a b { display: block; font-size: 17px; }
.next-row a span { font-size: 14px; color: var(--muted); }

/* ---------- Écran atelier (télé) : tailles lisibles à plusieurs mètres ---------- */
body.tv main { padding: 1.2vw 1.6vw; }
.tv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8vw; }
.tv-head h1 { margin: 0; font-size: clamp(22px, 2.2vw, 48px); }
.tv-head .clock { font-size: clamp(26px, 2.8vw, 60px); font-weight: 900; font-variant-numeric: tabular-nums; }
.tv-alert { background: var(--urgent); color: #fff; font-weight: 800; font-size: clamp(16px, 1.4vw, 30px); border-radius: 12px; padding: .6vw 1vw; margin-bottom: 1vw; }
.tv-postes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1vw; margin-bottom: 1.2vw; }
.tv-poste { background: #161a21; border-radius: 14px; padding: 1vw; }
.tv-poste h2 { margin: 0 0 .6vw; font-size: clamp(15px, 1.2vw, 26px); text-transform: uppercase; letter-spacing: .05em; color: #9aa3b2; display: flex; justify-content: space-between; }
.tv-now { background: #1f2530; border-radius: 12px; padding: .8vw .8vw .8vw 1.4vw; position: relative; margin-bottom: .6vw; }
.tv-now::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .5vw; min-width: 6px; border-radius: 12px 0 0 12px; background: var(--p); }
.tv-now .lbl-now { font-size: clamp(13px, 1vw, 22px); font-weight: 800; color: #7fb0ff; font-variant-numeric: tabular-nums; }
.tv-now.idle .lbl-now { color: #9aa3b2; }
.tv-now .c { font-size: clamp(22px, 2vw, 44px); font-weight: 900; line-height: 1.1; margin-top: .2vw; }
.tv-now .d { font-size: clamp(14px, 1.1vw, 24px); color: #b7bfcc; margin-top: .2vw; }
.tv-next { display: flex; justify-content: space-between; gap: 8px; padding: .4vw .6vw .4vw 1vw; border-left: .35vw solid var(--p); margin-top: .4vw; font-size: clamp(14px, 1.05vw, 22px); }
.tv-next span { color: #9aa3b2; white-space: nowrap; }
.tv-kanban { gap: 1vw; }
.tv-kanban .col h3 { font-size: clamp(14px, 1.05vw, 24px); }
.tv-kanban .card { padding: .8vw .8vw .8vw 1.3vw; }
.tv-kanban .card .c { font-size: clamp(16px, 1.35vw, 30px); }
.tv-kanban .card .d, .tv-kanban .card .due, .tv-kanban .plan-fin { font-size: clamp(13px, 1vw, 22px); }
.tv-kanban .chip { font-size: clamp(12px, .85vw, 18px); }

/* Cases modifiables du tableau des tailles : bordure pointillée pour montrer qu'on peut toucher. */
.sizes .btn.ghost { border: 2px dashed var(--line); min-width: 52px; padding: 6px 8px; }
.sizes .btn.ghost:disabled { border-color: transparent; }
.reception { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }

/* ---------- Planning ---------- */
.plan-fin { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.plan-fin.bad { color: var(--urgent); }
body.tv .plan-fin { color: #9aa3b2; } body.tv .plan-fin.bad { color: #ff6b7d; }
.plan-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .plan-wrap { grid-template-columns: 1fr; } }
.pane-plan { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.pane-plan h1 { margin: 0; font-size: 22px; }
.pane-plan h2 { margin: 0 0 4px; font-size: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; background: var(--standard); }
.lg.prev { background: repeating-linear-gradient(45deg,#c9ced8 0 4px,#e6e9ef 4px 8px); }
.lg.run { background: var(--accent); }
.day { border-top: 1px solid var(--line); padding: 10px 0; }
.day-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 800; margin-bottom: 6px; }
.day-h > span { font-weight: 600; font-size: 13px; color: var(--muted); }
.day-h .over { color: var(--urgent); font-weight: 800; }
.lane { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin-bottom: 4px; }
.lane > b { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .lane { grid-template-columns: 1fr; gap: 2px; } }
.bar { position: relative; height: 34px; background: var(--soft); border-radius: 7px; overflow: hidden; }
.bar .pause { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #c9ced8; }
.bar .blk { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; padding: 0 6px; font-size: 12.5px; font-weight: 700; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: var(--p); text-decoration: none; border: 2px solid transparent; }
.bar .blk.prev { color: #333; background: repeating-linear-gradient(45deg,#d4d9e2 0 7px,#e8ebf1 7px 14px); border-left: 5px solid var(--p); }
.bar .blk.run { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(27,77,216,.25); }
.bar .blk.late { border-color: var(--urgent); }
.pane-plan .wait { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.pane-plan .wait b, .pane-plan .wait span { display: block; }
.pane-plan .wait .r { font-size: 13px; font-weight: 700; color: var(--bad); margin-top: 3px; }
.pane-plan .wait .r.ok { color: var(--ok); }
.cad { padding-left: 18px; margin: 6px 0; line-height: 1.9; font-size: 14px; }
.field > label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.field > label.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
@media (max-width: 640px) { .top .who .txt { display: none; } }

/* ---------- Télé : planning 7 jours en grand, colonnes en petit ---------- */
body.tv main { padding: 1vw 1.4vw; }
.tv-page { display: flex; flex-direction: column; gap: .8vw; min-height: calc(100vh - 2vw); }
.tv-grid { display: grid; grid-template-columns: minmax(110px, 9vw) repeat(var(--jours), 1fr); gap: .35vw; }
.tv-jour { text-align: center; font-weight: 800; font-size: clamp(14px, 1.15vw, 26px); padding: .3vw 0; color: #cfd6e2; border-radius: 8px; }
.tv-jour span { color: #8a93a3; font-weight: 700; }
.tv-jour.auj { background: #1b4dd8; color: #fff; }
.tv-jour.auj span { color: #dce5ff; }
.tv-poste-nom { display: flex; align-items: center; font-weight: 800; font-size: clamp(13px, 1vw, 22px); color: #9aa3b2; text-transform: uppercase; letter-spacing: .03em; }
.tv-case { background: #161a21; border-radius: 10px; padding: .35vw; min-height: 5.5vw; display: flex; flex-direction: column; gap: .3vw; }
.tv-case.auj { background: #1a2233; box-shadow: inset 0 0 0 2px #2a4db0; }
.jauge { height: .45vw; min-height: 5px; background: #262c37; border-radius: 4px; overflow: hidden; }
.jauge i { display: block; height: 100%; background: #3fb071; }
.jauge.over i { background: var(--urgent); }
.tv-t { position: relative; background: #222938; border-radius: 7px; padding: .3vw .4vw .3vw .9vw; line-height: 1.15; }
.tv-t::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .35vw; min-width: 4px; border-radius: 7px 0 0 7px; background: var(--p); }
.tv-t b { display: block; font-size: clamp(13px, 1.05vw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-t span { font-size: clamp(11px, .8vw, 18px); color: #aab3c2; }
.tv-t.prev { background: repeating-linear-gradient(45deg, #1d2330 0 8px, #252c3a 8px 16px); }
.tv-t.prev b { color: #cfd6e2; }
.tv-t.run { box-shadow: inset 0 0 0 2px #4f86ff; }
.tv-t.run span { color: #9fc0ff; font-weight: 800; }
.tv-t.late { box-shadow: inset 0 0 0 2px var(--urgent); }
.tv-plus { font-size: clamp(11px, .8vw, 18px); color: #8a93a3; font-weight: 700; padding-left: .3vw; }
.tv-vide { grid-column: 1 / -1; color: #8a93a3; font-size: clamp(14px, 1.1vw, 24px); padding: 2vw; text-align: center; border: 2px dashed #2c323d; border-radius: 12px; }
.tv-bas { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: .5vw; margin-top: auto; border-top: 2px solid #232833; padding-top: .6vw; }
.tv-col h3 { margin: 0 0 .3vw; font-size: clamp(11px, .75vw, 16px); text-transform: uppercase; letter-spacing: .04em; color: #8a93a3; display: flex; justify-content: space-between; }
.tv-col .mini { position: relative; background: #1a1f28; border-radius: 6px; padding: .2vw .4vw .2vw .7vw; margin-bottom: .25vw; line-height: 1.2; }
.tv-col .mini::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 6px 0 0 6px; background: var(--p); }
.tv-col .mini b { display: block; font-size: clamp(12px, .85vw, 18px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-col .mini span { display: block; font-size: clamp(10px, .7vw, 15px); color: #8a93a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-col .mini i { font-style: normal; font-size: clamp(10px, .7vw, 15px); color: #9fc0ff; font-weight: 700; }
.tv-col .mini.late { box-shadow: inset 0 0 0 2px var(--urgent); }
.tv-legende { display: flex; gap: 1.2vw; font-size: clamp(11px, .75vw, 16px); color: #8a93a3; }
.lg.late { background: transparent; box-shadow: inset 0 0 0 2px var(--urgent); }
/* L'écran atelier tient toujours sur une seule hauteur d'écran, sans défilement. */
.tv-page { height: calc(100vh - 2vw); min-height: 0; overflow: hidden; }
.tv-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); overflow: hidden; }
.tv-case { min-height: 0; overflow: hidden; }
.tv-bas { flex: 0 0 auto; max-height: 24vh; overflow: hidden; }
/* Une ligne par commande dans les cases du planning télé. */
.tv-t { display: flex; align-items: baseline; gap: .4vw; white-space: nowrap; }
.tv-t em { font-style: normal; font-weight: 800; font-size: clamp(11px, .85vw, 19px); color: #cfd6e2; flex: none; }
.tv-t b { flex: 1 1 auto; min-width: 0; }
.tv-t span { flex: none; }
.tv-t.run em { color: #9fc0ff; }
.tv-t { padding-top: .25vw; padding-bottom: .25vw; }
.tv-t b { font-size: clamp(13px, .98vw, 22px); }

/* Cases à cocher : jamais étirées par les règles des champs texte. */
.field input[type=checkbox], .reg-postes input[type=checkbox] { width: 22px; height: 22px; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 520px) { .jours { grid-template-columns: repeat(4, 1fr); } }
.jours .case { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.jours .case:has(input:checked) { border-color: var(--accent); background: #eef2ff; color: #22308a; }
.reg-postes { width: 100%; border-collapse: collapse; }
.reg-postes th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px; }
.reg-postes td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
.reg-postes td.c, .reg-postes th:nth-child(3) { text-align: center; }
.cad-in { display: flex; align-items: center; gap: 6px; }
.cad-in input { width: 90px; }
.cad-in span { font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .reg-postes th:nth-child(4), .reg-postes td:nth-child(4) { display: none; } }
/* Planning télé : 2 lignes par commande (client, puis heure · durée prévue · pièces). */
.tv-t { display: block; white-space: normal; padding: .3vw .4vw .3vw .9vw; }
.tv-t b { display: block; font-size: clamp(13px, 1vw, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-t span { display: block; font-size: clamp(11px, .82vw, 18px); color: #aab3c2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-t em { font-size: inherit; color: #e6ebf3; }
/* Plus de place pour le planning : colonnes du bas plus basses. */
.tv-bas { max-height: 20vh; }

/* Planning : barre fine (charge), puis la liste lisible des commandes. */
.bar.fine { height: 12px; border-radius: 6px; }
.bar.fine .blk { top: 0; bottom: 0; padding: 0; border-radius: 3px; border-width: 0; }
.bar.fine .blk.prev { border-left-width: 0; }
.bar.fine .blk.run { box-shadow: 0 0 0 2px var(--accent); }
.taches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tache { position: relative; display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 6px 10px 6px 14px; border-radius: 8px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; max-width: 100%; }
.tache::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 8px 0 0 8px; background: var(--p); }
.tache em { font-style: normal; font-weight: 800; }
.tache span { color: var(--muted); font-size: 13px; }
.tache.prev { background: repeating-linear-gradient(45deg, #eceff4 0 8px, #f6f7fa 8px 16px); }
.tache.run { box-shadow: inset 0 0 0 2px var(--accent); }
.tache.run em { color: var(--accent); }
.tache.late { box-shadow: inset 0 0 0 2px var(--urgent); }
.tache:hover { filter: brightness(.97); }
.day.libre { padding: 6px 0; }
.day.libre .day-h { margin: 0; color: var(--muted); font-weight: 700; }
.lane { align-items: start; }
.lane > b { padding-top: 0; }

/* Étiquettes « où en est le matériel » (partout : tableau, planning, poste, télé). */
.ems { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.em { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.em.ok { background: var(--ok-bg); color: var(--ok); }
.em.wait { background: #fff4e5; color: #8a4f00; }
.em.run { background: #e3ebff; color: #1b3fb0; }
.em.bad { background: var(--bad-bg); color: var(--bad); }
body.tv .em { font-size: clamp(11px, .78vw, 17px); padding: .1vw .4vw; }
body.tv .em.ok { background: #14432a; color: #9be3b8; }
body.tv .em.wait { background: #4a3410; color: #ffd08a; }
body.tv .em.run { background: #1c2f66; color: #b5ccff; }
body.tv .em.bad { background: #4a1520; color: #ffb3bf; }
.card .ems, .next-row .ems { margin-top: 6px; }
body.tv .tv-t .ems { flex-wrap: wrap; gap: .2vw; margin-top: .2vw; }
body.tv .tv-t .em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tv-bas { max-height: 17vh; }
/* Télé : étiquettes d'état sur une seule ligne (raccourcies si besoin) pour garder de la place. */
body.tv .tv-t .ems { flex-wrap: nowrap; overflow: hidden; }
body.tv .tv-t .em { flex: 0 1 auto; min-width: 0; }
/* En-tête de case : jauge de charge + « + N autres », sur une seule ligne. */
.tv-case-h { display: flex; align-items: center; gap: .4vw; min-height: .45vw; }
.tv-case-h .jauge { flex: 1; }
.tv-case-h .tv-plus { flex: none; padding: 0; line-height: 1; color: #ffd08a; }

/* ---------- 📊 Mois ---------- */
.mois { max-width: 1200px; margin: 0 auto; }
.mois-nav { display: flex; align-items: center; gap: 10px; }
.mois-nav h1 { margin: 0; font-size: 22px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.kpis > div { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.kpis b { display: block; font-size: 20px; }
.kpis span { font-size: 13px; color: var(--muted); }
.kpis .bad b { color: var(--urgent); } .kpis .ok b { color: var(--ok); }
.client-bloc { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.client-bloc h2 { margin: 0 0 8px; font-size: 18px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.client-bloc h2 span { font-size: 14px; font-weight: 600; color: var(--muted); }
.tab-scroll { overflow-x: auto; }
.recap { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.recap th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px; border-bottom: 1px solid var(--line); }
.recap td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.recap .n { text-align: right; white-space: nowrap; }
.recap tr.fait td { background: #f6fbf8; }
.recap .bad { color: var(--urgent); font-weight: 700; }
.check-fact { display: flex; align-items: center; gap: 6px; }
.check-fact input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--standard); flex: none; }
.check-fact .in { width: 120px; padding: 6px 8px; font-size: 14px; }

.fact-bloc { display: grid; gap: 12px; }
.fact-l { display: grid; gap: 4px; }
.fact-l > .muted { font-size: 13px; }
.fact-l .bad { color: var(--urgent); }

/* ---------- Commande rapide ---------- */
.chips-clients { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips-clients button { font-weight: 700; font-size: 15px; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.chips-clients button.on { border-color: var(--accent); background: #eef2ff; color: #22308a; }
.zone-rapide { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; margin-top: 8px; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.zone-rapide .formats { grid-template-columns: repeat(5, 1fr); }
.zone-rapide .formats button { padding: 9px 2px; }
.mois-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; }
@media (max-width: 1100px) { .top .nav .txt, .top .who .txt { display: none; } .top .nav a { padding: 8px; font-size: 18px; } }

/* ---------- Dossiers importés d'Axonaut ---------- */
.axo { margin: 10px 0; }
.axo-completer { background: #eef2ff; border: 2px solid #c7d4ff; border-radius: 12px; padding: 12px; }
.axo-chap { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 2px; }
.axo-lignes { width: 100%; border-collapse: collapse; font-size: 14px; }
.axo-lignes td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.axo-lignes .n { text-align: right; font-weight: 800; width: 56px; white-space: nowrap; }

/* ---------- Commande DTF ---------- */
.planches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) { .planches { grid-template-columns: repeat(2, 1fr); } }
.planche { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 800; }
.planche small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.planche input { width: 100%; font-size: 20px; font-weight: 800; padding: 8px; border: 2px solid var(--line); border-radius: 8px; text-align: center; }
.planche.on { border-color: var(--accent); background: #eef2ff; }
.code-pro { font-size: 16px; font-weight: 800; letter-spacing: .06em; background: var(--soft); padding: 4px 8px; border-radius: 6px; margin-right: 6px; }
/* Clients pros : nom à gauche, code + boutons à droite ; tout passe à la ligne si la place manque */
.pro-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.pro-infos { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.pro-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.pro-actions .code-pro { margin-right: 4px; }
@media (max-width: 520px) { .pro-actions { justify-content: flex-start; } }

/* ---------- Appairage télé ---------- */
.tv-pair { min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1vw; padding: 2vw; }
.tv-pair h1 { font-size: clamp(28px, 3.5vw, 72px); margin: 0; }
.tv-pair p { font-size: clamp(18px, 1.8vw, 36px); max-width: 70vw; margin: 0; color: #cfd6e2; }
.tv-pair .muted { color: #8a93a3; font-size: clamp(14px, 1.2vw, 24px); }
.tv-code { font-size: clamp(64px, 12vw, 240px); font-weight: 900; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: #fff; margin: 1vw 0; }
.tailles { grid-template-columns: repeat(5, minmax(0, 1fr)); } /* 10 tailles adultes = 2 lignes de 5 */
.tailles .planche { padding: 8px; text-align: center; }
.total-tailles { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 800; font-size: 18px; flex-wrap: wrap; }
.total-tailles input { width: 110px; font-size: 22px; font-weight: 800; text-align: center; }
.total-tailles input[readonly] { background: #eef2ff; border-color: var(--accent); }
.zone-rapide .cote { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
.enfants { margin-top: 8px; }
.enfants summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 700; padding: 4px 0; }
.enfants .planche { border-width: 1px; font-weight: 700; font-size: 14px; color: var(--muted); }
.enfants .planche input { font-size: 17px; padding: 6px; }
.enfants .planche.on { color: inherit; }
.now-projet { font-size: 20px; font-weight: 800; margin-top: 2px; }
.next-row a em.projet { display: block; font-style: normal; font-weight: 700; font-size: 16px; color: var(--ink); }
.rappro { margin-top: 8px; }
dialog:has(.detail-tailles) { width: min(520px, calc(100% - 32px)); }
.detail-tailles input[name=autres] { box-sizing: border-box; }
.detail-tailles .bilan { margin: 12px 0; padding: 10px 12px; border-radius: 10px; font-weight: 800; font-size: 18px; background: #f3f4f6; }
.detail-tailles .bilan.ok { background: #e7f6ec; color: #17733a; }
.detail-tailles .bilan.bad { background: #fdecec; color: #b42318; }

/* ---------- Refonte : une couleur = la date, colonnes = prochaine action ---------- */
.u-rouge { --p: var(--urgent); } .u-orange { --p: var(--semaine); } .u-gris { --p: #a3aab6; }
.o-top.u-gris { --p: #475569; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.pill.rouge { background: var(--urgent); color: #fff; } .pill.orange { background: var(--semaine); color: #fff; } .pill.gris { background: #e6e9ee; color: #3d4450; }
.legende { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }

.kcarte { display: block; position: relative; background: #fff; border-radius: 12px; padding: 10px 10px 10px 16px; margin-bottom: 8px; color: inherit; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.kcarte::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 12px 0 0 12px; background: var(--p); }
.k-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.k-client { font-weight: 800; font-size: 16px; line-height: 1.2; }
.k-projet { font-weight: 700; font-size: 14px; margin-top: 2px; }
.k-qte { font-size: 14px; color: var(--muted); margin-top: 2px; }
.k-run { font-size: 13px; font-weight: 800; color: var(--accent); margin-top: 5px; }
.k-alerte { font-size: 13px; font-weight: 800; color: var(--urgent); margin-top: 5px; }
.k-extra { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 5px; }
.avance { display: flex; gap: 3px; margin-top: 8px; }
.avance i { flex: 1; height: 6px; border-radius: 3px; background: #e3e6eb; }
.avance i.f { background: var(--standard); } .avance i.c { background: var(--accent); }
.col-livree { opacity: .7; }
.kanban { grid-template-columns: repeat(var(--cols, 7), minmax(190px, 1fr)); }

.choix-type { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .choix-type { grid-template-columns: 1fr; } }
.type-carte { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink); text-decoration: none; }
.type-carte:hover { border-color: var(--accent); }
.type-carte .ic { font-size: 40px; }
.type-carte b { font-size: 20px; }
.type-carte span:last-child { color: var(--muted); font-size: 15px; }

/* Télé */
body.tv .tv-page { height: calc(100vh - 2vw); min-height: 0; }
.tv-head { align-items: center; gap: 1vw; }
.tv-leg { display: flex; gap: .6vw; align-items: center; font-size: clamp(13px, .95vw, 20px); color: #9aa3b2; flex-wrap: wrap; }
.tv-leg .pill, .tv-charge .pill { font-size: clamp(12px, .9vw, 19px); }
.tv-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8vw; }
.tv-col2 { display: flex; flex-direction: column; min-height: 0; background: #161a21; border-radius: 14px; padding: .7vw; }
.tv-col2 h2 { margin: 0 0 .6vw; font-size: clamp(18px, 1.6vw, 34px); display: flex; justify-content: space-between; color: #e6eaf0; }
.tv-col2 h2 span { color: #8a93a3; }
.tv-liste { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.tv .kcarte { background: #222938; color: #f2f4f7; box-shadow: none; padding: .7vw .7vw .7vw 1.2vw; margin-bottom: .5vw; flex: 0 0 auto; }
body.tv .k-client { font-size: clamp(17px, 1.45vw, 32px); }
body.tv .k-projet { font-size: clamp(14px, 1.1vw, 24px); }
body.tv .k-qte { font-size: clamp(13px, 1vw, 22px); color: #b7bfcc; }
body.tv .k-run { color: #7fb0ff; font-size: clamp(13px, 1vw, 22px); }
body.tv .k-alerte { color: #ff8090; font-size: clamp(13px, 1vw, 22px); }
body.tv .avance i { background: #3a4252; height: .45vw; min-height: 5px; }
body.tv .avance i.f { background: #3fbf7a; } body.tv .avance i.c { background: #4d86ff; }
body.tv .pill.gris { background: #3a4252; color: #dfe4ec; }
body.tv .tv-plus { color: #9aa3b2; font-weight: 800; font-size: clamp(14px, 1vw, 22px); padding: .3vw; }
.tv-charge { display: flex; flex-wrap: wrap; gap: .4vw 1.6vw; align-items: baseline; font-size: clamp(14px, 1.05vw, 24px); color: #9aa3b2; border-top: 2px solid #232833; padding-top: .6vw; }
.tv-charge b { color: #e6eaf0; }
.tv-charge em { font-style: normal; font-weight: 800; color: #e6eaf0; }
.tv-bat { margin-left: auto; color: #ffb3bf; font-weight: 800; }
body.tv .kcarte .pill { font-size: clamp(13px, 1vw, 22px); }
.avance-fiche { margin: 10px 0 2px; }
.avance-fiche .avance i { height: 8px; }
.avance-noms { display: flex; gap: 3px; margin-top: 4px; }
.avance-noms span { flex: 1; font-size: 12px; color: var(--muted); text-align: center; }
.avance-noms span.f { color: var(--ok); font-weight: 700; }

/* Formulaire marquage textile : 4 étapes numérotées, un bloc par produit */
.form-marquage .bat-ligne { margin-bottom: 18px; border-style: dashed; background: var(--soft); }
.etape { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin-bottom: 22px; }
.etape > div { min-width: 0; }
.etape .num { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.etape .lbl-t { font-size: 16px; margin-bottom: 8px; }
.etape .chips-clients { margin-bottom: 8px; }
.produit { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: #fff; }
.produit-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 16px; }
.sous-titre { font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.recap { text-align: center; font-weight: 800; margin: 6px 0 10px; }
.client-fixe { font-weight: 800; font-size: 18px; padding: 6px 0; }
.maquettes { display: grid; gap: 8px; } .maquettes img { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }
.maquettes { display: grid; gap: 10px; margin-bottom: 12px; }
.maquette { padding: 0; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: zoom-in; overflow: hidden; }
.maquette img { width: 100%; display: block; border: 0; border-radius: 0; }
dialog.zoom { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 12px; background: rgba(10,12,16,.92); border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: zoom-out; }
dialog.zoom img { max-width: 100%; max-height: calc(100vh - 60px); object-fit: contain; background: #fff; border-radius: 8px; }
dialog.zoom p { color: #cfd6e2; margin: 0; font-size: 14px; }

/* ================================================================ Espace commercial */
.seg a { padding: 7px 12px; font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.seg a.on { background: var(--ink); color: #fff; }
.co-nav { display: flex; gap: 6px; margin: -4px 0 14px; overflow-x: auto; }
.co-nav a { flex: none; padding: 9px 14px; border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; border: 2px solid transparent; }
.co-nav a .txt { margin-left: 4px; }
.co-nav a.on { border-color: var(--accent); color: var(--accent); }
@media (max-width: 520px) { .co-nav a .txt { display: none; } .co-nav a { flex: 1; text-align: center; font-size: 20px; } }
.co-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.co-h h2, .co-h2 { margin: 0; font-size: 18px; }
.co-h2 { margin-bottom: 10px; }
.pill.s-gris { background: #e6e9ee; color: #3d4450; } .pill.s-orange { background: #fff1dc; color: #8a4f00; }
.pill.s-bleu { background: #e3eaff; color: #22308a; } .pill.s-vert { background: var(--ok-bg); color: var(--ok); }
.rouge-t { color: var(--urgent); }
dialog.large { width: min(560px, calc(100% - 32px)); }

/* Ma journée */
.co-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.co-hero h1 { margin: 0 0 2px; font-size: 26px; }
.co-qui { width: auto; padding: 6px 10px; font-size: 14px; margin-bottom: 6px; }
.co-go { width: auto; min-width: 280px; text-decoration: none; }
@media (max-width: 640px) { .co-go { width: 100%; min-width: 0; } }
.co-kpi, .st-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.st-kpi { grid-template-columns: repeat(6, 1fr); }
.co-kpi > div, .st-kpi > div { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.co-kpi b, .st-kpi > div > b { display: block; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.co-kpi span, .st-kpi span { font-size: 13px; color: var(--muted); }
.st-kpi .fort { background: var(--ok-bg); } .st-kpi .fort b { color: var(--ok); }
@media (max-width: 900px) { .st-kpi { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .co-kpi, .st-kpi { grid-template-columns: repeat(2, 1fr); } }
.ecart { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.ecart.plus { color: var(--ok); } .ecart.moins { color: var(--urgent); }
.co-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.co-cols.deux { grid-template-columns: 1fr 1fr; }
.co-cols .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .co-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .co-cols, .co-cols.deux { grid-template-columns: 1fr; } }
.obj { padding: 10px 0; border-bottom: 1px solid var(--line); }
.obj-l { display: flex; justify-content: space-between; gap: 8px; }
.obj-n { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jauge { height: 10px; border-radius: 5px; background: var(--soft); margin: 6px 0; overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.obj.atteint .jauge i { background: var(--standard); } .obj.atteint .obj-n { color: var(--ok); }
.obj-pied { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.co-sem { font-size: 13px; margin-top: 10px; }
.tache-ajout { display: flex; gap: 6px; margin-bottom: 10px; }
.tache-ajout input[name=titre], .tache-ajout input[name=texte] { flex: 1; min-width: 0; }
.tache-ajout input[type=date] { width: 150px; }
@media (max-width: 520px) { .tache-ajout { flex-wrap: wrap; } .tache-ajout input[name=titre] { flex-basis: 100%; } .tache-ajout input[type=date] { flex: 1; } }
.taches, .rappels { list-style: none; margin: 0; padding: 0; }
.taches li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.coche { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); background: #fff; color: #fff; font-weight: 900; padding: 0; }
.coche:hover { border-color: var(--standard); }
.coche.on { background: var(--standard); border-color: var(--standard); }
.t-corps { flex: 1; min-width: 0; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; font-size: 13px; }
.t-detail { font-size: 14px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.taches.faites s { color: var(--muted); }
.rappels li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rappels li > a:first-child { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.rappels li > a:first-child span { display: block; font-size: 13px; color: var(--muted); }

/* Phoning */
.ph-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }
@media (max-width: 960px) { .ph-wrap { grid-template-columns: 1fr; } }
.ph-side > * + * { margin-top: 12px; }
.ph-filtres { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ph-filtres select { flex: 1 1 220px; width: auto; }
.ph-filtres input { flex: 1 1 160px; width: auto; }
.ph-reste { white-space: nowrap; color: var(--muted); }
.ph-reste b { color: var(--ink); font-size: 18px; }
.ph-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ph-tete h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.ph-qui { font-size: 18px; font-weight: 700; margin-top: 4px; }
.ph-ou { color: var(--muted); margin-top: 2px; }
.ph-etat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ph-tel { display: block; margin: 14px 0 10px; font-size: 30px; font-weight: 900; color: var(--ink); text-decoration: none; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ph-memo { background: #fff8db; border: 1px solid #f1df8f; border-radius: 10px; padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; }
.ph-memo b { margin-right: 6px; }
.ph-hist { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.ph-hist li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.ph-resultats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) { .ph-resultats { grid-template-columns: 1fr 1fr; } }
.res { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 15px; }
.res .ic { font-size: 24px; }
.res kbd { position: absolute; top: 5px; right: 7px; font: 700 11px system-ui; color: var(--muted); }
.res:hover { border-color: var(--accent); }
.res-devis { border-color: #9fd9b6; background: var(--ok-bg); color: var(--ok); }
.res-interesse { border-color: #b9c8ff; background: #eef2ff; color: #22308a; }
.ph-rappel { background: #fff4e5; border-radius: 12px; padding: 12px; }
.ph-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 8px 0; }
.ph-dates small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.ph-pied { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ph-vide { padding: 30px 16px; }
.ph-jour h2, .ph-script h2 { margin: 0 0 8px; font-size: 16px; }
.ph-compteurs { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.ph-compteurs b { display: block; font-size: 26px; font-weight: 900; }
.ph-compteurs span { font-size: 12px; color: var(--muted); }
.ph-plus { width: 100%; }
.ph-plus small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
.script-txt { white-space: pre-wrap; font-size: 15px; line-height: 1.5; max-height: 60vh; overflow: auto; }
.ph-script textarea { width: 100%; font-size: 15px; }

/* Contacts */
.ct-filtres { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ct-filtres input { flex: 2 1 260px; width: auto; }
.ct-filtres select { flex: 1 1 180px; width: auto; }
.secteurs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.secteurs button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-weight: 700; font-size: 14px; }
.secteurs button span { color: var(--muted); font-weight: 600; margin-left: 2px; }
.secteurs button.on { border-color: var(--accent); background: #eef2ff; color: #22308a; }
.ct-liste { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.ct-ligne { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1.2fr 1.3fr; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ct-ligne:hover { background: var(--soft); }
.ct-nom span { display: block; font-size: 13px; color: var(--muted); }
.ct-sect, .ct-der { font-size: 13px; }
.ct-tel { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) { .ct-ligne { grid-template-columns: 1fr auto; } .ct-sect, .ct-tel, .ct-der { display: none; } }
.fc-tete { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fc-tete h1 { margin: 0; font-size: 24px; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.fc-infos { display: grid; gap: 4px; }
.fc-l { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 15px; }
.fc-l span { color: var(--muted); }
.fc-reglages { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fc-reglages label { font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.fc-reglages label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }
.fc-reglages .in { width: auto; }
.imp-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.imp-map label { font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 3px; }
.imp-apercu { overflow-x: auto; margin: 10px 0; }
.imp-apercu table, .st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.imp-apercu th, .imp-apercu td, .st-table th, .st-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.imp-apercu th, .st-table th { font-size: 12px; color: var(--muted); }
.st-table td:not(:first-child), .st-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* Statistiques */
.st-taux { margin: -4px 0 12px; }
.st-barres { display: flex; align-items: stretch; gap: 3px; height: 160px; margin: 6px 0 14px; }
.st-j { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.st-j i { display: block; width: 100%; max-width: 38px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.st-j:hover i { background: #0f35a3; }
.st-v { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.st-l { font-size: 11px; color: var(--muted); margin-top: 3px; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 2px; }

/* Accueil : deux portes */
.accueil { max-width: 980px; margin: 4vh auto 0; }
.accueil h1 { font-size: 26px; margin: 0 0 16px; }
.portes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .portes { grid-template-columns: 1fr; } }
.porte { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 26px 24px; color: var(--ink); text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: border-color .15s, transform .15s; }
.porte:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .porte, .porte:hover { transition: none; transform: none; } }
.porte .ic { font-size: 46px; line-height: 1; }
.porte > b { font-size: 24px; margin-top: 6px; }
.porte-txt { color: var(--muted); font-size: 15px; }
.porte-chiffres { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.porte-chiffres b { font-size: 20px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.ph-modes { display: flex; margin-bottom: 12px; }
.ph-modes a { flex: 1; text-align: center; padding: 10px 12px; font-size: 15px; }
.ph-aide { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.ph-aide b { color: var(--ink); }
.ph-saisie { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 8px; }
@media (max-width: 640px) { .ph-saisie { grid-template-columns: 1fr; } }
.ph-lien { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ph-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 14px; }
.ph-suite { background: var(--soft); border-radius: 12px; padding: 14px; }
.ph-suite .field input, .ph-suite .field select { background: #fff; }
.ph-suite-btns { margin-top: 4px; }
.ph-suite-btns > .primary { flex: 2 1 260px; }
.ph-dates .btn.on { border-color: var(--accent); background: #eef2ff; color: #22308a; }
.ph-detail { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
/* Notes + pense-bête des questions */
.ph-notes { display: grid; grid-template-columns: 1fr 300px; gap: 12px; margin-top: 10px; }
.ph-notes .field { margin-bottom: 12px; display: flex; flex-direction: column; }
.ph-notes textarea { flex: 1; min-height: 210px; }
.ph-q { background: var(--soft); border-radius: 12px; padding: 8px; margin-bottom: 12px; }
.ph-q-h { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 4px; font-size: 14px; }
.ph-q ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.ph-q .q { display: flex; align-items: stretch; background: #fff; border-radius: 8px; border: 2px solid transparent; }
.ph-q .q:hover { border-color: var(--accent); }
.ph-q .q-case { flex: none; width: 30px; border: 0; background: none; padding: 0; position: relative; }
.ph-q .q-case::before { content: ""; position: absolute; left: 8px; top: 50%; margin-top: -8px; width: 12px; height: 12px; border: 2px solid #b9c0cc; border-radius: 4px; background: #fff; }
.ph-q .q-txt { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 3px 8px 3px 0; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-q .q-txt b { font-size: 14px; margin-right: 4px; }
.ph-q .q-txt span { color: var(--muted); font-size: 12px; }
.ph-q .q.ok { background: var(--ok-bg); }
.ph-q .q.ok .q-case::before { background: var(--standard); border-color: var(--standard); }
.ph-q .q.ok .q-case::after { content: "✓"; position: absolute; left: 10px; top: 50%; margin-top: -9px; color: #fff; font-size: 12px; font-weight: 900; }
.ph-q .q.ok .q-txt b { color: var(--ok); }
@media (max-width: 760px) {
  .ph-notes { grid-template-columns: 1fr; }
  .ph-q { order: -1; max-height: none; margin-bottom: 0; }
  .ph-q ul { display: flex; flex-wrap: wrap; }
  .ph-q .q-txt span { display: none; }
  .ph-notes textarea { min-height: 140px; }
}
.pl { white-space: pre-line; }
.ph-q, .ph-q li { min-width: 0; }
.ph-q ul { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .ph-q ul { grid-template-columns: none; } }
/* Phoning : résultat de l'appel en haut à droite, toujours visible */
.ph-wrap { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main res" "main side"; grid-template-rows: auto 1fr; }
.ph-main { grid-area: main; }
.ph-res { grid-area: res; }
.ph-side { grid-area: side; }
.ph-res-titre { margin: 0 0 8px; font-size: 16px; }
.ph-res .ph-resultats { grid-template-columns: 1fr 1fr; gap: 6px; }
.ph-res .res { padding: 10px 6px; font-size: 14px; }
.ph-res .res .ic { font-size: 22px; }
.ph-res .ph-rappel { background: none; padding: 0; }
.ph-res .ph-dates { grid-template-columns: 1fr 1fr; }
.ph-res .ph-rappel input { width: 100%; }
.ph-res-attente p { margin: 6px 0 10px; font-size: 14px; }
@media (max-width: 960px) {
  .ph-wrap { grid-template-columns: 1fr; grid-template-areas: "main" "res" "side"; grid-template-rows: none; }
  .ph-res .ph-resultats { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 520px) { .ph-res .ph-resultats { grid-template-columns: 1fr 1fr; } }
/* Tout tient sur un écran d'ordinateur : notes et questions un peu plus compactes. */
.ph-notes textarea { min-height: 180px; }
.ph-q .q-txt { padding-top: 2px; padding-bottom: 2px; }
.ph-main .field { margin-bottom: 8px; }
.ph-aide { margin-bottom: 8px; }
.ph-fiche .ph-champs { display: grid; gap: 6px; margin-bottom: 8px; }
.ph-fiche .in { padding: 9px 10px; font-size: 15px; }
.ph-fiche .ph-plein { display: block; width: 100%; margin-bottom: 6px; }
.ph-fiche .ph-dates { margin: 0 0 6px; }
.ph-fiche > input[type=date] { width: 100%; margin-bottom: 8px; }
.ph-fiche details.more { margin: 4px 0 6px; }
/* Phoning compact : tout sur un écran d'ordinateur portable (1366 × 768) */
.ph-contact .ph-tete { align-items: center; margin-bottom: 6px; }
.ph-contact .ph-tete h1 { font-size: 24px; }
.ph-contact .ph-qui { font-size: 16px; margin-top: 2px; }
.ph-contact .ph-etat { gap: 6px; }
.ph-contact .ph-tel { margin: 0; font-size: 26px; white-space: nowrap; }
.ph-contact .ph-memo { margin: 4px 0; padding: 6px 10px; font-size: 14px; }
.ph-filtres { padding-bottom: 8px; margin-bottom: 10px; }
.ph-histo h2 { margin: 10px 0 4px; font-size: 15px; }
.ph-histo .ph-hist { margin: 0; max-height: 220px; overflow: auto; }
.ph-actions { display: flex; gap: 6px; }
.ph-actions > * { flex: 1; text-align: center; padding-left: 4px; padding-right: 4px; }
.ph-q ul { gap: 2px; }
.ph-q .q-txt { padding-top: 1px; padding-bottom: 1px; }
.ph-res .ph-dates { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ph-res .ph-dates .btn { padding: 6px 4px; font-size: 13px; }
.ph-fiche:has(details[open]) > [data-sans-fiche] { display: none; }
@media (max-width: 640px) { .ph-contact .ph-tete { flex-direction: column; align-items: flex-start; } .ph-contact .ph-etat { align-items: flex-start; } }
.ph-modes a { padding: 7px 12px; }
.ph-modes { margin-bottom: 10px; }
.ph-contact .ph-tete h1 { font-size: 22px; }
.ph-q { padding: 6px; }
.ph-fiche .in { padding: 7px 10px; }
.ph-res .ph-dates input[type=date] { padding: 4px; font-size: 13px; min-width: 0; width: 100%; }
.ph-res .ph-dates input.on { border-color: var(--accent); background: #eef2ff; }
.ph-filtres { padding-bottom: 6px; margin-bottom: 6px; } .ph-filtres .in { padding-top: 8px; padding-bottom: 8px; }
/* Résultats juste sous les notes (demande du 04/10) : une ligne de 6 boutons. */
.ph-wrap { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main side"; grid-template-rows: none; }
@media (max-width: 960px) { .ph-wrap { grid-template-columns: 1fr; grid-template-areas: "main" "side"; } }
.ph-res { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.ph-res-titre { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.ph-res .ph-resultats { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ph-res .res { padding: 8px 4px; font-size: 14px; }
.ph-res .res .ic { font-size: 20px; }
@media (max-width: 1150px) { .ph-res .res { flex-direction: column; gap: 0; padding: 6px 2px; font-size: 13px; line-height: 1.2; } }
@media (max-width: 960px) { .ph-res .ph-resultats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .ph-res .ph-resultats { grid-template-columns: 1fr 1fr; } }
/* Pense-bête en pastilles (l'aide s'affiche au survol) */
.ph-notes { grid-template-columns: 1fr 300px; }
.ph-q ul { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-q .q { width: auto; }
.ph-q .q-txt { padding: 3px 9px 3px 0; }
.ph-q .q-txt span { display: none; }
.ph-notes textarea { min-height: 200px; }
/* Fiche et rappel sous les notes : sur la largeur */
.ph-fiche .ph-champs { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .ph-fiche .ph-champs { grid-template-columns: 1fr; } }
.ph-res .ph-dates { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 760px) { .ph-res .ph-dates { grid-template-columns: repeat(3, 1fr); } }
.ph-fiche .ph-plein { display: inline-block; width: auto; margin: 0 6px 6px 0; }
.ph-fiche > .btn.primary.ph-plein { min-width: 280px; }
.ph-res .ph-rappel .row { justify-content: flex-start; }
.ph-res .ph-rappel .row > * { flex: 0 0 auto; }
.ph-res .ph-rappel input[type=date] { width: auto; }
/* Compact : boutons de résultat sur une ligne, icône à gauche */
.ph-res .res { flex-direction: row; justify-content: center; gap: 6px; padding: 10px 4px; }
.ph-res .res .ic { font-size: 18px; }
.ph-res .res kbd { top: 3px; right: 5px; }
.ph-notes { grid-template-columns: 1fr 330px; }
.ph-q .q-txt { padding: 2px 9px 2px 0; font-size: 13px; }
.ph-q .q-txt b { font-size: 13px; }
.ph-notes textarea { min-height: 170px; }
.ph-notes-seules textarea { width: 100%; min-height: 90px; }
.ph-rappel-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ph-res .ph-rappel { padding: 0; }
.ph-res .ph-dates input[type=date] { height: 100%; }

/* Écrans peu hauts : on resserre pour garder les résultats visibles sans défiler. */
@media (max-height: 720px) and (min-width: 961px) {
  .ph-aide { display: none; }
  .co-nav { margin-bottom: 8px; } .co-nav a { padding: 6px 12px; }
  .ph-main.panel { padding-top: 10px; padding-bottom: 10px; }
  .ph-notes textarea { min-height: 120px; }
  .ph-q-h { padding-bottom: 2px; }
}
@media (max-width: 1150px) { .ph-res .res { flex-direction: column; gap: 0; padding: 6px 2px; font-size: 13px; line-height: 1.2; } .ph-res .res .ic { font-size: 18px; } }
/* Pense-bête en liste, avec les phrases d'aide visibles (demande du 04/10) */
.ph-notes { grid-template-columns: 1fr 360px; }
.ph-q ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ph-q .q { width: 100%; }
.ph-q .q-txt { padding: 2px 8px 2px 0; }
.ph-q .q-txt span { display: inline; }
.ph-notes textarea { min-height: 150px; }
@media (max-width: 1150px) { .ph-notes { grid-template-columns: 1fr 300px; } }
@media (max-width: 760px) {
  .ph-notes { grid-template-columns: 1fr; }
  .ph-q .q-txt { white-space: normal; }
}
/* Étape suivante : bandeau sous les notes, fiche dans la colonne de droite */
.ph-res-attente { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: #eef2ff; border-radius: 10px; padding: 8px 10px; }
.ph-fiche-col .ph-fiche .ph-champs { grid-template-columns: 1fr; }
.ph-fiche-col .ph-fiche .ph-plein { display: block; width: 100%; margin: 0 0 6px; min-width: 0; }
.ph-fiche-col .ph-dates { grid-template-columns: repeat(3, 1fr) !important; gap: 4px; }
.ph-fiche-col .ph-dates .btn { padding: 6px 4px; font-size: 13px; }
.ph-fiche-col .ph-dates input[type=date] { padding: 4px; font-size: 13px; min-width: 0; width: 100%; }
.ph-fiche-col .ph-dates input.on { border-color: var(--accent); background: #eef2ff; }
@media (max-width: 960px) { .ph-side { display: flex; flex-direction: column; } }
@media (max-width: 960px) { .fl-d { display: none; } }
/* Choix du mode + filtres de la liste sur une seule ligne ; pense-bête plus serré */
.ph-haut { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ph-haut .ph-modes { flex: 1 1 340px; margin: 0; }
.ph-haut .ph-filtres { flex: 2 1 420px; display: flex; gap: 6px; align-items: center; margin: 0; padding: 0; border: 0; }
.ph-haut .ph-filtres select { flex: 1 1 180px; width: auto; min-width: 0; }
.ph-haut .ph-filtres input { flex: 0 1 130px; width: auto; min-width: 0; }
.ph-contact .ph-tete h1 { font-size: 22px; }
.ph-contact .ph-tete h1 .ph-qui { font-size: 16px; font-weight: 700; color: var(--muted); margin: 0 0 0 6px; }
.ph-q ul { gap: 1px; }
.ph-q .q-txt { padding-top: 1px; padding-bottom: 1px; }
.ph-q .q { border-width: 1px; }
/* Phrase complète d'une question : flèche ▾ par ligne, ou « Tout déplier » */
.ph-q-h > span { display: flex; gap: 2px; }
.ph-q-h .btn.small { padding: 3px 7px; font-size: 13px; }
.ph-q .q-plus { flex: none; width: 26px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; border-radius: 0 8px 8px 0; transition: transform .15s; }
.ph-q .q-plus:hover { color: var(--accent); background: var(--soft); }
.ph-q .q.ouvert .q-plus { transform: rotate(180deg); }
.ph-q .q.ouvert .q-txt { white-space: normal; }
.ph-q .q.ouvert .q-txt span { display: block; font-size: 13px; color: var(--ink); opacity: .75; padding: 1px 0 3px; }
.ph-q .q.ouvert .q-case::before { top: 12px; margin-top: 0; }
.ph-q .q.ouvert.ok .q-case::after { top: 11px; margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .ph-q .q-plus { transition: none; } }
@media (max-width: 760px) { .ph-q .q-plus { display: none; } }
/* Contacts : qui suit qui */
.ct-suivi { display: block; font-size: 12px; }
.ct-masse { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.fc-suivi { width: auto; display: inline-block; padding: 4px 8px; font-size: 14px; }
/* Équipe */
.eq-tab { overflow-x: auto; }
.st-table.eq td, .st-table.eq th { white-space: nowrap; }
.st-table.eq tfoot td { font-weight: 800; border-bottom: 0; }
.eq-jour { font-size: 12px; margin-left: 6px; }
.eq-barre { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 110px; }
.eq-barre i { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--accent); max-width: 70px; flex: none; }
.eq-devis { color: var(--ok); }
.eq-ok { color: var(--ok); font-weight: 800; }
/* Phoning : recherche d'un contact existant */
.ph-recherche { position: relative; }
.ph-recherche > input { width: 100%; }
.ph-drop { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; width: max(100%, 460px); max-width: calc(100vw - 48px); background: #fff; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 4px; max-height: 360px; overflow: auto; }
.ph-drop-l { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; }
.ph-drop-l:hover, .ph-drop-l:focus-visible { background: #eef2ff; outline: none; }
.ph-drop-n { min-width: 0; }
.ph-drop-n b { display: block; }
.ph-drop-n span { font-size: 13px; }
.ph-drop-e { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.ph-drop-e small { font-size: 12px; white-space: nowrap; }
.ph-drop-vide { padding: 8px 10px; font-size: 14px; }
.ph-drop-creer { flex-direction: column; align-items: flex-start; gap: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--accent); font-weight: 800; }
.ph-drop-creer small { font-weight: 600; }
.ph-lie { border: 2px solid #bfe6cd; background: #f3fbf6; border-radius: 12px; padding: 10px 12px; }
.ph-lie-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ph-lie-nom { font-size: 20px; }
.ph-lie-e { display: flex; gap: 4px; align-items: center; }
.ph-lie-l { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 14px; }
.ph-lie-l a { color: var(--ink); text-decoration: none; }
.ph-lie-act { margin-left: auto; }
.ph-lie-act a.btn { color: var(--ink); }
.ph-lie .ph-hist { margin-top: 6px; }
.ph-lie .ph-hist li { padding: 3px 0; font-size: 13px; }
.ph-lie-info { font-size: 13px; font-weight: 700; color: var(--ok); margin-top: 4px; }
/* Messages (infos de l'administrateur) en haut de « Ma journée » */
.co-msgs { display: grid; gap: 8px; margin-bottom: 12px; }
.co-msg { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #eef2ff; border: 2px solid #c7d3ff; border-radius: 12px; padding: 10px 14px; }
.co-msg.imp { background: var(--bad-bg); border-color: #f3b3bc; }
.co-msg.imp b { color: var(--bad); }
.co-msg.lu { background: #fff; border-color: var(--line); opacity: .8; }
.co-msg-t { min-width: 0; }
.co-msg-t .pl { margin-top: 2px; }
.co-msg-lu { font-size: 13px; white-space: nowrap; }
/* Pilotage */
.pil-tous { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pil-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.pil-cartes .panel + .panel { margin-top: 0; }
.pil-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pil-h h2 { margin: 0; font-size: 20px; }
.pil-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; text-align: center; }
.pil-kpi div { background: var(--soft); border-radius: 10px; padding: 6px 2px; }
.pil-kpi b { display: block; font-size: 22px; font-weight: 900; }
.pil-kpi span { font-size: 11px; color: var(--muted); }
.pil-carte h3 { font-size: 14px; margin: 12px 0 6px; display: flex; gap: 6px; align-items: center; }
.pil-obj { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 14px; margin-bottom: 6px; }
.pil-obj .jauge { grid-column: 1 / -1; margin: 3px 0 0; height: 8px; }
.pil-obj.atteint b { color: var(--ok); } .pil-obj.atteint .jauge i { background: var(--standard); }
.pil-taches { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pil-taches li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 6px; }
.pil-vide { margin: 0; font-size: 14px; }
.pil-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pil-btns { display: flex; gap: 4px; }
.pil-msgs { margin-top: 12px; }
.pil-msg-h { display: flex; align-items: center; gap: 6px; }
.pil-msg-h .btn { margin-left: auto; }
.pil-imp b { color: var(--bad); }
.pil-taches .pill { flex: none; align-self: flex-start; font-size: 12px; }
.bat-attente { display: block; padding: 40px 10px; color: var(--muted); font-weight: 700; }
.bat-legende { font-size: 13px; color: var(--muted); margin: 4px 2px 0; }

/* Téléphone : une colonne du tableau à la fois, on glisse le doigt pour passer à la suivante */
@media (max-width: 640px) {
  .kanban { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86vw; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .kanban .col { scroll-snap-align: start; }
  .kanban .col.vide { display: none; }
  .board-head .legende { font-size: 12px; }
}
.poste-visuels { margin-top: 10px; } .poste-visuels .maquette img { max-height: 260px; object-fit: contain; background: #fff; }
.ref-etat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.refs-poste { margin-top: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.rp-titre { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.rp-ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px; }
.rp-attente { font-weight: 700; color: var(--urgent); font-size: 15px; }
.rp-faites { color: var(--ok); font-size: 14px; }

/* ================================================================ 💶 Tarifs */
.tarifs { --rev: #0E7A83; --asso: #2C7A50; --pro: #3A4F8F; --part: #B4356C; }
.tf-onglets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; margin-bottom: 14px; }
@media (max-width: 860px) { .tf-onglets { grid-template-columns: 1fr 1fr; } }
.tf-onglet { text-align: left; background: #fff; border: 2px solid var(--line); border-left: 8px solid var(--c, var(--ink)); border-radius: 10px; padding: 8px 12px; }
.tf-onglet b { display: block; font-size: 15px; }
.tf-onglet span { font-size: 12px; color: var(--muted); }
.tf-onglet.on { border-color: var(--c, var(--ink)); background: #f7f8ff; }
.tf-rev { --c: var(--rev); } .tf-asso { --c: var(--asso); } .tf-pro { --c: var(--pro); } .tf-part { --c: var(--part); } .tf-reg { --c: var(--ink); }
.tf-profil { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.tf-profil h2 { margin: 0; font-size: 22px; color: var(--c); }
.tf-profil p { margin: 4px 0 0; color: var(--muted); max-width: 64ch; }
.tf-faits { display: flex; gap: 20px; }
.tf-faits span { display: block; font-size: 12px; color: var(--muted); }
.tf-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; }
@media (max-width: 1080px) { .tf-split { grid-template-columns: minmax(0, 1fr); } }
.tf-bloc { padding: 0; overflow: hidden; }
.tf-bloc + .tf-bloc { margin-top: 12px; }
.tf-bloc > header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tf-bloc > header h3 { margin: 0; font-size: 16px; }
.tf-bloc > header span { font-size: 12.5px; }
.tf-tbl { overflow-x: auto; }
.tf-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tf-t th { font-size: 12px; color: var(--muted); font-weight: 700; padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 2px solid var(--line); }
.tf-t td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); font-weight: 600; }
.tf-t th:first-child, .tf-t td:first-child { text-align: left; font-weight: 800; }
.tf-t tbody tr:hover td { background: var(--soft); }
.tf-bascule { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #B07A0C; margin-right: 6px; vertical-align: 2px; }
.tf-leg { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); align-items: center; }
.tf-note { margin-top: 12px; background: #fff; border-left: 4px solid var(--c, var(--accent)); border-radius: 0 10px 10px 0; padding: 10px 12px; font-size: 13.5px; color: var(--muted); }
.tf-note b { color: var(--ink); }
.tf-calc { position: sticky; top: 76px; }
@media (max-width: 1080px) { .tf-calc { position: static; } }
.tf-h { margin: 0 0 8px; font-size: 16px; }
/* Réglages (administrateur) */
.tf-reglages > p { margin: 0 0 10px; }
.tf-cell { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.tf-cell input { width: 64px; border: 0; padding: 5px 6px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; }
.tf-cell input:focus { outline: none; }
.tf-cell:focus-within { border-color: var(--accent); }
.tf-cell u { text-decoration: none; padding: 5px 6px; font-size: 12px; color: var(--muted); background: var(--soft); border-left: 1px solid var(--line); white-space: nowrap; }
.tf-saisie td { padding: 4px 6px; }
.tf-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; padding: 14px; }
.tf-champ { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 700; }
.tf-champ .tf-cell { width: 100%; } .tf-champ .tf-cell input { flex: 1; text-align: left; }
.tf-champ small { font-weight: 400; }
.tf-mseg { margin: 10px 14px; display: flex; max-width: 520px; }
.tf-mseg button { flex: 1; }
.tf-marges td .chip { display: block; margin-top: 3px; text-align: center; }
.chip.warn { background: #fff1dc; color: #8a4f00; }
.tf-obj { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 900px) { .tf-obj { grid-template-columns: 1fr; } }
.tf-bilan { background: var(--soft); padding: 14px; display: grid; gap: 5px; font-size: 13.5px; }
.tf-bilan > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.tf-bilan b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tf-bilan .gros b { font-size: 19px; }
.ok-t { color: var(--ok) !important; }
.tf-deux { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0 16px; }
@media (max-width: 900px) { .tf-deux { grid-template-columns: 1fr; } }
.tf-deux .tf-t td { font-weight: 500; }
.tf-barre { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.ph-calcul summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ph-calcul summary::-webkit-details-marker { display: none; }
.ph-calcul summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.ph-calcul[open] summary { margin-bottom: 8px; }
.ph-calcul[open] summary::after { content: "▴"; }
.ph-calcul summary .muted { font-size: 13px; }
.ph-calc-lien { display: block; font-size: 13px; margin-top: 6px; }

/* Chiffrage sur t-shirt : couleurs de l'outil */
.ct { --ct-acc: var(--accent); --ct-encre: var(--ink); --ct-muet: var(--muted); --ct-trait: var(--line); --ct-doux: var(--soft); }
.pil-bilan { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pil-bilan p { margin: 0; font-size: 14px; max-width: 70ch; }
.pil-bilan .pil-btns { flex-wrap: wrap; }
.porte-demande { display: flex; align-items: center; gap: 16px; margin-top: 16px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 18px 22px; color: var(--ink); text-decoration: none; }
.porte-demande:hover { border-color: var(--accent); }
.porte-demande .ic { font-size: 34px; }
.porte-demande b { display: block; font-size: 19px; }
.porte-demande .fl { margin-left: auto; font-size: 28px; color: var(--muted); }

/* ================================================================ 🧾 Demandes */
.dm-ligne { grid-template-columns: 1.6fr 2fr .9fr 1.1fr 1.2fr; }
.dm-resume { font-size: 13.5px; }
.dm-total { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.dm-total small { font-weight: 500; color: var(--muted); }
@media (max-width: 760px) { .dm-ligne { grid-template-columns: 1fr auto; } .dm-resume, .dm-ligne .ct-der { display: none; } }
.dm-qui h1 { font-size: 24px; margin: 8px 0 4px; }
.dm-cherche { width: 100%; font-size: 18px; padding: 14px; margin: 8px 0; }
.dm-res { display: grid; gap: 6px; }
.dm-res-l { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.dm-res-l:hover { border-color: var(--accent); }
.dm-res-l > span:first-child b { display: block; }
.dm-res-l .muted { font-size: 13px; }
.dm-creer { flex-direction: column; align-items: flex-start; color: var(--accent); font-weight: 800; border-style: dashed; }
.dm { max-width: 1200px; margin: 0 auto; padding-bottom: 90px; }
.dm-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.dm-tete h1 { margin: 2px 0; font-size: 24px; display: flex; gap: 10px; align-items: center; }
.dm-tete a { text-decoration: none; font-size: 14px; }
.dm-etat { font-size: 13px; }
.dm-client { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.dm-client-nom { font-size: 19px; }
.dm-client-a { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dm-client-a label { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 14px; }
.dm-client-a .in { width: auto; }
.dm-prod { padding: 12px; }
.dm-prod + .dm-prod { margin-top: 12px; }
.dm-prod-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.dm-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; }
.dm-prod-h select { flex: 0 1 260px; width: auto; font-weight: 800; }
.dm-prod-h input { flex: 1 1 200px; width: auto; }
.dm-prod-c { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
@media (max-width: 900px) { .dm-prod-c { grid-template-columns: minmax(0, 1fr); } }
.dm-prod-c .ct-vues { max-width: 520px; }
.dm-prod-side { display: flex; flex-direction: column; gap: 10px; }
.dm-notes { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.dm-notes textarea { width: 100%; min-height: 130px; }
.dm-sous { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; font-size: 14px; }
.dm-sous > div { display: flex; justify-content: space-between; gap: 8px; }
.dm-sous b { font-variant-numeric: tabular-nums; }
.dm-sous-t { border-top: 1px dashed var(--line); padding-top: 4px; font-size: 16px; }
.dm-ajout { display: block; width: 100%; margin: 12px 0; border-style: dashed; }
.dm-notes-g label { display: flex; flex-direction: column; gap: 6px; }
.dm-notes-g textarea { width: 100%; }
.dm-pied { position: sticky; bottom: 0; z-index: 10; margin-top: 12px; background: var(--ink); color: #fff; border-radius: 14px 14px 0 0; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dm-tot { display: flex; gap: 10px; align-items: baseline; }
.dm-tot b { font-size: 26px; font-variant-numeric: tabular-nums; }
.dm-tot2 { font-size: 12.5px; color: #b7bfcc !important; }
.dm-pied-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dm-pied-a .in { width: auto; }
.dm-axo { font-weight: 800; color: #9be3b8; }
.dm-pied .btn.warn { background: transparent; color: #ffb3bf; border-color: #7a3040; }
.dm-pied select.in { color: var(--ink); background: #fff; }
@media (max-width: 640px) {
  .dm-pied { padding: 8px 12px; gap: 6px; }
  .dm-tot b { font-size: 20px; }
  .dm-tot2 { display: none; }
  .dm-pied-a { gap: 6px; width: 100%; }
  .dm-pied-a .btn.primary { flex: 1; padding: 9px 10px; font-size: 14px; }
  .dm-pied-a select.in { padding: 7px 8px; font-size: 14px; }
  .dm-pied-a .btn.warn { padding: 6px 8px; font-size: 12px; }
}
.dm-pied .dm-enreg { background: #fff; color: var(--ink); border-color: #fff; }
@media (max-width: 640px) {
  .dm-pied-a { display: grid; grid-template-columns: 1fr 1fr; }
  .dm-pied-a .btn.primary, .dm-pied-a .dm-axo { grid-column: 1 / -1; order: -1; }
  .dm-pied-a .dm-enreg { padding: 8px 10px; font-size: 14px; }
  .dm-pied-a .btn.warn { grid-column: 1 / -1; justify-self: end; }
}
.dm-journal { margin-top: 12px; }
.dm-journal summary { cursor: pointer; }
.dm-journal .hist { margin-top: 8px; max-height: 320px; overflow: auto; }

/* ================================================================ 💶 CA du mois */
.co-ca { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-bottom: 12px; }
@media (max-width: 860px) { .co-ca { grid-template-columns: 1fr; } }
.co-ca h3 { margin: 0; font-size: 15px; }
.ca-chiffres { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ca-chiffres b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ca-chiffres span { color: var(--muted); font-weight: 700; }
.ca-chiffres em { margin-left: auto; font-style: normal; font-weight: 900; font-size: 20px; color: var(--accent); }
.ca-barre { position: relative; height: 16px; border-radius: 8px; background: var(--soft); margin: 8px 0 6px; overflow: visible; }
.ca-barre i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), #4f7cff); }
.ca-barre u { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.ca-etat { font-weight: 800; font-size: 14px; }
.ca-etat.ok { color: var(--ok); }
.ca-etat.retard { color: #b35f00; }
.ca-reste { margin: 8px 0 4px; font-size: 14.5px; }
.ca-petit { font-size: 12.5px; margin: 2px 0; }
.ca-pipe { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fff8db; border: 1px solid #f1df8f; color: var(--ink); text-decoration: none; font-size: 14px; }
.ca-pipe:hover { border-color: #b07a0c; }
.ca-ventes { list-style: none; margin: 0; padding: 0; }
.ca-ventes li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ca-ventes li > span { flex: 1; min-width: 0; }
.ca-ventes li small { display: block; }
.ca-ventes li > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ca-jauge.compact .ca-chiffres b { font-size: 20px; }
.ca-jauge.compact .ca-chiffres em { font-size: 15px; }
.ca-jauge.compact .ca-barre { height: 10px; margin: 5px 0 4px; }
.ca-jauge.compact .ca-etat { font-size: 12.5px; }
/* Phoning : annuler un appel */
.ph-annuler { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-size: 14px; }
.ph-annuler .btn { background: #fff; }
.ph-rec-d { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.ph-rec-d summary { cursor: pointer; font-size: 13.5px; font-weight: 700; }
.ph-recents { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.ph-recents li { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ph-rec-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-vide-r { margin: 6px 0 0; font-size: 13px; }
/* Phoning : « Enregistrer » (on reste sur le contact) et « Nouvel appel », juste avant les résultats. */
.ph-sauve { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line, #e5e5e5); }
.ph-sauve .btn small { display: block; font-size: 11.5px; font-weight: 600; opacity: .8; }
.ph-sauve-etat { grid-column: 1 / -1; font-size: 12.5px; text-align: center; }
.ph-sauve-etat:empty { display: none; }
/* Demande : gamme du textile (Éco / Premium), au-dessus des notes du produit. */
.dm-gamme { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dm-gamme .btn { padding: 8px 6px; font-size: 15px; }
.dm-gamme .ic { margin-right: 4px; }
.dm-gamme small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.dm-gamme-eco.on { border-color: #2f8f4e; background: #e7f6ec; }
.dm-gamme-premium.on { border-color: #7a4fd0; background: #f1ebfc; }
.detail-tailles .bilan.change { background: #eef2ff; color: #22308a; }
.k-info { font-size: 13px; font-weight: 700; color: #475569; margin-top: 5px; }
body.tv .k-info { color: #b7bfcc; font-size: clamp(13px, 1vw, 22px); }
.o-top .delai-regle { font-size: 13px; opacity: .9; margin-top: 2px; }
.simu { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.simu:empty { display: none; }
.simu.ok { background: var(--ok-bg); color: var(--ok); }
.simu.bad { background: var(--bad-bg); color: var(--bad); }
.calc { margin-bottom: 14px; }
.calc summary { cursor: pointer; font-size: 17px; }
.calc-grille { display: grid; grid-template-columns: 140px 1fr 1fr 1.6fr; gap: 12px; margin-top: 12px; align-items: start; }
@media (max-width: 900px) { .calc-grille { grid-template-columns: 1fr 1fr; } }
.calc-grille .choice { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
.calc-grille .choice + .choice { margin-top: 6px; }
.calc-res { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--soft); }
.calc-res .calc-date { font-size: 26px; font-weight: 900; }
.calc-res .ok { color: var(--ok); } .calc-res .bad { color: var(--bad); }
.calc-grille [data-c=faces] { grid-template-columns: repeat(3, 1fr); }

/* ---------- Production : carnet de commandes, plan de production, choix de la vue ---------- */
.choix-vue { display: inline-flex; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.choix-vue button { border: 0; background: none; font-weight: 800; padding: 8px 14px; border-radius: 9px; color: var(--muted); }
.choix-vue button.on { background: var(--ink); color: #fff; }
.carnet-resume { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
@media (max-width: 760px) { .carnet-resume { grid-template-columns: 1fr 1fr; } }
.carnet-resume .m { background: #fff; border: 0; border-radius: 12px; padding: 10px 14px; text-align: left; font: inherit; color: inherit; }
.carnet-resume .m span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.carnet-resume .m b { font-size: 24px; }
.carnet-resume button.m { cursor: pointer; }
.carnet-resume .m.alerte b, .carnet-resume .m b.trop { color: var(--urgent); }
.carnet-resume .m.attention b { color: var(--semaine); }
.carnet-filtres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.carnet-filtres button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.carnet-filtres button.on { border-color: var(--accent); background: #eef2ff; color: #22308a; }
table.carnet { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 15px; }
table.carnet th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px; border-bottom: 2px solid var(--line); background: var(--soft); }
table.carnet td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.carnet tbody tr { cursor: pointer; }
table.carnet tbody tr:hover { background: #f5f7ff; }
table.carnet tr.ligne-retard td:first-child { box-shadow: inset 4px 0 0 var(--urgent); }
.tag { display: inline-block; border-radius: 7px; padding: 2px 8px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.risk { background: #fff3e0; color: #9a5200; }
.tag.late { background: var(--bad-bg); color: var(--bad); } .tag.n { background: var(--soft); color: var(--muted); }
@media (max-width: 760px) { table.carnet .c-pcs, table.carnet .c-tex { display: none; } table.carnet { font-size: 14px; } table.carnet td, table.carnet th { padding: 8px 6px; } }

.plan5 { display: grid; grid-template-columns: 110px repeat(var(--jours), minmax(0, 1fr)); gap: 6px; }
@media (max-width: 760px) { .plan5 { grid-template-columns: 80px repeat(var(--jours), minmax(150px, 1fr)); overflow-x: auto; } }
.p5-jour { text-align: center; font-weight: 800; padding: 6px 0; border-radius: 8px; text-transform: capitalize; }
.p5-jour span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; }
.p5-jour.auj { background: var(--ink); color: #fff; } .p5-jour.auj span { color: #cfd6e2; }
.p5-poste { display: flex; align-items: flex-start; padding-top: 10px; font-weight: 800; color: var(--muted); font-size: 14px; }
.p5-case { background: #fff; border-radius: 10px; padding: 6px; min-height: 64px; display: flex; flex-direction: column; gap: 5px; }
.p5-case.auj { box-shadow: inset 0 0 0 2px var(--ink); }
.p5-jauge { height: 4px; background: #e3e6eb; border-radius: 2px; overflow: hidden; }
.p5-jauge i { display: block; height: 100%; background: var(--standard); } .p5-jauge.trop i { background: var(--urgent); }
.p5-t { display: block; text-decoration: none; color: var(--ink); background: var(--soft); border-left: 4px solid var(--accent); border-radius: 7px; padding: 5px 7px; line-height: 1.25; }
.p5-t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p5-t span { font-size: 12px; color: var(--muted); }
.p5-t.run { border-left-color: var(--standard); background: var(--ok-bg); }
.p5-t.chaud { border-left-color: var(--urgent); }
.p5-t.attente { border-left-style: dashed; border-left-color: #9aa3b2; opacity: .75; }
.p5-legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.lg5 { display: inline-block; width: 14px; height: 10px; border-left: 4px solid var(--accent); background: var(--soft); margin-right: 5px; vertical-align: middle; }
.lg5.run { border-left-color: var(--standard); background: var(--ok-bg); } .lg5.chaud { border-left-color: var(--urgent); } .lg5.attente { border-left: 4px dashed #9aa3b2; }
.p5-alertes { margin-top: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 700; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
body.tv .plan5 { gap: .5vw; grid-template-columns: minmax(110px, 8vw) repeat(var(--jours), minmax(0, 1fr)); }
body.tv .p5-jour { font-size: clamp(16px, 1.3vw, 30px); color: #cfd6e2; }
body.tv .p5-jour.auj { background: #1b4dd8; color: #fff; }
body.tv .p5-poste { color: #9aa3b2; font-size: clamp(14px, 1.1vw, 26px); }
body.tv .p5-case { background: #161a21; }
body.tv .p5-case.auj { box-shadow: inset 0 0 0 2px #2a4db0; background: #1a2233; }
body.tv .p5-t { background: #222938; color: #f2f4f7; }
body.tv .p5-t b { font-size: clamp(14px, 1.15vw, 26px); }
body.tv .p5-t span { color: #b7bfcc; font-size: clamp(12px, .9vw, 20px); }
body.tv .p5-t.run { background: #14432a; }
body.tv .p5-legende { color: #9aa3b2; font-size: clamp(13px, .9vw, 20px); }
body.tv .p5-alertes { font-size: clamp(14px, 1.1vw, 24px); }

/* ---------- Stock ---------- */
.choix-vue a { text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 9px; color: var(--muted); }
.choix-vue a.on { background: var(--ink); color: #fff; }
.stock-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.stock-ref { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.stock-ref-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.stock-nom { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: 18px; }
.stock-grille-wrap { overflow-x: auto; }
table.stock-grille { border-collapse: collapse; width: 100%; }
table.stock-grille th { font-size: 12px; color: var(--muted); padding: 6px; border-bottom: 2px solid var(--line); }
table.stock-grille td { border-bottom: 1px solid var(--line); padding: 4px; text-align: center; }
.sc-nom { text-align: left !important; white-space: nowrap; font-weight: 700; }
.sc-nom .sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); vertical-align: -3px; margin-right: 6px; }
.sc-in { display: flex; align-items: center; justify-content: center; gap: 2px; }
.sc-in button { border: 0; background: none; font-weight: 800; font-size: 18px; width: 28px; height: 34px; border-radius: 8px; color: var(--muted); }
.sc-in button:hover { background: var(--soft); color: var(--ink); }
.sc-in .sc-n { font-family: ui-monospace, Menlo, monospace; font-size: 17px; color: var(--ink); min-width: 36px; }
.sc small { display: block; font-size: 11px; color: var(--muted); }
.sc.low { background: #fff3e0; } .sc.low .sc-n { color: #9a5200; }
.sc.zero { background: var(--bad-bg); } .sc.zero .sc-n { color: var(--bad); }
.sc-tot { font-weight: 800; font-family: ui-monospace, Menlo, monospace; }
.stock-ligne { margin: 8px 0 4px; font-size: 14px; padding: 6px 10px; border-radius: 8px; background: var(--soft); }
.stock-ligne.ok { background: var(--ok-bg); color: var(--ok); }
.stock-ligne.manque { background: #fff3e0; color: #9a5200; }
.stock-ligne:not(.ok):not(.manque) { background: none; padding: 0; }
.sc-coul { border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0; color: inherit; } .sc-coul:hover { text-decoration: underline; }
.tx-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tx-table th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; padding: 4px 6px; border-bottom: 2px solid var(--line); }
.tx-table td { padding: 6px; border-bottom: 1px solid var(--line); }
.tx-table td.reste { color: var(--urgent); font-weight: 800; }
.tx-total { margin: 8px 0 0; } .tx-total .ok { color: var(--ok); font-weight: 700; }
.faces-fact { font-size: 20px; }
.a-commander { color: var(--ink) !important; font-size: 14px; margin-top: 2px; }
.qt-liste { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; vertical-align: middle; }
.qt { white-space: nowrap; color: var(--ink); }
.qt b { font-size: 1.1em; }
.qt-taille { display: inline-block; background: #e6e9ee; color: #3d4450; border-radius: 5px; padding: 0 6px; font-weight: 700; font-size: .9em; }
.ok-total { color: var(--ok); font-weight: 700; }
@media (max-width: 560px) {
  .tailles { gap: 4px; }
  .tailles .planche { padding: 4px 2px; gap: 3px; font-size: 13px; }
  .tailles .planche input { font-size: 16px; padding: 6px 0; }
}
.stock-form { margin-top: 10px; display: grid; gap: 8px; }
.stock-produit { border: 2px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.sp-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-tete select { flex: 1; min-width: 200px; font: inherit; padding: 8px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.sp-etat { margin-top: 8px; font-size: 14px; padding: 6px 10px; border-radius: 8px; background: var(--soft); }
.sp-etat.ok { background: var(--ok-bg); color: var(--ok); } .sp-etat.manque { background: #fff3e0; color: #9a5200; }
.stock-dispo { margin: 8px 0 4px; display: grid; gap: 4px; justify-items: start; }
.stock-dispo .stock-ligne { margin: 0; width: 100%; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.stock-dispo .stock-ligne .btn { margin-left: auto; }

/* Maquette d'une commande de l'espace pro : silhouettes à l'échelle, devant en haut, dos en dessous. */
.maquette-pro { margin-bottom: 12px; }
.maquette-pro .mp-titre { margin-bottom: 8px; }
.maquette-pro .vues { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 460px; margin: 0 auto; }
.maquette-pro .vue { margin: 0; background: #f7f6f6; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 4px; }
.maquette-pro .vue svg { width: 100%; height: auto; display: block; }
.maquette-pro .vue figcaption { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.maquette-pro .tee { fill: var(--tex, #fff); stroke: #8f898c; stroke-width: 1.4; stroke-linejoin: round; }
.maquette-pro .col { fill: none; stroke: #8f898c; stroke-width: 1.4; }
.maquette-pro .ph { fill: rgba(231, 39, 129, .18); stroke: #e72781; stroke-width: .8; }
.maquette-pro .ph-t { font: 700 6px ui-monospace, monospace; fill: #c01767; text-anchor: middle; }
.maquette-pro .mp-logos { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.maquette-pro .mp-logos li { display: flex; gap: 10px; align-items: center; }
.maquette-pro .vue.zoom { width: 84px; flex: none; padding: 2px; }
