/* BREAKDOWN · Picture in Picture · identité « Acid » : noir, chartreuse, magenta, Outfit */
:root {
  --noir: #000; --fond: #070707; --carte: #111; --ligne: #1e1e1e; --ligne2: #2a2a2a;
  --texte: #f2f2f2; --texte2: #a8a8a8; --texte3: #6a6a6a;
  --acid: #BFFF00; --acid2: #8fc400; --mag: #FF3CAC; --mag2: #c21f7d;
  --jaune: #ffd23c; --bleu: #4cc9ff; --orange: #ff8c42;
  --r: 10px; --police: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--noir); color: var(--texte); font-family: var(--police); font-size: 14px; line-height: 1.35; }
body { padding: 0 16px 80px; -webkit-font-smoothing: antialiased; }
a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--ligne2); background: var(--carte); color: var(--texte); border-radius: 8px; padding: 7px 12px; transition: .15s; }
button:hover { border-color: var(--acid); color: var(--acid); }
button.prim { background: var(--acid); border-color: var(--acid); color: #000; font-weight: 600; }
button.prim:hover { background: #d4ff4d; color: #000; }
button.mag { background: var(--mag); border-color: var(--mag); color: #000; font-weight: 600; }
button.petit { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
button.fantome { background: transparent; border-color: transparent; color: var(--texte2); }
button.fantome:hover { color: var(--acid); border-color: transparent; }
input, select, textarea { background: #0d0d0d; border: 1px solid var(--ligne2); border-radius: 8px; padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--acid); }
::selection { background: var(--mag); color: #000; }

/* en-tête */
header.pip { display: flex; align-items: center; gap: 18px; padding: 18px 0 12px; border-bottom: 1px solid var(--ligne); position: sticky; top: 0; background: linear-gradient(#000 85%, transparent); z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.logo .pip-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--acid); position: relative; box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--acid); }
.logo .pip-mark::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 12px; height: 9px; background: var(--mag); border-radius: 2px; }
.logo small { display: block; font-weight: 400; color: var(--texte3); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
header h1 { font-size: 20px; font-weight: 600; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header h1 .client { color: var(--texte3); font-weight: 400; }
header h1 .client::after { content: " / "; }
.outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.moi { color: var(--texte2); font-size: 13px; }
.moi b { color: var(--acid); font-weight: 600; }

/* résumé */
.resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.tuile { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--r); padding: 12px 14px; }
.tuile .l { color: var(--texte3); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.tuile .v { font-size: 26px; font-weight: 600; margin-top: 2px; line-height: 1.1; }
.tuile .v small { font-size: 13px; color: var(--texte2); font-weight: 400; }
.tuile.acid .v { color: var(--acid); }
.tuile.mag .v { color: var(--mag); }
.barre { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--ligne2); margin-top: 10px; }
.barre i { display: block; height: 100%; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--texte2); }
.legende span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; background: var(--c); }

/* statuts */
.s-afaire { --c: #555; } .s-encours { --c: var(--bleu); } .s-avalider { --c: var(--jaune); }
.s-retours { --c: var(--mag); } .s-valide { --c: var(--acid); } .s-livre { --c: #fff; }
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--c); color: var(--c); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; background: color-mix(in srgb, var(--c) 10%, transparent); }
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.statut.s-livre, .statut.s-valide { font-weight: 600; }

/* séquences */
section.seq { margin: 26px 0 10px; }
.seq-titre { display: flex; align-items: baseline; gap: 12px; padding: 0 0 8px; border-bottom: 2px solid var(--acid); margin-bottom: 0; }
.seq-titre h2 { margin: 0; font-size: 17px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--acid); outline: none; }
.seq-titre h2[contenteditable]:focus { background: #0d0d0d; padding: 0 6px; border-radius: 4px; }
.seq-titre .n { color: var(--texte3); font-size: 12px; }
.seq-titre .sp { flex: 1; }
.seq-titre .actions { opacity: 0; transition: .15s; }
section.seq:hover .seq-titre .actions { opacity: 1; }

/* tableau */
table.plans { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.plans th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--texte3); padding: 10px 8px 6px; border-bottom: 1px solid var(--ligne); }
table.plans td { padding: 8px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
table.plans tr.plan:hover td { background: #0b0b0b; }
table.plans tr.plan.deplace td { opacity: .4; }
table.plans tr.cible td { box-shadow: inset 0 2px 0 var(--mag); }
td.poignee { width: 18px; padding: 10px 2px; color: var(--texte3); cursor: grab; text-align: center; font-size: 14px; user-select: none; }
td .rush { font-weight: 600; font-size: 13px; }
td .rush small { display: block; color: var(--texte3); font-weight: 400; font-size: 11px; margin-top: 2px; }
td.vig { width: 150px; }
.vignette { width: 134px; aspect-ratio: 16/11; border-radius: 6px; background: var(--carte) center/cover no-repeat; border: 1px solid var(--ligne2); display: flex; align-items: center; justify-content: center; color: var(--texte3); font-size: 11px; cursor: pointer; position: relative; overflow: hidden; }
.vignette:hover { border-color: var(--acid); }
.vignette.vide::after { content: "+ vignette"; }
.vignette.glisse { border-color: var(--mag); box-shadow: 0 0 0 2px var(--mag) inset; }
.ed { white-space: pre-wrap; min-height: 20px; border-radius: 6px; padding: 3px 5px; margin: -3px -5px; outline: none; transition: .15s; }
.ed:hover { background: #0f0f0f; }
.ed:focus { background: #0d0d0d; box-shadow: 0 0 0 1px var(--acid); }
.ed:empty::before { content: attr(data-vide); color: var(--texte3); }
td.h { text-align: right; font-variant-numeric: tabular-nums; }
td.h .ed { text-align: right; }
td.h.devis { color: var(--texte2); }
td.h.reel.plus { color: var(--mag); }
td.gr .ed { font-weight: 500; }
td.actions { width: 34px; text-align: right; }
td.actions button { opacity: 0; }
tr.plan:hover td.actions button { opacity: 1; }
tr.total td { background: #0a0a0a; font-weight: 600; border-bottom: 2px solid var(--ligne2); color: var(--texte2); }
tr.total td.h { color: var(--texte); }
tr.total td.h.devis { color: var(--acid); }
tr.total td .sous { display: block; font-weight: 400; font-size: 11px; color: var(--texte3); }
.maj { font-size: 11px; color: var(--texte3); margin-top: 4px; }
.ajout { margin: 8px 0 0; }

/* superposition */
.voile { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.voile.cache { display: none; }
.boite { background: var(--carte); border: 1px solid var(--ligne2); border-radius: 14px; padding: 22px; width: min(440px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.boite h3 { margin: 0 0 6px; font-size: 18px; }
.boite p { color: var(--texte2); margin: 0 0 14px; }
.boite label { display: block; font-size: 12px; color: var(--texte2); margin: 10px 0 4px; }
.boite input, .boite select { width: 100%; }
.boite .pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.boite .err { color: var(--mag); font-size: 13px; margin-top: 8px; min-height: 16px; }
.lightbox img { max-width: min(96vw, 1400px); max-height: 90vh; border-radius: 8px; border: 1px solid var(--ligne2); }
.menu { position: absolute; background: var(--carte); border: 1px solid var(--ligne2); border-radius: 10px; padding: 6px; z-index: 60; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
.menu .statut { justify-content: flex-start; }
.journal { max-height: 60vh; overflow: auto; font-size: 13px; }
.journal div { padding: 6px 0; border-bottom: 1px solid var(--ligne); }
.journal time { color: var(--texte3); font-size: 11px; margin-right: 8px; }
.journal b { color: var(--acid); font-weight: 500; }
.journal i { color: var(--mag); font-style: normal; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--acid); color: #000; padding: 8px 16px; border-radius: 999px; font-weight: 500; z-index: 70; opacity: 0; transition: .2s; pointer-events: none; }
.toast.vu { opacity: 1; }
.toast.mag { background: var(--mag); }
.pied-page { margin-top: 50px; color: var(--texte3); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* accueil / admin */
.centre { max-width: 760px; margin: 60px auto; }
.centre h1 { font-size: 34px; font-weight: 700; margin: 10px 0 4px; }
.centre h1 em { color: var(--acid); font-style: normal; }
.centre p.sous { color: var(--texte2); font-size: 16px; margin: 0 0 30px; }
.liste-projets { display: grid; gap: 10px; }
.carte-projet { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.carte-projet:hover { border-color: var(--acid); }
.carte-projet .c { color: var(--texte3); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.carte-projet .n { font-weight: 600; font-size: 16px; }
.carte-projet .sp { flex: 1; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* impression */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  header.pip { position: static; background: none; border-color: #ccc; }
  .outils, td.actions, td.poignee, .ajout, .seq-titre .actions, .pied-page, .toast, .voile { display: none !important; }
  .tuile, .carte-projet { background: #f4f4f4; border-color: #ddd; }
  table.plans td, table.plans th { border-color: #ddd; color: #000; }
  .seq-titre h2 { color: #000; }
  .statut { color: #000; }
  .vignette { border-color: #ccc; }
}
/* mobile */
@media (max-width: 820px) {
  table.plans, table.plans thead, table.plans tbody, table.plans tr, table.plans td { display: block; width: 100%; }
  table.plans thead { display: none; }
  table.plans tr.plan { border: 1px solid var(--ligne2); border-radius: var(--r); margin: 10px 0; padding: 8px; }
  table.plans td { border: none; padding: 4px 6px; }
  table.plans td::before { content: attr(data-l); display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--texte3); }
  table.plans td.poignee, table.plans td.actions { display: none; }
  td.vig { width: auto; } .vignette { width: 100%; max-width: 360px; }
  header.pip { flex-wrap: wrap; gap: 10px; position: static; }
  header h1 { flex: 1 0 100%; order: 3; }
  td.h { text-align: left; } td.h .ed { text-align: left; }
  tr.total td { display: inline-block; width: auto; margin-right: 14px; }
  header h1 { white-space: normal; font-size: 17px; }
}
