:root {
  --marine: #1f3a5f; --rouge: #c8102e; --fond: #f3f6fa; --carte: #fff; --texte: #1d2733; --discret: #5d6b7c; --trait: #d5dbe3;
  --ok: #1a7f4b; --attention: #b86e00; --rayon: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #11161d; --carte: #1a222d; --texte: #e8edf3; --discret: #9aa8b8; --trait: #2c3846; --marine: #6c9bd6; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--fond); color: var(--texte); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--marine); }
.discret { color: var(--discret); font-size: .9rem; }
.erreur-texte { color: var(--rouge); min-height: 1.3em; margin: .3em 0; font-size: .92rem; }
#app { max-width: 880px; margin: 0 auto; padding: 0 16px 120px; }
header.haut { position: sticky; top: 0; z-index: 5; background: var(--marine); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
header.haut h1 { color: #fff; margin: 0; font-size: 1.1rem; flex: 1; }
header.haut button, header.haut a { color: #fff; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; margin: 12px 0; }
.connexion { max-width: 380px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.connexion label { text-align: left; font-size: .9rem; color: var(--discret); display: flex; flex-direction: column; gap: 4px; }
.logo-connexion { width: 72px; height: 72px; align-self: center; }
label { display: block; font-size: .85rem; color: var(--discret); margin-bottom: 8px; }
input, select, textarea { width: 100%; font: inherit; color: var(--texte); background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; padding: 10px; min-height: 44px; margin-top: 3px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--marine) 45%, transparent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--trait); background: var(--carte); color: var(--texte); padding: 10px 14px; min-height: 44px; }
button.primaire { background: var(--marine); color: #fff; border-color: var(--marine); font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primaire { color: #0b1118; } }
button.danger { color: var(--rouge); border-color: var(--rouge); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.lien { border: 0; background: none; color: var(--marine); padding: 6px 8px; min-height: 36px; text-decoration: underline; }
.barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.barre > * { flex: 0 0 auto; }
.grille { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille.deux { grid-template-columns: 1fr 1fr; } .grille.trois { grid-template-columns: 1fr 1fr 1fr; } }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.puce { border: 1px solid var(--trait); border-radius: 999px; padding: 6px 12px; background: var(--carte); min-height: 36px; }
.puce.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
@media (prefers-color-scheme: dark) { .puce.actif { color: #0b1118; } }
.devis-ligne { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.devis-ligne .rang { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.devis-ligne .num { font-weight: 700; color: var(--marine); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #e8edf3; color: #33424f; }
.badge.envoye { background: #dbe9ff; color: #1f4f99; } .badge.accepte { background: #d8f2e3; color: var(--ok); }
.badge.refuse, .badge.annule { background: #fde0e4; color: var(--rouge); } .badge.bloque { background: #fde0e4; color: var(--rouge); }
.badge.invite { background: #fff0cf; color: var(--attention); } .badge.actif { background: #d8f2e3; color: var(--ok); }
.lot { border-left: 4px solid var(--rouge); padding-left: 10px; margin: 14px 0; }
.ligne-devis { border: 1px solid var(--trait); border-radius: 8px; padding: 10px; margin: 8px 0; background: color-mix(in srgb, var(--fond) 55%, var(--carte)); }
.ligne-devis .nombres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ligne-devis .total-ligne { text-align: right; font-weight: 700; margin-top: 4px; }
.totaux { width: 100%; border-collapse: collapse; }
.totaux td { padding: 6px 4px; border-bottom: 1px solid var(--trait); }
.totaux td:last-child { text-align: right; white-space: nowrap; }
.totaux tr.ttc td { font-weight: 800; font-size: 1.15rem; border-bottom: 0; }
.totaux tr.remise td { color: var(--rouge); }
.pied-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--carte); border-top: 1px solid var(--trait); padding: 10px 16px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pied-actions .total-mini { font-weight: 800; margin-right: auto; }
.bandeau { background: #fff0cf; color: #6b4300; padding: 8px 16px; text-align: center; font-size: .9rem; }
.modif { background: #fff0cf; color: #6b4300; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }
table.simple { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.simple th, table.simple td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.defile { overflow-x: auto; }
.lien-affiche { word-break: break-all; background: var(--fond); border: 1px dashed var(--trait); border-radius: 8px; padding: 8px; margin: 8px 0; font-size: .85rem; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; }
#toast.visible { opacity: 1; } #toast.erreur { background: var(--rouge); }
.onglets { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; }
