/* Design system Flow, repris de Flow CRM (styles/flow) : couleurs, typo, espace, apps, classes. */
/* Flow — couleurs. Base 6a « Papier teinté » : papier, encre, filets ; la pastel de l'app en navigation. */
:root {
  /* Neutres */
  --papier: #F2F1EE;
  --blanc: #FFFFFF;
  --encre: #111111;
  --gris-1: #5B5955;
  --gris-2: #8E8B85;
  --gris-3: #C4C1BA;
  --filet: #E2E0DB;
  --filet-fort: #D6D4CE;
  --charbon: #1B1B1A;
  --charbon-2: #222120;
  --charbon-filet: #2A2927;

  /* Sémantiques */
  --bg: var(--papier);
  --surface: var(--blanc);
  --surface-2: #F8F7F5;
  --fg: var(--encre);
  --fg-2: var(--gris-1);
  --fg-3: var(--gris-2);
  --fg-off: var(--gris-3);
  --line: var(--filet);
  --line-strong: var(--filet-fort);
  --inverse-bg: var(--encre);
  --inverse-fg: var(--papier);
  --voile: rgba(17, 17, 17, 0.45);
  --coeur: #E5484D; /* ♥ de la signature « made with ♥ by Jouf », clair et nuit */

  /* Palette pastel (tonalité soutenue) + texte profond + vif. Une couleur = un sens. */
  --peche: #EFC2A6;      --peche-fonce: #8A3F1D;    --peche-vif: #C8501F;    --peche-nuit: #F1B99C;
  --rose: #EBB9CF;       --rose-fonce: #8F2A5E;     --rose-vif: #C8006E;     --rose-nuit: #EFB6CE;
  --abricot: #F0CF95;    --abricot-fonce: #8A5A12;  --abricot-vif: #D97706;  --abricot-nuit: #F0B65A;
  --paille: #EADB95;     --paille-fonce: #6B5A12;   --paille-vif: #C29A12;   --paille-nuit: #E8CF6A;
  --sauge: #C3D6AE;      --sauge-fonce: #3B5A2E;    --sauge-vif: #4E8A3A;    --sauge-nuit: #A3C98A;
  --menthe: #B4D6C7;     --menthe-fonce: #1F5E54;   --menthe-vif: #0F8A7A;   --menthe-nuit: #9FD1C1;
  --ciel: #B8D4EC;       --ciel-fonce: #1F4E72;     --ciel-vif: #2F7FBF;     --ciel-nuit: #A8CBEA;
  --lavande: #BFCBEA;    --lavande-fonce: #2B4A7E;  --lavande-vif: #2457A6;  --lavande-nuit: #B3C3EA;
  --brique: #EFB7B0;     --brique-fonce: #8A2A20;   --brique-vif: #C0392B;   --brique-nuit: #F0A79E;

  /* Sociétés (planning, documents internes) : un filet et une étiquette par société */
  --soc-pp: #2B2A28;             --soc-pp-bg: #DAD8D3;         --soc-pp-fg: #111111;          /* charbon */
  --soc-has: var(--lavande-vif); --soc-has-bg: var(--lavande); --soc-has-fg: var(--lavande-fonce); /* bleu */
  --soc-pul: #6E3FA3;             --soc-pul-bg: #D6C6EA;        --soc-pul-fg: #4B2A78;         /* violet */
  --soc-usi: var(--brique-vif);  --soc-usi-bg: var(--brique);  --soc-usi-fg: var(--brique-fonce); /* rouge */

  /* Rôles sémantiques */
  --succes-bg: var(--sauge);    --succes-fg: var(--sauge-fonce);    --succes: var(--sauge-vif);
  --alerte-bg: var(--paille);   --alerte-fg: var(--paille-fonce);   --alerte: var(--paille-vif);
  --erreur-bg: var(--brique);   --erreur-fg: var(--brique-fonce);   --erreur: var(--brique-vif);
  --info-bg: var(--lavande);    --info-fg: var(--lavande-fonce);    --info: var(--lavande-vif);

  /* Statuts métier (jamais la couleur seule : toujours un libellé ou un numéro) */
  --statut-a-faire-bg: var(--surface-2);  --statut-a-faire-fg: var(--fg-2);
  --statut-en-cours-bg: var(--app-pastel); --statut-en-cours-fg: var(--app-fonce);
  --statut-attente-bg: var(--paille);     --statut-attente-fg: var(--paille-fonce);
  --statut-termine-bg: var(--inverse-bg); --statut-termine-fg: var(--inverse-fg); /* noir : libère la sauge (teinte de flow sav) */
  --statut-annule-bg: var(--surface-2);   --statut-annule-fg: var(--fg-3);

  /* Focus clavier */
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--app-fonce);

  color-scheme: light;
}

