/* AR'COLOR Commandes — charte : blanc dominant, panneau marine en biais, liseré magenta, Avant Garde */
@font-face { font-family: "AG"; src: url("../fonts/AvantGarde-Book.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AG"; src: url("../fonts/AvantGarde-Bold.ttf"); font-weight: 700; font-display: swap; }

:root {
  --marine: #28305B; --marine-2: #323B6E; --magenta: #EB098B; --magenta-ink: #C9077A; --magenta-fill: #D4087F; --magenta-soft: #FDE7F3;
  --surface: #FFFFFF; --paper: #F7F6F3; --ink: #28305B; --ink-muted: #62688B; --line: #E3E4EC; --field: #FFFFFF;
  --on-marine: #FFFFFF; --on-marine-muted: rgba(255,255,255,.66); --on-marine-line: rgba(255,255,255,.16);
  --ok: #1F7A55; --ok-soft: #E3F3EC; --warn: #A04B0B; --warn-soft: #FBEEE3; --late: #C0263A; --late-soft: #FCE8EB;
  --shadow: 0 1px 2px rgba(40,48,91,.06), 0 4px 16px rgba(40,48,91,.06);
  --shadow-lg: 0 12px 48px rgba(20,24,50,.22);
  --font: "AG", "Century Gothic", "URW Gothic", "Avant Garde", sans-serif;
  --r: 6px; --side: 248px; --bias: 26px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --surface: #12152B; --paper: #181D38; --ink: #F3F2EE; --ink-muted: #A9AECB; --line: #2C3256; --field: #181D38;
  --magenta-soft: #3A1530; --magenta-ink: #F04BA6; --ok: #5CC79A; --ok-soft: #14322A; --warn: #F0A35E; --warn-soft: #3A2A18; --late: #FF7A8A; --late-soft: #3A1820;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 48px rgba(0,0,0,.5); color-scheme: dark; } }
:root[data-theme="dark"] {
  --surface: #12152B; --paper: #181D38; --ink: #F3F2EE; --ink-muted: #A9AECB; --line: #2C3256; --field: #181D38;
  --magenta-soft: #3A1530; --magenta-ink: #F04BA6; --ok: #5CC79A; --ok-soft: #14322A; --warn: #F0A35E; --warn-soft: #3A2A18; --late: #FF7A8A; --late-soft: #3A1820;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 48px rgba(0,0,0,.5); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--surface); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.small { font-size: 12px; line-height: 17px; }
.dot { display: inline-block; width: .16em; height: .16em; border-radius: 50%; background: var(--magenta); margin-left: .06em; }
.eyebrow { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }

/* ——— Structure ——— */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; color: var(--on-marine); z-index: 20; }
.side-panel { position: absolute; inset: 0; background: var(--marine); clip-path: polygon(0 0, 100% 0, calc(100% - var(--bias)) 100%, 0 100%); overflow: hidden; }
.side-lisere { position: absolute; top: 0; bottom: 0; right: -6px; width: calc(var(--bias) + 6px); background: var(--magenta); clip-path: polygon(calc(100% - 5px) 0, 100% 0, calc(var(--bias) * 0 + 5px) 100%, 0 100%); }
.side-rings { position: absolute; left: -90px; bottom: -90px; width: 300px; height: 300px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 0 58px, rgba(255,255,255,.07) 58px 60px, transparent 60px 92px, rgba(255,255,255,.07) 92px 94px, transparent 94px 126px, rgba(255,255,255,.07) 126px 128px, transparent 128px); }
.side-inner { position: relative; height: 100%; display: flex; flex-direction: column; padding: 22px 30px 18px 18px; gap: 18px; overflow-y: auto; scrollbar-width: none; }
.side-inner::-webkit-scrollbar { display: none; }
/* Écran peu haut (portable 1366 × 768) : menu plus compact pour que « Se déconnecter » reste visible */
.side-logo { display: block; width: 150px; height: auto; margin: 2px auto 4px 8px; }
.btn-new { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--magenta-fill); color: #fff; border: 0; border-radius: var(--r); padding: 11px 14px; font-weight: 700; font-size: 14px; }
.btn-new:hover { filter: brightness(1.06); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--on-marine-muted); font-weight: 700; font-size: 14px; position: relative; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 3px 3px 0; background: var(--magenta); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: 13px; }
.me { display: flex; align-items: center; gap: 10px; }
.me b { display: block; line-height: 1.2; }
@media (max-height: 820px) { .side-inner { gap: 12px; padding-top: 14px; padding-bottom: 12px; } .side-logo { width: 116px; } .nav a { padding: 8px 12px; } .nav a[aria-current="page"]::before { top: 7px; bottom: 7px; } }
.me button { background: none; border: 0; padding: 0; color: var(--on-marine-muted); font-size: 12px; text-decoration: underline; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--on-marine-muted); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--on-marine-muted); flex: none; }
.sync[data-s="ok"] i { background: #5CC79A; } .sync[data-s="warn"] i { background: #F0A35E; } .sync[data-s="run"] i { background: var(--magenta); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.head { padding: 26px 32px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head h1 { font-size: 40px; line-height: 1; letter-spacing: -.04em; }
.head .sub { margin-top: 6px; color: var(--ink-muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page { padding: 0 32px 48px; min-width: 0; flex: 1; }

/* ——— Mobile ——— */
.mtop, .mnav, .fab { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 30; height: calc(70px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); align-items: center; justify-content: space-between; color: #fff; overflow: hidden; }
  .mtop::before { content: ""; position: absolute; inset: 0; background: var(--marine); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  .mtop::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--magenta); }
  .mtop > * { position: relative; }
  .mtop img { height: 56px; width: auto; display: block; }
  .mtop .sync { color: var(--on-marine-muted); }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .mnav a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 10.5px; font-weight: 700; color: var(--ink-muted); text-decoration: none; position: relative; }
  .mnav a svg { width: 22px; height: 22px; }
  .mnav a[aria-current="page"] { color: var(--magenta-ink); }
  .mnav .badge { position: absolute; top: 3px; left: calc(50% + 6px); }
  .fab { display: grid; place-items: center; position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 25; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--magenta-fill); color: #fff; box-shadow: var(--shadow-lg); }
  .fab svg { width: 26px; height: 26px; }
  .head { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .head h1 { font-size: 30px; }
  .head .sub { display: none; }
  .hide-m { display: none !important; }
  .stats { gap: 8px; margin-bottom: 12px; }
  .stat { padding: 9px 11px; }
  .stat b { font-size: 21px; }
  .dr-title { font-size: 19px; }
  .page { padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
}

/* ——— Éléments ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: var(--r); font-weight: 700; font-size: 13px; line-height: 18px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink-muted); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--marine); border-color: var(--marine); color: #fff; }
.btn.accent { background: var(--magenta-fill); border-color: var(--magenta-ink); color: #fff; }
.btn.primary:hover, .btn.accent:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--late); border-color: var(--late-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on-m { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn.on-m:hover { border-color: #fff; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--ink-muted); }
.iconbtn:hover { background: var(--paper); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }

.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.badge.soft { background: var(--paper); color: var(--ink-muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--paper); color: var(--ink-muted); white-space: nowrap; line-height: 17px; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.mag { background: var(--magenta-soft); color: var(--magenta-ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.late { background: var(--late-soft); color: var(--late); }
.pill.marine { background: var(--marine); color: #fff; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; letter-spacing: 0; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.avatar.empty { background: transparent; border: 1.5px dashed var(--line); color: var(--ink-muted); }

.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--ink); }
.field small { color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.inp, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .search input {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); color: var(--ink); padding: 9px 11px; outline: none; }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.inp:focus, .field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--magenta-ink); box-shadow: 0 0 0 3px var(--magenta-soft); }
.unit { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); min-width: 0; }
.unit:focus-within { border-color: var(--magenta-ink); box-shadow: 0 0 0 3px var(--magenta-soft); }
.unit input, .unit select { flex: 1; min-width: 0; border: 0 !important; background: transparent; padding: 9px 11px; outline: none; color: var(--ink); }
.unit em { font-style: normal; font-size: 12px; color: var(--ink-muted); padding: 0 10px; display: flex; align-items: center; border-left: 1px solid var(--line); white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.full { grid-column: 1 / -1; }
.search { position: relative; min-width: 0; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-muted); pointer-events: none; }
/* Même dans un .field (dont la règle est plus précise), la loupe garde sa place à gauche du texte */
.search input, .search input:not([type=checkbox]):not([type=radio]) { padding-left: 36px; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 700; font-size: 13px; min-width: 0; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--magenta-ink); flex: none; }
.check small { margin-left: auto; font-weight: 400; color: var(--ink-muted); text-align: right; }
.check:has(input:checked) { border-color: var(--marine); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--ink-muted); }
.chip[aria-pressed="true"] { background: var(--marine); border-color: var(--marine); color: #fff; }
.chip .badge { height: 17px; min-width: 17px; font-size: 10.5px; }
.chip[aria-pressed="true"] .badge.soft { background: rgba(255,255,255,.18); color: #fff; }
.chip.sq { border-radius: var(--r); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink-muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--marine); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.empty { padding: 28px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-muted); text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty b { color: var(--ink); font-size: 15px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; max-width: 340px; }
.spacer { flex: 1; }
.err { color: var(--late); font-size: 13px; }
.sep { height: 1px; background: var(--line); margin: 6px 0; }
details.more > summary { cursor: pointer; font-weight: 700; font-size: 13px; list-style: none; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; line-height: 1; }
details.more[open] > summary::before { content: "−"; }

/* ——— Tableau des commandes ——— */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; min-height: 60vh; }
.col { background: var(--paper); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 120px; scroll-snap-align: start; transition: box-shadow .15s; }
.col.drop { box-shadow: inset 0 0 0 2px var(--magenta); }
.col-h { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 4px; }
.col-h h3 { font-size: 13px; letter-spacing: 0; }
.col-h .count { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.col-h .sum { margin-left: auto; font-size: 12px; color: var(--ink-muted); }
.col-step { width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); flex: none; align-self: center; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; display: grid; gap: 7px; cursor: pointer; box-shadow: var(--shadow); text-align: left; width: 100%; position: relative; }
.tcard:hover { border-color: var(--ink-muted); }
.tcard.dragging { opacity: .45; }
.tcard .top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-muted); font-weight: 700; letter-spacing: .02em; }
.tcard .top .badge { margin-left: auto; }
.tcard h4 { font-size: 14px; line-height: 1.3; letter-spacing: -.01em; }
.tcard .client { font-size: 12.5px; color: var(--ink-muted); line-height: 1.3; }
.tcard .bot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard .bot .amount { margin-left: auto; font-weight: 700; font-size: 13px; }
.tcard::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tc, transparent); }
.col-add { border: 1px dashed var(--line); background: transparent; border-radius: 8px; padding: 8px; color: var(--ink-muted); font-weight: 700; font-size: 12.5px; }
.col-add:hover { color: var(--ink); border-color: var(--ink-muted); }
.typedot { width: 8px; height: 8px; border-radius: 2px; flex: none; transform: rotate(45deg); }
@media (max-width: 900px) { .board { grid-auto-columns: 84%; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; } }

