/* Atelier Magic OS — identité sobre en attendant le logo et les couleurs de la Direction (décision n° 5).
   Tout passe par ces variables : changer l'identité = changer ce bloc. */
:root {
  --fond: #f5f4f0; --surface: #ffffff; --surface-2: #efede7; --texte: #1f2433; --doux: #5d6273; --trait: #dedbd2;
  --encre: #1f2433; --accent: #c98a1b; --accent-doux: #f6e7c8; --sur-accent: #1f2433;
  --ok: #2f7d5b; --ok-doux: #dcefe5; --bientot: #a86a00; --bientot-doux: #f8ead0; --perime: #b23b3b; --perime-doux: #f6dcdc;
  --rayon: 14px; --ombre: 0 1px 2px rgba(20, 24, 36, .06), 0 4px 14px rgba(20, 24, 36, .05);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #14161d; --surface: #1c1f29; --surface-2: #252935; --texte: #eceae4; --doux: #a3a7b5; --trait: #343949;
    --encre: #eceae4; --accent: #e8b04b; --accent-doux: #3a2f17; --sur-accent: #14161d;
    --ok: #6cc59b; --ok-doux: #19352a; --bientot: #e8b04b; --bientot-doux: #3a2f17; --perime: #ef8a8a; --perime-doux: #3d2020;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #14161d; --surface: #1c1f29; --surface-2: #252935; --texte: #eceae4; --doux: #a3a7b5; --trait: #343949;
  --encre: #eceae4; --accent: #e8b04b; --accent-doux: #3a2f17; --sur-accent: #14161d;
  --ok: #6cc59b; --ok-doux: #19352a; --bientot: #e8b04b; --bientot-doux: #3a2f17; --perime: #ef8a8a; --perime-doux: #3d2020;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--texte); font: 16px/1.45 var(--police); -webkit-text-size-adjust: 100%; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.bandeau-demo { background: var(--accent); color: var(--sur-accent); font-size: 14px; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.bandeau-demo select { width: auto; min-height: 0; border: 0; border-radius: 8px; padding: 3px 6px; background: var(--surface); }

.entete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--trait); }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; }
.marque-signe { width: 28px; height: 28px; }
.marque-signe rect { fill: var(--encre); }
.marque-signe path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.marque-os { color: var(--doux); font-weight: 500; }
.entete-statut { font-size: 13px; color: var(--doux); text-align: right; }
.hors-ligne { color: var(--perime); font-weight: 600; }

.vue { max-width: 760px; margin: 0 auto; padding: 16px; outline: none; }
.chargement { color: var(--doux); text-align: center; padding: 48px 0; }
h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.sous { color: var(--doux); margin: 0 0 16px; font-size: 15px; }
.petit { font-size: 13px; color: var(--doux); }

.barre { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--trait); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.barre a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 11px; color: var(--doux); padding: 4px 0; border-radius: 10px; }
.barre a .ico { font-size: 20px; line-height: 1; }
.barre a.actif { color: var(--texte); font-weight: 600; }
.barre a.barre-plus .ico { background: var(--encre); color: var(--fond); width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; }

.cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; box-shadow: var(--ombre); text-decoration: none; display: block; }
.carte .chiffre { font-size: 28px; font-weight: 700; line-height: 1.1; }
.carte .legende { color: var(--doux); font-size: 13px; }
.carte.alerte .chiffre { color: var(--perime); }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ligne { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 600; overflow-wrap: anywhere; }
.ligne .meta { color: var(--doux); font-size: 13px; overflow-wrap: anywhere; }
.vide { color: var(--doux); padding: 20px; text-align: center; background: var(--surface); border: 1px dashed var(--trait); border-radius: var(--rayon); }

.pastille { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pastille.ok { background: var(--ok-doux); color: var(--ok); }
.pastille.bientot { background: var(--bientot-doux); color: var(--bientot); }
.pastille.perime { background: var(--perime-doux); color: var(--perime); }
.pastille.neutre { background: var(--surface-2); color: var(--doux); }
.score { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.score.ok { background: var(--ok-doux); color: var(--ok); }
.score.bientot { background: var(--bientot-doux); color: var(--bientot); }
.score.perime { background: var(--perime-doux); color: var(--perime); }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--trait); background: var(--surface); text-decoration: none; cursor: pointer; font-weight: 600; }
.bouton.principal { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.bouton.accent { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.bouton.danger { color: var(--perime); }
.bouton.petit-b { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.bouton:disabled { opacity: .55; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.actions.colle { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: var(--fond); padding: 10px 0; margin: 0; z-index: 4; }

.puces { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.puce { border: 1px solid var(--trait); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.puce[aria-pressed="true"] { background: var(--encre); color: var(--fond); border-color: var(--encre); }

.champ { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.champ > label, .champ > .etiquette { font-weight: 600; font-size: 14px; }
.champ .aide { font-size: 13px; color: var(--doux); }
.champ .requis { color: var(--perime); }
input[type="text"], input[type="number"], input[type="email"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--trait); background: var(--surface); }
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .bouton:focus-visible, .puce:focus-visible, .barre a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.case { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.case input { width: 22px; height: 22px; }
.coches { display: flex; flex-wrap: wrap; gap: 6px; }
.coches label { border: 1px solid var(--trait); border-radius: 999px; padding: 6px 12px; display: inline-flex; gap: 6px; align-items: center; background: var(--surface); font-weight: 500; font-size: 14px; }
.horaires { display: grid; grid-template-columns: 54px 1fr; gap: 6px 10px; align-items: center; }
.masque { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; color: var(--doux); font-size: 14px; }
.plus-champs { margin: 4px 0 16px; }

.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; margin: 0 0 12px; }
.bloc h2 { margin-top: 0; }
.valeurs { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 12px; margin: 0; }
.valeurs dt { color: var(--doux); font-size: 14px; }
.valeurs dd { margin: 0; overflow-wrap: anywhere; }
.fraicheur { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fraicheur li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.etoiles { display: flex; gap: 4px; }
.etoiles button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); font-size: 18px; cursor: pointer; }
.etoiles button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.diff { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff th, .diff td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; overflow-wrap: anywhere; }
.diff .avant { color: var(--doux); text-decoration: line-through; }
.diff .apres { font-weight: 600; }
.encadre { border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.encadre.alerte { background: var(--perime-doux); color: var(--perime); }
.encadre.info { background: var(--accent-doux); }
.encadre.ok { background: var(--ok-doux); color: var(--ok); }
.defilant { overflow-x: auto; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 10; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); }
.toast { background: var(--encre); color: var(--fond); padding: 12px 14px; border-radius: 12px; box-shadow: var(--ombre); font-size: 14px; }
.toast.erreur { background: var(--perime); color: #fff; }

@media (min-width: 640px) {
  .cartes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .photos { grid-template-columns: repeat(5, 1fr); }
}