/* Mode nuit : data-theme="nuit" sur <html>. Le bandeau noir du logo devient le fond ; les pastels deviennent texte et boutons. */
@media screen {
  :root[data-theme="nuit"] {
    --bg: var(--encre);
    --surface: var(--charbon);
    --surface-2: var(--charbon-2);
    --fg: var(--papier);
    --fg-2: #A8A6A1;
    --fg-3: #8E8B85;
    --fg-off: #4A4846;
    --line: var(--charbon-filet);
    --line-strong: #3A3937;
    --inverse-bg: var(--papier);
    --inverse-fg: var(--encre);
    --voile: rgba(0, 0, 0, 0.6);

    --succes-bg: rgba(163, 201, 138, 0.16);  --succes-fg: var(--sauge-nuit);
    --alerte-bg: rgba(232, 207, 106, 0.16);  --alerte-fg: var(--paille-nuit);
    --erreur-bg: rgba(240, 167, 158, 0.16);  --erreur-fg: var(--brique-nuit);
    --info-bg: rgba(179, 195, 234, 0.16);    --info-fg: var(--lavande-nuit);
    --statut-en-cours-bg: var(--app-tint);   --statut-en-cours-fg: var(--app-nuit);
    --statut-attente-bg: var(--alerte-bg);   --statut-attente-fg: var(--alerte-fg);
    --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--app-nuit);
    --soc-pp: #A8A6A1;  --soc-pp-bg: rgba(168, 166, 161, 0.18); --soc-pp-fg: #E2E0DB;
    --soc-has: #7FA0E0; --soc-has-bg: rgba(179, 195, 234, 0.16); --soc-has-fg: var(--lavande-nuit);
    --soc-pul: #A98BD6; --soc-pul-bg: rgba(169, 139, 214, 0.18); --soc-pul-fg: #CDB8EC;
    --soc-usi: #E2685B; --soc-usi-bg: rgba(240, 167, 158, 0.16); --soc-usi-fg: var(--brique-nuit);
    color-scheme: dark;
  }
}
/* Flow — typographie. Outfit = mot-symbole, titres, grands chiffres (300 maigre / 600 gras). Geist = interface. Geist Mono = références, montants alignés. */
:root {
  --font-display: 'Outfit', 'Geist Sans', system-ui, sans-serif;
  --font-ui: 'Geist Sans', 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --t-kicker: 11px;   /* capitales espacées .14em */
  --t-xs: 12px;
  --t-sm: 13px;       /* corps dense : tableaux, fiches */
  --t-md: 14px;       /* corps */
  --t-lg: 16px;
  --t-xl: 19px;
  --t-2xl: 24px;      /* chiffre clé */
  --t-3xl: 32px;      /* titre de page */
  --t-4xl: 40px;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-body: 1.5;
  --ls-kicker: 0.14em;
  --ls-display: -0.02em;
  --w-light: 300; --w-regular: 400; --w-medium: 500; --w-semibold: 600;
}
/* Flow — espace, rayons, relief, mouvement, cibles. */
:root {
  --s-1: 2px; --s-2: 4px; --s-3: 6px; --s-4: 8px; --s-5: 12px; --s-6: 16px; --s-7: 20px; --s-8: 24px; --s-9: 32px; --s-10: 40px; --s-11: 48px;

  --r-btn: 2px;      /* boutons, champs, tuiles : quasi carré (Premier Plan) */
  --r-carte: 4px;    /* cartes, blocs, encarts */
  --r-pilule: 999px; /* badges de statut */
  --r-tel: 12px;     /* encarts groupés sur téléphone */

  --ombre-sm: 0 1px 2px rgba(17, 17, 17, 0.06);
  --ombre-md: 0 6px 16px rgba(17, 17, 17, 0.10);
  --ombre-lg: 0 18px 40px rgba(17, 17, 17, 0.14);

  --duree-1: 120ms; --duree-2: 200ms; --duree-3: 320ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --hit: 44px;        /* cible tactile minimale (tablette, téléphone) */
  --ctrl: 32px;       /* hauteur des contrôles bureau */
  --ctrl-lg: 40px;    /* contrôles tablette */
  --l-sidebar: 200px; --l-sidebar-repliee: 64px; --h-toolbar: 52px; --h-tabbar: 60px;
}
@media screen { :root[data-theme="nuit"] { --ombre-sm: 0 1px 2px rgba(0,0,0,.4); --ombre-md: 0 6px 16px rgba(0,0,0,.45); --ombre-lg: 0 18px 40px rgba(0,0,0,.6); } }
@media (prefers-reduced-motion: reduce) { :root { --duree-1: 0ms; --duree-2: 0ms; --duree-3: 0ms; } }
/* Flow — une teinte par application. Poser data-app="crm|caisse|livraison|sav|immo" sur <html> (ou sur un conteneur).
   --app-pastel : fond de navigation (clair) · --app-fonce : boutons, repères, texte sur pastel · --app-vif : carré de marque, graphiques
   --app-nuit : accent en mode nuit · --app-tint : lavis à 14 % · --app-nav-* : navigation (clair : pastel/encre ; nuit : charbon/pastel). */
