/* =====================================================================
   Makeset : jetons de la direction artistique v0.6 (mélange C « Makeset »
   et A « Workspace », choix d'Arnaud du 20/10/2026).
   Fichier autonome, sans Django : à copier tel quel dans toute interface
   Makeset (espace client, Gestion, admin client de makeset-engine).
   Mode d'emploi : docs/design/direction-artistique.md.
   Tous les noms commencent par --mk- ; aucune règle sauf les polices et
   les listes déroulantes (select.mk-select, ou select.in dans le site Django)
   et le calendrier des champs de date (.mk-date, posé par datepicker.js).
   Contrastes vérifiés AA : texte 4,5:1, bordures et contrôles 3:1.
   ===================================================================== */

/* Polices (OFL, auto-hébergées) : Plus Jakarta Sans pour la coque,
   Mona Sans (largeur variable) pour le contenu, les titres et les chiffres. */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.7660bd9909fb.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 400 700; font-stretch: 100% 112%; font-display: swap;
  src: url("../fonts/mona-sans-latin-subset.676329e6f469.woff2") format("woff2-variations"); }

:root {
  /* ---------- Couleurs ---------- */
  /* Marine : barre latérale, aplat d'ouverture, bande de chiffres clés. Dérivé du bleu du logo. */
  --mk-navy: #0b2341;          /* fond marine */
  --mk-navy-2: #12304f;        /* survol, champ sur marine */
  --mk-navy-3: #1b3d69;        /* élément actif du menu, cadre de capture */
  --mk-navy-ink: #e6edf7;      /* texte sur marine (13,4:1) */
  --mk-navy-muted: #a4b4cb;    /* texte secondaire sur marine (7,5:1) */
  --mk-navy-icon: #8fa3c0;     /* icônes du menu */
  --mk-navy-line: rgb(255 255 255 / .12);
  --mk-navy-accent: #6cb2ff;   /* icône et repère de l'élément actif */
  --mk-navy-focus: #8cc0ff;    /* anneau de focus sur marine */
  --mk-navy-ok: #7ee2a8;       /* « en ligne », hausse, sur marine */
  --mk-navy-bad: #ff9aa8;      /* panne, en texte seulement, sur marine (7,8:1) */
  /* Bleu Makeset : une seule couleur d'accent. */
  --mk-brand: #006ced;         /* bouton principal (blanc dessus : 4,8:1) */
  --mk-brand-press: #0058c4;   /* survol du bouton, titres de section, chiffres clés (6,6:1 sur blanc) */
  --mk-link: #005cc9;
  --mk-pill-bg: #d3e3fd;       /* pastille bleu pâle pleine : compteur, filtre ou option choisis */
  --mk-pill-ink: #041e49;      /* texte sur la pastille (12,6:1) */
  /* Surfaces */
  --mk-canvas: #f1f3f4;        /* fond de page, gris clair */
  --mk-surface: #ffffff;       /* cartes, feuilles, champs */
  --mk-hover: rgb(14 27 45 / .045);
  --mk-press: rgb(14 27 45 / .08);
  /* Texte */
  --mk-ink: #0e1b2d;           /* texte principal (17,3:1) */
  --mk-ink-2: #364254;         /* texte de ligne secondaire */
  --mk-muted: #5d6879;         /* légendes (5,6:1 sur blanc, 5,1:1 sur le canevas) */
  --mk-icon: #7a8495;
  /* Filets */
  --mk-line: #e3e5e8;          /* séparateur de lignes, bas d'en-tête de carte */
  --mk-line-2: #d4d9e1;        /* bordure de bouton secondaire */
  --mk-ctl-line: #747775;      /* bordure de champ et de liste (4,5:1) */
  /* États : un point et un mot. Le rouge n'est qu'en texte, pour une vraie panne. */
  --mk-ok: #17905a;            /* point « en ligne », « payée » */
  --mk-ok-text: #0f7a43;
  --mk-warn: #c27406;          /* point « alerte », « à payer » */
  --mk-bad: #b11a42;           /* texte « panne » (6,8:1) */
  --mk-off: #a3acb9;           /* point neutre */

  /* ---------- Rayons ---------- */
  --mk-r-xs: 4px;              /* option de liste */
  --mk-r-sm: 8px;              /* bouton, champ, liste */
  --mk-r-md: 12px;             /* petite carte, toast */
  --mk-r-lg: 16px;             /* carte, bande de chiffres */
  --mk-r-xl: 20px;             /* aplat d'ouverture */
  --mk-r-pill: 999px;

  /* ---------- Élévations (A) ---------- */
  --mk-e-card: 0 1px 2px rgb(60 64 67 / .3), 0 1px 3px 1px rgb(60 64 67 / .15);
  --mk-e-pop: 0 2px 6px 2px rgb(60 64 67 / .15), 0 1px 2px rgb(60 64 67 / .3);
  --mk-e-dialog: 0 24px 64px rgb(14 27 45 / .22);
  --mk-e-shot: 0 24px 48px -20px rgb(0 0 0 / .55);   /* capture posée sur le marine */

  /* ---------- Espacements (base 4) ---------- */
  --mk-s-1: 4px; --mk-s-2: 8px; --mk-s-3: 12px; --mk-s-4: 16px; --mk-s-5: 20px;
  --mk-s-6: 24px; --mk-s-8: 32px; --mk-s-10: 40px; --mk-s-12: 48px;
  --mk-card-x: 24px;           /* marge intérieure des cartes (18px sous 768px) */
  --mk-gap: 24px;              /* entre deux cartes (16px sous 768px) */
  --mk-side-w: 240px;          /* barre latérale */
  --mk-row-h: 56px;            /* ligne de liste */
  --mk-ctl-h: 44px;            /* champ et liste (48px sur écran tactile) */

  /* ---------- Typographie (polices actuelles de production) ---------- */
  --mk-font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mk-font: "Mona Sans", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  /* Échelle : 12 / 13 / 14 / 16 / 20 / 26 / 32 / 46. Titres en largeur 104 à 110 %. */
  --mk-t-xs: 12px; --mk-t-sm: 13px; --mk-t-md: 14px; --mk-t-lg: 16px;
  --mk-t-xl: 20px; --mk-t-2xl: 26px; --mk-t-3xl: 32px; --mk-t-key: 46px;
  --mk-w-regular: 420; --mk-w-medium: 560; --mk-w-strong: 620;
  --mk-stretch-title: 108%;    /* h1, domaine du site, chiffres clés */
  --mk-stretch-section: 104%;  /* titres de section */

  /* ---------- Focus ---------- */
  --mk-focus: #006ced;
  --mk-focus-ring: 0 0 0 3px rgb(0 108 237 / .22);
  --mk-focus-outline: 2px solid #006ced;
}
@media (max-width: 767px) { :root { --mk-card-x: 18px; --mk-gap: 16px; } }
@media (pointer: coarse) { :root { --mk-ctl-h: 48px; } }

