/* Portail Molding France — bleu profond, frise tricolore, jour / nuit */
:root {
  --bleu: #0b2a63;
  --bleu-clair: #1d4fa8;
  --rouge: #e1000f;
  --fond: #f4f6fa;
  --carte: #ffffff;
  --texte: #14213d;
  --texte-doux: #5b6785;
  --bord: #d9dfeb;
  --ok: #1b7f4b;
  --police: "Air France Text", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bleu: #8fb2ff;
  --bleu-clair: #5d8df0;
  --fond: #0c1424;
  --carte: #131d33;
  --texte: #e8edf8;
  --texte-doux: #9aa7c4;
  --bord: #25314f;
  --ok: #4cc58a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: var(--police); line-height: 1.45;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.6rem; margin: 8px 0 20px; color: var(--bleu); }
h2 { font-size: 1.1rem; margin: 0; }

.frise-tricolore { display: flex; height: 5px; }
.frise-tricolore span { flex: 1; }
.frise-tricolore span:nth-child(1) { background: #0055a4; }
.frise-tricolore span:nth-child(2) { background: #ffffff; }
.frise-tricolore span:nth-child(3) { background: var(--rouge); }
:root[data-theme="dark"] .frise-tricolore span:nth-child(1) { background: #3b7be0; }

.entete {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--carte); border-bottom: 1px solid var(--bord);
}
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: 28px; width: auto; display: block; }
.logo-login { text-align: center; margin: 4px 0 22px; }
.logo-login img { width: 100%; max-width: 320px; height: auto; }
/* Logo : version claire en mode jour, version éclaircie en mode nuit */
:root[data-theme="dark"] .logo-jour { display: none; }
:root:not([data-theme="dark"]) .logo-nuit { display: none; }
.entete-droite { display: flex; align-items: center; gap: 14px; }
.qui { color: var(--texte-doux); font-size: .9rem; }
.inline { display: inline; margin: 0; }
.bouton-theme {
  background: none; border: 1px solid var(--bord); color: var(--texte);
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
}
.bouton-langue {
  background: none; border: 1px solid var(--bord); color: var(--texte); cursor: pointer;
  height: 36px; min-width: 40px; padding: 0 10px; border-radius: 18px;
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
}
.lien { background: none; border: 0; color: var(--bleu-clair); cursor: pointer; font: inherit; }
.lien:hover { text-decoration: underline; }
.pied { text-align: center; color: var(--texte-doux); font-size: .8rem; padding: 18px; }

.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px;
  padding: 22px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(11,42,99,.05);
}
.carte-login { max-width: 400px; margin: 48px auto; }
.carte-login h1 { font-size: 1.25rem; text-align: center; margin-top: 0; }
.carte-login .sous-titre { text-align: center; }
.sous-titre { color: var(--texte-doux); margin-top: -10px; }
label { display: block; margin: 14px 0 6px; font-size: .9rem; color: var(--texte-doux); }
input[type=text], input[type=password] {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--texte);
  background: var(--fond); border: 1px solid var(--bord); border-radius: 8px;
}
input:focus-visible, button:focus-visible {
  outline: 2px solid var(--bleu-clair); outline-offset: 2px;
}
.principal {
  width: 100%; margin-top: 22px; padding: 12px; font: inherit; font-weight: 600;
  color: #fff; background: #0b2a63; border: 0; border-radius: 8px; cursor: pointer;
}
:root[data-theme="dark"] .principal { background: var(--bleu-clair); }
.principal:hover { filter: brightness(1.12); }
.alerte { padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.alerte.erreur { background: rgba(225,0,15,.1); color: var(--rouge); border: 1px solid rgba(225,0,15,.3); }
.vide { color: var(--texte-doux); text-align: center; padding: 40px 0; }

/* Commande */
.commande-tete { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.meta { margin: 4px 0 0; color: var(--texte-doux); font-size: .88rem; }
.compteur { text-align: right; white-space: nowrap; }
.compteur-num { font-size: 2rem; font-weight: 800; color: var(--bleu); }
.compteur-sur { color: var(--texte-doux); margin-left: 4px; }
.compteur-lib { display: block; font-size: .75rem; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; }

.frise { list-style: none; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  gap: 4px; padding: 0; margin: 22px 0 10px; }
.frise li { text-align: center; padding: 0 2px; }
.pastille {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-weight: 700; border: 2px solid var(--bord); background: var(--carte); color: var(--texte-doux);
}
.etape-lib { display: block; margin-top: 6px; font-size: .78rem; color: var(--texte-doux); }
.frise .faite .pastille { background: var(--ok); border-color: var(--ok); color: #fff; }
.frise .en-cours .pastille { background: #0b2a63; border-color: #0b2a63; color: #fff;
  box-shadow: 0 0 0 4px rgba(29,79,168,.22); }
:root[data-theme="dark"] .frise .en-cours .pastille { background: var(--bleu-clair); border-color: var(--bleu-clair); }
.frise .en-cours .etape-lib { color: var(--texte); font-weight: 700; }
.pastille-icone { border-color: var(--bleu-clair); color: var(--bleu-clair);
  background: rgba(29,79,168,.10); }
.commande-passee .etape-lib { color: var(--texte); }
.etape-date { display: block; margin-top: 2px; font-size: .72rem; color: var(--texte-doux); }
/* Boutons de téléchargement (ARC, BL) */
.documents { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.doc-bouton {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-size: .88rem; font-weight: 600; text-decoration: none; border-radius: 8px;
  color: #fff; background: #0b2a63; border: 1px solid #0b2a63;
}
:root[data-theme="dark"] a.doc-bouton { background: var(--bleu-clair); border-color: var(--bleu-clair); }
a.doc-bouton:hover { filter: brightness(1.15); }
a.doc-bouton:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.doc-bouton.indispo {
  color: var(--texte-doux); background: transparent; border: 1px dashed var(--bord);
  font-weight: 400; cursor: default;
}

.barre { height: 8px; background: var(--bord); border-radius: 99px; overflow: hidden; }
.barre span { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #0055a4, var(--bleu-clair)); }
.commande-pied { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px;
  font-size: .9rem; color: var(--texte-doux); }
.commande-pied a { color: var(--bleu-clair); }
.maj { margin-left: auto; font-size: .8rem; }


/* Tableau des commandes */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tableau-carte { padding: 18px; }
.tableau-outils { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tableau-outils label { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.tableau-outils select, .tableau-outils input[type=search] {
  font: inherit; color: var(--texte); background: var(--fond);
  border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px;
}
.tableau-outils input[type=search] { min-width: 230px; }
.tableau-defil { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th { text-align: left; padding: 11px 12px; color: #fff; background: #0b2a63;
  font-weight: 600; white-space: nowrap; user-select: none; }
:root[data-theme="dark"] .tableau th { background: #1b3366; }
.tableau th[data-tri] { cursor: pointer; }
.tableau th[data-tri]::after { content: " \2195"; opacity: .45; font-size: .8em; }
.tableau th[aria-sort="ascending"]::after { content: " \25B2"; opacity: 1; }
.tableau th[aria-sort="descending"]::after { content: " \25BC"; opacity: 1; }
.tableau td { padding: 11px 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau tr.ligne { cursor: pointer; }
.tableau tr.ligne:nth-of-type(4n+1) { background: rgba(29,79,168,.05); }
.tableau tr.ligne:hover { background: rgba(29,79,168,.12); }
.tableau tr.ligne[aria-expanded="true"] { background: rgba(29,79,168,.14); }
.tableau tr.ligne:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: -2px; }
.nowrap { white-space: nowrap; }
.col-fleche { width: 28px; text-align: center; }
.fleche { display: inline-block; color: var(--bleu-clair); transition: transform .15s; }
tr[aria-expanded="true"] .fleche { transform: rotate(90deg); }
.statut { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .82rem;
  font-weight: 600; background: rgba(29,79,168,.14); color: var(--bleu); line-height: 1.3; }
.statut-fin { background: rgba(27,127,75,.16); color: var(--ok); }
.puce { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: .75rem; font-weight: 700; border: 1px dashed var(--bord); color: var(--texte-doux); }
.puce-ok { border: 1px solid var(--ok); color: var(--ok); background: rgba(27,127,75,.1); }
tr.detail > td { background: var(--fond); border-bottom: 2px solid var(--bleu-clair); padding: 6px 18px 18px; }
.detail-contenu { width: 0; min-width: 100%; }
.detail-contenu .meta { margin: 10px 0 0; }
.aucun { text-align: center; color: var(--texte-doux); padding: 28px 0 8px; }
.tableau-pied { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; color: var(--texte-doux); }
.pagination { display: flex; gap: 4px; align-items: center; }
.pagination button { font: inherit; font-size: .85rem; cursor: pointer; color: var(--texte);
  background: var(--carte); border: 1px solid var(--bord); border-radius: 6px; padding: 5px 11px; }
.pagination button.actif { background: #0b2a63; border-color: #0b2a63; color: #fff; }
:root[data-theme="dark"] .pagination button.actif { background: var(--bleu-clair); border-color: var(--bleu-clair); }
.pagination button:disabled { opacity: .45; cursor: default; }
@media (max-width: 800px) { .col-desi, .col-livr, .col-date { display: none; } }
@media (max-width: 600px) {
  .col-docs { display: none; }
  .tableau th, .tableau td { padding: 10px 8px; }
  .tableau th { white-space: normal; }
  .tableau-carte { padding: 12px; }
  .tableau-outils input[type=search] { min-width: 0; width: 100%; }
  .tableau-outils .recherche { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
}

@media (max-width: 600px) {
  .entete { padding: 12px 14px; gap: 10px; }
  .logo { flex: 1 1 0; min-width: 0; }
  .logo img { height: auto; max-width: 100%; }
  .entete-droite { flex-shrink: 0; }
  .entete-droite { gap: 10px; }
  .qui { display: none; }
  /* Frise en liste verticale : plus lisible avec 6 repères et leurs dates */
  .frise { grid-template-columns: 1fr; gap: 12px; margin: 18px 0 16px; }
  .frise li { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px;
              align-items: center; text-align: left; padding: 0; }
  .frise li .pastille { grid-row: 1 / span 2; width: 34px; height: 34px; }
  .etape-lib { margin: 0; font-size: .92rem; }
  .etape-date { margin: 0; font-size: .8rem; }
  .commande-tete { flex-direction: column; }
  .compteur { text-align: left; }
  .maj { margin-left: 0; }
}