:root, [data-app="crm"] {
  --app-nom: "crm";
  --app-pastel: var(--ciel); --app-fonce: var(--ciel-fonce); --app-vif: var(--ciel-vif); --app-nuit: var(--ciel-nuit);
  --app-tint: rgba(184, 212, 236, 0.30); --app-line: #93B8DA;
}
[data-app="caisse"] { --app-nom: "caisse"; --app-pastel: #E6C1C4; --app-fonce: #7E3440; --app-vif: #B0414F; --app-nuit: #EDC3C6; --app-tint: rgba(230, 193, 196, 0.28); --app-line: #CF9CA1; } /* vieux rose */
[data-app="livraison"] { --app-nom: "livraison"; --app-pastel: #F5C49E; --app-fonce: #8F4416; --app-vif: #D9661F; --app-nuit: #F5BE92; --app-tint: rgba(245, 196, 158, 0.28); --app-line: #DDA176; } /* orange tendre */
[data-app="sav"] { --app-nom: "sav"; --app-pastel: var(--sauge); --app-fonce: var(--sauge-fonce); --app-vif: var(--sauge-vif); --app-nuit: var(--sauge-nuit); --app-tint: rgba(195, 214, 174, 0.28); --app-line: #A0BD86; } /* sauge */
[data-app="immo"] { --app-nom: "immo"; --app-pastel: var(--lavande); --app-fonce: var(--lavande-fonce); --app-vif: var(--lavande-vif); --app-nuit: var(--lavande-nuit); --app-tint: rgba(191, 203, 234, 0.28); --app-line: #9DB0DB; }

/* Navigation : clair = pastel + encre ; nuit = charbon + pastel. Bouton principal : fonce en clair, pastel en nuit. */
:root {
  --app-nav-bg: var(--app-pastel); --app-nav-fg: var(--encre); --app-nav-fg-2: color-mix(in srgb, var(--app-fonce) 70%, var(--encre)); --app-nav-line: var(--app-line); --app-nav-actif: var(--app-fonce);
  --btn-bg: var(--app-fonce); --btn-fg: #FFFFFF; --btn-bg-hover: color-mix(in srgb, var(--app-fonce) 86%, #000);
  --lien: var(--app-fonce);
}
@media screen {
  :root[data-theme="nuit"] {
    --app-nav-bg: var(--charbon); --app-nav-fg: var(--papier); --app-nav-fg-2: #A8A6A1; --app-nav-line: var(--charbon-filet); --app-nav-actif: var(--app-nuit);
    --btn-bg: var(--app-nuit); --btn-fg: var(--encre); --btn-bg-hover: color-mix(in srgb, var(--app-nuit) 86%, #fff);
    --lien: var(--app-nuit);
    --app-tint: color-mix(in srgb, var(--app-nuit) 16%, transparent);
  }
}
/* flow.css — classes prêtes à l'emploi pour les applications sans framework (Hermès, Pronto, Immo).
   Une seule feuille : les jetons ci-dessus + ces classes. Les apps React (CRM 2, Caisse) utilisent les mêmes jetons via leurs composants. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font-family: var(--font-ui); font-size: var(--t-md); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
body { margin: 0; }
a { color: var(--lien); text-underline-offset: 3px; }
a:hover { opacity: .8; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-btn); }
::selection { background: var(--app-pastel); color: var(--encre); }

/* Mot-symbole : <span class="fl-wordmark">flow<b>crm</b></span> — « flow » gras, l'app maigre ; carré de couleur après. */
.fl-wordmark { font-family: var(--font-display); font-weight: var(--w-semibold); letter-spacing: -0.01em; line-height: 1; display: inline-flex; align-items: baseline; gap: 10px; }
.fl-wordmark b { font-weight: var(--w-light); }
.fl-wordmark-empile { position: relative; max-width: 100%; display: inline-flex; flex-direction: column; align-items: flex-start; }
.fl-wordmark::after { content: ""; width: .32em; height: .32em; background: var(--app-vif); align-self: center; }
.fl-kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
h1, .fl-h1 { font-family: var(--font-display); font-weight: var(--w-light); font-size: var(--t-3xl); line-height: var(--lh-tight); letter-spacing: var(--ls-display); margin: 0; }
h1 b, .fl-h1 b { font-weight: var(--w-semibold); }
h2, .fl-h2 { font-family: var(--font-display); font-weight: var(--w-medium); font-size: var(--t-2xl); line-height: var(--lh-tight); letter-spacing: var(--ls-display); margin: 0; }
h3, .fl-h3 { font-family: var(--font-ui); font-weight: var(--w-semibold); font-size: var(--t-lg); line-height: var(--lh-snug); margin: 0; }
.fl-chiffre { font-family: var(--font-display); font-weight: var(--w-light); font-size: var(--t-2xl); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.fl-muted { color: var(--fg-2); }

/* Boutons : plein = agir ; contour = secondaire ; texte = tertiaire ; danger = irréversible. */
.fl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctrl); padding: 0 14px; border-radius: var(--r-btn); border: 1px solid transparent; background: transparent; color: var(--fg); font-weight: var(--w-medium); font-size: var(--t-sm); cursor: pointer; white-space: nowrap; transition: background var(--duree-1) var(--ease), border-color var(--duree-1) var(--ease), transform var(--duree-1) var(--ease); }
.fl-btn:active { transform: translateY(1px); }
.fl-btn:disabled { opacity: .45; cursor: not-allowed; }
.fl-btn-primaire { background: var(--btn-bg); color: var(--btn-fg); }
.fl-btn-primaire:hover:not(:disabled) { background: var(--btn-bg-hover); }
.fl-btn-encre { background: var(--inverse-bg); color: var(--inverse-fg); }
.fl-btn-secondaire { border-color: var(--fg); }
.fl-btn-secondaire:hover:not(:disabled) { background: var(--surface-2); }
.fl-btn-texte { color: var(--lien); padding: 0 8px; }
.fl-btn-texte:hover:not(:disabled) { background: var(--app-tint); }
.fl-btn-danger { border-color: var(--erreur); color: var(--erreur-fg); }
.fl-btn-danger:hover:not(:disabled) { background: var(--erreur-bg); }
.fl-btn-lg, .fl-tactile .fl-btn { min-height: var(--hit); padding: 0 18px; font-size: var(--t-md); }
.fl-btn-bloc { width: 100%; }
.fl-btn-icone { width: var(--ctrl); padding: 0; }
.fl-btn svg { width: 16px; height: 16px; }
.fl-btn.fl-chargement { color: transparent; position: relative; }
.fl-btn.fl-chargement::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; color: var(--btn-fg); animation: fl-tourne .8s linear infinite; }
@keyframes fl-tourne { to { transform: rotate(360deg); } }

/* Champs */
.fl-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fl-field > label { font-size: var(--t-xs); font-weight: var(--w-medium); color: var(--fg-2); }
.fl-input { width: 100%; min-height: var(--ctrl); padding: 6px 10px; font-size: var(--t-md); color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-btn); caret-color: var(--app-fonce); transition: border-color var(--duree-1) var(--ease); }
.fl-input::placeholder { color: var(--fg-3); }
.fl-input:hover { border-color: var(--fg-2); }
.fl-input:focus-visible { border-color: var(--fg); box-shadow: none; outline: 2px solid var(--app-fonce); outline-offset: -1px; }
.fl-input:disabled, .fl-input[readonly] { background: var(--surface-2); color: var(--fg-2); }
.fl-input[aria-invalid="true"] { border-color: var(--erreur); }
.fl-field .fl-erreur { font-size: var(--t-xs); color: var(--erreur-fg); }
.fl-input.fl-droite { text-align: right; font-variant-numeric: tabular-nums; }
textarea.fl-input { min-height: 80px; resize: vertical; }
select.fl-input { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.fl-tactile .fl-input { min-height: var(--hit); font-size: var(--t-lg); }
.fl-case { display: inline-flex; align-items: center; gap: 10px; min-height: var(--ctrl); font-size: var(--t-md); cursor: pointer; }
.fl-case input { appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--fg-2); border-radius: var(--r-btn); display: grid; place-items: center; background: var(--surface); }
.fl-case input:checked { background: var(--fg); border-color: var(--fg); }
.fl-case input:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.fl-case input[type="radio"] { border-radius: 50%; }
.fl-case input[type="radio"]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--surface); transform: none; }
.fl-case input.fl-switch, .fl-switch { position: relative; border: 0; width: 40px; height: 24px; appearance: none; margin: 0; border-radius: 999px; background: var(--fg-off); cursor: pointer; transition: background var(--duree-2) var(--ease); }
.fl-case input.fl-switch::after, .fl-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform var(--duree-2) var(--ease); }
.fl-case input.fl-switch:checked, .fl-switch:checked { background: var(--app-fonce); }
.fl-case input.fl-switch:checked::after, .fl-switch:checked::after { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--surface); transform: translateX(16px); }
.fl-recherche { position: relative; }
.fl-recherche .fl-input { padding-left: 34px; }
.fl-recherche > svg, .fl-recherche > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-3); }
.fl-suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-carte); box-shadow: var(--ombre-md); overflow: hidden; }
.fl-suggestions button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border: 0; background: none; font-size: var(--t-sm); cursor: pointer; }
.fl-suggestions button:hover, .fl-suggestions button[aria-selected="true"] { background: var(--app-tint); }
.fl-suggestions mark { background: none; color: var(--app-fonce); font-weight: var(--w-semibold); }

