/* Espace pro Dynaprint — charte de la plateforme (02_documentation/04_charte-et-principes.md) */
:root {
  --ivoire: #f8f7f1; --papier: #fffefa; --encre: #33402f; --encre-douce: #6b7566;
  --sauge: #8fa58a; --sauge-fonce: #5f7558; --sauge-clair: #e9eee3; --olive: #6f7b4a; --or: #a8873f; --or-clair: #f3ecdc; --or-fonce: #7d6226;
  --alerte: #a85a45; --alerte-fond: #f5e9e3; --trait: #dfe3d6;
  --titre: "Bodoni Moda", Georgia, serif; --texte: Manrope, system-ui, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--ivoire); color: var(--encre); font: 15px/1.55 var(--texte); }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
[hidden] { display: none !important; }
.attente { padding: 60px 24px; text-align: center; color: var(--encre-douce); }
.note { color: var(--encre-douce); font-size: 13.5px; }
.muet { color: var(--encre-douce); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.pousse { flex: 1; }
.rang { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.marque { font-family: var(--titre); font-size: 26px; font-weight: 600; white-space: nowrap; }
.marque span { font: 600 11px var(--texte); letter-spacing: .16em; text-transform: uppercase; color: var(--or); margin-left: 10px; }

/* boutons */
.btn { display: inline-block; text-decoration: none; background: var(--sauge-fonce); color: #fff; border: 1px solid var(--sauge-fonce); border-radius: 999px; padding: 9px 20px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--encre); border-color: var(--encre); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.plein { width: 100%; padding: 12px; }
.btn.or { background: var(--or); border-color: var(--or); }
.btn.or:hover:not(:disabled) { background: var(--or-fonce); border-color: var(--or-fonce); }
.btn.discret { background: transparent; color: var(--encre); border-color: var(--trait); }
.btn.discret:hover:not(:disabled) { background: var(--sauge-clair); border-color: var(--sauge); }
.btn.danger { color: var(--alerte); }
.btn.danger.arme { background: var(--alerte); border-color: var(--alerte); color: #fff; }
.lien { background: none; border: 0; padding: 4px 0; color: var(--sauge-fonce); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
a { color: var(--sauge-fonce); text-underline-offset: 3px; }

/* champs */
input[type=text], input[type=email], input[type=password], input[type=date], textarea {
  width: 100%; background: var(--papier); border: 1px solid var(--trait); border-radius: 8px; padding: 9px 11px; min-width: 0; }
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--sauge-fonce); width: 17px; height: 17px; flex: none; margin: 2px 0 0; }
.champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; flex: 1 1 200px; min-width: 0; }
.champ .lib { font-size: 13px; font-weight: 600; }
.champ small { color: var(--encre-douce); font-size: 12.5px; }
.rang > .champ { align-self: flex-start; }
.erreur { color: var(--alerte); min-height: 1.4em; margin: 0 0 10px; font-size: 13.5px; }
.coche { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }

/* connexion, invitation */
.porte { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.carte { width: min(420px, 100%); background: var(--papier); border: 1px solid var(--trait); border-radius: 16px; padding: 34px; }
.carte .marque { margin-bottom: 20px; }
.carte h1 { font-size: 24px; margin-bottom: 6px; }

/* cadre */
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 14px 28px; background: var(--papier); border-bottom: 1px solid var(--trait); }
.barre nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.onglet { background: none; border: 0; border-radius: 999px; padding: 7px 15px; cursor: pointer; font-weight: 600; color: var(--encre-douce); text-decoration: none; }
.onglet:hover { background: var(--sauge-clair); }
.onglet.actif { background: var(--encre); color: var(--papier); }
.onglet .n { font: 500 11px var(--mono); margin-left: 7px; background: var(--or); color: #fff; border-radius: 999px; padding: 1px 7px; }
.moi { display: flex; gap: 16px; align-items: center; font-size: 13.5px; }
.moi .qui { text-align: right; line-height: 1.3; }
.page { padding: 30px 28px 90px; max-width: 1040px; margin: 0 auto; }
.entete { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.surtitre { font: 600 11px var(--texte); letter-spacing: .16em; text-transform: uppercase; color: var(--or); margin-bottom: 6px; }
.bloc { background: var(--papier); border: 1px solid var(--trait); border-radius: 14px; padding: 20px 22px; margin-top: 18px; }
.bloc > h2, .bloc > h3 { margin-bottom: 12px; }

/* tirages à l'échelle */
.article { display: grid; grid-template-columns: 200px 1fr; gap: 26px; align-items: start; }
.article > img { width: 100%; border-radius: 10px; border: 1px solid var(--trait); display: block; }
.depot { display: grid; gap: 3px; border: 1.5px dashed var(--sauge); border-radius: 12px; padding: 18px 20px; margin: 16px 0 12px; cursor: pointer; background: var(--ivoire); }
.depot:hover, .depot.survol { border-color: var(--encre); background: var(--sauge-clair); }
.depot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.depot b { font-size: 15.5px; }
.depot span { color: var(--encre-douce); font-size: 13.5px; }
ul.pieces { list-style: none; margin: 0 0 14px; padding: 0; }
ul.pieces li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--trait); }
ul.pieces .alerte { flex-basis: 100%; color: var(--alerte); font-size: 13px; }
ul.pieces li:last-child { border-bottom: 0; }
ul.pieces .nom { font-weight: 600; overflow-wrap: anywhere; }
ul.pieces .echec { color: var(--alerte); }
.lignes { display: grid; gap: 7px; margin: 6px 0 4px; }
.lignes .tete, .lignes .ligne { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 100px 64px; gap: 8px; align-items: center; }
.lignes .tete { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); }
.lignes .tete span:nth-child(5), .lignes .prix { text-align: right; }
.lignes .prix { font: 500 13px var(--mono); white-space: nowrap; }
.lignes input.lu { background: var(--sauge-clair); border-color: var(--sauge); }
.bilan { display: flex; gap: 8px 22px; align-items: baseline; flex-wrap: wrap; margin: 14px 0 18px; padding-top: 14px; border-top: 1px solid var(--trait); }
.bilan .total { margin-left: auto; font-size: 16px; }
.bilan .total b { font: 600 19px var(--mono); margin-left: 8px; }
.pied { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* commandes */
.cadre { background: var(--papier); border: 1px solid var(--trait); border-radius: 14px; overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 600; text-align: left; color: var(--encre-douce); letter-spacing: .04em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
th.num { font-family: var(--texte); }
td { padding: 11px 14px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; border-bottom: 0; }
tfoot .num { font-size: 15px; }
tr.clic { cursor: pointer; }
tr.clic:hover, tr.clic:focus-visible { background: var(--sauge-clair); }
td.vide { text-align: center; color: var(--encre-douce); padding: 44px 20px; }
.bloc table th:first-child, .bloc table td:first-child { padding-left: 0; }
.bloc table th:last-child, .bloc table td:last-child { padding-right: 0; }
.pastille { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.pastille.agir { background: var(--or); color: #fff; }
.pastille.attente { background: var(--or-clair); color: var(--or-fonce); }
.pastille.ok { background: var(--sauge-clair); color: var(--sauge-fonce); }
.pastille.off { background: var(--alerte-fond); color: var(--alerte); }
.pastille.gris { background: #ecece6; color: var(--encre-douce); }
.accord { border-color: var(--or); box-shadow: 0 0 0 1px var(--or); }
.accord .montant { font: 600 22px var(--mono); }
.message { background: var(--or-clair); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; white-space: pre-line; }
.message b { display: block; font-size: 12.5px; color: var(--or-fonce); margin-bottom: 2px; }
.etat { background: var(--sauge-clair); border-radius: 10px; padding: 12px 16px; margin-top: 18px; }
.etat.off { background: var(--alerte-fond); color: var(--alerte); }
ol.histo { list-style: none; margin: 0; padding: 0; }
ol.histo li { padding: 8px 0 8px 14px; border-left: 2px solid var(--trait); }
ol.histo li.equipe { border-left-color: var(--or); }
ol.histo .mono { display: block; color: var(--encre-douce); font-size: 12px; }
ol.histo p { margin: 3px 0 0; color: var(--encre-douce); white-space: pre-line; }
dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.infos dt { font-size: 13px; font-weight: 600; color: var(--encre-douce); }
dl.infos dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

#toast { position: fixed; inset: auto auto 28px 50%; transform: translateX(-50%); margin: 0; border: 0; max-width: min(560px, calc(100vw - 32px)); background: var(--encre); color: var(--papier); padding: 11px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 24px rgba(51, 64, 47, .25); }
#toast.erreur { background: var(--alerte); border-radius: 14px; }

@media (max-width: 760px) {
  .barre { padding: 10px 14px; gap: 10px; }
  .page { padding: 20px 14px 80px; }
  .moi .qui { display: none; }
  .article { grid-template-columns: 1fr; }
  .article > img { max-width: 220px; }
  .lignes .tete { display: none; }
  .lignes .ligne { grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--trait); padding-top: 8px; }
  .lignes .ligne > :first-child { grid-column: 1 / -1; }
  .lignes .prix { grid-column: 1 / 3; text-align: left; }
  .bilan .total { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .onglet, tr.clic, .depot { transition: background-color .12s, border-color .12s; } }