.ltable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ltable th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.ltable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ltable tr.click { cursor: pointer; } .ltable tr.click:hover td { background: var(--paper); }
.ltable td.r, .ltable th.r { text-align: right; }
.ltable small { display: block; color: var(--ink-muted); font-size: 12px; }
.tscroll { overflow-x: auto; }

/* ——— Panneau latéral (commande, mail) ——— */
.overlay { position: fixed; inset: 0; background: rgba(18, 21, 43, .38); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(640px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer.wide { width: min(980px, 100%); }
@keyframes slide { from { transform: translateX(40px); opacity: .6; } }
.dr-head { position: relative; padding: 18px 56px 16px 20px; background: var(--marine); color: #fff; overflow: hidden; display: grid; gap: 6px; flex: none; }
.dr-head::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 120px; background: var(--magenta); clip-path: polygon(52% 0, 56% 0, 30% 100%, 26% 100%); }
.dr-head .rings { position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, transparent 0 40px, rgba(255,255,255,.07) 40px 42px, transparent 42px 66px, rgba(255,255,255,.07) 66px 68px, transparent 68px 92px, rgba(255,255,255,.07) 92px 94px, transparent 94px); }
.dr-head > * { position: relative; }
.dr-head .eyebrow { color: var(--on-marine-muted); }
.dr-title { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; padding-right: 70px; }
.dr-title textarea { display: block; width: 100%; background: transparent; border: 0; border-bottom: 1px dashed transparent; color: #fff; font: inherit; font-weight: 700; padding: 0; outline: none; resize: none; overflow: hidden; line-height: 1.2; }
.dr-title textarea:hover, .dr-title textarea:focus { border-bottom-color: rgba(255,255,255,.4); }
.dr-close { position: absolute; top: 12px; right: 12px; z-index: 2; color: #fff; }
.dr-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 20px; align-content: start; }
.dr-foot { flex: none; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sec { display: grid; gap: 10px; }
.sec-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-h h3 { font-size: 15px; }
.sec-h .btn { margin-left: auto; }

.stepper { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: 1 0 auto; border: 0; background: var(--paper); color: var(--ink-muted); padding: 9px 12px; font-size: 12px; font-weight: 700; position: relative; white-space: nowrap; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); padding-left: 16px; }
.stepper button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 5px 0 0 5px; padding-left: 12px; }
.stepper button.done { background: color-mix(in srgb, var(--marine) 14%, var(--surface)); color: var(--ink); }
.stepper button[aria-current="step"] { background: var(--marine); color: #fff; }
.stepper button:hover:not([aria-current]) { color: var(--ink); }

.timeline { display: grid; gap: 0; }
.ev { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink-muted); }
.ev .ic svg { width: 14px; height: 14px; }
.ev p { margin: 0; font-size: 13px; }
.ev .when { font-size: 11.5px; color: var(--ink-muted); }
.ev.note .txt { white-space: pre-wrap; background: var(--paper); border-radius: 8px; padding: 9px 11px; margin-top: 4px; font-size: 13.5px; }
.composer { display: grid; gap: 8px; }
.composer textarea { min-height: 64px; }

.mlist { display: grid; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: transparent; border-left: 3px solid transparent; width: 100%; border-top: 0; border-right: 0; }
.mrow:hover { background: var(--paper); }
.mrow[aria-current="true"] { background: var(--paper); border-left-color: var(--magenta-ink); }
.mrow .who { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.mrow.unread .who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); flex: none; }
.mrow .date { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.mrow .subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1 / -1; }
.mrow.unread .subj { font-weight: 700; }
.mrow .snip { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1 / -1; }
.mrow .tags { grid-column: 1 / -1; display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.mailsplit { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-height: 70vh; background: var(--surface); }
.mailsplit .mlist { border-right: 1px solid var(--line); align-content: start; overflow-y: auto; max-height: 78vh; }
.mailpane { min-width: 0; display: flex; flex-direction: column; }
.mailpane .empty { margin: 24px; }
@media (max-width: 900px) { .mailsplit { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; margin: 0 -16px; } .mailsplit .mlist { border-right: 0; max-height: none; } .mailsplit .mailpane { display: none; } }
.mview { display: grid; gap: 14px; padding: 18px 20px; align-content: start; }
.mview h2 { font-size: 20px; line-height: 1.25; }
.mmeta { display: grid; gap: 2px; font-size: 13px; }
.mmeta b { font-weight: 700; }
.mactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; background: var(--paper); border-radius: 8px; }
.mactions select { width: auto; padding: 7px 10px; }
.mbody-frame { width: 100%; min-height: 280px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mbody-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-wrap: anywhere; }
.atts { display: flex; gap: 8px; flex-wrap: wrap; }
.att { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; text-decoration: none; max-width: 100%; }
.att:hover { border-color: var(--ink-muted); }
.att svg { width: 16px; height: 16px; color: var(--magenta-ink); flex: none; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: grid; gap: 6px; }
.thread button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 11px; display: grid; gap: 2px; font-size: 12.5px; }
.thread button:hover { border-color: var(--ink-muted); }
.suggest { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; padding: 10px 12px; border-left: 3px solid var(--magenta); background: var(--magenta-soft); border-radius: 0 8px 8px 0; }