/* Segment (onglets de barre d'outils) */
.fl-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-carte); background: var(--surface-2); border: 1px solid var(--line); }
.fl-seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 3px; font-size: var(--t-xs); font-weight: var(--w-medium); color: var(--fg-2); cursor: pointer; min-height: 28px; white-space: nowrap; }
.fl-seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); font-weight: var(--w-semibold); box-shadow: var(--ombre-sm); }

/* Onglets soulignés (en-tête de fiche) */
.fl-onglets { display: flex; gap: 32px; border-bottom: 1px solid var(--line); }
.fl-onglet { padding: 18px 0 16px; font-size: var(--t-lg); font-weight: var(--w-medium); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); border: 0; background: none; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.fl-onglet { white-space: nowrap; }
.fl-onglet:hover { color: var(--fg); }
.fl-onglet[aria-selected="true"] { color: var(--fg); box-shadow: inset 0 -3px 0 var(--fg); }

/* Badges de statut et pastilles */
.fl-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pilule); font-size: var(--t-xs); font-weight: var(--w-medium); white-space: nowrap; line-height: 1.4; }
.fl-badge-a-faire { background: var(--statut-a-faire-bg); color: var(--statut-a-faire-fg); border: 1px solid var(--line); }
.fl-badge-en-cours { background: var(--statut-en-cours-bg); color: var(--statut-en-cours-fg); }
.fl-badge-attente { background: var(--statut-attente-bg); color: var(--statut-attente-fg); }
.fl-badge-termine { background: var(--statut-termine-bg); color: var(--statut-termine-fg); }
.fl-badge-annule { background: var(--statut-annule-bg); color: var(--statut-annule-fg); text-decoration: line-through; }
.fl-badge-succes { background: var(--succes-bg); color: var(--succes-fg); }
.fl-badge-alerte { background: var(--alerte-bg); color: var(--alerte-fg); }
.fl-badge-erreur { background: var(--erreur-bg); color: var(--erreur-fg); }
.fl-badge-info { background: var(--info-bg); color: var(--info-fg); }
.fl-pastille { display: inline-block; width: 7px; height: 7px; background: currentColor; }
.fl-compteur { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pilule); background: var(--erreur); color: #fff; font-size: 11px; font-weight: var(--w-semibold); }