/* =====================================================================
   Listes déroulantes (A), une seule implémentation.
   Fermée : champ blanc, bordure 1px --mk-ctl-line, chevron à 14px du bord.
   Ouverte (appearance: base-select, Chrome et Edge 135+, Safari 27) :
   menu sans bordure avec élévation, option choisie en pastille bleu pâle
   et coche à droite. Ailleurs, le menu natif du système, champ identique.
   Clavier, lecteurs d'écran et envoi du formulaire restent ceux de <select>.
   ===================================================================== */
select.mk-select, select.in {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: var(--mk-ctl-h); height: auto;
  padding: 0 44px 0 14px; border: 1px solid var(--mk-ctl-line); border-radius: var(--mk-r-sm);
  color: var(--mk-ink); font: 500 15px/20px var(--mk-font); cursor: pointer; text-overflow: ellipsis;
  background: var(--mk-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444746' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px 18px; }
select.mk-select:hover, select.in:hover { border-color: var(--mk-ink); }
select.mk-select:focus-visible, select.in:focus-visible { outline: none; border-color: var(--mk-focus); box-shadow: var(--mk-focus-ring); }
select.mk-select[aria-invalid="true"], select.in[aria-invalid="true"] { border-color: var(--mk-bad); box-shadow: 0 0 0 1px var(--mk-bad); }
select.mk-select:disabled, select.in:disabled { background-color: var(--mk-canvas); border-color: var(--mk-line); color: var(--mk-muted); cursor: not-allowed; opacity: 1; }
@media (max-width: 1023px) { select.mk-select, select.in { font-size: 16px; } }  /* pas de zoom iOS */
@supports (appearance: base-select) {
  select.mk-select, select.mk-select::picker(select), select.in, select.in::picker(select) { appearance: base-select; }
  select.mk-select, select.in { display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
  select.mk-select::picker-icon, select.in::picker-icon { display: none; }
  select.mk-select:open, select.in:open { border-color: var(--mk-focus); box-shadow: var(--mk-focus-ring);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230058c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E"); }
  select.mk-select::picker(select), select.in::picker(select) {
    margin-block: 6px; padding: 6px; max-height: min(340px, 50vh); overflow-y: auto; border: 0; border-radius: var(--mk-r-sm);
    background: var(--mk-surface); box-shadow: var(--mk-e-pop); font: 500 15px/20px var(--mk-font); color: var(--mk-ink);
    scrollbar-width: thin; scrollbar-color: var(--mk-line-2) transparent; }
  select.mk-select option, select.in option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
    border-radius: var(--mk-r-xs); cursor: pointer; color: var(--mk-ink); }
  select.mk-select option:hover, select.mk-select option:focus-visible,
  select.in option:hover, select.in option:focus-visible { background: var(--mk-canvas); outline: none; }
  select.mk-select option:checked, select.in option:checked { background: var(--mk-pill-bg); color: var(--mk-pill-ink); font-weight: 600; }
  select.mk-select option:checked:hover, select.in option:checked:hover { background: #c2d7fb; }
  select.mk-select option::checkmark, select.in option::checkmark { order: 1; margin-left: auto; content: ""; width: 16px; height: 16px; background: var(--mk-pill-ink);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") center / 16px 16px no-repeat; }
  select.mk-select option:disabled, select.in option:disabled { color: var(--mk-muted); cursor: default; }
  select.mk-select hr, select.in hr { margin: 6px 8px; border: 0; border-top: 1px solid var(--mk-line); }
}
@media (prefers-reduced-motion: reduce) { select.mk-select::picker(select), select.in::picker(select) { transition: none; } }

/* =====================================================================
   Champs de date (datepicker.js), même style que les listes ci-dessus.
   Fermé : le bouton .mk-date-btn a le champ, la bordure et le rayon de
   select.in, avec une icône calendrier à la place du chevron. Ouvert : un
   popover sans bordure avec l'élévation du menu, jour choisi en pastille
   bleu pâle, aujourd'hui cerclé. Le <input type="date"> reste dessous,
   invisible, pour l'envoi et la validation du formulaire.
   ===================================================================== */
.mk-date { position: relative; display: block; min-width: 0; }
.mk-date input.mk-date-native[type] { position: absolute; inset: 0 0 auto 0; width: 100%; height: var(--mk-ctl-h); margin: 0; opacity: 0; pointer-events: none; }
.mk-date-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: var(--mk-ctl-h); margin: 0;
  padding: 0 14px; border: 1px solid var(--mk-ctl-line); border-radius: var(--mk-r-sm); background: var(--mk-surface);
  color: var(--mk-ink); font: 500 15px/20px var(--mk-font); font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; }
.mk-date-btn .mk-date-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-date-btn.is-empty .mk-date-v { color: var(--mk-muted); font-weight: 420; }
.mk-date-btn .mk-date-ic { flex: none; width: 18px; height: 18px; fill: none; stroke: #444746; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mk-date-btn:hover { border-color: var(--mk-ink); }
.mk-date-btn:focus-visible { outline: none; border-color: var(--mk-focus); box-shadow: var(--mk-focus-ring); }
.mk-date-btn[aria-expanded="true"] { border-color: var(--mk-focus); box-shadow: var(--mk-focus-ring); }
.mk-date-btn[aria-expanded="true"] .mk-date-ic { stroke: var(--mk-brand-press); }
.mk-date-btn.is-invalid, .mk-date:has(.mk-date-native:user-invalid) .mk-date-btn { border-color: var(--mk-bad); box-shadow: 0 0 0 1px var(--mk-bad); }
.mk-date-btn:disabled { background: var(--mk-canvas); border-color: var(--mk-line); color: var(--mk-muted); cursor: not-allowed; }
.mk-date-btn:disabled .mk-date-ic { stroke: var(--mk-muted); }
@media (max-width: 1023px) { .mk-date-btn { font-size: 16px; } }

.mk-date-pop { position: fixed; inset: auto; z-index: 1000; width: 304px; max-width: calc(100vw - 16px); margin: 0; padding: 12px;
  border: 0; border-radius: var(--mk-r-md); background: var(--mk-surface); color: var(--mk-ink); box-shadow: var(--mk-e-pop);
  font: 500 14px/20px var(--mk-font); }
.mk-date-pop:not([popover]):not(.is-open) { display: none; }
/* Sous 600 px : inséré dans la feuille juste sous le champ, même largeur (façon iOS). */
.mk-date-pop.is-inline { position: static; z-index: auto; width: 100%; max-width: none; margin-top: 8px; padding: 8px 4px;
  box-shadow: none; border: 1px solid var(--mk-line); border-radius: var(--mk-r-md);
  scroll-margin-block: 16px 96px; }  /* au-dessus de la barre d'onglets du bas */
.mk-date-h { display: flex; align-items: center; gap: 4px; padding: 0 0 8px 8px; }
.mk-date-t { flex: 1; margin: 0; font: 600 15px/20px var(--mk-font); font-stretch: var(--mk-stretch-section); color: var(--mk-ink); }
.mk-date-nav { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--mk-r-pill);
  background: none; color: var(--mk-ink-2); cursor: pointer; }
.mk-date-nav .mk-date-ic, .mk-date-pop .mk-date-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mk-date-nav:hover { background: var(--mk-hover); }
.mk-date-nav:disabled { color: var(--mk-off); cursor: default; background: none; }
.mk-date-g { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mk-date-g th { height: 32px; padding: 0; font: 500 12px/16px var(--mk-font); color: var(--mk-muted); text-align: center; }
.mk-date-g td { height: 40px; padding: 2px 0; text-align: center; font-variant-numeric: tabular-nums; }
.mk-date-g td[data-date] { position: relative; z-index: 0; cursor: pointer; color: var(--mk-ink); }
.mk-date-g td[data-date]::before { content: ""; position: absolute; z-index: -1; inset: 2px; margin: auto; width: 36px; height: 36px;
  border-radius: var(--mk-r-pill); }
.mk-date-g td[data-date]:hover::before { background: var(--mk-canvas); }
.mk-date-g td.is-today { color: var(--mk-brand-press); font-weight: 600; }
.mk-date-g td.is-today::before { box-shadow: inset 0 0 0 1px var(--mk-brand-press); }
.mk-date-g td[aria-selected="true"] { color: var(--mk-pill-ink); font-weight: 600; }
.mk-date-g td[aria-selected="true"]::before { background: var(--mk-pill-bg); box-shadow: none; }
.mk-date-g td[aria-selected="true"]:hover::before { background: #c2d7fb; }
.mk-date-g td[aria-disabled="true"] { color: var(--mk-off); cursor: default; font-weight: 420; }
.mk-date-g td[aria-disabled="true"]:hover::before { background: none; }
.mk-date-g td:focus { outline: none; }
.mk-date-g td:focus-visible::before { box-shadow: 0 0 0 2px var(--mk-focus); }
.mk-date-f { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--mk-line); }
.mk-date-a { min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--mk-r-sm); background: none;
  color: var(--mk-brand-press); font: 600 14px/20px var(--mk-font); cursor: pointer; }
.mk-date-a:hover { background: var(--mk-hover); }
.mk-date-a:focus-visible, .mk-date-nav:focus-visible { outline: var(--mk-focus-outline); outline-offset: -2px; }
@media (pointer: coarse) { .mk-date-g td { height: 44px; } .mk-date-g td[data-date]::before { width: 40px; height: 40px; } }