/* ——— Fenêtres ——— */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(18, 21, 43, .45); display: grid; place-items: center; padding: 16px; animation: fade .15s; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; overflow: hidden; max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr) auto; }
.modal.wide { width: min(820px, 100%); }
.modal-h { padding: 18px 20px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 19px; }
.modal-h .iconbtn { margin-left: auto; }
.modal-b { padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; overflow-y: auto; align-content: start; }
.modal-f { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 560px) { .modal-wrap { padding: 0; place-items: end stretch; } .modal { border-radius: 14px 14px 0 0; max-height: 92vh; } }
.picklist { display: grid; border: 1px solid var(--line); border-radius: 8px; max-height: 280px; overflow-y: auto; }
.picklist button { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 10px 12px; display: grid; gap: 1px; }
.picklist button:last-child { border-bottom: 0; }
.picklist button:hover, .picklist button[aria-pressed="true"] { background: var(--paper); }
.picklist button[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--magenta); }
.picklist small { color: var(--ink-muted); font-size: 12px; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--marine); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 700; animation: fade .2s; border-left: 4px solid var(--magenta); }
.toast.bad { border-left-color: #FF7A8A; }
@media (max-width: 900px) { .toasts { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); } }

/* ——— Résumé ——— */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; text-align: left; background: var(--surface); }
button.stat:hover { border-color: var(--ink-muted); }
.stat b { font-size: 26px; line-height: 1.1; letter-spacing: -.03em; }
.stat span { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.stat.hot b { color: var(--magenta-ink); } .stat.late b { color: var(--late); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ——— Connexion ——— */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; }
.login-art .panel { position: absolute; inset: 0; background: var(--marine); clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
.login-art .lis { position: absolute; top: 0; bottom: 0; left: 0; width: 14%; background: var(--magenta); clip-path: polygon(calc(100% - 6px) 0, 100% 0, 6px 100%, 0 100%); }
.login-art .rings { position: absolute; right: -140px; bottom: -140px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, transparent 0 100px, rgba(255,255,255,.07) 100px 103px, transparent 103px 160px, rgba(255,255,255,.07) 160px 163px, transparent 163px 220px, rgba(255,255,255,.07) 220px 223px, transparent 223px); }
.login-art img { position: absolute; left: 50%; top: 50%; transform: translate(-42%, -50%); width: min(300px, 60%); }
.login-form { display: grid; place-items: center; padding: 32px 24px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 16px; }
.login-form h1 { font-size: 44px; line-height: 1; letter-spacing: -.04em; }
.login-form .lead { color: var(--ink-muted); margin: -6px 0 6px; }
.login-mobile-logo { display: none; width: 150px; }
@media (max-width: 800px) { .login { grid-template-columns: minmax(0, 1fr); } .login-art { display: none; } .login-mobile-logo { display: block; } .login-form { align-items: start; padding-top: 48px; } }

/* ——— Chiffrage ——— */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 32px; align-items: start; }
@media (max-width: 1100px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc-form { display: grid; gap: 24px; min-width: 0; }
.step { display: grid; gap: 10px; min-width: 0; }
.step-h { display: flex; align-items: baseline; gap: 10px; }
.step-h b { font-size: 12px; color: var(--magenta-ink); font-variant-numeric: tabular-nums; }
.step-h h3 { font-size: 17px; }
.step-h small { color: var(--ink-muted); font-size: 12px; margin-left: auto; }
.hint { font-size: 12px; line-height: 17px; color: var(--ink-muted); margin: 0; }
.ctx { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 8px; background: var(--magenta-soft); border-left: 3px solid var(--magenta); margin-bottom: 18px; font-size: 13px; }
.price { position: sticky; top: 16px; background: var(--marine); color: #fff; padding: 22px 22px 18px; border-radius: 4px; display: grid; gap: 14px; overflow: hidden; }
.price::after { content: ""; position: absolute; right: -40px; top: 0; height: 110px; width: 110px; background: var(--magenta); clip-path: polygon(62% 0, 67% 0, 40% 100%, 35% 100%); opacity: .9; }
.price > * { position: relative; z-index: 1; }
.price .eyebrow { color: var(--on-marine-muted); }
.big { font-size: 54px; line-height: .95; font-weight: 700; letter-spacing: -.04em; white-space: nowrap; }
.big .cur { font-size: .48em; margin-left: .1em; letter-spacing: 0; }
.ttc { color: var(--on-marine-muted); font-size: 13.5px; }
.lines { display: grid; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--on-marine-line); font-size: 13.5px; }
.line small { display: block; color: var(--on-marine-muted); font-size: 11.5px; line-height: 15px; }
.line span:last-child { white-space: nowrap; }
.price details { border-top: 1px solid var(--on-marine-line); padding-top: 10px; font-size: 12.5px; }
.price details > summary { cursor: pointer; font-weight: 700; color: var(--on-marine-muted); }
.price .dtable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.price .dtable td { padding: 5px 0; border-top: 1px solid var(--on-marine-line); vertical-align: top; }
.price .dtable td.r { text-align: right; white-space: nowrap; padding-left: 8px; }
.price .dtable small { display: block; color: var(--on-marine-muted); font-size: 11px; line-height: 14px; }
.price .dtable tr.cur td { font-weight: 700; color: var(--magenta-ink); }
.price .flag { font-size: 12px; color: var(--on-marine-muted); margin: 0; }
.price .warnbox { background: rgba(255,255,255,.08); border-radius: 6px; padding: 9px 11px; font-size: 12.5px; }
.price-empty { color: var(--on-marine-muted); font-size: 14px; }

/* ——— Devis ——— */
.dv { display: grid; gap: 18px; }
.dv-lines { display: grid; border-top: 1px solid var(--line); }
.dv-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 104px 76px 100px 64px; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dv-row.head { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; padding: 8px 0; }
.dv-row .desc { display: grid; gap: 5px; }
.dv-row input, .dv-row textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); padding: 7px 9px; outline: none; color: var(--ink); }
.dv-row textarea { min-height: 36px; resize: vertical; font-size: 12.5px; color: var(--ink-muted); }
.dv-row input:focus, .dv-row textarea:focus { border-color: var(--magenta-ink); box-shadow: 0 0 0 3px var(--magenta-soft); }
.dv-row .tot { text-align: right; font-weight: 700; padding-top: 8px; }
.dv-row .acts { display: flex; gap: 0; justify-content: flex-end; }
.dv-row .acts .iconbtn { width: 28px; height: 30px; }
.dv-row input.r { text-align: right; }
@media (max-width: 760px) {
  .dv-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dv-row .desc { grid-column: 1 / -1; } .dv-row.head { display: none; } .dv-row .tot { grid-column: 3 / 4; } .dv-row .acts { grid-column: 4 / 5; }
  .dv-row .lbl::before { content: attr(data-l); display: block; font-size: 10.5px; color: var(--ink-muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
}
.dv-tot { display: grid; gap: 6px; justify-self: end; width: min(320px, 100%); font-size: 14px; }
.dv-tot div { display: flex; justify-content: space-between; }
.dv-tot .ttcrow { background: var(--marine); color: #fff; padding: 9px 12px; border-radius: 4px; font-weight: 700; font-size: 16px; }

/* ——— Réglages ——— */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 11px 14px 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--magenta-ink); }
.setgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 36px; }
.setgroup { display: grid; gap: 10px; align-content: start; }
.setgroup h3 { font-size: 15px; }
.setgroup .grid-auto { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.editor { border: 1px solid var(--line); border-left: 4px solid var(--magenta); border-radius: 8px; padding: 16px; display: grid; gap: 14px; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ucard { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.ucard .row { display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-muted); } .kv dd { margin: 0; }
.rule { display: grid; grid-template-columns: 140px minmax(0, 1fr) 180px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
@media (max-width: 700px) { .rule { grid-template-columns: minmax(0, 1fr) auto; } .rule .rcat { grid-column: 1; } }
.formats { display: grid; gap: 8px; }
.formats .frow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: center; }

.loading { display: grid; place-items: center; min-height: 40vh; color: var(--ink-muted); }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--magenta-ink); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.demo-banner { background: var(--magenta-fill); color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px 12px; position: relative; z-index: 40; }

/* ——— Mails : arborescence des dossiers IONOS (à gauche) ——— */
.mailwrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; align-items: start; }
.mailcol { min-width: 0; }
.mtree { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 4px 4px 16px 0; font-size: 13.5px; scrollbar-width: thin; }
.mtree.inmodal { position: static; max-height: 62vh; padding: 0; }
.tsec { margin: 12px 0 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.tsec:first-child { margin-top: 0; }
.tnode { display: flex; align-items: center; padding-left: calc(var(--d) * 16px); }
.tchev { flex: none; width: 24px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-muted); padding: 0; border-radius: 4px; }
button.tchev:hover { color: var(--ink); background: var(--paper); }
.tchev svg { width: 14px; height: 14px; transition: transform .15s; }
.tchev[aria-expanded="true"] svg { transform: rotate(90deg); }
.titem { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; color: var(--ink); font-size: 13.5px; line-height: 18px; }
.titem.static { cursor: default; font-weight: 700; }
button.titem:hover { background: var(--paper); }
.titem[aria-current="true"] { background: color-mix(in srgb, var(--marine) 12%, var(--surface)); font-weight: 700; box-shadow: inset 3px 0 0 var(--magenta); }
.titem.drop { background: var(--magenta-soft); box-shadow: inset 0 0 0 2px var(--magenta); }
.titem svg { width: 17px; height: 17px; flex: none; color: var(--ink-muted); }
.titem[aria-current="true"] svg, .titem.hot svg { color: var(--magenta-ink); }
.tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcount { font-weight: 700; font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.titem.hot .tcount { color: var(--magenta-ink); }
.ttag { width: 11px; height: 11px; flex: none; margin: 0 3px; border-radius: 2px 6px 6px 2px; background: var(--c); }
.troot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.tree-btn { display: none; max-width: 60%; }
.tree-btn span { overflow: hidden; text-overflow: ellipsis; }
.mcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 10px; font-size: 14px; }
.mcrumb svg { width: 17px; height: 17px; color: var(--magenta-ink); }
.mfolder { margin-bottom: -6px; }
.mrow.dragging { opacity: .45; }
@media (max-width: 1250px) {
  .mailwrap { grid-template-columns: minmax(0, 1fr); }
  .mailwrap > .mtree { display: none; }
  .tree-btn { display: inline-flex; }
}