/* Cartes et listes groupées */
.fl-carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-carte); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.fl-groupe { display: flex; flex-direction: column; gap: 4px; }
.fl-groupe > .fl-kicker { padding: 0 2px; }
.fl-liste { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-carte); display: flex; flex-direction: column; }
.fl-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px; font-size: var(--t-sm); border-bottom: 1px solid var(--line); min-height: 36px; }
.fl-ligne:last-child { border-bottom: 0; }
.fl-ligne > :first-child { color: var(--fg-2); }
.fl-tactile .fl-liste { border-radius: var(--r-tel); }
.fl-tactile .fl-ligne { min-height: var(--hit); font-size: var(--t-md); }

/* Tableau dense */
.fl-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.fl-table th { text-align: left; font-size: var(--t-kicker); font-weight: var(--w-medium); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); padding: 8px 10px; border-bottom: 1px solid var(--fg); white-space: nowrap; }
.fl-table th[aria-sort] { color: var(--fg); cursor: pointer; }
.fl-table th[aria-sort="ascending"]::after { content: " ↑"; } .fl-table th[aria-sort="descending"]::after { content: " ↓"; }
.fl-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fl-table tbody tr:hover { background: var(--surface-2); }
.fl-table tbody tr[aria-selected="true"] { background: var(--app-tint); }
.fl-table tbody tr.fl-cliquable { cursor: pointer; }
.fl-table tfoot td { font-weight: var(--w-semibold); border-bottom: 0; border-top: 1px solid var(--fg); }
.fl-table .fl-droite { text-align: right; font-variant-numeric: tabular-nums; }
.fl-table .fl-num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.fl-pagination { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: var(--t-xs); color: var(--fg-2); }
.fl-pagination .fl-espace { flex: 1; }
.fl-filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fl-filtre { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pilule); background: var(--surface); font-size: var(--t-xs); cursor: pointer; }
.fl-filtre[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); }

