/* ===== MIS Atelier ===== */
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(../fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url(../fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url(../fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700 900; font-display: swap; src: url(../fonts/figtree-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 800; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }

:root {
  --bg: #eef0f4; --surface: #ffffff; --surface-2: #f7f8fa; --line: #dde2ea; --line-2: #eef0f4;
  --text: #111827; --muted: #5b6475; --faint: #8a93a3;
  --navy: #0f172a; --accent: #1d4ed8; --accent-bg: #eef3ff; --accent-bd: #9db4f0;
  --brand: #c0007f; --brand-bg: #fdf0f8; --teal: #0f766e; --teal-bg: #e7f6f3;
  --ok: #15803d; --ok-bg: #e9f8ef; --warn: #b45309; --warn-bg: #fdf3e6; --danger: #b91c1c; --danger-bg: #fdecec;
  --col-afaire: #64748b; --col-encours: #2563eb; --col-attente: #d97706; --col-pret: #15803d; --col-rendu: #475569;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 2px 10px rgba(15,23,42,.05);
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
body.theme-dark {
  --bg: #0b1120; --surface: #131c2e; --surface-2: #0f172a; --line: #243149; --line-2: #1b2539;
  --text: #e8eef8; --muted: #9fb0cb; --faint: #6f81a0; --accent-bg: #172554; --shadow: 0 2px 10px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.spacer { flex: 1; }
h1.title { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; }

/* ---------- barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 60px; background: var(--navy); color: #e2e8f0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-family: "Figtree"; font-size: 11.5px; letter-spacing: .04em; }
.nav { display: flex; gap: 2px; }
.nav a { color: #cbd5e1; text-decoration: none; padding: 8px 13px; border-radius: 8px; font-weight: 600; }
.nav a:hover { background: #1e293b; }
.nav a.active { background: #1e293b; color: #fff; box-shadow: inset 0 -2px 0 var(--brand); }
.search { position: relative; }
.search input { width: 280px; padding: 8px 12px 8px 32px; border-radius: 9px; border: 1px solid #334155; background: #1e293b; color: #f1f5f9; }
.search input::placeholder { color: #94a3b8; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 6px; color: #94a3b8; font-size: 16px; }
.search-results { position: absolute; right: 0; top: 42px; width: 460px; max-height: 65vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.25); padding: 6px; }
.search-results .res { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 8px; color: inherit; text-decoration: none; }
.search-results .res:hover { background: var(--surface-2); }
.search-results .m { color: var(--muted); font-size: 13px; }
.search-results .d { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.live { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #94a3b8; white-space: nowrap; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.live.on .dot { background: #22c55e; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #e2e8f0; white-space: nowrap; font-weight: 600; }
.btn-ghost-dark { background: transparent; border: 1px solid #334155; color: #cbd5e1; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-weight: 500; }
.btn-ghost-dark:hover { background: #1e293b; }

/* ---------- boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #c3cad6; background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.brand { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(192,0,127,.25); }
.btn.teal { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(15,118,110,.25); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(21,128,61,.25); }
.btn.danger { color: var(--danger); }
.btn.big { padding: 14px 24px; font-size: 16.5px; font-weight: 800; border-radius: 12px; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary:hover, .btn.brand:hover, .btn.teal:hover, .btn.ok:hover { filter: brightness(1.08); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #cfd6e1; background: var(--surface); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.input.big { font-size: 19px; padding: 13px 15px; border: 2px solid var(--accent); border-radius: 12px; }
.hint { font-size: 12.5px; color: var(--muted); }
.suffix { display: flex; align-items: center; border: 1.5px solid #cfd6e1; border-radius: 10px; background: var(--surface); overflow: hidden; }
.suffix input { border: 0 !important; box-shadow: none !important; min-width: 0; }
.suffix span { padding: 0 12px; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* chips / tuiles */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 99px; border: 1.5px solid #cfd6e1; background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip:hover { border-color: #aab4c5; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.soft.on { background: var(--accent-bg); color: var(--accent); }
.chip.green.on { background: var(--ok-bg); border-color: var(--ok); color: #166534; }
.chip.teal.on { background: var(--teal-bg); border-color: var(--teal); color: #115e59; }
.chip.square { border-radius: 10px; padding: 11px 16px; font-size: 15px; }
.chip.mini { padding: 6px 11px; font-size: 13px; font-weight: 500; background: var(--surface-2); border-width: 1px; }
.chip svg { flex-shrink: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.tile { height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 15px; }
.tile:hover { border-color: #aab4c5; }
.tile.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.teal-mode .tile.on { border-color: var(--teal); background: var(--teal-bg); color: var(--teal); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; background: var(--col-afaire); }
.tag { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--teal); color: #fff; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: #dfe3ea; }
.seg button, .seg a { border: 0; background: transparent; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 14.5px; cursor: pointer; color: #374151; text-decoration: none; }
.seg .on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.seg .on.teal { color: var(--teal); }

/* ---------- cartes ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }

/* ---------- accueil : étapes ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 20px 28px 40px; max-width: 1500px; margin: 0 auto; }
.intake-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.progress { width: 220px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > div { height: 6px; background: var(--accent); border-radius: 99px; transition: width .25s; }
.teal-mode .progress > div { background: var(--teal); }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { background: var(--surface); border-radius: var(--radius); border: 1px solid #e3e7ee; transition: box-shadow .15s, border-color .15s; }
.step.open { border-color: var(--accent-bd); box-shadow: 0 6px 22px rgba(29,78,216,.10); }
.teal-mode .step.open { border-color: #8fd0c4; box-shadow: 0 6px 22px rgba(15,118,110,.10); }
.step-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 20px; background: none; border: 0; cursor: pointer; text-align: left; }
.step-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--line-2); color: var(--faint); }
.step.open .step-num { background: var(--accent); color: #fff; }
.teal-mode .step.open .step-num { background: var(--teal); }
.step.done .step-num { background: #dcfce7; color: var(--ok); }
.step-title { font-weight: 700; font-size: 17px; }
.step.future .step-title { color: var(--faint); }
.step-sum { margin-left: auto; color: #374151; font-weight: 500; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-body { padding: 0 20px 20px 64px; display: flex; flex-direction: column; gap: 14px; }
.step:not(.open) .step-body { display: none; }
.step-actions { display: flex; justify-content: flex-end; gap: 10px; }
.results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.result { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; text-align: left; }
.result:hover, .result.kb { background: var(--accent-bg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e8edfb; color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.result .who { display: flex; flex-direction: column; gap: 1px; }
.result .who b { font-size: 16px; }
.result .who span, .muted { color: var(--muted); font-size: 13px; }
.result .hist { margin-left: auto; font-size: 12.5px; color: #374151; background: var(--surface-2); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.client-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: #f5f8ff; border: 1px solid #c9d6f6; }
.teal-mode .client-card { background: #f1faf8; border-color: #b8e2da; }
.new-client { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 10px; border: 1.5px dashed var(--accent); background: #f5f8ff; color: var(--accent); font-weight: 700; font-size: 15px; cursor: pointer; }
.teal-mode .new-client { border-color: var(--teal); color: var(--teal); background: #f1faf8; }

/* bande des jours */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.day-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.day-btn .dn { font-size: 13px; color: var(--muted); font-weight: 600; }
.day-btn .dd { font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1; }
.day-btn .dm { font-size: 12px; color: var(--muted); }
.day-btn .st { font-size: 12px; font-weight: 700; margin-top: 3px; }
.day-btn.libre .st { color: var(--ok); } .day-btn.reserve .st { color: var(--warn); } .day-btn.complet .st { color: var(--danger); }
.day-btn.urgence .st { color: var(--muted); }
.day-btn.complet, .day-btn.urgence { background: var(--surface-2); }
.day-btn.on { border-color: var(--brand); background: var(--brand-bg); }
.teal-mode .day-btn.on { border-color: var(--teal); background: var(--teal-bg); }
.day-btn .badge { position: absolute; top: -10px; padding: 2px 8px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.teal-mode .day-btn .badge { background: var(--teal); }
.segs { display: flex; gap: 3px; margin-top: 6px; }
.segs span { width: 12px; height: 7px; border-radius: 2px; background: #dde2ea; }
.segs span.full { background: #334155; } .segs span.res { background: #f4c6e2; }
.legend { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #374151; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

/* récap */
.recap { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.ticket { background: var(--surface); border-radius: 16px; border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.ticket-head { padding: 15px 20px; background: var(--navy); color: #fff; display: flex; align-items: baseline; gap: 10px; }
.teal-mode .ticket-head { background: var(--teal); }
.ticket-head small { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.teal-mode .ticket-head small { color: #ccefe9; }
.ticket-head b { font-family: var(--display); font-size: 22px; }
.ticket-rows { padding: 6px 20px 12px; }
.ticket-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.ticket-row span:first-child { width: 104px; flex-shrink: 0; color: var(--muted); font-weight: 600; }
.ticket-row span:last-child { font-weight: 600; word-break: break-word; }
.ticket-row.empty span:last-child { color: #9aa3b2; }

/* ---------- overlay de confirmation ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.overlay .box { width: min(580px, 100%); background: var(--surface); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.overlay .ok-ic { width: 56px; height: 56px; border-radius: 50%; background: #dcfce7; color: var(--ok); display: grid; place-items: center; }
.overlay h3 { margin: 0; font-family: var(--display); font-size: 25px; }
.overlay .lines { display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; color: #374151; }

/* ---------- planning ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px 8px; flex-wrap: wrap; }
.toolbar h1 { font-size: 20px; margin: 0 6px; }
.plegend { display: flex; gap: 14px; margin-left: auto; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.plegend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.playout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 8px 24px 40px; align-items: start; }
@media (max-width: 1250px) { .playout { grid-template-columns: 1fr; } }
.week-title { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 10px; font-size: 17px; position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 8px 0; }
.week-title .wt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 6px; background: var(--brand); color: #fff; }
.week-title .wt.next { background: var(--accent); } .week-title .wt.past { background: #94a3b8; }
.week-title .sub { font-weight: 500; }
.week-block { margin-bottom: 22px; }
.past-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin: 26px 0 12px; }
.past-sep::before, .past-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day { display: grid; grid-template-columns: 110px minmax(0, 1fr) 190px; background: var(--surface); border: 1.5px solid #e3e7ee; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.day-label { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; background: #fbf1f8; color: #86198f; }
.day-label .dn { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.day-label .dd { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; }
.day-label .dm { font-size: 12px; }
.day-label .reste { margin-top: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.day-label .segs span { flex: 1; width: auto; }
.day-label .note { font-size: 11px; margin-top: 2px; }
.day.today { border-color: var(--brand); }
.day.today .day-label { background: var(--brand); color: #fff; }
.day.past .day-label { background: var(--surface-2); color: var(--muted); }
.day-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.row-title::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.slots { display: grid; grid-template-columns: repeat(var(--slots, 5), minmax(0, 1fr)); gap: 8px; }
.card { --c: #64748b; position: relative; min-height: 84px; padding: 9px 10px; border-radius: 10px; cursor: pointer; background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--c) 32%, var(--line)); display: flex; flex-direction: column; gap: 3px; min-width: 0; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,.12); }
.card .client { font-weight: 800; text-transform: uppercase; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .numf { font-size: 11px; color: var(--muted); margin-left: auto; }
.card .badge { position: absolute; top: -9px; right: 8px; padding: 1px 8px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; }
.card.rdv { box-shadow: 0 0 0 2px var(--brand); }
.card.late { border-color: var(--danger); background: #fdf6f6; }
.card.rendu { opacity: .6; }
.card.flash, .tcard.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px #facc15; } 100% { box-shadow: 0 0 0 0 transparent; } }
.card.dragging { opacity: .4; }
.slot-empty { min-height: 84px; border: 1.5px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: #b6c1d1; font-size: 20px; cursor: pointer; background: transparent; }
.slot-empty:hover { border-color: var(--accent); color: var(--accent); }
.drop-over { outline: 3px solid #facc15; outline-offset: 1px; }
.site-list { display: flex; flex-direction: column; gap: 6px; }
.site-line { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; background: #f0f9ff; border: 1px solid #bae6fd; cursor: pointer; text-decoration: none; color: inherit; }
.site-line .h { font-weight: 800; color: #0369a1; min-width: 60px; }
.site-line .n { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-line { align-self: flex-start; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.add-line:hover { color: var(--accent); border-color: var(--accent); }
.neuf-col { padding: 10px 12px; border-left: 1px solid var(--line-2); background: #f7fbfa; display: flex; flex-direction: column; gap: 5px; }
.neuf-col .row-title { color: var(--teal); }
.neuf-col .row-title::after { background: #d3ece7; }
.nitem { --c: #0f766e; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; background: #fff; border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); cursor: pointer; text-decoration: none; color: inherit; }
.nitem b { font-size: 12.5px; text-transform: uppercase; }
.nitem span { font-size: 11.5px; color: #374151; }
.nitem.done { background: var(--ok-bg); }
.nfree { font-size: 12px; color: var(--muted); }
.aside { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; }
.abox { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.abox h2 { margin: 0; padding: 10px 14px; font-size: 13.5px; color: #fff; display: flex; justify-content: space-between; }
.abox.green h2 { background: var(--ok); } .abox.red h2 { background: var(--danger); } .abox.orange h2 { background: var(--warn); }
.abox .list { max-height: 34vh; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.aitem { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: inherit; }
.aitem:hover { background: var(--line-2); }
.aitem b { font-size: 13.5px; }
.aitem span { font-size: 12px; color: var(--muted); }
.aitem .late { color: var(--danger); font-weight: 700; }
.abox .empty { color: var(--muted); padding: 12px; text-align: center; font-size: 13px; }
.load-more { display: block; margin: 8px auto 30px; }

/* ---------- fiche ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 16px; }
.fiche-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 500; }
.hist { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.hist b { color: var(--text); font-weight: 600; }
.etat-grid { display: flex; flex-direction: column; gap: 8px; }
.etat-grid .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.opt { --c: #64748b; border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: 9px; padding: 7px 10px; cursor: pointer; font-size: 12.5px; font-weight: 700; }
.opt.cur { background: var(--c); color: #fff; }

/* ---------- rapport ---------- */
.rapport { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.counter { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid #c6e9d3; background: #f3fbf6; }
.counter.bad { border-color: #f5caca; background: #fdf6f6; }
.counter b { flex: 1; }
.counter button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid #cfd6e1; background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.counter .v { min-width: 28px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--ok); }
.counter.bad .v { color: var(--danger); }
.forfaits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.forfait { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid #e3e7ee; background: #fff; cursor: pointer; text-align: left; }
.forfait.on { border-color: var(--ok); background: #f3fbf6; }
.forfait .box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #aab4c5; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.forfait.on .box { border-color: var(--ok); background: var(--ok); }
.forfait .lib { flex: 1; font-weight: 600; }
.total { font-family: var(--display); font-size: 30px; font-weight: 800; }
.actionbar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.segbtns { display: inline-flex; border: 1.5px solid #cfd6e1; border-radius: 10px; overflow: hidden; }
.segbtns button { padding: 9px 16px; border: 0; background: #fff; font-weight: 700; cursor: pointer; }
.segbtns button + button { border-left: 1px solid #e3e7ee; }

/* ---------- atelier (kanban) ---------- */
body.kanban { overflow: hidden; }
.board-head { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.clock { font-family: var(--display); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.date-long { font-size: 16px; color: var(--muted); text-transform: capitalize; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; height: calc(100vh - 60px - 70px); }
.col { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; min-height: 0; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 3px solid var(--cc); }
.col-head h2 { margin: 0; font-size: 19px; text-transform: uppercase; letter-spacing: .05em; }
.col-head .n { margin-left: auto; min-width: 34px; text-align: center; background: var(--cc); color: #fff; font-weight: 800; font-size: 17px; border-radius: 99px; padding: 2px 10px; }
.col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.col.drop-over { outline: 3px dashed #facc15; outline-offset: -3px; }
.tcard { --c: #64748b; position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 12px; padding: 12px 14px; cursor: grab; box-shadow: var(--shadow); }
.tcard .client { font-size: 21px; font-weight: 800; text-transform: uppercase; line-height: 1.15; word-break: break-word; }
.tcard .meta { font-size: 15px; color: var(--muted); margin-top: 3px; }
.tcard .row { margin-top: 8px; }
.tcard .pill { font-size: 12.5px; padding: 3px 10px; }
.tcard .age { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.tcard .age.old { color: #f87171; }
.tcard .badge { position: absolute; top: -10px; right: 10px; padding: 2px 9px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; }
.tcard.late { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
.tcard.rendu { opacity: .55; padding: 8px 12px; }
.tcard.rendu .client { font-size: 15px; }
body.dense .tcard .client { font-size: 16px; } body.dense .tcard { padding: 8px 10px; } body.dense .tcard .meta { font-size: 13px; }
.readonly .tcard { cursor: default; }
.popover { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.45); padding: 12px; width: 370px; max-height: 80vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.popover h4 { margin: 0; font-size: 16px; text-transform: uppercase; }
.popover .opts { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.admin-menu { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-menu .grp { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.admin-menu button { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 9px; border: 0; background: transparent; font-weight: 600; cursor: pointer; text-align: left; }
.admin-menu button:hover { background: var(--surface-2); }
.admin-menu button.on { background: var(--accent-bg); color: var(--accent); }
.admin-menu small { color: var(--faint); font-weight: 700; }
.admin-main { padding: 22px 30px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.trow { display: grid; gap: 10px; align-items: center; padding: 7px 2px; border-top: 1px solid var(--line-2); }
.thead { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 0; }
.trow input[type=text], .trow input:not([type]), .trow select { padding: 8px 10px; border: 1.5px solid #e3e7ee; border-radius: 9px; width: 100%; background: var(--surface); }
.switch { width: 50px; height: 28px; border-radius: 99px; border: 0; background: #cfd6e1; cursor: pointer; position: relative; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: var(--ok); }
.switch.on::after { left: 25px; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e3e7ee; background: #fff; cursor: pointer; color: #374151; }
.iconbtn.del { color: var(--danger); border-color: #f0c4c4; font-weight: 700; }
.poids { display: flex; gap: 4px; }
.poids button { width: 36px; height: 34px; border-radius: 8px; border: 1.5px solid #cfd6e1; background: #fff; font-weight: 700; cursor: pointer; }
.poids button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.techs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tech { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tech.off { opacity: .55; }
.tech .av { width: 46px; height: 46px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; cursor: pointer; box-shadow: 0 0 0 1px #cfd6e1; }
.swatch.on { box-shadow: 0 0 0 2px #111827; }
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.setting .v { min-width: 64px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 800; }

/* ---------- stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--display); font-size: 28px; font-weight: 800; margin-top: 2px; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 190px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted); }
.bar .b { width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar .n { font-weight: 700; color: var(--text); }
.hbar { display: grid; grid-template-columns: 220px 1fr 50px; gap: 10px; align-items: center; font-size: 13.5px; padding: 4px 0; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.hbar .track div { height: 10px; background: var(--brand); border-radius: 99px; }

/* ---------- divers ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #0f172a; color: #f1f5f9; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 13.5px; max-width: 400px; }
.toast.err { background: #b91c1c; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #86198f 0%, transparent 55%), #0b1120; padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 12px; }
.login-card .brand { color: #0f172a; margin-bottom: 6px; }
.login-card .brand .logo { color: #fff; }
.login-card .check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #475569; }
.login-card .err { color: var(--danger); font-size: 13px; min-height: 18px; }
.login-card .btn { justify-content: center; }
dialog.overlay-dlg { border: 0; padding: 0; background: transparent; }
dialog.overlay-dlg::backdrop { background: rgba(15,23,42,.55); }
dialog .box { background: var(--surface); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