/* ——— Factures ——— */
.fc-row { grid-template-columns: 84px minmax(0, 1fr) 64px 96px 70px 84px 96px 64px; }
.fc-row select { width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); padding: 7px 6px; color: var(--ink); }
@media (max-width: 760px) {
  .fc-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fc-row .ref { grid-column: 1 / 2; } .fc-row .desc { grid-column: 1 / -1; grid-row: 1; }
  .fc-row .tot { grid-column: 3 / 4; } .fc-row .acts { grid-column: 4 / 5; }
}
.note-box { border: 1px solid var(--line); border-left: 3px solid var(--marine); border-radius: var(--r); padding: 10px 12px; font-size: 13px; background: var(--surface); }
.note-box.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note-box a { color: inherit; font-weight: 700; }
.ebpck { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer; }
.ebpck input { width: 16px; height: 16px; margin: 0; accent-color: var(--magenta-ink); }
.ebpck:has(input:checked) { color: var(--ok); }

.seg a.segbtn { padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink-muted); text-decoration: none; display: inline-flex; align-items: center; }
.seg a.segbtn[aria-current="page"] { background: var(--marine); color: #fff; }
.bl-row { grid-template-columns: 84px minmax(0, 1fr) 90px 90px 64px; }
.bl-row input.diff { border-color: var(--magenta-ink); color: var(--magenta-ink); font-weight: 700; }
@media (max-width: 760px) {
  .bl-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bl-row .desc { grid-column: 1 / -1; grid-row: 1; } .bl-row .acts { grid-column: 3 / 4; }
}

/* ——— Reprise des clients EBP ——— */
.steps-ebp { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.dropfile { display: block; border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; }
.dropfile:hover { border-color: var(--magenta-ink); }
.dropfile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropfile span { display: grid; gap: 4px; justify-items: center; color: var(--ink); }
.dropfile svg { width: 22px; height: 22px; color: var(--magenta-ink); }
.dropfile small { color: var(--ink-muted); }
.ic-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
@media (max-width: 760px) { .ic-map { grid-template-columns: minmax(0, 1fr); } }

/* ——— Rédaction des mails ——— */
.cmp { display: grid; gap: 6px; position: relative; }
.cmp-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 0; }
.cmp-row > span { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.cmp-row input { border: 0; outline: none; background: transparent; padding: 6px 2px; font-size: 14px; color: var(--ink); width: 100%; }
.cmp-row select.cmp-from { border: 0; outline: none; background: transparent; padding: 6px 2px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); width: auto; max-width: 100%; cursor: pointer; grid-column: span 2; justify-self: start; }
.cmp-row select.cmp-from:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; border-radius: 4px; }
.cmp-tools { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.cmp-tools > button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 4px 9px; font-size: 12.5px; color: var(--ink); min-width: 30px; }
.cmp-tools > button:hover { border-color: var(--ink-muted); }
.cmp-body { min-height: 260px; max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: #fff; color: #1c1f33; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5; outline: none; }
.cmp-body:focus { border-color: var(--magenta-ink); }
.cmp-body p { margin: 0 0 8px; }
.cmp-body img { max-width: 100%; }
.cmp-body .sig { color: #444; }
.cmp-atts { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-atts .chip svg { width: 13px; height: 13px; }
.cmp-atts .chip button { border: 0; background: none; color: var(--ink-muted); font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.cmp-sugg { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(20, 24, 50, .14); display: grid; overflow: hidden; }
.cmp-sugg button { border: 0; background: none; text-align: left; padding: 8px 10px; font-size: 13px; color: var(--ink); }
.cmp-sugg button:hover { background: var(--field); }
.mreply { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.modal-f .spacer { flex: 1; }
@media (max-width: 700px) { .cmp-row { grid-template-columns: 44px minmax(0, 1fr) auto; } .cmp-body { min-height: 200px; max-height: 45vh; } }

/* ——— BAT ——— */
.bat-vis { display: grid; gap: 8px; }
.bat-v { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.bat-v img { width: 88px; height: 62px; object-fit: contain; background: var(--field); border-radius: 4px; }
.bat-v input { width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); padding: 7px 9px; color: var(--ink); }
.bat-v > div { display: flex; }
.bat-prev { border-radius: 10px; overflow: hidden; background: var(--field); line-height: 0; }
.bat-prev canvas { display: block; width: 100%; height: auto; }

/* ——— Chorus Pro ——— */
.chorus-box { display: grid; gap: 10px; border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; }
.chorus-box .grid2 { margin: 0; }
.pill.chorus { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-muted); }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--magenta-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; border-radius: 3px; }
.chorus-box .check { flex-wrap: wrap; row-gap: 2px; }
.chorus-box .check small { flex-basis: 100%; margin-left: 27px; text-align: left; }

/* ——— Chiffres (tableau de bord) ——— */
:root { --c-arcolor: #EB098B; --c-stcyr: #2B7BC0; --c-type: #28305B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-arcolor: #F04BA6; --c-stcyr: #4F9BDC; --c-type: #A9AECB; } }
:root[data-theme="dark"] { --c-arcolor: #F04BA6; --c-stcyr: #4F9BDC; --c-type: #A9AECB; }
#tb { display: grid; gap: 16px; }
.tb-stats .stat em { font-style: normal; font-weight: 700; }
.tb-stats .stat em.up { color: var(--ok); } .tb-stats .stat em.down { color: var(--late); }
.tb-alerts { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-alerts .chip svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
.tb-card { padding: 16px; display: grid; gap: 12px; min-width: 0; }
.tb-h { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.tb-h h3 { margin: 0; font-size: 15px; }
.tb-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-muted); }
.tb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tb-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c-arcolor); flex: none; }
.tb-key.stcyr { background: var(--c-stcyr); }
.tb-key.n1 { height: 2px; width: 14px; border-radius: 1px; background: var(--ink); }
.tb-plot { position: relative; min-width: 0; }
#tb-chart { width: 100%; min-height: 260px; }
.tb-svg { display: block; }
.tb-grid { stroke: var(--line); stroke-width: 1; }
.tb-base { stroke: var(--ink-muted); stroke-width: 1; }
.tb-tick { fill: var(--ink-muted); font-size: 11px; font-family: var(--font); }
.tb-bar { stroke: var(--surface); stroke-width: 2px; paint-order: stroke; }
.tb-bar.arcolor { fill: var(--c-arcolor); } .tb-bar.stcyr { fill: var(--c-stcyr); }
.tb-n1 { stroke: var(--ink); stroke-width: 2px; stroke-linecap: round; }
.tb-hit { fill: transparent; cursor: default; }
.tb-hit.on { fill: var(--ink); fill-opacity: .05; }
.tb-tip { position: absolute; z-index: 3; min-width: 190px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; pointer-events: none; display: grid; gap: 3px; }
.tb-tip div { display: flex; align-items: center; gap: 6px; } .tb-tip .num { margin-left: auto; padding-left: 12px; }
.tb-tip .tb-tot { font-weight: 700; border-top: 1px solid var(--line); padding-top: 3px; }
.tb-table summary { cursor: pointer; font-size: 13px; color: var(--ink-muted); font-weight: 700; }
.tb-table[open] summary { margin-bottom: 8px; }
.tb-bas { align-items: start; }
.tb-hbars { display: grid; gap: 8px; }
.tb-hrow { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.tb-hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-htrack { height: 12px; display: block; }
.tb-hbar { display: block; height: 100%; background: var(--c-type); border-radius: 0 4px 4px 0; }
.tb-hv { color: var(--ink); min-width: 74px; text-align: right; }
@media (max-width: 560px) { .tb-stats .stat b { font-size: 20px; } .tb-hrow { grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; } }

/* ——— Tableaux sur téléphone : une fiche par ligne, chaque valeur avec son intitulé ——— */
@media (max-width: 640px) {
  .ltable thead { display: none; }
  .ltable, .ltable tbody { display: block; }
  .ltable tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .ltable td { display: block; padding: 0; border: 0; text-align: left !important; min-width: 0; }
  .ltable td:empty { display: none; }
  .ltable td:first-child, .ltable td:first-child:empty + td { flex: 1 1 100%; }
  .ltable td[data-th]:not(:first-child)::before { content: attr(data-th); display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; margin-bottom: 1px; }
  .ltable tr.click:hover td { background: none; } .ltable tr.click:active { background: var(--paper); }
  .tscroll { overflow-x: visible; }
}

.titem.tnew { color: var(--ink-muted); font-weight: 700; }
.titem.tnew:hover { color: var(--magenta-ink); }

/* Accessibilité : champ actif du composeur, mouvements réduits */
.cmp-row:focus-within { border-bottom-color: var(--magenta-ink); box-shadow: 0 1px 0 var(--magenta-ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ——— Mode test ——— */
.test-banner { position: sticky; top: 0; z-index: 60; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  background: #C62828; color: #fff; font-size: 12.5px; line-height: 16px; padding: 7px 14px; text-align: center; }
.test-banner b { letter-spacing: .14em; font-size: 12px; background: #fff; color: #C62828; padding: 2px 8px; border-radius: 3px; }
.test-banner a { color: #fff; font-weight: 700; text-decoration: underline; }
.test-banner[hidden] { display: none !important; }
html.en-test .side { top: 30px; height: calc(100vh - 30px); }
html.en-test .mtop { top: 30px; }
@media (max-width: 700px) { .test-banner span { display: none; } }
.mt-pastille { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.mt-etat.on { border-color: #C62828; box-shadow: inset 4px 0 0 #C62828; }
.mt-etat.on .mt-pastille { background: #C62828; color: #fff; }