/* Étapes numérotées 01–07 */
.fl-etapes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.fl-etape { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 2px solid var(--line); color: var(--fg-2); min-width: 0; font-size: var(--t-xs); }
.fl-etape > b { font-family: var(--font-display); font-weight: var(--w-medium); font-size: var(--t-md); color: var(--fg-3); }
.fl-etape > span { font-size: var(--t-md); font-weight: var(--w-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-etape > small { font-size: var(--t-sm); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.fl-etape.faite { border-top-color: var(--fg); color: var(--fg); } .fl-etape.faite > b { color: var(--fg); }
.fl-etape.active { position: relative; border-top: 4px solid var(--app-fonce); margin-top: -2px; padding: 8px 10px 10px; background: var(--app-pastel); color: var(--encre); box-shadow: var(--ombre-sm); }
.fl-etape.active > b { color: var(--app-fonce); font-weight: var(--w-semibold); font-size: var(--t-lg); }
.fl-etape.active > span { font-weight: 700; font-size: var(--t-lg); }
.fl-etape.active > small { color: var(--app-fonce); font-weight: 600; }
.fl-etape.active::after { content: "En cours"; position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--app-fonce); }
@media screen { :root[data-theme="nuit"] .fl-etape.active { background: var(--app-tint); color: var(--fg); border-top-color: var(--app-nuit); } :root[data-theme="nuit"] .fl-etape.active > b, :root[data-theme="nuit"] .fl-etape.active > small, :root[data-theme="nuit"] .fl-etape.active::after { color: var(--app-nuit); } }
.fl-etape.vide { color: var(--fg-3); }

/* Navigation : barre latérale (bureau), repliée en icônes sous 1280 px ; barre d'onglets (téléphone). */
.fl-sidebar { width: var(--l-sidebar); flex: none; display: flex; flex-direction: column; padding: 22px 20px 18px; background: var(--app-nav-bg); color: var(--app-nav-fg); border-right: 1px solid var(--app-nav-line); }
.fl-sidebar .fl-wordmark { font-size: 24px; }
.fl-sidebar .fl-kicker { color: var(--app-nav-fg-2); margin-top: 6px; }
.fl-nav { display: flex; flex-direction: column; margin: 26px -20px 0; }
.fl-nav a, .fl-nav button { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 20px 0 18px; border: 0; border-left: 2px solid transparent; background: none; font-family: var(--font-display); font-size: 14px; font-weight: var(--w-regular); color: var(--app-nav-fg-2); text-decoration: none; cursor: pointer; }
.fl-nav a:hover, .fl-nav button:hover { color: var(--app-nav-fg); }
.fl-nav a[aria-current="page"], .fl-nav button[aria-current="page"] { color: var(--app-nav-fg); font-weight: var(--w-semibold); border-left-color: var(--app-nav-actif); }
.fl-nav svg { width: 18px; height: 18px; flex: none; }
.fl-sidebar-pied { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--app-nav-line); display: flex; align-items: center; gap: 9px; font-size: var(--t-xs); }
@media (max-width: 1279px) { .fl-sidebar { width: var(--l-sidebar-repliee); padding-inline: 12px; } .fl-sidebar .fl-wordmark, .fl-sidebar .fl-wordmark-empile, .fl-sidebar > [data-app], .fl-sidebar .fl-kicker, .fl-nav a span, .fl-sidebar-pied span, .fl-sidebar .fl-masque-replie { display: none; } .fl-sidebar-pied { justify-content: center; } .fl-sidebar::before { content: "f"; align-self: center; width: 22px; padding-bottom: 6px; border-bottom: 3px solid var(--app-vif); text-align: center; font: 600 30px/1 var(--font-display); color: var(--app-nav-fg); } .fl-nav a { justify-content: center; padding: 0; } }
.fl-toolbar { min-height: var(--h-toolbar); flex: none; display: flex; align-items: center; gap: 22px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.fl-ariane { white-space: nowrap; flex: none; font-size: var(--t-kicker); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); display: flex; gap: 6px; }
.fl-ariane a { color: inherit; text-decoration: none; } .fl-ariane b { color: var(--fg); font-weight: var(--w-regular); }
.fl-tabbar { position: sticky; bottom: 0; display: flex; justify-content: space-around; align-items: flex-start; height: var(--h-tabbar); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.fl-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); text-decoration: none; }
.fl-tabbar a[aria-current="page"] { color: var(--fg); }
.fl-tabbar svg { width: 20px; height: 20px; }

/* Modale, confirmation, toast, vide */
.fl-voile { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: var(--voile); }
.fl-modale { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; background: var(--surface); border-radius: var(--r-carte); box-shadow: var(--ombre-lg); }
.fl-modale-titre { display: flex; align-items: center; gap: 10px; } .fl-modale-titre h2 { flex: 1; }
.fl-modale-corps { overflow: auto; font-size: var(--t-md); display: flex; flex-direction: column; gap: 12px; }
.fl-modale-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.fl-irreversible { border-left: 2px solid var(--erreur); padding: 8px 12px; background: var(--erreur-bg); color: var(--erreur-fg); font-size: var(--t-sm); }
.fl-toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.fl-toast { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-radius: var(--r-carte); background: var(--inverse-bg); color: var(--inverse-fg); font-size: var(--t-sm); box-shadow: var(--ombre-lg); }
.fl-toast.erreur { background: var(--erreur); color: #fff; }
.fl-toast button { border: 0; background: none; color: inherit; font-weight: var(--w-semibold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fl-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; padding: 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-carte); color: var(--fg-2); font-size: var(--t-sm); }
.fl-vide b { font-family: var(--font-display); font-weight: var(--w-medium); font-size: var(--t-xl); color: var(--fg); }

/* Chiffres clés et barres */
.fl-kpi { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fl-kpi > small { font-size: var(--t-xs); color: var(--fg-2); }
.fl-kpi > .fl-chiffre.fort { font-weight: var(--w-semibold); }
.fl-jauge { position: relative; height: 2px; background: var(--line); margin-top: 6px; }
.fl-jauge > span { position: absolute; left: 0; top: 0; height: 100%; background: var(--fg); }
.fl-barres { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; height: 120px; }
.fl-barre { background: var(--app-pastel); border-top: 2px solid var(--app-fonce); min-height: 2px; }
.fl-barre.active { background: var(--app-fonce); }

/* Planning (semaine) */
.fl-planning { display: grid; grid-template-columns: 56px repeat(var(--jours, 6), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-carte); overflow: hidden; background: var(--surface); font-size: var(--t-xs); }
.fl-planning-tete { padding: 8px 6px; border-bottom: 1px solid var(--fg); border-left: 1px solid var(--line); font-size: var(--t-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.fl-planning-tete b { display: block; font-family: var(--font-display); font-size: var(--t-xl); font-weight: var(--w-light); color: var(--fg); letter-spacing: 0; }
.fl-planning-heure { padding: 4px 6px; color: var(--fg-3); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.fl-planning-case { border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 48px; padding: 3px; display: flex; flex-direction: column; gap: 3px; }
.fl-rdv { padding: 4px 6px; border-left: 2px solid var(--app-fonce); background: var(--app-tint); color: var(--fg); border-radius: 2px; line-height: 1.25; }
.fl-rdv b { display: block; font-weight: var(--w-medium); } .fl-rdv.pose { border-left-color: var(--sauge-vif); background: var(--succes-bg); } .fl-rdv.sav { border-left-color: var(--erreur); background: var(--erreur-bg); }

/* Pavé de caisse et récapitulatif (tablette) */
.fl-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fl-pave button { min-height: 56px; border: 1px solid var(--fg); border-radius: var(--r-btn); background: var(--surface); font-family: var(--font-display); font-size: 22px; font-weight: var(--w-regular); cursor: pointer; }
.fl-pave button:active { background: var(--surface-2); }
.fl-pave .fl-pave-ok { grid-column: span 3; background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); font-family: var(--font-ui); font-size: var(--t-md); font-weight: var(--w-medium); }
.fl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fl-modes button { min-height: var(--hit); border: 1px solid var(--fg); border-radius: var(--r-btn); background: var(--surface); font-size: var(--t-xs); font-weight: var(--w-medium); cursor: pointer; }
.fl-modes button[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-fg); }
.fl-recap { display: flex; flex-direction: column; gap: 6px; }
.fl-recap .fl-total { font-family: var(--font-display); font-weight: var(--w-light); font-size: 28px; letter-spacing: -0.01em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-recap .fl-reste { display: flex; justify-content: space-between; font-weight: var(--w-semibold); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fl-recap .fl-reste span:last-child { color: var(--app-fonce); }
